Skip to content

Instantly share code, notes, and snippets.

@wubin1989
Forked from weibeld/prometheus.yml
Created January 3, 2023 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wubin1989/197d56d91eb9ce78411a9fd65dac2c90 to your computer and use it in GitHub Desktop.
Save wubin1989/197d56d91eb9ce78411a9fd65dac2c90 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