Add exemplar support to Prometheus exporter#5929
Add exemplar support to Prometheus exporter#5929saul wants to merge 12 commits intoopen-telemetry:mainfrom
Conversation
src/OpenTelemetry.Exporter.Prometheus.HttpListener/Internal/PrometheusSerializerExt.cs
Show resolved
Hide resolved
I think you can enable it by default, given Exemplars itself is off-by-default in the SDK! So if prometheus exporter is exporting exemplars, users has already made an explicit decision to enable it at the sdk. |
@saul Can you sign the CLA part, as it is a mandatory pre-req for accepting any contributions to OpenTelemetry. If you are working on behalf on an employer, you may want to consult your employer before CLA. (Note: This is a one time requirement only) |
a609c15 to
b412857
Compare
d6e35f6 to
bfedbfc
Compare
bfedbfc to
8550c31
Compare
|
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
|
Hi @cijothomas the CLA has been signed and this is ready for review when you have time. Thanks |
|
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
|
@robertcoltheart Tagging you here, to see if you have some bandwidth to help review this PR, given you have made several contributions to the Prometheus Exporter! |
I am not sure of the reasoning for this either...You can put a TODO in the code and state this is not implemented, and we can follow up with the spec. |
|
I believe I've fixed the failing test now. Unfortunately when I push, my commits don't seem to trigger CI - do I need to manually trigger CI? |
First contribution requires approval to execute pipeliene (until PR is merged). Any furter changes will trigger pipeline automatically. CI triggered. |
|
Thanks for your help @Kielek. From what I can see all of the checks have passed now. |
|
@robertcoltheart, do you have some time to make full review of this PR? |
|
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5929 +/- ##
==========================================
- Coverage 86.36% 86.36% -0.01%
==========================================
Files 257 257
Lines 11584 11581 -3
==========================================
- Hits 10005 10002 -3
Misses 1579 1579
🚀 New features to boost your workflow:
|
|
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
|
Hi team - is someone able to take a look at this? This PR's been open for over 3 months now. Thank you |
|
@saul, sorry for delay with reviewing. I am pretty busy with other work. Lets start with this
If there is hard requirement from the spec, we need to follow. As https://opentelemetry.io/docs/specs/otel/compatibility/prometheus_and_openmetrics/#:~:text=If%20no%20exemplars%20exist%20on,trace%20and%20span%20IDs%2C%20respectively. is still marked as Development, you can try to create otel-spec issue to modify this. For now, it should be hard requirement before merge. |
I do not found anything in specification. I would recommend to create issue under https://github.com/open-telemetry/opentelemetry-specification to clarify. There is a chance that there will be a need to modify some documentation there. |
|
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
|
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
|
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
|
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
Fixes #3449
Design discussion issue - not found
Changes
Adds support for exporting histogram exemplars to OpenTelemetry.Exporter.Prometheus.AspNetCore and OpenTelemetry.Exporter.Prometheus.HttpListener. There are a couple of aspects that I'd appreciate some guidance on:
/metricsendpoint? Or should the exemplars be persistent in that once a bucket has an exemplar, it will always be returned by the/metricsendpoint until it is replaced by another exemplar.PrometheusAspNetCoreOptionsto enable exemplars, with the default being disabled (i.e. current behaviour)Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changesPrometheusAspNetCoreOptionsoption