Fix logging section in agent-send-to-grafana-cloud.yaml

This commit is contained in:
Ishan Jain 2023-04-06 14:14:16 +05:30 committed by GitHub
parent 527020bde6
commit b07cd09ceb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,41 +32,47 @@
basic_auth: basic_auth:
username: "1234567" # your username / instanceID username: "1234567" # your username / instanceID
password: "..." # your grafana.com token password: "..." # your grafana.com token
scrape_configs: configs:
# scrape all of the log files in /var/log on the localhost - name: local
- job_name: log-files positions:
static_configs: filename: /tmp/positions.yaml
- targets: target_config:
- localhost sync_period: 10s
labels: scrape_configs:
job: var-logs # scrape all of the log files in /var/log on the localhost
instance: "{{ ansible_host }}" - job_name: log-files
__path__: /var/log/*.log static_configs:
# scrape all of the journal logs on localhost - targets:
- job_name: systemd-journal - localhost
journal: labels:
max_age: 12h job: var-logs
labels: instance: "{{ ansible_host }}"
job: systemd-journal __path__: /var/log/*.log
relabel_configs: # scrape all of the journal logs on localhost
- source_labels: - job_name: systemd-journal
- __journal__systemd_unit journal:
target_label: systemd_unit max_age: 12h
- source_labels: labels:
- __journal__hostname job: systemd-journal
target_label: hostname relabel_configs:
- source_labels: - source_labels:
- __journal_syslog_identifier - __journal__systemd_unit
target_label: syslog_identifier target_label: systemd_unit
- source_labels: - source_labels:
- __journal__pid - __journal__hostname
target_label: pid target_label: hostname
- source_labels: - source_labels:
- __journal__uid - __journal_syslog_identifier
target_label: uid target_label: syslog_identifier
- source_labels: - source_labels:
- __journal__transport - __journal__pid
target_label: transport target_label: pid
- source_labels:
- __journal__uid
target_label: uid
- source_labels:
- __journal__transport
target_label: transport
grafana_agent_integrations_config: grafana_agent_integrations_config:
scrape_integrations: true scrape_integrations: true
# get metrics about the agent # get metrics about the agent