-
Notifications
You must be signed in to change notification settings - Fork 845
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
Guidance to enable exemplar for metrics #5329
Comments
Hey @gautam-nutalapati , Can you change your code so that it looks similar to this: Span span = spanBuilder.startSpan();
try (Scope scope = span.makeCurrent()) {
// ... application logic
apiInvocationCounter.add(1, Attributes.of(...));
apiLatencyRecorder.record(System.currentTimeMillis() - startTime, Attributes.of(...));
// ...
return new Saying(...);
} Also notice how I'm not passing the |
Thank you for the response @mateuszrzeszutek !
To ensure my expectation is correct, I am expecting metrics like below
Also, Based on Link, as I am using java-agent, I am only using the |
Was there a resolution for this issue? I am trying a similar setup where I am using the Opentelemetry java instrumentation agent to send metrics to otel collector which then forward metrics to prometheus. I am not seeing any metrics that contains "TraceID" or "SpanID". |
Answering my own question above, it seems the prometheusexporter in the OpenTelemetry collector is not supporting exemplars yet. There is a PR that is being worked on. |
@gautam-nutalapati @alvinhom are you still having this issue? is there something you think we need to fix in the javaagent? thx! |
I don't think there is any fix needed in javaagent. The issue seems to be the opentelemetry collector's prometheus exporter is not enabled with exemplar. My setup goes like this: Javaagent (otel exporter) --> Otel Collector (prometheus exporter) --> Prometheus Javaagent seems to be generating metrics with exemplar, but the prometheus exporter in otel collector contrib is not. I am waiting for the above mention issue to be merged into otel collector contrib to retest. I think you can close the issue for now. |
Hi,
I am auto-instrumenting my java app with java-agent and also adding couple of custom metrics.
Demo app is here: Link
My pipeline is as follows:
otlp-receiver -> processors > prometheus-exporter
otlp-receiver -> processors > jaeger-exporter
I want to use exemplars to link metrics and traces. But exemplar data is not being generated.
Where can I find information/documentation on how to achieve this for auto-instrumented metrics as well as custom metrics?
Any guidance is much appreciated.
The text was updated successfully, but these errors were encountered: