Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[receiver/prometheus] Add static TAG/LABEL to all metrics scraped with job #31812

Open
SaschaBrechmannVHV opened this issue Mar 18, 2024 · 4 comments
Labels
question Further information is requested receiver/prometheus Prometheus receiver Stale

Comments

@SaschaBrechmannVHV
Copy link

SaschaBrechmannVHV commented Mar 18, 2024

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?

@SaschaBrechmannVHV SaschaBrechmannVHV added the needs triage New item requiring triage label Mar 18, 2024
@github-actions github-actions bot added the receiver/prometheus Prometheus receiver label Mar 18, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@Frapschen
Copy link
Contributor

maybe you can use attributesprocessor to add your label

@Frapschen Frapschen added question Further information is requested and removed needs triage New item requiring triage labels Mar 22, 2024
@dashpole
Copy link
Contributor

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]?

Copy link
Contributor

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:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested receiver/prometheus Prometheus receiver Stale
Projects
None yet
Development

No branches or pull requests

3 participants