Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change aws-sdk span kind to INTERNAL #323

Merged
merged 1 commit into from
Apr 15, 2020
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 @@ -16,7 +16,6 @@
package io.opentelemetry.auto.instrumentation.awssdk.v1_11;

import static io.opentelemetry.auto.instrumentation.awssdk.v1_11.RequestMeta.SPAN_SCOPE_PAIR_CONTEXT_KEY;
import static io.opentelemetry.trace.Span.Kind.CLIENT;
import static io.opentelemetry.trace.TracingContextUtils.currentContextWith;

import com.amazonaws.AmazonWebServiceRequest;
Expand Down Expand Up @@ -48,8 +47,7 @@ public AmazonWebServiceRequest beforeMarshalling(final AmazonWebServiceRequest r

@Override
public void beforeRequest(final Request<?> request) {
final Span span =
TRACER.spanBuilder(decorate.spanNameForRequest(request)).setSpanKind(CLIENT).startSpan();
final Span span = TRACER.spanBuilder(decorate.spanNameForRequest(request)).startSpan();
decorate.afterStart(span);
decorate.onRequest(span, request);
request.addHandlerContext(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import java.util.concurrent.atomic.AtomicReference
import static io.opentelemetry.auto.test.server.http.TestHttpServer.httpServer
import static io.opentelemetry.auto.test.utils.PortUtils.UNUSABLE_PORT
import static io.opentelemetry.trace.Span.Kind.CLIENT
import static io.opentelemetry.trace.Span.Kind.INTERNAL

class AWSClientTest extends AgentTestRunner {

Expand Down Expand Up @@ -151,7 +152,7 @@ class AWSClientTest extends AgentTestRunner {
trace(0, 2) {
span(0) {
operationName "$service.$operation"
spanKind CLIENT
spanKind INTERNAL
errored false
parent()
tags {
Expand Down Expand Up @@ -238,7 +239,7 @@ class AWSClientTest extends AgentTestRunner {
trace(0, 2) {
span(0) {
operationName "$service.$operation"
spanKind CLIENT
spanKind INTERNAL
errored true
parent()
tags {
Expand Down Expand Up @@ -297,7 +298,7 @@ class AWSClientTest extends AgentTestRunner {
trace(0, 1) {
span(0) {
operationName "S3.HeadBucket"
spanKind CLIENT
spanKind INTERNAL
errored true
parent()
tags {
Expand Down Expand Up @@ -339,7 +340,7 @@ class AWSClientTest extends AgentTestRunner {
trace(0, 5) {
span(0) {
operationName "S3.GetObject"
spanKind CLIENT
spanKind INTERNAL
errored true
parent()
tags {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import java.util.concurrent.atomic.AtomicReference
import static io.opentelemetry.auto.test.server.http.TestHttpServer.httpServer
import static io.opentelemetry.auto.test.utils.PortUtils.UNUSABLE_PORT
import static io.opentelemetry.trace.Span.Kind.CLIENT
import static io.opentelemetry.trace.Span.Kind.INTERNAL

class AWSClientTest extends AgentTestRunner {

Expand Down Expand Up @@ -114,7 +115,7 @@ class AWSClientTest extends AgentTestRunner {
trace(0, 2) {
span(0) {
operationName "$service.$operation"
spanKind CLIENT
spanKind INTERNAL
errored false
parent()
tags {
Expand Down Expand Up @@ -183,7 +184,7 @@ class AWSClientTest extends AgentTestRunner {
trace(0, 2) {
span(0) {
operationName "$service.$operation"
spanKind CLIENT
spanKind INTERNAL
errored true
parent()
tags {
Expand Down Expand Up @@ -242,7 +243,7 @@ class AWSClientTest extends AgentTestRunner {
trace(0, 1) {
span(0) {
operationName "S3.GetObject"
spanKind CLIENT
spanKind INTERNAL
errored true
parent()
tags {
Expand Down Expand Up @@ -285,7 +286,7 @@ class AWSClientTest extends AgentTestRunner {
trace(0, 5) {
span(0) {
operationName "S3.GetObject"
spanKind CLIENT
spanKind INTERNAL
errored true
parent()
tags {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import static io.opentelemetry.auto.instrumentation.awssdk.v2_2.AwsSdkClientDecorator.DECORATE;
import static io.opentelemetry.auto.instrumentation.awssdk.v2_2.AwsSdkClientDecorator.TRACER;
import static io.opentelemetry.trace.Span.Kind.CLIENT;
import static io.opentelemetry.trace.TracingContextUtils.currentContextWith;

import io.opentelemetry.context.Scope;
Expand Down Expand Up @@ -49,8 +48,7 @@ public static class ScopeHolder {
@Override
public void beforeExecution(
final Context.BeforeExecution context, final ExecutionAttributes executionAttributes) {
final Span span =
TRACER.spanBuilder(DECORATE.spanName(executionAttributes)).setSpanKind(CLIENT).startSpan();
final Span span = TRACER.spanBuilder(DECORATE.spanName(executionAttributes)).startSpan();
try (final Scope scope = currentContextWith(span)) {
DECORATE.afterStart(span);
executionAttributes.putAttribute(SPAN_ATTRIBUTE, span);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import java.util.concurrent.atomic.AtomicReference

import static io.opentelemetry.auto.test.server.http.TestHttpServer.httpServer
import static io.opentelemetry.trace.Span.Kind.CLIENT
import static io.opentelemetry.trace.Span.Kind.INTERNAL

class AwsClientTest extends AgentTestRunner {

Expand Down Expand Up @@ -92,7 +93,7 @@ class AwsClientTest extends AgentTestRunner {
trace(0, 2) {
span(0) {
operationName "$service.$operation"
spanKind CLIENT
spanKind INTERNAL
errored false
parent()
tags {
Expand Down Expand Up @@ -192,7 +193,7 @@ class AwsClientTest extends AgentTestRunner {
trace(0, 1) {
span(0) {
operationName "$service.$operation"
spanKind CLIENT
spanKind INTERNAL
errored false
parent()
tags {
Expand Down Expand Up @@ -303,7 +304,7 @@ class AwsClientTest extends AgentTestRunner {
trace(0, 5) {
span(0) {
operationName "S3.GetObject"
spanKind CLIENT
spanKind INTERNAL
errored true
parent()
tags {
Expand Down