-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Collect syslog lines next to metrics
This makes that we can show the last log entries next to a metric to detect certain issues such as why a CPU clocks down or why a process stops for example.
- Loading branch information
Showing
10 changed files
with
172 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/ssl.* | ||
/grafana.deb | ||
/loki-linux-amd64.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
provision-contest/ansible/roles/prometheus_target_all/defaults/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
prom: true | ||
GROUP_PREFIXES: | ||
- 'online-' | ||
- '' |
1 change: 1 addition & 0 deletions
1
provision-contest/ansible/roles/prometheus_target_all/files/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
*.key | ||
*.crt | ||
promtail-linux-amd64.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
...ision-contest/ansible/roles/prometheus_target_all/templates/promtail-local-config.yaml.j2
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
provision-contest/ansible/roles/prometheus_target_all/templates/promtail-local-config.yml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
server: | ||
http_listen_port: 9080 | ||
grpc_listen_port: 19080 | ||
|
||
positions: | ||
filename: /var/tmp/promtail-syslog-positions.yml | ||
|
||
clients: | ||
{% for host in groups["grafana"] %} | ||
- url: http://{{ hostvars[host].ansible_host }}:3100/loki/api/v1/push | ||
{% endfor %} | ||
|
||
scrape_configs: | ||
- job_name: system | ||
static_configs: | ||
- labels: | ||
__path__: /var/log/**/*log | ||
{% for group_prefix in GROUP_PREFIXES %} | ||
{% if ansible_fqdn in groups[group_prefix+'judgehost'] %} | ||
- job_name: judgehostlogs | ||
static_configs: | ||
- labels: | ||
__path__: '/opt/domjudge/output/log/*' | ||
{% endif %} | ||
{% if ansible_fqdn in groups[group_prefix+'domserver'] %} | ||
- job_name: webapplogs | ||
static_configs: | ||
- labels: | ||
__path__: '/opt/domjudge/webapp/var/log/*' | ||
{% endif %} | ||
{% endfor %} | ||
# See: https://alexandre.deverteuil.net/post/syslog-relay-for-loki/ | ||
- job_name: syslog | ||
syslog: | ||
listen_address: 0.0.0.0:1514 | ||
labels: | ||
job: syslog |