Skip to content

Instantly share code, notes, and snippets.

@diogok
Created June 30, 2018 02:17
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 diogok/a6b2501aefc5d951c1ca2112d0ac6f05 to your computer and use it in GitHub Desktop.
Save diogok/a6b2501aefc5d951c1ca2112d0ac6f05 to your computer and use it in GitHub Desktop.
global:
scrape_interval: 5s
scrape_configs:
- job_name: 'services'
consul_sd_configs:
- server: 'host:8500'
relabel_configs:
- source_labels: [__meta_consul_tags]
regex: .*,prometheus,.*
action: keep
- source_labels: [__meta_consul_service]
target_label: job
- source_labels: [__meta_consul_tags]
regex: .*,prometheus.metrics_path=([^,]+),.*
replacement: '${1}'
target_label: __metrics_path__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment