Open huahuayu opened 2 years ago
Hi @huahuayu
I think that we can filter by host with InfluxDB due to it has tags/value on the metrics, and it seems there's not the same thing on prometheus, so we cannot filter by host on prometheus.
If you config like this (with labels
) you can filter by alias
. I know it works (I have seen it before) but I don't know how to write the query.
global:
scrape_interval: 15s
scrape_configs:
- job_name: opera
scrape_interval: 60s
scrape_timeout: 30s
metrics_path: /debug/metrics/prometheus
scheme: http
static_configs:
- targets: ["192.168.2.11:6060"]
labels:
alias: "192.168.2.11"
- targets: ['192.168.2.23:6060']
labels:
alias: '192.168.2.23'
- targets: ['192.168.2.40:6060']
labels:
alias: '192.168.2.40'
in labels
you can put any key you like. It can be used to be as filter
- targets: ['192.168.2.40:6060']
labels:
key1: 'value1'
key2: 'value2'
influxDB
prometheus