The OpenTelemetry .NET Client
Activity.Current
was different than instance obtained from IHttpActivityFeature.Activity
. (#5136)http.route
attribute was not set on either the Activity
or http.server.request.duration
metric generated from a request when an exception handling middleware is invoked. One caveat is that this fix does not address the problem for the http.server.request.duration
metric when running ASP.NET Core 8. ASP.NET Core 8 contains an equivalent fix which should ship in version 8.0.2 (see: dotnet/aspnetcore#52652). (#5135)net6.0
target of this library is loaded into a .NET 7+ process and the instrumentation does not behave as expected. This is an unusual scenario that does not affect users consuming this package normally. This fix is primarily to support the opentelemetry-dotnet-instrumentation project. (#5252)http.client.request.duration
metric. (#5234)OTEL_SEMCONV_STABILITY_OPT_IN
environment variable which toggled the use of the new conventions for the server, client, and shared network attributes. Now that this suite of attributes are stable, this instrumentation will only emit the new attributes. (#5270)SqlClientInstrumentationOptions
to SqlClientTraceInstrumentationOptions
. (#5285)db.statement_type
attribute. This attribute was never a part of the semantic conventions. (#5301)OpenTelemetry.Instrumentation.Http
package version 1.6.0
or greater. This is not a result of a change in the OpenTelemetry.Instrumentation.GrpcNetClient
package therefore this also affects versions prior to this release. See this issue for details and workaround.OTEL_SEMCONV_STABILITY_OPT_IN
environment variable which toggled the use of the new conventions for the server, client, and shared network attributes. Now that this suite of attributes are stable, this instrumentation will only emit the new attributes. (#5259)GrpcClientInstrumentationOptions
to GrpcClientTraceInstrumentationOptions
. (#5272)From a feature standpoint, 1.7.0 release of these two instrumentation libraries don't have any additional changes on top of the respective 1.6.0 version packages. The major difference in 1.7.0 is that it depends on 1.7.0 version of OpenTelemetry.Api.ProviderBuilderExtensions
which brings in >=8.0.0
version of System.Diagnostics.DiagnosticSource.
If you're interested in knowing all of the changes that went into 1.6.0 release, please go through the Release notes of all the previous pre-release versions for 1.6.0 for these two packages.
This is the first stable release of both AspNetCore and Http instrumentation libraries. If you're interested in knowing all of the changes that went into 1.6.0 release, please go through the Release notes of all the previous pre-release versions for 1.6.0 for these two packages.
OpenTelemetry.Instrumentation.AspNetCore
OTEL_DOTNET_EXPERIMENTAL_ASPNETCORE_ENABLE_GRPC_INSTRUMENTATION
flag to True
. OTEL_DOTNET_EXPERIMENTAL_ASPNETCORE_ENABLE_GRPC_INSTRUMENTATION
can be set as an environment variable or via IConfiguration. The change is introduced in order to support stable release of http
instrumentation. Semantic conventions for RPC is still experimental and hence the package will only support it as an opt-in experimental feature. Note that the support was removed in 1.6.0-rc.1
version of the package and versions released before 1.6.0-rc.1
had gRPC instrumentation enabled by default. (#5130)If you're interested in knowing all of the changes that went into 1.7.0
release, please go through the Release notes of all the previous pre-release versions for 1.7.0
.
Note: Instrumentation libraries were not included for 1.7.0-beta.1
.
OpenTelemetry.Shims.OpenTracing
TracerShim(Tracer, TextMapPropagator)
constructor. Use TracerShim(TracerProvider)
or TracerShim(TracerProvider, TextMapPropagator)
constructors. (#4862)Removed support for OTEL_SEMCONV_STABILITY_OPT_IN
environment variable. The library will now emit only the stable
semantic conventions. (#5066)
Removed netstandard2.1
target. (#5094)
Removed support for grpc instrumentation to unblock stable release of http instrumentation. For details, see issue #5098 (#5097)
Breaking Change : Renamed AspNetCoreInstrumentationOptions
to AspNetCoreTraceInstrumentationOptions
. (#5108)
Removed support for OTEL_SEMCONV_STABILITY_OPT_IN
environment variable. The library will now emit only the stable
semantic conventions. (#5068)
Update activity DisplayName as per the specification. (#5078)
Removed reference to OpenTelemetry
package. This is a breaking change for users relying on SuppressDownstreamInstrumentation option in OpenTelemetry.Instrumentation.GrpcNetClient
. For details, check out this issue. (#5077)
Breaking Change: Renamed HttpClientInstrumentationOptions
to HttpClientTraceInstrumentationOptions
. (#5109)
Breaking Change: Removed http.user_agent
tag from HttpClient activity. (#5110)
HttpWebRequest
: Introduced additional values for error.type
tag on activity and http.client.request.duration
metric. (#5111)
OpenTelemetry
The AddService
ResourceBuilder
extension method will now generate the same service.instance.id
for the lifetime of a process when autoGenerateServiceInstanceId
is true
. (#4988)
Fixed a Metrics SDK bug which led to ExemplarReservoir.Offer
always being called regardless of whether or not the ExemplarFilter
sampled the measurement. (#5004) (#5016)
Update Metrics SDK to override the default histogram buckets for the followingmetrics 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) (#5021)
Remove the bucket with value 0
for histogram buckets for all metrics from ASP.NET Core and HttpClient. (#5021)
Updated Microsoft.Extensions.Logging.Configuration
package version to 8.0.0
. (#5051)
Updated Microsoft.Extensions.Logging
package version to 8.0.0
. (#5051)
Revert the default behavior of Metrics SDK for Delta aggregation. It would not reclaim unused Metric Points by default. You can enable the SDK to reclaim unused Metric Points by setting the environment variable OTEL_DOTNET_EXPERIMENTAL_METRICS_RECLAIM_UNUSED_METRIC_POINTS
to true
before setting up the MeterProvider
. (#5052)
Update Metrics SDK to override the default histogram buckets for ASP.NET (.NET Framework).
Histogram metrics for the meter name OpenTelemetry.Instrumentation.AspNet
and instrument name http.request.server.duration
which have their Unit
as s
(second) will have their default histogram buckets as [ 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 ]
. (#5063)
Added AddProcessor
overload on OpenTelemetryLoggerOptions
which exposes the factory pattern (Func<IServiceProvider, BaseProcessor<LogRecord>> implementationFactory)
. (#4916)
Add support for Instrumentation Scope Attributes (i.e Meter Tags), fixing issue #4563. (#5089)
Added the ILoggingBuilder.UseOpenTelemetry
experimental API extension for registering OpenTelemetry ILogger
integration using LoggerProviderBuilder
which supports the full DI (IServiceCollection
\ IServiceProvider
) API surface (mirrors tracing & metrics). (#5072)
Changed the ILoggingBuilder
registration extensions (AddOpenTelemetry
& UseOpenTelemetry
) to fire the optional OpenTelemetryLoggerOptions
configuration delegate AFTER the "Logging:OpenTelemetry" IConfiguration
section has been applied. (#5072)
OpenTelemetry.Api
System.Diagnostics.DiagnosticSource
package version to 8.0.0
. (#5051)OpenTelemetry.Api.ProviderBuilderExtensions
Microsoft.Extensions.DependencyInjection.Abstractions
package version to 8.0.0
. (#5051)OpenTelemetry.Exporter.Console
OpenTelemetry.Exporter.OpenTelemetryProtocol
Made OpenTelemetry.Exporter.OtlpLogExporter
public. (#4979)
Updated the OpenTelemetryLoggerOptions.AddOtlpExporter
extension to retrieve OtlpExporterOptions
and LogRecordExportProcessorOptions
using the IServiceProvider
/ Options API so that they can be controlled via IConfiguration
(similar to metrics and traces). (#4916)
Added an OpenTelemetryLoggerOptions.AddOtlpExporter
extension overload which accepts a name
parameter to support named options. (#4916)
Add support for Instrumentation Scope Attributes (i.e Meter Tags), fixing issue #4563. (#5089)
OpenTelemetry.Extensions.Hosting
Updated Microsoft.Extensions.Hosting.Abstractions
package version to 8.0.0
. (#5051)
The OpenTelemetryBuilder.WithMetrics
method will now register an IMetricsListener
named 'OpenTelemetry' into the IServiceCollection
to enable metric management via the new Microsoft.Extensions.Diagnostics
.NET 8 APIs. (#4958)
The OpenTelemetryBuilder.WithLogging
experimental API method will now register an ILoggerProvider
named 'OpenTelemetry' into the IServiceCollection
to enable ILoggerFactory
integration. (#5072)
Removed the Activity Status Description that was being set during exceptions. Activity Status will continue to be reported as Error
. This is a breaking change. EnrichWithException
can be leveraged
to restore this behavior. (#5025)
Updated http.request.method
to match specification guidelines.
http.request.method.original
and http.request.method
will be set to _OTHER
.http.request.method
on http.server.request.duration
metric will be set to _OTHER
http.request.method
is set on http.server.request.duration
metric or activity when OTEL_SEMCONV_STABILITY_OPT_IN
environment variable is set to http
or http/dup
.
(#5001)
An additional attribute error.type
will be added to activity and http.server.request.duration
metric when the request results in unhandled exception. The attribute value will be set to full name of exception type.
The attribute will only be added when OTEL_SEMCONV_STABILITY_OPT_IN
environment variable is set to http
or http/dup
. (#4986)
Fixed network.protocol.version
attribute values to match the specification. (#5007)
Calls to /metrics
will now be included in the http.server.request.duration
metric. This change may affect Prometheus pull scenario if the Prometheus server sends request to the scraping endpoint that contains /metrics
in path. (#5044)
Fixes the http.route
attribute for scenarios in which it was previously missing or incorrect. Additionally, the http.route
attribute is now the same for both the metric and Activity
emitted for a request
Lastly, the Activity.DisplayName
has been adjusted to have the format {http.request.method} {http.route}
to conform with the specification. There remain scenarios when using conventional routing or Razor pages where http.route
is still incorrect. See #5056 and #5057 for more details. (#5026)
Removed network.protocol.name
from http.server.request.duration
metric as per spec. (#5049)
Removed the Activity Status Description that was being set during exceptions. Activity Status will continue to be reported as Error
. This is a breaking change. EnrichWithException
can be leveraged to restore this behavior. (#5025)
Updated http.request.method
to match specification guidelines.
http.request.method.original
and http.request.method
will be set to _OTHER
.http.request.method
on http.client.request.duration
metric will be set to _OTHER
http.request.method
is set on http.client.request.duration
metric or activity when OTEL_SEMCONV_STABILITY_OPT_IN
environment variable is set to http
or http/dup
. (#5003)
An additional attribute error.type
will be added to activity and http.client.request.duration
metric in case of failed requests as per the specification.
Users moving to net8.0
or newer frameworks from lower versions will see difference in values in case of an exception. net8.0
or newer frameworks add the ability to further drill down the exceptions to a specific type through HttpRequestError enum. For lower versions, the individual types will be rolled in to a single type. This could be a breaking change if alerts are set based on the values.
The attribute will only be added when OTEL_SEMCONV_STABILITY_OPT_IN
environment variable is set to http
or http/dup
. (#5005) (#5034)
Fixed network.protocol.version
attribute values to match the specification. (#5006)
Set network.protocol.version
value using the protocol version on the received response. If the request fails without response, then network.protocol.version
attribute will not be set on Activity and http.client.request.duration
metric. (#5043)
Microsoft.Extensions.Configuration
and Microsoft.Extensions.Options
package version to 8.0.0
. (#5051)http.server.request.duration
measured in seconds. The OTel SDK (starting with version 1.6.0) applies custom histogram buckets for this metric to comply with the Semantic Convention for Http Metrics.This new metric is only available for users who opt-in to the new semantic convention by configuring the OTEL_SEMCONV_STABILITY_OPT_IN
environment variable to either http
(to emit only the new metric) or http/dup
(to emit both the new and old metrics). (#4802)
http.server.request.duration
s
(seconds)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
http.server.duration
ms
(milliseconds)0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000
Note: the older http.server.duration
metric and OTEL_SEMCONV_STABILITY_OPT_IN
environment variable will eventually be removed after the HTTP semantic conventions are marked stable. At which time this instrumentation can publish a stable release. Refer to the specification for more information regarding the new HTTP semantic conventions for both spans and metrics.
Following metrics will now be enabled by default when targeting .NET8.0
or newer framework:
Meter : Microsoft.AspNetCore.Hosting
http.server.request.duration
http.server.active_requests
Meter : Microsoft.AspNetCore.Server.Kestrel
kestrel.active_connections
kestrel.connection.duration
kestrel.rejected_connections
kestrel.queued_connections
kestrel.queued_requests
kestrel.upgraded_connections
kestrel.tls_handshake.duration
kestrel.active_tls_handshakes
Meter : Microsoft.AspNetCore.Http.Connections
signalr.server.connection.duration
signalr.server.active_connections
Meter : Microsoft.AspNetCore.Routing
aspnetcore.routing.match_attempts
Meter : Microsoft.AspNetCore.Diagnostics
aspnetcore.diagnostics.exceptions
Meter : Microsoft.AspNetCore.RateLimiting
aspnetcore.rate_limiting.active_request_leases
aspnetcore.rate_limiting.request_lease.duration
aspnetcore.rate_limiting.queued_requests
aspnetcore.rate_limiting.request.time_in_queue
aspnetcore.rate_limiting.requests
For details about each individual metric check ASP.NET Core docs page.
NOTES:
.NET8.0
framework or newer, http.server.request.duration
metric will only follow v1.22.0 semantic conventions specification. Ability to switch behavior to older conventions using OTEL_SEMCONV_STABILITY_OPT_IN
environment variable is not available.Added network.protocol.name
dimension to http.server.request.duration
metric. This change only affects users setting OTEL_SEMCONV_STABILITY_OPT_IN
to http
or http/dup
. (#4934)
Breaking: Removed Enrich
and Filter
support for metrics instrumentation. With this change, AspNetCoreMetricsInstrumentationOptions
is no longer available. (#4981)
Enrich
migration:
An enrichment API for the http.server.request.duration
metric is available inside AspNetCore for users targeting .NET 8.0 (or newer). For details see: Enrich the ASP.NET Core request
metric.
Filter
migration:
There is no comparable filter mechanism currently available for any .NET version. Please share your feedback if you are impacted by this feature gap.
Note The View API may be used to drop dimensions.
Updated description for http.server.request.duration
metrics to match spec definition. (#4990)
HttpClient
, http.client.request.duration
measured in seconds. The OTel SDK (starting with version 1.6.0) applies custom histogram buckets for this metric to comply with the Semantic Convention for Http Metrics.This new metric is only available for users who opt-in to the new semantic convention by configuring the OTEL_SEMCONV_STABILITY_OPT_IN
environment variable to either http
(to emit only the new metric) or http/dup
(to emit both the new and old metrics). (#4870)
http.client.request.duration
s
(seconds)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
http.client.duration
ms
(milliseconds)0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000
Note: The older http.client.duration
metric and OTEL_SEMCONV_STABILITY_OPT_IN
environment variable will eventually be removed after the HTTP semantic conventions are marked stable. At which time this instrumentation can publish a stable release. Refer to the specification for more information regarding the new HTTP semantic conventions:
Added support for publishing http.client.duration
& http.client.request.duration
metrics on .NET Framework for HttpWebRequest
. (#4870)
Following HttpClient
metrics will now be enabled by default when targeting .NET8.0
framework or newer.
Meter : System.Net.Http
http.client.request.duration
http.client.active_requests
http.client.open_connections
http.client.connection.duration
http.client.request.time_in_queue
Meter : System.Net.NameResolution
dns.lookups.duration
For details about each individual metric check System.Net metrics docs page.
NOTES:
.NET8.0
framework or newer, http.client.request.duration
metric will only follow v1.22.0 semantic conventions specification. Ability to switch behavior to older conventions using OTEL_SEMCONV_STABILITY_OPT_IN
environment variable is
not available.Added url.scheme
attribute to http.client.request.duration
metric. The metric will be emitted when OTEL_SEMCONV_STABILITY_OPT_IN
environment variable is set to http
or http/dup
. (#4989)
Updated description for http.client.request.duration
metrics to match spec definition. (#4990)
OpenTelemetry
Update AggregatorStore
to reclaim unused MetricPoints for Delta aggregation temporality. (#4486)
Fixed a bug where TracerProviderBuilderBase
was not invoking the instrumentationFactory
delegate passed to the protected
AddInstrumentation
method. (#4873)
Allowed metric instrument names to contain /
characters. (#4882)
Breaking Change [Tracer|Meter|Logger]ProviderBuilder.Build
extension will now throw a NotSupportedException
if invoked on a non-SDK builder type. Previously it would return null
. (#4885)
Updated Microsoft.Extensions.Logging
package version to 8.0.0-rc.1.23419.4
. (#4920, #4933)
OpenTelemetry.Api
Fixed a bug which caused Tracer.StartRootSpan
to generate a child span if a trace was running (Activity.Current != null
). (#4890)
Added a Tracer
cache inside of TracerProvider
to prevent repeated calls to GetTracer
from leaking memory. (#4906)
Fix TraceContextPropagator
by validating the first digit of the hex-encoded trace-flags
field of the traceparent
header. (#4893)
OpenTelemetry.Exporter.OpenTelemetryProtocol
Bumped the version of Google.Protobuf
used by the project to 3.22.5
so that consuming applications can be published as NativeAOT successfully. Also, a new performance feature can be used instead of reflection emit, which is not AOT-compatible. Removed the dependency on System.Reflection.Emit.Lightweight
. (#4859)
Added support for OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT
and OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT
. (#4887)
Added ability to export attributes corresponding to LogRecord.Exception
i.e. exception.type
, exception.message
and exception.stacktrace
. These attributes will be exported when OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES
environment variable will be set to true
.
NOTE: These attributes were removed in 1.6.0-rc.1 release in order to support stable release of OTLP Log Exporter. The attributes will now be available via environment variable mentioned above. (#4892)
Added ability to export attributes corresponding to LogRecord.EventId.Id
as logrecord.event.id
and LogRecord.EventId.Name
as logrecord.event.name
. The attributes will be exported when OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES
will be set to true
.
NOTE: These attributes were removed in 1.6.0-rc.1 release in order to support stable release of OTLP Log Exporter. The attributes will now be available via environment variable mentioned above. (#4925)
LogRecord.CategoryName
will now be exported as InstrumentationScope name
field under ScopeLogs. (#4941)
OpenTelemetry.Exporter.Prometheus.AspNetCore
OpenTelemetry.Exporter.Prometheus.HttpListener
OpenTelemetry.Extensions.Hosting
OpenTelemetryBuilder.AddOpenTelemetry
extension to INSERT OpenTelemetry services at the beginning of the IServiceCollection
in an attempt to provide a better experience for end users capturing telemetry in hosted services. Note that this does not guarantee that OpenTelemetry services will be initialized while other hosted services start, so it is possible to miss telemetry until OpenTelemetry services are fully initialized. (#4883)Note: The below only shows the changes that were added to the core components post 1.6.0-rc.1
release. If you're interested in knowing all of the changes that went into 1.6.0
release, please go through the Release notes of all the previous pre-release versions for 1.6.0
.
OpenTelemetry
Increased the character limit of the Meter instrument name from 63 to 255. (#4774)
Update default size for SimpleExemplarReservoir
to 1
.
(#4803)
Note: Instrumentation libraries were not included for 1.6.0-beta.1
.
OpenTelemetry.Shims.OpenTracing