Skip to content

Commit 0012d26

Browse files
committed
Cleanup
1 parent caf64d0 commit 0012d26

File tree

5 files changed

+15
-11
lines changed

5 files changed

+15
-11
lines changed

sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/OpenTelemetryConfigurationFactoryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ void create_Configured() throws NoSuchFieldException, IllegalAccessException {
344344
.extracting("sharedState")
345345
.extracting("activeSpanProcessor")
346346
.extracting("worker")
347-
.extracting("spanProcessorMetrics")
347+
.extracting("spanProcessorInstrumentation")
348348
.extracting("processedSpans")
349349
.isNull();
350350
}

sdk/common/src/main/java/io/opentelemetry/sdk/internal/SemConvAttributes.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,9 @@ private SemConvAttributes() {}
3333
AttributeKey.longKey("rpc.grpc.status_code");
3434
public static final AttributeKey<Long> HTTP_RESPONSE_STATUS_CODE =
3535
AttributeKey.longKey("http.response.status_code");
36+
37+
public static final AttributeKey<String> OTEL_SPAN_PARENT_ORIGIN =
38+
AttributeKey.stringKey("otel.span.parent.origin");
39+
public static final AttributeKey<String> OTEL_SPAN_SAMPLING_RESULT =
40+
AttributeKey.stringKey("otel.span.sampling_result");
3641
}

sdk/common/src/test/java/io/opentelemetry/sdk/internal/SemConvAttributesTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,10 @@ void testAttributeKeys() {
3131
.isEqualTo(RpcIncubatingAttributes.RPC_GRPC_STATUS_CODE);
3232
assertThat(SemConvAttributes.HTTP_RESPONSE_STATUS_CODE)
3333
.isEqualTo(HttpAttributes.HTTP_RESPONSE_STATUS_CODE);
34+
35+
assertThat(SemConvAttributes.OTEL_SPAN_PARENT_ORIGIN)
36+
.isEqualTo(OtelIncubatingAttributes.OTEL_SPAN_PARENT_ORIGIN);
37+
assertThat(SemConvAttributes.OTEL_SPAN_SAMPLING_RESULT)
38+
.isEqualTo(OtelIncubatingAttributes.OTEL_SPAN_SAMPLING_RESULT);
3439
}
3540
}

sdk/trace/src/main/java/io/opentelemetry/sdk/trace/SdkTracerMetrics.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
package io.opentelemetry.sdk.trace;
77

8-
import static io.opentelemetry.api.common.AttributeKey.stringKey;
8+
import static io.opentelemetry.sdk.internal.SemConvAttributes.OTEL_SPAN_PARENT_ORIGIN;
9+
import static io.opentelemetry.sdk.internal.SemConvAttributes.OTEL_SPAN_SAMPLING_RESULT;
910

10-
import io.opentelemetry.api.common.AttributeKey;
1111
import io.opentelemetry.api.common.Attributes;
1212
import io.opentelemetry.api.metrics.LongCounter;
1313
import io.opentelemetry.api.metrics.LongUpDownCounter;
@@ -25,12 +25,6 @@
2525
*/
2626
final class SdkTracerMetrics {
2727

28-
// Visible for testing
29-
static final AttributeKey<String> OTEL_SPAN_PARENT_ORIGIN = stringKey("otel.span.parent.origin");
30-
// Visible for testing
31-
static final AttributeKey<String> OTEL_SPAN_SAMPLING_RESULT =
32-
stringKey("otel.span.sampling_result");
33-
3428
private static final Attributes noParentDrop =
3529
Attributes.of(
3630
OTEL_SPAN_PARENT_ORIGIN, "none", OTEL_SPAN_SAMPLING_RESULT, SamplingDecision.DROP.name());

sdk/trace/src/test/java/io/opentelemetry/sdk/trace/SdkTracerProviderMetricsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
import static io.opentelemetry.sdk.internal.SemConvAttributes.ERROR_TYPE;
99
import static io.opentelemetry.sdk.internal.SemConvAttributes.OTEL_COMPONENT_NAME;
1010
import static io.opentelemetry.sdk.internal.SemConvAttributes.OTEL_COMPONENT_TYPE;
11+
import static io.opentelemetry.sdk.internal.SemConvAttributes.OTEL_SPAN_PARENT_ORIGIN;
12+
import static io.opentelemetry.sdk.internal.SemConvAttributes.OTEL_SPAN_SAMPLING_RESULT;
1113
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
12-
import static io.opentelemetry.sdk.trace.SdkTracerMetrics.OTEL_SPAN_PARENT_ORIGIN;
13-
import static io.opentelemetry.sdk.trace.SdkTracerMetrics.OTEL_SPAN_SAMPLING_RESULT;
1414
import static org.mockito.ArgumentMatchers.any;
1515
import static org.mockito.Mockito.lenient;
1616
import static org.mockito.Mockito.when;

0 commit comments

Comments
 (0)