File tree Expand file tree Collapse file tree 3 files changed +0
-28
lines changed
main/java/com/google/api/gax/tracing
test/java/com/google/api/gax/tracing
java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it Expand file tree Collapse file tree 3 files changed +0
-28
lines changed Original file line number Diff line number Diff line change 4545@ BetaApi
4646@ InternalApi
4747public class SpanTracer implements ApiTracer {
48- public static final String LANGUAGE_ATTRIBUTE = "gcp.client.language" ;
49-
50- public static final String DEFAULT_LANGUAGE = "Java" ;
5148
5249 static final String CONTENT_LENGTH_KEY = "Content-Length" ;
5350
@@ -103,7 +100,6 @@ private static String resolveAttemptSpanName(ApiTracerContext apiTracerContext)
103100 }
104101
105102 private void buildAttributes () {
106- this .attemptAttributes .put (LANGUAGE_ATTRIBUTE , DEFAULT_LANGUAGE );
107103 this .attemptAttributes .putAll (this .apiTracerContext .getAttemptAttributes ());
108104 }
109105
Original file line number Diff line number Diff line change @@ -84,19 +84,6 @@ void testAttemptLifecycle_startsAndEndsAttemptSpan() {
8484 verify (span ).end ();
8585 }
8686
87- @ Test
88- void testAttemptStarted_includesLanguageAttribute () {
89- spanTracer .attemptStarted (new Object (), 1 );
90-
91- ArgumentCaptor <Attributes > attributesCaptor = ArgumentCaptor .forClass (Attributes .class );
92- verify (spanBuilder ).setAllAttributes (attributesCaptor .capture ());
93-
94- assertThat (attributesCaptor .getValue ().asMap ())
95- .containsEntry (
96- io .opentelemetry .api .common .AttributeKey .stringKey (SpanTracer .LANGUAGE_ATTRIBUTE ),
97- SpanTracer .DEFAULT_LANGUAGE );
98- }
99-
10087 @ Test
10188 void testAttemptSucceeded_grpc () {
10289 ApiTracerContext context =
Original file line number Diff line number Diff line change 4242import com .google .api .gax .rpc .TransportChannelProvider ;
4343import com .google .api .gax .rpc .UnavailableException ;
4444import com .google .api .gax .tracing .ObservabilityAttributes ;
45- import com .google .api .gax .tracing .SpanTracer ;
4645import com .google .api .gax .tracing .SpanTracerFactory ;
4746import com .google .common .collect .ImmutableList ;
4847import com .google .protobuf .InvalidProtocolBufferException ;
@@ -134,11 +133,6 @@ void testTracing_successfulEcho_grpc() throws Exception {
134133 .findFirst ()
135134 .orElseThrow (() -> new AssertionError ("Incorrect span name" ));
136135 assertThat (attemptSpan .getKind ()).isEqualTo (SpanKind .CLIENT );
137- assertThat (
138- attemptSpan
139- .getAttributes ()
140- .get (AttributeKey .stringKey (SpanTracer .LANGUAGE_ATTRIBUTE )))
141- .isEqualTo (SpanTracer .DEFAULT_LANGUAGE );
142136 assertThat (
143137 attemptSpan
144138 .getAttributes ()
@@ -220,11 +214,6 @@ void testTracing_successfulEcho_httpjson() throws Exception {
220214 .orElseThrow (
221215 () -> new AssertionError ("Attempt span 'POST v1beta1/echo:echo' not found" ));
222216 assertThat (attemptSpan .getKind ()).isEqualTo (SpanKind .CLIENT );
223- assertThat (
224- attemptSpan
225- .getAttributes ()
226- .get (AttributeKey .stringKey (SpanTracer .LANGUAGE_ATTRIBUTE )))
227- .isEqualTo (SpanTracer .DEFAULT_LANGUAGE );
228217 assertThat (
229218 attemptSpan
230219 .getAttributes ()
You can’t perform that action at this time.
0 commit comments