Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Instrumentation.AspNet/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Histograms produced by this instrumentation package specify explicit bucket boundaries.
Copy link
Member

Choose a reason for hiding this comment

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

I think we could level this up a bit.

  • The http.server.request.duration histogram (measured in seconds) produced by the metrics instrumentation in this package now uses the Advice API to set default explicit buckets following the OpenTelemetry Specification.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed, with stable links ffee25f

Copy link
Member

Choose a reason for hiding this comment

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

I approved but I don't know if I love the stable link part 😄 Fine for the semantic conventions. But the link to advice API doc in main repo, I'm hoping to update that if this ever lands: dotnet/docs#43640

([#2430](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2430))

## 1.10.0-beta.1

Released 2024-Dec-09
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ internal sealed class HttpInMetricsListener : IDisposable

public HttpInMetricsListener(Meter meter, AspNetMetricsInstrumentationOptions options)
{
this.httpServerDuration = meter.CreateHistogram<double>(
this.httpServerDuration = meter.CreateHistogram(
"http.server.request.duration",
unit: "s",
description: "Duration of HTTP server requests.");
description: "Duration of HTTP server requests.",
advice: new InstrumentAdvice<double> { HistogramBucketBoundaries = [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] });
TelemetryHttpModule.Options.OnRequestStoppedCallback += this.OnStopActivity;
this.options = options;
}
Expand Down
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Histograms produced by this instrumentation package specify explicit bucket boundaries.
([#2430](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2430))

## 1.10.1

Released 2024-Dec-10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ internal sealed class HttpInMetricsListener : ListenerHandler
private static readonly PropertyFetcher<HttpContext> HttpContextPropertyFetcher = new("HttpContext");
private static readonly object ErrorTypeHttpContextItemsKey = new();

private static readonly Histogram<double> HttpServerRequestDuration = Meter.CreateHistogram<double>(HttpServerRequestDurationMetricName, "s", "Duration of HTTP server requests.");
private static readonly Histogram<double> HttpServerRequestDuration = Meter.CreateHistogram(
HttpServerRequestDurationMetricName,
unit: "s",
description: " Duration of HTTP server requests.",
advice: new InstrumentAdvice<double> { HistogramBucketBoundaries = [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 HttpInMetricsListener(string name)
: base(name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
span status. For details see: [Setting Status](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry.Api/README.md#setting-status).
([#2358](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2358))

* Histograms produced by this instrumentation package specify explicit bucket boundaries.
([#2430](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2430))

## 0.1.0-alpha.2

Released 2024-Sep-18
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,23 @@ internal static class ConfluentKafkaCommon
internal static readonly string InstrumentationVersion = typeof(ConfluentKafkaCommon).Assembly.GetPackageVersion();
internal static readonly ActivitySource ActivitySource = new(InstrumentationName, InstrumentationVersion);
internal static readonly Meter Meter = new(InstrumentationName, InstrumentationVersion);
internal static readonly Counter<long> ReceiveMessagesCounter = Meter.CreateCounter<long>(SemanticConventions.MetricMessagingReceiveMessages);
internal static readonly Histogram<double> ReceiveDurationHistogram = Meter.CreateHistogram<double>(SemanticConventions.MetricMessagingReceiveDuration);
internal static readonly Counter<long> PublishMessagesCounter = Meter.CreateCounter<long>(SemanticConventions.MetricMessagingPublishMessages);
internal static readonly Histogram<double> PublishDurationHistogram = Meter.CreateHistogram<double>(SemanticConventions.MetricMessagingPublishDuration);
internal static readonly Counter<long> ReceiveMessagesCounter = Meter.CreateCounter<long>(
SemanticConventions.MetricMessagingReceiveMessages,
description: "Measures the number of received messages.");

internal static readonly Histogram<double> ReceiveDurationHistogram = Meter.CreateHistogram(
SemanticConventions.MetricMessagingReceiveDuration,
unit: "s",
description: "Measures the duration of receive operation.",
advice: new InstrumentAdvice<double> { HistogramBucketBoundaries = [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 Counter<long> PublishMessagesCounter = Meter.CreateCounter<long>(
SemanticConventions.MetricMessagingPublishMessages,
description: "Measures the number of published messages.");

internal static readonly Histogram<double> PublishDurationHistogram = Meter.CreateHistogram(
SemanticConventions.MetricMessagingPublishDuration,
unit: "s",
description: "Measures the duration of publish operation.",
advice: new InstrumentAdvice<double> { HistogramBucketBoundaries = [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] });
}
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Instrumentation.Http/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Histograms produced by this instrumentation package specify explicit bucket boundaries.
([#2430](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2430))

## 1.10.0

Released 2024-Nov-27
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ internal sealed class HttpHandlerMetricsDiagnosticListener : ListenerHandler
internal static readonly string MeterVersion = AssemblyName.Version!.ToString();
internal static readonly Meter Meter = new(MeterName, MeterVersion);
private const string OnUnhandledExceptionEvent = "System.Net.Http.Exception";
private static readonly Histogram<double> HttpClientRequestDuration = Meter.CreateHistogram<double>("http.client.request.duration", "s", "Duration of HTTP client requests.");
private static readonly Histogram<double> HttpClientRequestDuration = Meter.CreateHistogram(
"http.client.request.duration",
unit: "s",
description: "Duration of HTTP client requests.",
advice: new InstrumentAdvice<double> { HistogramBucketBoundaries = [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] });

private static readonly PropertyFetcher<HttpRequestMessage> StopRequestFetcher = new("Request");
private static readonly PropertyFetcher<HttpResponseMessage> StopResponseFetcher = new("Response");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ internal static class HttpWebRequestActivitySource
private static readonly string Version = AssemblyName.Version.ToString();
private static readonly ActivitySource WebRequestActivitySource = new(ActivitySourceName, Version);
private static readonly Meter WebRequestMeter = new(MeterName, Version);
private static readonly Histogram<double> HttpClientRequestDuration = WebRequestMeter.CreateHistogram<double>("http.client.request.duration", "s", "Duration of HTTP client requests.");
private static readonly Histogram<double> HttpClientRequestDuration = WebRequestMeter.CreateHistogram(
"http.client.request.duration",
unit: "s",
description: "Duration of HTTP client requests.",
advice: new InstrumentAdvice<double> { HistogramBucketBoundaries = [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] });

// Fields for reflection
private static FieldInfo connectionGroupListField;
Expand Down
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Instrumentation.Owin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
span status. For details see: [Setting Status](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry.Api/README.md#setting-status).
([#2358](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2358))

* Histograms produced by this instrumentation package specify explicit bucket boundaries.
([#2430](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2430))

## 1.0.0-rc.6

Released 2024-Apr-19
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ internal static class OwinInstrumentationMetrics
internal static readonly AssemblyName AssemblyName = Assembly.GetName();
internal static readonly string MeterName = AssemblyName.Name;
internal static readonly Meter Instance = new(MeterName, Assembly.GetPackageVersion());
internal static readonly Histogram<double> HttpServerDuration = Instance.CreateHistogram<double>("http.server.request.duration", "s", "Duration of HTTP server requests.");
internal static readonly Histogram<double> HttpServerDuration = Instance.CreateHistogram(
"http.server.request.duration",
unit: "s",
description: "Duration of HTTP server requests.",
advice: new InstrumentAdvice<double> { HistogramBucketBoundaries = [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] });
}
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Instrumentation.SqlClient/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
* **Breaking change** The `EnableConnectionLevelAttributes` option has been removed.
([#2414](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2414))

* Histograms produced by this instrumentation package specify explicit bucket boundaries.
([#2430](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2430))

## 1.10.0-beta.1

Released 2024-Dec-09
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ internal sealed class SqlActivitySourceHelper
public static readonly string MeterName = AssemblyName.Name!;
public static readonly Meter Meter = new(MeterName, Assembly.GetPackageVersion());

public static readonly Histogram<double> DbClientOperationDuration = Meter.CreateHistogram<double>(
public static readonly Histogram<double> DbClientOperationDuration = Meter.CreateHistogram(
"db.client.operation.duration",
"s",
"Duration of database client operations.");
unit: "s",
description: "Duration of database client operations.",
advice: new InstrumentAdvice<double> { HistogramBucketBoundaries = [0.001, 0.005, 0.01, 0.05, 0.1, 0.5, 1, 5, 10] });

internal static readonly string[] SharedTagNames =
[
Expand Down
Loading