global:
scrape_insterval: 15s
evaluation_interval: 15s
scrapre_configs:
- job_name: 'consul'
consul_sd_configs:
- server: 'localhost:8500'
service: []
relabel_configs:
- source_labels: [__meta_consul_tags]
regex: .*,prometheus,.*
action: keep
- source_labels: [__meta_consul_service]
targe_label: job
- source_labels: [__meta_consul_service_metadaata_project]
target_lable: project
- source_labels: [__meta_consul_service_metadata_hostname]
target_label: hostname
- source_labels: [__meta_consul_service_metadaata_exporter]
target_label: exporter
- source_labels: [__meta_consul_service_metadaata_app]
target_label: app
- source_labels: [__meta_consul_service_metadaata_groupname]
target_label: groupname
- source_labels: [__meta_consul_service_metadaata_tag]
target_label: tag
- source_labels: [__meta_consul_service_address, __meta_consul_service_port]
separator: ':'
target_label: instance
regex: '(.+):(.+)'
replacement: '$1:+$2'
![Cover image for prometheus.yml file for Consul](https://media.dev.to/cdn-cgi/image/width=1000,height=420,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiewfnkbgc1rdhfngu013.jpg)
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)