I have a job formatted like this:
- job_name: 'test_job'
metrics_path: /export
scrape_interval: 5m
scrape_timeout: 15s
params:
command: [script_X]
argument: ['ip address']
static_configs:
- targets: ['127.0.0.1:5666']
labels:
field1: 'text'
field2: 'text'
field3: 'text'
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: ip:port
The parms and labels are what vary by instance so I want to have an
external sd file with these fields in it for better management but I am
having a hard time reworking the job and formatting the content of the SD
file:
- job_name: 'test_job'
metrics_path: /export
scrape_interval: 5m
scrape_timeout: 15s
file_sd_configs:
- files:
- my_file.yml
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: ip:port
But how would the my_file.yml look to keep the parms and the labels related?
Thanks,
Kevin
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/761acb0f-9757-4721-ab01-9ecf0d87b944n%40googlegroups.com.