promtail: Add more systemd-journal fields as structured metadata

This commit is contained in:
Julian Rother 2024-11-24 05:12:55 +01:00
parent 59a76a526b
commit 5045dc7fde
No known key found for this signature in database
GPG key ID: 8F9B6AE9BAAE4899
2 changed files with 81 additions and 8 deletions

View file

@ -10,7 +10,7 @@
{%- if 'scrape_configs' not in config -%}
{%- set tmp = config.setdefault('scrape_configs', []) -%}
{%- for key, value in prometheus_agent.agents.promtail.scrape_jobs.items() -%}
{%- for key, value in prometheus_agent.agents.promtail.scrape_jobs.items() if value -%}
{%- set tmp = value.setdefault('job_name', key) -%}
{%- set tmp = config.scrape_configs.append(value) -%}
{%- endfor -%}