Skip to content

Commit 3028801

Browse files
committed
Activate messaging v1.43 in v3 preview
1 parent 5c00da3 commit 3028801

8 files changed

Lines changed: 43 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
### 🚫 Deprecations
66

7+
- Deprecate `MessageOperation` in favor of `MessagingOperationType`.
8+
([#19276](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/19276))
9+
710
- Deprecate `DeclarativeConfigPropertiesBridgeBuilder`. Read declarative component configuration
811
through `DeclarativeConfigProperties` directly. To expose `ConfigProperties` through the
912
declarative configuration API, use `ConfigPropertiesBackedConfigProvider`.

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/messaging/MessageOperation.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55

66
package io.opentelemetry.instrumentation.api.incubator.semconv.messaging;
77

8-
/** Represents an operation that may be used in a messaging system. */
8+
/**
9+
* Represents an operation that may be used in a messaging system.
10+
*
11+
* @deprecated Use {@link MessagingOperationType}. Will be removed in 3.0.
12+
*/
13+
@Deprecated // to be removed in 3.0
914
public enum MessageOperation {
1015
PUBLISH(MessagingOperationType.SEND),
1116
RECEIVE(MessagingOperationType.RECEIVE),

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ public static <REQUEST, RESPONSE> AttributesExtractor<REQUEST, RESPONSE> createF
7373
return builderForOperationType(getter, operationType).build();
7474
}
7575

76-
/** Creates the messaging attributes extractor for the given operation. */
76+
/**
77+
* @deprecated Use {@link #createForOperationType(MessagingAttributesGetter,
78+
* MessagingOperationType)}. Will be removed in 3.0.
79+
*/
80+
@Deprecated // to be removed in 3.0
7781
public static <REQUEST, RESPONSE> AttributesExtractor<REQUEST, RESPONSE> create(
7882
MessagingAttributesGetter<REQUEST, RESPONSE> getter, @Nullable MessageOperation operation) {
7983
return createForOperationType(getter, operation == null ? null : operation.type());
@@ -90,7 +94,11 @@ MessagingAttributesExtractorBuilder<REQUEST, RESPONSE> builderForOperationType(
9094
return new MessagingAttributesExtractorBuilder<>(getter, operationType);
9195
}
9296

93-
/** Returns a new messaging attributes extractor builder for the given operation. */
97+
/**
98+
* @deprecated Use {@link #builderForOperationType(MessagingAttributesGetter,
99+
* MessagingOperationType)}. Will be removed in 3.0.
100+
*/
101+
@Deprecated // to be removed in 3.0
94102
public static <REQUEST, RESPONSE> MessagingAttributesExtractorBuilder<REQUEST, RESPONSE> builder(
95103
MessagingAttributesGetter<REQUEST, RESPONSE> getter, @Nullable MessageOperation operation) {
96104
return builderForOperationType(getter, operation == null ? null : operation.type());

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/messaging/MessagingSpanKindExtractor.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ public static <REQUEST> SpanKindExtractor<REQUEST> create(
5959
return request -> result;
6060
}
6161

62-
/** Returns a span kind extractor for the given operation. */
62+
/**
63+
* @deprecated Use {@link #create(MessagingOperationType)}. Will be removed in 3.0.
64+
*/
65+
@Deprecated // to be removed in 3.0
6366
public static <REQUEST> SpanKindExtractor<REQUEST> create(MessageOperation operation) {
6467
return create(operation.type());
6568
}

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/messaging/MessagingSpanNameExtractor.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ public static <REQUEST> SpanNameExtractor<REQUEST> create(
2525
return builder(getter, operationType).build();
2626
}
2727

28-
/** Returns a messaging span name extractor for the given operation. */
28+
/**
29+
* @deprecated Use {@link #create(MessagingAttributesGetter, MessagingOperationType)}. Will be
30+
* removed in 3.0.
31+
*/
32+
@Deprecated // to be removed in 3.0
2933
public static <REQUEST> SpanNameExtractor<REQUEST> create(
3034
MessagingAttributesGetter<REQUEST, ?> getter, MessageOperation operation) {
3135
return create(getter, operation.type());
@@ -40,7 +44,11 @@ public static <REQUEST> MessagingSpanNameExtractorBuilder<REQUEST> builder(
4044
return new MessagingSpanNameExtractorBuilder<>(getter, operationType);
4145
}
4246

43-
/** Returns a messaging span name extractor builder for the given operation. */
47+
/**
48+
* @deprecated Use {@link #builder(MessagingAttributesGetter, MessagingOperationType)}. Will be
49+
* removed in 3.0.
50+
*/
51+
@Deprecated // to be removed in 3.0
4452
public static <REQUEST> MessagingSpanNameExtractorBuilder<REQUEST> builder(
4553
MessagingAttributesGetter<REQUEST, ?> getter, MessageOperation operation) {
4654
return builder(getter, operation.type());

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ void shouldExtractErrorTypeFromResponse() {
248248
assertThat(attributes.build()).isEqualTo(expected);
249249
}
250250

251+
@SuppressWarnings("OtelDeprecatedApiUsage")
251252
@Test
252253
void shouldExtractNoAttributesIfNoneAreAvailable() {
253254
// given

instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/internal/SemconvSelectionResolver.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ SemconvMode rpc() {
8989
}
9090

9191
SemconvMode messaging() {
92-
return resolveSemconvSelection(
92+
SemconvDomain.Builder domain =
9393
SemconvDomain.builder("messaging")
94-
.defaultMode(SemconvMode.V0_STABLE)
9594
.otherSupportedModes(
96-
SemconvMode.V1_EXPERIMENTAL, SemconvMode.V1_EXPERIMENTAL.withDualEmit())
97-
.build());
95+
SemconvMode.V1_EXPERIMENTAL, SemconvMode.V1_EXPERIMENTAL.withDualEmit());
96+
domain.defaultMode(v3Preview ? SemconvMode.V1_EXPERIMENTAL : SemconvMode.V0_STABLE);
97+
return resolveSemconvSelection(domain.build());
9898
}
9999

100100
SemconvMode servicePeer() {

instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/internal/SemconvStabilityTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ void v3PreviewIgnoresStableOptInForPreviewDomains() {
356356

357357
assertThat(rpc).isEqualTo(SemconvMode.V0_STABLE);
358358
assertThat(servicePeer).isEqualTo(SemconvMode.V0_STABLE);
359-
assertThat(messaging).isEqualTo(SemconvMode.V0_STABLE);
359+
assertThat(messaging).isEqualTo(SemconvMode.V1_EXPERIMENTAL);
360360
}
361361

362362
@ParameterizedTest
@@ -420,23 +420,23 @@ private static List<Arguments> messagingSelectionModes() {
420420
preview("messaging/dup"),
421421
SemconvMode.V1_EXPERIMENTAL.withDualEmit()),
422422
argumentSet(
423-
"v3 activation remains staged",
423+
"v3 activates messaging preview",
424424
true,
425425
noStableOptIn(),
426426
noPreview(),
427-
SemconvMode.V0_STABLE),
427+
SemconvMode.V1_EXPERIMENTAL),
428428
argumentSet(
429429
"v3 ignores legacy opt-in property",
430430
true,
431431
stableOptIn("messaging"),
432432
noPreview(),
433-
SemconvMode.V0_STABLE),
433+
SemconvMode.V1_EXPERIMENTAL),
434434
argumentSet(
435435
"v3 ignores legacy opt-in dual emit",
436436
true,
437437
stableOptIn("messaging/dup"),
438438
noPreview(),
439-
SemconvMode.V0_STABLE),
439+
SemconvMode.V1_EXPERIMENTAL),
440440
argumentSet(
441441
"v3 with explicit preview",
442442
true,

0 commit comments

Comments
 (0)