- job_name: 'netdata'
metrics_path: '/api/v1/allmetrics'
params:
format: [prometheus]
honor_labels: true
file_sd_configs:
- files:
- 'nodes.yaml'
relabel_configs:
- source_labels: [__address__]
regex: (.*):(9100)
target_label: __param_target
replacement: '${1}:19999'
- source_labels: [__address__]
regex: (.*):(9100)
target_label: instance
replacement: '${1}:19999'
- source_labels: [__param_target]
regex: (.*)
target_label: __address__
replacement: '${1}'
- source_labels: [__address__]
regex: (.*):(9100)
target_label: instance
replacement: '${1}:19999'
- source_labels: [__address__]
regex: (.*):(9100)
target_label: instance
replacement: '${1}'
- job_name: 'node'
file_sd_configs:
- files:
- 'nodes.yaml'
relabel_configs:
- source_labels: [__address__]
target_label: instance
- source_labels: [__address__]
target_label: __address__
replacement: '${1}:9100'
- job_name: 'netdata'
metrics_path: '/api/v1/allmetrics'
params:
format: [prometheus]
file_sd_configs:
- files:
- 'nodes.yaml'
relabel_configs:
- source_labels: [__address__]
target_label: instance
- source_labels: [__address__]
target_label: __address__
replacement: '${1}:19999'
relabel_configs:
- source_labels: [__address__]
target_label: instance
- source_labels: [__address__]
target_label: __address__
replacement: '${1}:19999'
--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/2bf6c48d-1ea7-4f45-8d41-3b5802f891deo%40googlegroups.com.
I have a question on the relabel_configs section you suggested. We are mapping the same source_label([__address__]) twice to different things. Could you please help me understand the logic and the sequence of the mappings?relabel_configs:
- source_labels: [__address__]
target_label: instance
- source_labels: [__address__]
target_label: __address__
replacement: '${1}:19999'
- job_name: 'aws_netdata'
params:
honor_labels: true
ec2_sd_configs:
- access_key: "aaaaaa"
secret_key: "bbbbbbbbbbb"
port: 19999
relabel_configs:
- source_labels: [__meta_ec2_instance_state]
regex: running
action: keep
- source_labels: [__meta_ec2_public_ip]
regex: (.+)
target_label: __address__
replacement: '${1}:19999'
- source_labels: [__metrics_path__]
regex: (.+)
target_label: __metrics_path__
replacement: '/api/v1/allmetrics'
- source_labels: [__meta_ec2_tag_Name]
target_label: name
- source_labels: [__meta_ec2_instance_id]
target_label: id
--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/9ca73c1a-1389-4b72-989e-8127295e783fo%40googlegroups.com.
- job_name: 'aws_netdata'
params:
honor_labels: true
ec2_sd_configs:
- access_key: "aaaaaa"
secret_key: "bbbbbbbbbbb"
port: 19999
relabel_configs:
- source_labels: [__meta_ec2_instance_state]
regex: running
action: keep
- source_labels: [__meta_ec2_public_ip]
regex: (.+)
target_label: __address__
replacement: '${1}:19999'
- source_labels: [__metrics_path__]
regex: (.+)
target_label: __metrics_path__
replacement: '/api/v1/allmetrics'
Yes that's correct. And I believe prometheus SD is smart enough not to run the service discovery query twice, but to re-use the previous answers, when seeing the same SD with the same parameters.
--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/aa4d6eeb-875f-49f9-818f-2df4645d9a8ao%40googlegroups.com.