Skip to content

Instantly share code, notes, and snippets.

@cyriltovena
Created June 3, 2020 15:39
Show Gist options
  • Save cyriltovena/7cc5359a692206782db889f4c73f78b1 to your computer and use it in GitHub Desktop.
Save cyriltovena/7cc5359a692206782db889f4c73f78b1 to your computer and use it in GitHub Desktop.
scrape_configs:
- job_name: monitoring
ec2_sd_configs:
- region: us-east-1
port: 9100
relabel_configs:
- action: replace
regex: ".*"
replacement: /var/log/nginx/access.log
target_label: __path__
- source_labels: [__meta_ec2_tag_purpose]
regex: "(api|ws|monitoring)"
action: keep
- source_labels: [__meta_ec2_tag_purpose]
regex: "(api|ws|monitoring)"
target_label: purpose
- source_labels: [__meta_ec2_private_dns_name]
regex: "(.*)"
target_label: __host__
- job_name: http
ec2_sd_configs:
- region: us-east-1
port: 9100
relabel_configs:
- action: replace
regex: ".*"
replacement: /var/log/nginx/error.log
target_label: __path__
- source_labels: [__meta_ec2_tag_purpose]
regex: "(api|ws|monitoring)"
action: keep
- source_labels: [__meta_ec2_tag_purpose]
regex: "(api|ws|monitoring)"
target_label: purpose
- source_labels: [__meta_ec2_private_dns_name]
regex: "(.*)"
target_label: __host__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment