Skip to content

Instantly share code, notes, and snippets.

@srl295
Created February 20, 2019 19:32
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 srl295/a0e4b15417498a229d856ef70ed83141 to your computer and use it in GitHub Desktop.
Save srl295/a0e4b15417498a229d856ef70ed83141 to your computer and use it in GitHub Desktop.
Prometheus Scratchpad
[
{
"labels": {
"job": "nodes"
},
"targets": [
"host1", "host2", "host3"
]
}
]
scrape_configs:
- job_name: 'nodes'
file_sd_configs:
- files:
- 'node_exporters.json' # ..., targets: ['host1','host2',...] ...
relabel_configs:
- source_labels: [__address__]
target_label: instance # keep instance=host1 as the label
- source_labels: [__address__]
regex: '(.*)'
target_label: __address__
replacement: '${1}:9100' # host1:9100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment