Skip to content

Commit bbb0527

Browse files
opentelemetrybottrasklaurit
authored
Update the OpenTelemetry SDK version to 1.27.0 (open-telemetry#8688)
Co-authored-by: Trask Stalnaker <[email protected]> Co-authored-by: Lauri Tulmin <[email protected]>
1 parent 9b6e2b0 commit bbb0527

File tree

126 files changed

+463
-668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+463
-668
lines changed

conventions/src/main/kotlin/io.opentelemetry.instrumentation.javaagent-testing.gradle.kts

-4
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,10 @@ dependencies {
2525
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-extension-api") {
2626
// OpenTelemetry SDK is not needed for compilation
2727
exclude(group = "io.opentelemetry", module = "opentelemetry-sdk")
28-
exclude(group = "io.opentelemetry", module = "opentelemetry-sdk-metrics")
29-
exclude(group = "io.opentelemetry", module = "opentelemetry-sdk-logs")
3028
}
3129
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-tooling") {
3230
// OpenTelemetry SDK is not needed for compilation
3331
exclude(group = "io.opentelemetry", module = "opentelemetry-sdk")
34-
exclude(group = "io.opentelemetry", module = "opentelemetry-sdk-metrics")
35-
exclude(group = "io.opentelemetry", module = "opentelemetry-sdk-logs")
3632
}
3733

3834
// Used by byte-buddy but not brought in as a transitive dependency

dependencyManagement/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ val dependencyVersions = hashMapOf<String, String>()
1212
rootProject.extra["versions"] = dependencyVersions
1313

1414
// this line is managed by .github/scripts/update-sdk-version.sh
15-
val otelSdkVersion = "1.26.0"
15+
val otelSdkVersion = "1.27.0"
1616
val otelSdkAlphaVersion = otelSdkVersion.replaceFirst("(-SNAPSHOT)?$".toRegex(), "-alpha$1")
1717

1818
// Need both BOM and groovy jars

