Hey Fabian,
Thanks for the reply! I did check out the it_exemplars_otel_agent and followed the instructions here
https://github.com/prometheus/client_java/blob/master/OTEL_EXEMPLARS.md
for getting that up and working. I used Otel 1.9.1 to match my version and was able to see exemplars with this test code.
$ java -Dotel.traces.exporter=logging -Dotel.metrics.exporter=none -javaagent:./opentelemetry-javaagent.jar -jar ./exa
mple-spring-boot-app.jar
$ curl -H 'Accept: application/openmetrics-text; version=1.0.0; charset=utf-8'
http://localhost:8080/metrics | grep sp
an_id
requests_total{path="/hello"} 3.0 # {span_id="4f836ba5e1b35cc2",trace_id="0d02651c1faf5b6aeb9a2cabdcdc0009"} 1.0 1641568523.154
requests_total{path="/god-of-fire"} 3.0 # {span_id="d00084d7529b0881",trace_id="0d02651c1faf5b6aeb9a2cabdcdc0009"} 1.0 1641568523.278
So the test code definitely works. Now I'm trying to understand what's different in my code in GitHub so that I can reproduce these results. The only real things that stood out to me are:
* The hotspot default metrics were missing in my code -- I've added these, but this didn't fix exemplars
* I'm manually instrumenting exemplars in all but one Counter
* I'm using the Scheduler for repeated tasks rather than a REST-like app.
But I'm out of ideas about what to try next here and I'm looking for some assistance as to what the issue is with my example code. Again, that lives here:
https://github.com/jjneely/java-exemplar-example
Jack Neely
On Thu, Jan 6, 2022, at 16:13, Fabian Stäber wrote:
> Hi Jack,
>
> You can find a working example in the it_exemplars_otel_agent
> integration test. The test runs the ExampleSpringBootApp in a Docker
> container with the OpenTelemetry agent attached.
> ExemplarsOpenTelemetryAgentIT verifies that Counter and Histogram
> metrics have Exemplars if they were observed in the context of a
> distributed trace.
>
> Fabian
>> --
>> You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to
prometheus-devel...@googlegroups.com <mailto:
prometheus-developers%2Bunsu...@googlegroups.com>.
>> To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-developers/73deecb0-da81-4970-ae20-66cc3543f7c1%40www.fastmail.com.