dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.07k stars 4.69k forks source link

Add bucket size hints to histograms #104137

Closed JamesNK closed 2 months ago

JamesNK commented 3 months ago

Histogram bucket annotations were added with https://github.com/dotnet/runtime/issues/63650. But they need to used with histograms that are published.

All dotnet/runtime histograms use seconds so they should have an annotation to provide good bucket boundaries.

CreateHistogram<double>() usages: https://github.com/search?q=repo%3Adotnet%2Fruntime%20CreateHistogram&type=code. Looks like they're currently all networking related.

dotnet/aspnetcore doing the same thing: https://github.com/dotnet/aspnetcore/pull/56500

This is easy to do and should be done in .NET 9. It allows opentelemetry-dotnet to remove a hack to infer the bucket sizes. They can replace that code with code that looks at the attached bucket sizes.

dotnet-policy-service[bot] commented 3 months ago

Tagging subscribers to this area: @dotnet/ncl See info in area-owners.md if you want to be subscribed.

JamesNK commented 3 months ago

cc @noahfalk @tarekgh

CarnaViire commented 3 months ago

Triage: tentatively putting it to Future/10.0, as it seems to be nice-to-have ("hack" in OTel is already in place so it doesn't look blocking). @antonfirsov please feel free to re-triage it if my judgement was wrong.

JamesNK commented 3 months ago

OTEL has a hack to make data better. But that won't be true of other frameworks consuming metrics.

karelz commented 3 months ago

Triage: This will help remove hack in OTel. If it is really simple, we should do it. Discussed with @JamesNK. FYI: @antonfirsov cc @CarnaViire