Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
@BetaApi
@InternalApi
public class SpanTracer implements ApiTracer {
public static final String LANGUAGE_ATTRIBUTE = "gcp.client.language";

public static final String DEFAULT_LANGUAGE = "Java";

static final String CONTENT_LENGTH_KEY = "Content-Length";

Expand Down Expand Up @@ -103,7 +100,6 @@ private static String resolveAttemptSpanName(ApiTracerContext apiTracerContext)
}

private void buildAttributes() {
this.attemptAttributes.put(LANGUAGE_ATTRIBUTE, DEFAULT_LANGUAGE);
this.attemptAttributes.putAll(this.apiTracerContext.getAttemptAttributes());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,6 @@ void testAttemptLifecycle_startsAndEndsAttemptSpan() {
verify(span).end();
}

@Test
void testAttemptStarted_includesLanguageAttribute() {
spanTracer.attemptStarted(new Object(), 1);

ArgumentCaptor<Attributes> attributesCaptor = ArgumentCaptor.forClass(Attributes.class);
verify(spanBuilder).setAllAttributes(attributesCaptor.capture());

assertThat(attributesCaptor.getValue().asMap())
.containsEntry(
io.opentelemetry.api.common.AttributeKey.stringKey(SpanTracer.LANGUAGE_ATTRIBUTE),
SpanTracer.DEFAULT_LANGUAGE);
}

@Test
void testAttemptSucceeded_grpc() {
ApiTracerContext context =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnavailableException;
import com.google.api.gax.tracing.ObservabilityAttributes;
import com.google.api.gax.tracing.SpanTracer;
import com.google.api.gax.tracing.SpanTracerFactory;
import com.google.common.collect.ImmutableList;
import com.google.protobuf.InvalidProtocolBufferException;
Expand Down Expand Up @@ -134,11 +133,6 @@ void testTracing_successfulEcho_grpc() throws Exception {
.findFirst()
.orElseThrow(() -> new AssertionError("Incorrect span name"));
assertThat(attemptSpan.getKind()).isEqualTo(SpanKind.CLIENT);
assertThat(
attemptSpan
.getAttributes()
.get(AttributeKey.stringKey(SpanTracer.LANGUAGE_ATTRIBUTE)))
.isEqualTo(SpanTracer.DEFAULT_LANGUAGE);
assertThat(
attemptSpan
.getAttributes()
Expand Down Expand Up @@ -205,11 +199,6 @@ void testTracing_successfulEcho_httpjson() throws Exception {
.orElseThrow(
() -> new AssertionError("Attempt span 'POST v1beta1/echo:echo' not found"));
assertThat(attemptSpan.getKind()).isEqualTo(SpanKind.CLIENT);
assertThat(
attemptSpan
.getAttributes()
.get(AttributeKey.stringKey(SpanTracer.LANGUAGE_ATTRIBUTE)))
.isEqualTo(SpanTracer.DEFAULT_LANGUAGE);
assertThat(
attemptSpan
.getAttributes()
Expand Down Expand Up @@ -491,8 +480,9 @@ public void sendMessage(ReqT message) {}

assertThrows(UnavailableException.class, () -> client.echo(echoRequest));
verifyErrorTypeAttribute("UNAVAILABLE");
}
}
}
}

@Test
void testTracing_statusCodes_grpc() throws Exception {
SpanTracerFactory tracingFactory = new SpanTracerFactory(openTelemetrySdk);
Expand Down Expand Up @@ -626,8 +616,9 @@ public String getHeaderValue(int index) {

assertThrows(UnavailableException.class, () -> client.echo(echoRequest));
verifyErrorTypeAttribute("503");
}
}
}
}

void testTracing_statusCodes_httpjson() throws Exception {
SpanTracerFactory tracingFactory = new SpanTracerFactory(openTelemetrySdk);
EchoRequest errorRequest =
Expand Down
Loading