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

Add the job and instance labels to resource attributes #33212

Closed
chenlujjj opened this issue May 24, 2024 · 3 comments
Closed

Add the job and instance labels to resource attributes #33212

chenlujjj opened this issue May 24, 2024 · 3 comments
Labels
enhancement New feature or request receiver/prometheus Prometheus receiver

Comments

@chenlujjj
Copy link
Contributor

Component(s)

receiver/prometheus

Is your feature request related to a problem? Please describe.

We are moving from prometheus to otel-collector to collect metrics, but the metrics collected by prometheus receiver don't have job and instance labels any more, which are default labels for prometheus metrics( see https://prometheus.io/docs/concepts/jobs_instances/) and used by many popular dashboards and alert rules.

Describe the solution you'd like

Add the job and instance labels to resource attributes.
A few lines of codes in https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/prometheusreceiver/internal/prom_to_otlp.go#L35 can solve this.

Describe alternatives you've considered

No response

Additional context

It can be optional

@chenlujjj chenlujjj added enhancement New feature or request needs triage New item requiring triage labels May 24, 2024
@github-actions github-actions bot added the receiver/prometheus Prometheus receiver label May 24, 2024
Copy link
Contributor

Pinging code owners:

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

@dashpole
Copy link
Contributor

OpenTelemetry uses service.instance.id and service.name. Prometheus exporters rename these to job and instance per the specification. You can also use the resource processor to rename from service.instance.id and service.name to job and instance if you want.

@dashpole dashpole removed the needs triage New item requiring triage label May 24, 2024
@chenlujjj
Copy link
Contributor Author

@dashpole Thanks for your answer, the resource processor can solve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request receiver/prometheus Prometheus receiver
Projects
None yet
Development

No branches or pull requests

2 participants