opentelemetry-collector-contrib
opentelemetry-collector-contrib copied to clipboard
[receiver/prometheus] Add static TAG/LABEL to all metrics scraped with job
Component(s)
receiver/prometheus
Describe the issue you're reporting
Hi all, i use the prometheus-receiver, to scrape the otel-col Metrics. Now i would route the otel-metrics to an other metrics-DB than the default OT-Metrics, createt by the OT-Agent. For this i need an extra TAG/LABEL with every metric, create bei on prometheus-receiver job.
This is my current config:
receivers:
prometheus:
config:
scrape_configs:
- job_name: otel-collector-emtrics
scrape_interval: 3s
static_configs:
- targets: ['localhost:8888']
labels: ['influxdb_database: apm']
The label-part is not working. Did any one have an idee, what i could do?
Pinging code owners:
- receiver/prometheus: @Aneurysm9 @dashpole
See Adding Labels via Comments if you do not have permissions to add labels yourself.
maybe you can use attributesprocessor to add your label
I think the labels section might have the wrong quoting? At least it looks funky to me.
https://prometheus.io/docs/prometheus/latest/configuration/configuration/#static_config
Try labels: ['influxdb_database': 'apm']? or labels: [influxdb_database: apm]?
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.
Pinging code owners:
- receiver/prometheus: @Aneurysm9 @dashpole
See Adding Labels via Comments if you do not have permissions to add labels yourself.
This issue has been closed as inactive because it has been stale for 120 days with no activity.