diff --git a/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTests.client.cs b/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTests.client.cs index 6d617b98098..a735df41352 100644 --- a/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTests.client.cs +++ b/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTests.client.cs @@ -23,6 +23,7 @@ using Microsoft.AspNetCore.Http; using Moq; using OpenTelemetry.Instrumentation.GrpcNetClient; +using OpenTelemetry.Instrumentation.GrpcNetClient.Implementation; using OpenTelemetry.Trace; using Xunit; @@ -143,6 +144,7 @@ public void GrpcAndHttpClientInstrumentationIsInvoked(bool shouldEnrich) ValidateGrpcActivity(grpcSpan); Assert.Equal($"greet.Greeter/SayHello", grpcSpan.DisplayName); + Assert.Equal(0, grpcSpan.GetTagValue(SemanticConventions.AttributeRpcGrpcStatusCode)); Assert.Equal($"HTTP POST", httpSpan.DisplayName); Assert.Equal(grpcSpan.SpanId, httpSpan.ParentSpanId); } @@ -274,6 +276,7 @@ public void GrpcPropagatesContextWithSuppressInstrumentation() Assert.Equal($"greet.Greeter/SayHello", serverActivity.DisplayName); Assert.Equal(clientActivity.TraceId, serverActivity.TraceId); Assert.Equal(clientActivity.SpanId, serverActivity.ParentSpanId); + Assert.Equal(0, clientActivity.GetTagValue(SemanticConventions.AttributeRpcGrpcStatusCode)); Assert.Contains("item1=value1", serverActivity.GetCustomProperty("BaggageString") as string); } @@ -286,11 +289,14 @@ 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(ActivityKind.Client, activityToValidate.Kind); } private static void ActivityEnrichment(Activity activity, string method, object obj) { + Assert.True(activity.IsAllDataRequested); switch (method) { case "OnStartActivity":