examples/distro/agent/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ tasks {
7474
dependencies {
7575
exclude("io.opentelemetry:opentelemetry-api")
7676
exclude("io.opentelemetry:opentelemetry-api-events")
77-
exclude("io.opentelemetry:opentelemetry-api-logs")
7877
exclude("io.opentelemetry:opentelemetry-context")
7978
exclude("io.opentelemetry:opentelemetry-semconv")
8079
// metrics advice API

examples/distro/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ subprojects {
2727
ext {
2828
versions = [
2929
// this line is managed by .github/scripts/update-sdk-version.sh
30-
opentelemetrySdk : "1.26.0",
30+
opentelemetrySdk : "1.27.0",
3131

3232
// these lines are managed by .github/scripts/update-version.sh
3333
opentelemetryJavaagent : "1.27.0-SNAPSHOT",

examples/distro/testing/agent-for-testing/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ tasks {
7171
dependencies {
7272
exclude("io.opentelemetry:opentelemetry-api")
7373
exclude("io.opentelemetry:opentelemetry-api-events")
74-
exclude("io.opentelemetry:opentelemetry-api-logs")
7574
exclude("io.opentelemetry:opentelemetry-context")
7675
exclude("io.opentelemetry:opentelemetry-semconv")
7776
// metrics advice API

instrumentation-annotations-support/build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@ dependencies {
1717
annotationProcessor("com.google.auto.value:auto-value")
1818

1919
testImplementation(project(":testing-common"))
20-
testImplementation("io.opentelemetry:opentelemetry-sdk-metrics")
2120
testImplementation("io.opentelemetry:opentelemetry-sdk-testing")
2221
}

instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractor.java

-4
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ public static <REQUEST, RESPONSE> MessagingAttributesExtractorBuilder<REQUEST, R
6767
@Override
6868
public void onStart(AttributesBuilder attributes, Context parentContext, REQUEST request) {
6969
internalSet(attributes, SemanticAttributes.MESSAGING_SYSTEM, getter.getSystem(request));
70-
internalSet(
71-
attributes,
72-
SemanticAttributes.MESSAGING_DESTINATION_KIND,
73-
getter.getDestinationKind(request));
7470
boolean isTemporaryDestination = getter.isTemporaryDestination(request);
7571
if (isTemporaryDestination) {
7672
internalSet(attributes, SemanticAttributes.MESSAGING_DESTINATION_TEMPORARY, true);

instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesGetter.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,15 @@ public interface MessagingAttributesGetter<REQUEST, RESPONSE> {
2222
@Nullable
2323
String getSystem(REQUEST request);
2424

25+
/**
26+
* @deprecated This method is deprecated and will be removed in a future release. There is no
27+
* replacement for this concept.
28+
*/
2529
@Nullable
26-
String getDestinationKind(REQUEST request);
30+
@Deprecated
31+
default String getDestinationKind(REQUEST request) {
32+
return null;
33+
}
2734

2835
@Nullable
2936
String getDestination(REQUEST request);

instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractorTest.java

-6
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ void shouldExtractAllAvailableAttributes(
6363
// then
6464
List<MapEntry<AttributeKey<?>, Object>> expectedEntries = new ArrayList<>();
6565
expectedEntries.add(entry(SemanticAttributes.MESSAGING_SYSTEM, "myQueue"));
66-
expectedEntries.add(entry(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"));
6766
expectedEntries.add(entry(SemanticAttributes.MESSAGING_DESTINATION_NAME, expectedDestination));
6867
if (temporary) {
6968
expectedEntries.add(entry(SemanticAttributes.MESSAGING_DESTINATION_TEMPORARY, true));
@@ -118,11 +117,6 @@ public String getSystem(Map<String, String> request) {
118117
return request.get("system");
119118
}
120119

121-
@Override
122-
public String getDestinationKind(Map<String, String> request) {
123-
return request.get("destinationKind");
124-
}
125-
126120
@Override
127121
public String getDestination(Map<String, String> request) {
128122
return request.get("destination");

instrumentation-api/build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ dependencies {
1919
annotationProcessor("com.google.auto.value:auto-value")
2020

2121
testImplementation(project(":testing-common"))
22-
testImplementation("io.opentelemetry:opentelemetry-sdk-metrics")
2322
testImplementation("io.opentelemetry:opentelemetry-sdk-testing")
2423
testImplementation("org.junit-pioneer:junit-pioneer")
2524

instrumentation/camel-2.20/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachecamel/decorators/KafkaSpanDecorator.java

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public void pre(
6161
super.pre(attributes, exchange, endpoint, camelDirection);
6262

6363
attributes.put(SemanticAttributes.MESSAGING_OPERATION, "process");
64-
attributes.put(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic");
6564

6665
Integer partition = exchange.getIn().getHeader(PARTITION, Integer.class);
6766
if (partition != null) {

instrumentation/java-util-logging/javaagent/build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ plugins {
55
dependencies {
66
compileOnly(project(":instrumentation:java-util-logging:shaded-stub-for-instrumenting"))
77

8-
compileOnly("io.opentelemetry:opentelemetry-api-logs")
98
compileOnly(project(":javaagent-bootstrap"))
109

1110
// ensure no cross interference

instrumentation/java-util-logging/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jul/JavaUtilLoggingHelper.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
package io.opentelemetry.javaagent.instrumentation.jul;
77

88
import application.java.util.logging.Logger;
9+
import io.opentelemetry.api.GlobalOpenTelemetry;
910
import io.opentelemetry.api.common.Attributes;
1011
import io.opentelemetry.api.common.AttributesBuilder;
11-
import io.opentelemetry.api.logs.GlobalLoggerProvider;
1212
import io.opentelemetry.api.logs.LogRecordBuilder;
1313
import io.opentelemetry.api.logs.Severity;
1414
import io.opentelemetry.context.Context;
@@ -41,7 +41,11 @@ public static void capture(Logger logger, LogRecord logRecord) {
4141
instrumentationName = "ROOT";
4242
}
4343
LogRecordBuilder builder =
44-
GlobalLoggerProvider.get().loggerBuilder(instrumentationName).build().logRecordBuilder();
44+
GlobalOpenTelemetry.get()
45+
.getLogsBridge()
46+
.loggerBuilder(instrumentationName)
47+
.build()
48+
.logRecordBuilder();
4549
mapLogRecord(builder, logRecord);
4650
builder.emit();
4751
}
@@ -81,7 +85,7 @@ private static void mapLogRecord(LogRecordBuilder builder, LogRecord logRecord)
8185
Throwable throwable = logRecord.getThrown();
8286
if (throwable != null) {
8387
// TODO (trask) extract method for recording exception into
84-
// io.opentelemetry:opentelemetry-api-logs
88+
// io.opentelemetry:opentelemetry-api
8589
attributes.put(SemanticAttributes.EXCEPTION_TYPE, throwable.getClass().getName());
8690
attributes.put(SemanticAttributes.EXCEPTION_MESSAGE, throwable.getMessage());
8791
StringWriter writer = new StringWriter();

instrumentation/java-util-logging/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jul/JavaUtilLoggingTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
package io.opentelemetry.javaagent.instrumentation.jul;
77

8-
import static io.opentelemetry.sdk.testing.assertj.LogAssertions.assertThat;
8+
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
99
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
1010
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.satisfies;
1111

instrumentation/jboss-logmanager/jboss-logmanager-appender-1.1/javaagent/build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ muzzle {
1414
dependencies {
1515
library("org.jboss.logmanager:jboss-logmanager:1.1.0.GA")
1616

17-
compileOnly("io.opentelemetry:opentelemetry-api-logs")
1817
compileOnly(project(":javaagent-bootstrap"))
1918

2019
// ensure no cross interference

instrumentation/jboss-logmanager/jboss-logmanager-appender-1.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jbosslogmanager/appender/v1_1/LoggingEventMapper.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
import static java.util.Collections.emptyList;
99

10+
import io.opentelemetry.api.GlobalOpenTelemetry;
1011
import io.opentelemetry.api.common.AttributeKey;
1112
import io.opentelemetry.api.common.Attributes;
1213
import io.opentelemetry.api.common.AttributesBuilder;
13-
import io.opentelemetry.api.logs.GlobalLoggerProvider;
1414
import io.opentelemetry.api.logs.LogRecordBuilder;
1515
import io.opentelemetry.api.logs.Severity;
1616
import io.opentelemetry.context.Context;
@@ -58,7 +58,11 @@ public void capture(Logger logger, ExtLogRecord record) {
5858
}
5959

6060
LogRecordBuilder builder =
61-
GlobalLoggerProvider.get().loggerBuilder(instrumentationName).build().logRecordBuilder();
61+
GlobalOpenTelemetry.get()
62+
.getLogsBridge()
63+
.loggerBuilder(instrumentationName)
64+
.build()
65+
.logRecordBuilder();
6266

6367
String message = record.getFormattedMessage();
6468
if (message != null) {
@@ -76,7 +80,7 @@ public void capture(Logger logger, ExtLogRecord record) {
7680
Throwable throwable = record.getThrown();
7781
if (throwable != null) {
7882
// TODO (trask) extract method for recording exception into
79-
// io.opentelemetry:opentelemetry-api-logs
83+
// io.opentelemetry:opentelemetry-api
8084
attributes.put(SemanticAttributes.EXCEPTION_TYPE, throwable.getClass().getName());
8185
attributes.put(SemanticAttributes.EXCEPTION_MESSAGE, throwable.getMessage());
8286
StringWriter writer = new StringWriter();

instrumentation/jboss-logmanager/jboss-logmanager-appender-1.1/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jbosslogmanager/appender/v1_1/JbossLogmanagerTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
package io.opentelemetry.javaagent.instrumentation.jbosslogmanager.appender.v1_1;
77

8-
import static io.opentelemetry.sdk.testing.assertj.LogAssertions.assertThat;
8+
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
99
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
1010
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.satisfies;
1111
import static org.assertj.core.api.Assertions.assertThat;

instrumentation/jms/jms-1.1/javaagent/src/jms2Test/groovy/Jms2Test.groovy

+34-36
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class Jms2Test extends AgentInstrumentationSpecification {
8181
server.stop()
8282
}
8383

84-
def "sending a message to #destinationName #destinationType generates spans"() {
84+
def "sending a message to #destinationName generates spans"() {
8585
setup:
8686
def producer = session.createProducer(destination)
8787
def consumer = session.createConsumer(destination)
@@ -104,7 +104,7 @@ class Jms2Test extends AgentInstrumentationSpecification {
104104
name "producer parent"
105105
hasNoParent()
106106
}
107-
producerSpan(it, 1, destinationType, destinationName, span(0))
107+
producerSpan(it, 1, destinationName, span(0))
108108

109109
producerSpanData = span(1)
110110
}
@@ -113,7 +113,7 @@ class Jms2Test extends AgentInstrumentationSpecification {
113113
name "consumer parent"
114114
hasNoParent()
115115
}
116-
consumerSpan(it, 1, destinationType, destinationName, messageId, "receive", span(0), producerSpanData)
116+
consumerSpan(it, 1, destinationName, messageId, "receive", span(0), producerSpanData)
117117
}
118118
}
119119

@@ -122,14 +122,14 @@ class Jms2Test extends AgentInstrumentationSpecification {
122122
consumer.close()
123123

124124
where:
125-
destination | destinationType | destinationName
126-
session.createQueue("someQueue") | "queue" | "someQueue"
127-
session.createTopic("someTopic") | "topic" | "someTopic"
128-
session.createTemporaryQueue() | "queue" | "(temporary)"
129-
session.createTemporaryTopic() | "topic" | "(temporary)"
125+
destination | destinationName
126+
session.createQueue("someQueue") | "someQueue"
127+
session.createTopic("someTopic") | "someTopic"
128+
session.createTemporaryQueue() | "(temporary)"
129+
session.createTemporaryTopic() | "(temporary)"
130130
}
131131

132-
def "sending to a MessageListener on #destinationName #destinationType generates a span"() {
132+
def "sending to a MessageListener on #destinationName generates a span"() {
133133
setup:
134134
def lock = new CountDownLatch(1)
135135
def messageRef = new AtomicReference<TextMessage>()
@@ -155,8 +155,8 @@ class Jms2Test extends AgentInstrumentationSpecification {
155155
name "parent"
156156
hasNoParent()
157157
}
158-
producerSpan(it, 1, destinationType, destinationName, span(0))
159-
consumerSpan(it, 2, destinationType, destinationName, messageRef.get().getJMSMessageID(), "process", span(1))
158+
producerSpan(it, 1, destinationName, span(0))
159+
consumerSpan(it, 2, destinationName, messageRef.get().getJMSMessageID(), "process", span(1))
160160
}
161161
}
162162
// This check needs to go after all traces have been accounted for
@@ -167,14 +167,14 @@ class Jms2Test extends AgentInstrumentationSpecification {
167167
consumer.close()
168168

169169
where:
170-
destination | destinationType | destinationName
171-
session.createQueue("someQueue") | "queue" | "someQueue"
172-
session.createTopic("someTopic") | "topic" | "someTopic"
173-
session.createTemporaryQueue() | "queue" | "(temporary)"
174-
session.createTemporaryTopic() | "topic" | "(temporary)"
170+
destination | destinationName
171+
session.createQueue("someQueue") | "someQueue"
172+
session.createTopic("someTopic") | "someTopic"
173+
session.createTemporaryQueue() | "(temporary)"
174+
session.createTemporaryTopic() | "(temporary)"
175175
}
176176

177-
def "failing to receive message with receiveNoWait on #destinationName #destinationType works"() {
177+
def "failing to receive message with receiveNoWait on #destinationName works"() {
178178
setup:
179179
def consumer = session.createConsumer(destination)
180180

@@ -190,12 +190,12 @@ class Jms2Test extends AgentInstrumentationSpecification {
190190
consumer.close()
191191

192192
where:
193-
destination | destinationType | destinationName
194-
session.createQueue("someQueue") | "queue" | "someQueue"
195-
session.createTopic("someTopic") | "topic" | "someTopic"
193+
destination | destinationName
194+
session.createQueue("someQueue") | "someQueue"
195+
session.createTopic("someTopic") | "someTopic"
196196
}
197197

198-
def "failing to receive message with wait(timeout) on #destinationName #destinationType works"() {
198+
def "failing to receive message with wait(timeout) on #destinationName works"() {
199199
setup:
200200
def consumer = session.createConsumer(destination)
201201
@@ -211,12 +211,12 @@ class Jms2Test extends AgentInstrumentationSpecification {
211211
consumer.close()
212212
213213
where:
214-
destination | destinationType | destinationName
215-
session.createQueue("someQueue") | "queue" | "someQueue"
216-
session.createTopic("someTopic") | "topic" | "someTopic"
214+
destination | destinationName
215+
session.createQueue("someQueue") | "someQueue"
216+
session.createTopic("someTopic") | "someTopic"
217217
}
218218
219-
def "sending a message to #destinationName #destinationType with explicit destination propagates context"() {
219+
def "sending a message to #destinationName with explicit destination propagates context"() {
220220
given:
221221
def producer = session.createProducer(null)
222222
def consumer = session.createConsumer(destination)
@@ -244,8 +244,8 @@ class Jms2Test extends AgentInstrumentationSpecification {
244244
name "parent"
245245
hasNoParent()
246246
}
247-
producerSpan(it, 1, destinationType, destinationName, span(0))
248-
consumerSpan(it, 2, destinationType, destinationName, messageRef.get().getJMSMessageID(), "process", span(1))
247+
producerSpan(it, 1, destinationName, span(0))
248+
consumerSpan(it, 2, destinationName, messageRef.get().getJMSMessageID(), "process", span(1))
249249
}
250250
}
251251
// This check needs to go after all traces have been accounted for
@@ -256,14 +256,14 @@ class Jms2Test extends AgentInstrumentationSpecification {
256256
consumer.close()
257257
258258
where:
259-
destination | destinationType | destinationName
260-
session.createQueue("someQueue") | "queue" | "someQueue"
261-
session.createTopic("someTopic") | "topic" | "someTopic"
262-
session.createTemporaryQueue() | "queue" | "(temporary)"
263-
session.createTemporaryTopic() | "topic" | "(temporary)"
259+
destination | destinationName
260+
session.createQueue("someQueue") | "someQueue"
261+
session.createTopic("someTopic") | "someTopic"
262+
session.createTemporaryQueue() | "(temporary)"
263+
session.createTemporaryTopic() | "(temporary)"
264264
}
265265
266-
static producerSpan(TraceAssert trace, int index, String destinationType, String destinationName, SpanData parentSpan = null) {
266+
static producerSpan(TraceAssert trace, int index, String destinationName, SpanData parentSpan = null) {
267267
trace.span(index) {
268268
name destinationName + " send"
269269
kind PRODUCER
@@ -275,7 +275,6 @@ class Jms2Test extends AgentInstrumentationSpecification {
275275
attributes {
276276
"$SemanticAttributes.MESSAGING_SYSTEM" "jms"
277277
"$SemanticAttributes.MESSAGING_DESTINATION_NAME" destinationName
278-
"$SemanticAttributes.MESSAGING_DESTINATION_KIND" destinationType
279278
if (destinationName == "(temporary)") {
280279
"$SemanticAttributes.MESSAGING_DESTINATION_TEMPORARY" true
281280
}
@@ -287,7 +286,7 @@ class Jms2Test extends AgentInstrumentationSpecification {
287286
// passing messageId = null will verify message.id is not captured,
288287
// passing messageId = "" will verify message.id is captured (but won't verify anything about the value),
289288
// any other value for messageId will verify that message.id is captured and has that same value
290-
static consumerSpan(TraceAssert trace, int index, String destinationType, String destinationName, String messageId, String operation, SpanData parentSpan, SpanData linkedSpan = null) {
289+
static consumerSpan(TraceAssert trace, int index, String destinationName, String messageId, String operation, SpanData parentSpan, SpanData linkedSpan = null) {
291290
trace.span(index) {
292291
name destinationName + " " + operation
293292
kind CONSUMER
@@ -304,7 +303,6 @@ class Jms2Test extends AgentInstrumentationSpecification {
304303
attributes {
305304
"$SemanticAttributes.MESSAGING_SYSTEM" "jms"
306305
"$SemanticAttributes.MESSAGING_DESTINATION_NAME" destinationName
307-
"$SemanticAttributes.MESSAGING_DESTINATION_KIND" destinationType
308306
"$SemanticAttributes.MESSAGING_OPERATION" operation
309307
if (messageId != null) {
310308
//In some tests we don't know exact messageId, so we pass "" and verify just the existence of the attribute

0 commit comments

Comments
 (0)