-
Notifications
You must be signed in to change notification settings - Fork 881
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
Enabling Exemplars in Prometheus exporter #4616
Comments
@anuraaga @jkwatson can you transfer this to https://github.com/open-telemetry/opentelemetry-java? @irizzant once this is implemented in the prometheus exporter, it should get automatically picked up in the following java agent release. |
Thanks for the repy @trask , so if I understand correctly is prometheus-exporter that currently does not implement this feature? If I use the |
oh, it looks like the prometheus exporter has exemplar support already. @jsuereth have you happened to test the java agent + prometheus + exemplars? |
hi @irizzant, can you test out using OpenTelemetry SDK + Prometheus exporter directly to help narrow down where the issue is? |
Hello @irizzant Have you accessed the prometheus port from the browser address bar to view? Accept:application/openmetrics-text You can refer to public static String chooseContentType(String acceptHeader) {
if (acceptHeader == null) {
return CONTENT_TYPE_004;
}
for (String accepts : acceptHeader.split(",")) {
if ("application/openmetrics-text".equals(accepts.split(";")[0].trim())) {
return CONTENT_TYPE_OPENMETRICS_100;
}
}
return CONTENT_TYPE_004;
} In addition, the exemplar data has a sampling policy, the default policy is "with_sampled_trace". |
Thanks @trask @zmapleshine for your replies.
As I originally wrote my Java application is not using SDK but the auto-instrumentation agent, I configured the exporter with the following properties:
As you can see I'm using the Prometheus exporter directly offered by the agent.
Nope, I run a simple
I get the metrics but no trace info. I also tried with |
hey @irizzant, we figured out the problem today. the agent is not passing the context when recording metrics (and there's no active context at that time, at least for server metrics), which is why exemplars aren't captured. will plan to fix this before 1.9.0 release next week. |
Hi @trask , perfect thank you |
@irizzant we hope to release this week |
@laurit ok thank you |
@irizzant 1.9.0 is released, thanks again for reporting this! |
@trask thank you! |
@irizzant @trask
|
@nutslove I tested it and it works fine.
|
Is your feature request related to a problem? Please describe.
I have deployed and enabled the Java agent for auto instrumentation and enabled Prometheus exporter with system property
-Dotel.metrics.exporter=prometheus
.I cannot see any Exemplars in the metrics exported.
Describe the solution you'd like
I'd like to have Exemplars in the metrics exported by Prometheus exporter.
The text was updated successfully, but these errors were encountered: