Skip to content

Instantly share code, notes, and snippets.

@weibeld
Created July 31, 2019 06:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save weibeld/7ccc448a9ea000f23e4b83012671f2d0 to your computer and use it in GitHub Desktop.
Save weibeld/7ccc448a9ea000f23e4b83012671f2d0 to your computer and use it in GitHub Desktop.
Example Prometheus configuration (scrape config)
global:
scrape_interval: 10s
scrape_configs:
- job_name: node
static_configs:
- targets:
- localhost:9100
- job_name: python-app
static_configs:
- targets:
- localhost:8000
labels:
my_new_target_label: foo
- job_name: go-app
file_sd_configs:
- files:
- filesd.yaml
relabel_configs:
- target_label: instance
replacement: foo
- job_name: ec2_instances
ec2_sd_configs:
- region: eu-west-2
access_key: <REDACTED>
secret_key: <REDACTED>
relabel_configs:
- source_labels:
- __meta_ec2_tag_prometheus
- __meta_ec2_tag_app
regex: '.+;test|foo'
action: keep
- action: labelmap
regex: __meta_ec2_public_ip
replacement: public_ip
- job_name: cadvisor
static_configs:
- targets:
- localhost:8888
metric_relabel_configs:
- action: labeldrop
regex: 'container_label_.*'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment