I wanted to post some updates to this issue in case any one else runs into this.

Fabian found that Spring Boot implicitly includes 
"io.prometheus.:simpleclient_common:0.10.0" and I had not explicitly listed 
that implementation dependency in my Gradle build file.  (Although I had listed 
several other simpleclient dependencies at 0.14.1.). The 0.10.0 version does 
not have Prometheus Exemplar support.  But adding the following line to upgrade 
that dependency to 0.14.1 fixed the problem.

    implementation 'io.prometheus:simpleclient_common:0.14.1'

>From this point on I was able to see both the manually instrumented exemplars 
>as well as OpenTelemetry autoinstrumented span_id and trace_id added by having 
>the Agent loaded with:

    curl -H 'Accept: application/openmetrics-text; version=1.0.0; 
charset=utf-8' ...

Also, they appeared in my test Prometheus running on my laptop.

Thanks!
Jack Neely

On Thu, Jan 6, 2022, at 15:10, Jack Neely wrote:
> Friends,
>
> I wrote about this issue some months ago when I was trying to put 
> together a company wide demo and running out of time.  My apologies for 
> not following through.
>
> I'm attempting to write a simple Java Spring framework app that serves 
> as a working example of the metric and logging practices we'd like to 
> follow as our standards.  I've been trying for a while now to get 
> exemplar support working to demo how to pivot from metrics to traces, 
> but I've never been successful in getting exemplars to appear.
>
> I've copied the example code to GitHub.
>
>     https://github.com/jjneely/java-exemplar-example
>
> This is a super simple Gradle / Spring Boot app and running "./gradlew 
> bootrun" should get it up and running.  Log output will indicate if 
> exemplar support is enabled and it should be as it runs with the 
> OpenTelemetry Agent 1.9.1.  However, using curl against the metric 
> endpoint does not show exemplars and having Prometheus scrape the 
> endpoint does not show exemplars.
>
>     $ curl -H 'Accept: application/openmetrics-text; version=1.0.0; 
> charset=utf-8' http://localhost:8081/
>
> I've manually added exemplar values in the code, yet no luck.  I feel 
> like I'm missing something simple here.  I'm hoping this issue is 
> reproducible and someone can help me figure out what I've missed here.
>
> I've also sent a note in the CNCF Slack:
>
>    https://cloud-native.slack.com/archives/C167KFM6C/p1641494335010700
>
> Thanks for the help!  Now that I'm not under a time crunch I promise to 
> get back to folks.
>
> Jack Neely
>
> -- 
> 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-developers+unsubscr...@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.

-- 
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-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-developers/c61f79d6-a9e5-4948-ada1-6fa492f6611e%40www.fastmail.com.

Reply via email to