Skip to content

Commit

Permalink
Instrumentation.GrpcNetClient
Browse files Browse the repository at this point in the history
  • Loading branch information
Kielek committed Apr 2, 2024
1 parent a5ae3fc commit af3e76e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Instrumentation.GrpcNetClient/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* `ActivitySource.Version` is set to NuGet package version.
([#5498](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5498))

## 1.7.0-beta.1

Released 2024-Feb-09
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ internal sealed class GrpcClientDiagnosticListener : ListenerHandler
{
internal static readonly AssemblyName AssemblyName = typeof(GrpcClientDiagnosticListener).Assembly.GetName();
internal static readonly string ActivitySourceName = AssemblyName.Name;
internal static readonly Version Version = AssemblyName.Version;
internal static readonly ActivitySource ActivitySource = new(ActivitySourceName, Version.ToString());
internal static readonly string Version = SignalVersionHelper.GetVersion<GrpcClientDiagnosticListener>();
internal static readonly ActivitySource ActivitySource = new(ActivitySourceName, Version);

private const string OnStartEvent = "Grpc.Net.Client.GrpcOut.Start";
private const string OnStopEvent = "Grpc.Net.Client.GrpcOut.Stop";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<ItemGroup>
<Compile Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.Http\HttpRequestMessageContextPropagation.cs" Link="Includes\HttpRequestMessageContextPropagation.cs" />
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
<Compile Include="$(RepoRoot)\src\Shared\SignalVersionHelper.cs" Link="Includes\SignalVersionHelper.cs" />
<Compile Include="$(RepoRoot)\src\Shared\Options\*.cs" Link="Includes\Options\%(Filename).cs" />
<Compile Include="$(RepoRoot)\src\Shared\Shims\NullableAttributes.cs" Link="Includes\Shims\NullableAttributes.cs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public void Grpc_BadArgs()
private static void ValidateGrpcActivity(Activity activityToValidate)
{
Assert.Equal(GrpcClientDiagnosticListener.ActivitySourceName, activityToValidate.Source.Name);
Assert.Equal(GrpcClientDiagnosticListener.Version.ToString(), activityToValidate.Source.Version);
Assert.Equal(GrpcClientDiagnosticListener.Version, activityToValidate.Source.Version);
Assert.Equal(ActivityKind.Client, activityToValidate.Kind);
}
}

0 comments on commit af3e76e

Please sign in to comment.