Skip to content

Commit c829b68

Browse files
authored
Update to otel 0.17.0 (#42)
1 parent b9dbf8f commit c829b68

File tree

5 files changed

+7
-22
lines changed

5 files changed

+7
-22
lines changed

dependencyManagement/build.gradle.kts

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ val DEPENDENCY_BOMS = listOf(
3232
"com.google.protobuf:protobuf-bom:3.14.0",
3333
"com.linecorp.armeria:armeria-bom:1.4.0",
3434
"io.grpc:grpc-bom:1.35.0",
35-
"io.opentelemetry:opentelemetry-bom:${if (!TEST_SNAPSHOTS) "0.15.0" else "0.16.0"}",
35+
"io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:${if (!TEST_SNAPSHOTS) "0.17.0-alpha" else "0.18.0-alpha-SNAPSHOT"}",
3636
"org.apache.logging.log4j:log4j-bom:2.14.0",
3737
"org.junit:junit-bom:5.7.0",
3838
"org.springframework.boot:spring-boot-dependencies:2.4.2",
@@ -41,22 +41,6 @@ val DEPENDENCY_BOMS = listOf(
4141
)
4242

4343
val DEPENDENCY_SETS = listOf(
44-
DependencySet(
45-
"io.opentelemetry",
46-
"0.15.0-alpha",
47-
listOf(
48-
"opentelemetry-api-metrics",
49-
"opentelemetry-sdk-extension-autoconfigure"
50-
)
51-
),
52-
DependencySet(
53-
"io.opentelemetry.javaagent",
54-
if (!TEST_SNAPSHOTS) "0.15.0" else "0.17.0-SNAPSHOT",
55-
listOf(
56-
"opentelemetry-javaagent",
57-
"opentelemetry-javaagent-spi"
58-
)
59-
),
6044
DependencySet(
6145
"org.assertj",
6246
"3.19.0",
@@ -80,7 +64,8 @@ val DEPENDENCY_SETS = listOf(
8064
val DEPENDENCIES = listOf(
8165
"commons-logging:commons-logging:1.2",
8266
"com.sparkjava:spark-core:2.9.3",
83-
"com.squareup.okhttp3:okhttp:4.9.1"
67+
"com.squareup.okhttp3:okhttp:4.9.1",
68+
"io.opentelemetry.javaagent:opentelemetry-javaagent:${if (!TEST_SNAPSHOTS) "0.17.0" else "0.18.0-SNAPSHOT"}"
8469
)
8570

8671
javaPlatform {

sample-apps/spark/src/main/java/com/amazon/sampleapp/App.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public static void main(String[] args) {
108108

109109
// get x-ray trace id
110110
private static String getXrayTraceId() {
111-
String traceId = Span.current().getSpanContext().getTraceIdAsHexString();
111+
String traceId = Span.current().getSpanContext().getTraceId();
112112
String xrayTraceId = "1-" + traceId.substring(0, 8) + "-" + traceId.substring(8);
113113

114114
return String.format("{\"traceId\": \"%s\"}", xrayTraceId);

sample-apps/spark/src/main/java/com/amazon/sampleapp/MetricEmitter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.amazon.sampleapp;
22

3-
import io.opentelemetry.api.common.Labels;
43
import io.opentelemetry.api.metrics.GlobalMetricsProvider;
54
import io.opentelemetry.api.metrics.LongCounter;
65
import io.opentelemetry.api.metrics.LongSumObserver;
@@ -9,6 +8,7 @@
98
import io.opentelemetry.api.metrics.LongValueObserver;
109
import io.opentelemetry.api.metrics.LongValueRecorder;
1110
import io.opentelemetry.api.metrics.Meter;
11+
import io.opentelemetry.api.metrics.common.Labels;
1212

1313
public class MetricEmitter {
1414

sample-apps/springboot/src/main/java/com/amazon/sampleapp/DemoController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public String awssdkCall() {
5454

5555
// get x-ray trace id
5656
private String getXrayTraceId() {
57-
String traceId = Span.current().getSpanContext().getTraceIdAsHexString();
57+
String traceId = Span.current().getSpanContext().getTraceId();
5858
String xrayTraceId = "1-" + traceId.substring(0, 8) + "-" + traceId.substring(8);
5959

6060
return String.format("{\"traceId\": \"%s\"}", xrayTraceId);

sample-apps/springboot/src/main/java/com/amazon/sampleapp/MetricEmitter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.amazon.sampleapp;
22

3-
import io.opentelemetry.api.common.Labels;
43
import io.opentelemetry.api.metrics.GlobalMetricsProvider;
54
import io.opentelemetry.api.metrics.LongCounter;
65
import io.opentelemetry.api.metrics.LongSumObserver;
@@ -9,6 +8,7 @@
98
import io.opentelemetry.api.metrics.LongValueObserver;
109
import io.opentelemetry.api.metrics.LongValueRecorder;
1110
import io.opentelemetry.api.metrics.Meter;
11+
import io.opentelemetry.api.metrics.common.Labels;
1212

1313
public class MetricEmitter {
1414

0 commit comments

Comments
 (0)