From b07cd09ceb13d12c29212dc756ee02483cf19f94 Mon Sep 17 00:00:00 2001 From: Ishan Jain <51803183+ishanjainn@users.noreply.github.com> Date: Thu, 6 Apr 2023 14:14:16 +0530 Subject: [PATCH] Fix logging section in `agent-send-to-grafana-cloud.yaml` --- examples/agent-send-to-grafana-cloud.yaml | 76 ++++++++++++----------- 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/examples/agent-send-to-grafana-cloud.yaml b/examples/agent-send-to-grafana-cloud.yaml index 2648779..f90dda9 100644 --- a/examples/agent-send-to-grafana-cloud.yaml +++ b/examples/agent-send-to-grafana-cloud.yaml @@ -32,41 +32,47 @@ basic_auth: username: "1234567" # your username / instanceID password: "..." # your grafana.com token - scrape_configs: - # scrape all of the log files in /var/log on the localhost - - job_name: log-files - static_configs: - - targets: - - localhost - labels: - job: var-logs - instance: "{{ ansible_host }}" - __path__: /var/log/*.log - # scrape all of the journal logs on localhost - - job_name: systemd-journal - journal: - max_age: 12h - labels: - job: systemd-journal - relabel_configs: - - source_labels: - - __journal__systemd_unit - target_label: systemd_unit - - source_labels: - - __journal__hostname - target_label: hostname - - source_labels: - - __journal_syslog_identifier - target_label: syslog_identifier - - source_labels: - - __journal__pid - target_label: pid - - source_labels: - - __journal__uid - target_label: uid - - source_labels: - - __journal__transport - target_label: transport + configs: + - name: local + positions: + filename: /tmp/positions.yaml + target_config: + sync_period: 10s + scrape_configs: + # scrape all of the log files in /var/log on the localhost + - job_name: log-files + static_configs: + - targets: + - localhost + labels: + job: var-logs + instance: "{{ ansible_host }}" + __path__: /var/log/*.log + # scrape all of the journal logs on localhost + - job_name: systemd-journal + journal: + max_age: 12h + labels: + job: systemd-journal + relabel_configs: + - source_labels: + - __journal__systemd_unit + target_label: systemd_unit + - source_labels: + - __journal__hostname + target_label: hostname + - source_labels: + - __journal_syslog_identifier + target_label: syslog_identifier + - source_labels: + - __journal__pid + target_label: pid + - source_labels: + - __journal__uid + target_label: uid + - source_labels: + - __journal__transport + target_label: transport grafana_agent_integrations_config: scrape_integrations: true # get metrics about the agent