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

service.version does not appear as metric label #8176

Closed
spedersen-emailage opened this issue Mar 30, 2023 · 5 comments
Closed

service.version does not appear as metric label #8176

spedersen-emailage opened this issue Mar 30, 2023 · 5 comments
Labels
bug Something isn't working needs author feedback Waiting for additional feedback from the author stale

Comments

@spedersen-emailage
Copy link

Describe the bug

The service.version attribute does not appear as a label in metrics, but does appear as a resource in spans.

Steps to reproduce

Enable service.version attribute via Java option or environment variable.

What did you expect to see?

A version (or equivalent) label in metrics.

What did you see instead?

No version (or equivalent) label in metrics.

What version are you using?

1.24.0

Environment

OS: Amazon Linux 2
Runtime (if different from JDK above): openjdk 17.0.6 2023-01-17 LTS

Additional context

We have three resource attributes defined via the OTEL_RESOURCE_ATTRIBUTES environment variable:

  • service.name
  • service.instance.id
  • service.version

We found that service.name and service.instance.id appear as labels in our metrics, but service.version does not. It does, however, appear in spans/traces as a resource. This is outlined in the table below:

Attribute Metric Label Span Resource
service.name job service.name
service.instance.id instance service.instance.id
service.version - service.version

At this point I'm uncertain if this "problem" originates from the JIA, OTel itself, or Grafana. Or if this is by design. I can move this to a feature enhancement issue if it becomes one.

I would appreciate any insight you could offer while I continue to troubleshoot.

@spedersen-emailage spedersen-emailage added the bug Something isn't working label Mar 30, 2023
@trask
Copy link
Member

trask commented Apr 2, 2023

hi @spedersen-emailage, I'm guessing you are using prometheus exporter for metrics? check out: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md#resource-attributes, it looks like service.version should be available via the target_info metric

@spedersen-emailage
Copy link
Author

spedersen-emailage commented Apr 7, 2023

@trask Thanks for the response!

Unfortunately, the target_info metric doesn't exist. :(

Aside from the default instrumentation metrics, the only additional metrics for the associated job are:

  • otlp_exporter_exported{}
  • otlp_exporter_seen{}
  • processedSpans{}
  • queueSize{}

We use the prometheusremotewrite exporter to send metrics to an /api/prom/push endpoint.

Could this be an issue with Prometheus?

@trask
Copy link
Member

trask commented Apr 11, 2023

Unfortunately, the target_info metric doesn't exist. :(

it looks like this was implemented and should be available in 1.24.0: open-telemetry/opentelemetry-java#5039

We use the prometheusremotewrite exporter to send metrics to an /api/prom/push endpoint.

ah, it looks like you are using OTLP from Java -> Collector? The PR above implements target_info in the Java SDK's prometheus (pull) exporter.

you may need to see what the level of support for target_info is in the Collector's prometheusremotewrite

@mateuszrzeszutek
Copy link
Member

Hey @spedersen-emailage ,

Did you manage to consult the collector team about this?

@mateuszrzeszutek mateuszrzeszutek added the needs author feedback Waiting for additional feedback from the author label May 30, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2023

This has been automatically marked as stale because it has been marked as needing author feedback and has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

@github-actions github-actions bot added the stale label Jun 6, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs author feedback Waiting for additional feedback from the author stale
Projects
None yet
Development

No branches or pull requests

3 participants