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

Remove zero bucket for the histogram buckets for ASP.NET Core and HttpClient metrics #5021

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/OpenTelemetry/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,21 @@
([#5004](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5004))
([#5016](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5016))

* Update `AggregatorStore` to provide known connection metrics with larger
histogram buckets.
* Update Metrics SDK to override the default histogram buckets for the following
metrics from ASP.NET Core and HttpClient runtime:
* `signalr.server.connection.duration`
* `kestrel.connection.duration`
* `http.client.connection.duration`

These histogram metrics which have their `Unit` as `s` (second) will have
their default histogram buckets as `[ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2,
5, 10, 30, 60, 120, 300 ]`.
([#5008](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5008))

* Remove the bucket with value `0` for histogram buckets for metrics from
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need this entry as the above entry already shows the buckets without 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR associated with the above entry adds the zero bucket ☹️

This PR removes the zero bucket for the previously added metrics as well. I thought it's better to just list out the correct buckets even for the above entry.

ASP.NET Core and HttpClient.
([#5021](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5021))

## 1.7.0-alpha.1

Released 2023-Oct-16
Expand Down
4 changes: 2 additions & 2 deletions src/OpenTelemetry/Metrics/Metric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public sealed class Metric
internal static readonly double[] DefaultHistogramBounds = new double[] { 0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000 };

// Short default histogram bounds. Based on the recommended semantic convention values for http.server.request.duration.
internal static readonly double[] DefaultHistogramBoundsShortSeconds = new double[] { 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 };
internal static readonly double[] DefaultHistogramBoundsShortSeconds = new double[] { 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 };
internal static readonly HashSet<(string, string)> DefaultHistogramBoundShortMappings = new()
{
("Microsoft.AspNetCore.Hosting", "http.server.request.duration"),
Expand All @@ -45,7 +45,7 @@ public sealed class Metric
};

// Long default histogram bounds. Not based on a standard. May change in the future.
internal static readonly double[] DefaultHistogramBoundsLongSeconds = new double[] { 0, 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 };
internal static readonly double[] DefaultHistogramBoundsLongSeconds = new double[] { 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 };
internal static readonly HashSet<(string, string)> DefaultHistogramBoundLongMappings = new()
{
("Microsoft.AspNetCore.Http.Connections", "signalr.server.connection.duration"),
Expand Down
Loading