add promtail support
This commit is contained in:
parent
1b9547ecd8
commit
248ed5fd02
4 changed files with 60 additions and 1 deletions
37
templates/grafana-promtail.yml.j2
Normal file
37
templates/grafana-promtail.yml.j2
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
server:
|
||||
disable: true
|
||||
http_listen_port: 9080
|
||||
grpc_listen_port: 0
|
||||
|
||||
positions:
|
||||
filename: /var/lib/grafana-promtail/positions.yaml
|
||||
|
||||
clients:
|
||||
{% for i in prometheus_agent.scrapers if prometheus_agent.scrapers[i].get("loki") %}
|
||||
{% set lokiconfig = {}|combine({ "external_labels": merged_prometheus_labels|combine( {"instance": inventory_hostname} ) }, prometheus_agent.scrapers[i]['loki'] ) %}
|
||||
- {{ lokiconfig|to_json }}
|
||||
{% endfor %}
|
||||
|
||||
scrape_configs:
|
||||
- job_name: system
|
||||
static_configs:
|
||||
- targets:
|
||||
- localhost
|
||||
labels:
|
||||
job: varlogs
|
||||
__path__: /var/log/*log
|
||||
- job_name: journal
|
||||
journal:
|
||||
max_age: 12h
|
||||
labels:
|
||||
job: systemd-journal
|
||||
relabel_configs:
|
||||
- source_labels: ['__journal__systemd_unit']
|
||||
target_label: 'unit'
|
||||
- job_name: nginx
|
||||
static_configs:
|
||||
- targets:
|
||||
- localhost
|
||||
labels:
|
||||
job: nginx
|
||||
__path__: /var/log/nginx/access-promtail.log
|
||||
Loading…
Add table
Add a link
Reference in a new issue