Skip to content
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

Poor Histogram Support for the Prometheus Exporter #5782

Closed
SeWieland opened this issue Aug 9, 2024 · 3 comments
Closed

Poor Histogram Support for the Prometheus Exporter #5782

SeWieland opened this issue Aug 9, 2024 · 3 comments
Labels
bug Something isn't working pkg:OpenTelemetry.Exporter.Prometheus.AspNetCore Issues related to OpenTelemetry.Exporter.Prometheus.AspNetCore NuGet package

Comments

@SeWieland
Copy link

SeWieland commented Aug 9, 2024

Package

OpenTelemetry.Exporter.Prometheus.AspNetCore

Package Version

Package Name Version
OpenTelemetry.Exporter.Prometheus.AspNetCore 1.8.0-rc.1
OpenTelemetry.Extensions.Hosting 1.9.0

Runtime Version

net6.0

Description

The first issue I experienced: enabling exponential histograms using the Base2ExponentialHistogramConfiguration resulted in no histograms at all. I could not find anything in the docs, until is read #4337

Prometheus exporter: Currently, the exporter ignores exponential histograms.

It would be great to mention this more prominently somwhere in the docs.
I then tried to modify the Boundaries of the ExplicitBucketHistogramConfiguration explicitly, because I need much higher values than 10000 - still the default buckets are used.

Is this simply not working, or am I missing something?

I will now try to workaround the whole issue, by pushing metrics directly via the new OTEL endpoint of prometheus instead.
If this is the recommended way because many features simply do not work with the prom exporter, please consider leaving a note in the docs as well.

Steps to Reproduce

builder.AddView(instrument =>
{
    return instrument.GetType().GetGenericTypeDefinition() == typeof(Histogram<>)
    ? new ExplicitBucketHistogramConfiguration(){ Boundaries = customBuckets }
    : null;
});

Expected Result

histogram recordings are available in custom buckets in prometheus

Actual Result

histogram recordings are available in default buckets in prometheus

Additional Context

No response

@SeWieland SeWieland added the bug Something isn't working label Aug 9, 2024
@github-actions github-actions bot added the pkg:OpenTelemetry.Exporter.Prometheus.AspNetCore Issues related to OpenTelemetry.Exporter.Prometheus.AspNetCore NuGet package label Aug 9, 2024
@cijothomas
Copy link
Member

cijothomas commented Aug 9, 2024

image There is this warning in the doc already about this is under-development. (And no ETA either for making it production ready)

@cijothomas
Copy link
Member

cijothomas commented Aug 9, 2024

Expected Result histogram recordings are available in custom buckets in prometheus

This is not expected. While prometheus exporter does not support Exponential, it does support explicit one, and the custom boundaries should have worked. Would you mind sharing a repro, so it can be looked at?

@SeWieland
Copy link
Author

Sorry opening the issue here without investigating it entirely. I think I just got a bit frustrated with the not working Base2ExponentialBucketHistogramConfiguration..
By creating the minimum working example repo for debugging, I found out that it worked as expected.
Right now, I have no clue where the issue comes from in our code and will probably request to reopen the issue if it's related at all to the exporter or other otel libraries. But I think its just a misconfiguration after all.
Thanks for the heads up anyways

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:OpenTelemetry.Exporter.Prometheus.AspNetCore Issues related to OpenTelemetry.Exporter.Prometheus.AspNetCore NuGet package
Projects
None yet
Development

No branches or pull requests

2 participants