Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions opentelemetry-dotnet-contrib.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@
<File Path="src/Shared/RedactionHelper.cs" />
<File Path="src/Shared/RequestDataHelper.cs" />
<File Path="src/Shared/ResourceSemanticConventions.cs" />
<File Path="src/Shared/RpcSemanticConventionHelper.cs" />
<File Path="src/Shared/SemanticConventions.cs" />
<File Path="src/Shared/ServerCertificateValidationHandler.cs" />
<File Path="src/Shared/ServerCertificateValidationProvider.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using OpenTelemetry.Instrumentation.AspNetCore.Implementation;
using static OpenTelemetry.Internal.RpcSemanticConventionHelper;

namespace OpenTelemetry.Instrumentation.AspNetCore;

Expand Down Expand Up @@ -38,6 +39,10 @@ internal AspNetCoreTraceInstrumentationOptions(IConfiguration configuration)
{
this.DisableUrlQueryRedaction = disableUrlQueryRedaction;
}

var rpcSemanticConvention = GetSemanticConventionOptIn(configuration);
this.EmitOldRpcAttributes = rpcSemanticConvention.HasFlag(RpcSemanticConvention.Old);
this.EmitNewRpcAttributes = rpcSemanticConvention.HasFlag(RpcSemanticConvention.New);
}

/// <summary>
Expand Down Expand Up @@ -115,7 +120,7 @@ internal AspNetCoreTraceInstrumentationOptions(IConfiguration configuration)
/// Gets or sets a value indicating whether RPC attributes are added to an Activity when using Grpc.AspNetCore.
/// </summary>
/// <remarks>
/// https://github.com/open-telemetry/semantic-conventions/blob/main/docs/rpc/rpc-spans.md.
/// https://github.com/open-telemetry/semantic-conventions/blob/v1.41.0/docs/rpc/rpc-spans.md.
/// </remarks>
internal bool EnableGrpcAspNetCoreSupport { get; set; }

Expand All @@ -128,4 +133,14 @@ internal AspNetCoreTraceInstrumentationOptions(IConfiguration configuration)
/// The redaction can be disabled by setting this property to <see langword="true" />.
/// </remarks>
internal bool DisableUrlQueryRedaction { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the old RPC attributes should be emitted.
/// </summary>
internal bool EmitOldRpcAttributes { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the new RPC attributes should be emitted.
/// </summary>
internal bool EmitNewRpcAttributes { get; set; }
}
5 changes: 5 additions & 0 deletions src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
* Fix enrich methods being called multiple times.
([#4015](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/4015))

* Add support for version [1.41.0](https://github.com/open-telemetry/semantic-conventions/blob/v1.41.0/docs/rpc/README.md)
of the Semantic Conventions for RPC/gRPC when the `OTEL_SEMCONV_STABILITY_OPT_IN`
environment variable is set to `rpc` or `rpc/dup`.
([#4370](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/4370))

## 1.15.2

Released 2026-Apr-21
Expand Down
Loading