Skip to content

Commit 5acfa1a

Browse files
committed
Merge branch 'main' into servlet-async-context
2 parents ed4f298 + 2fc47b5 commit 5acfa1a

File tree

40 files changed

+494
-177
lines changed

40 files changed

+494
-177
lines changed

.github/workflows/release.yml

+3-48
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,15 @@ jobs:
188188
echo "version=$VERSION" >> $GITHUB_OUTPUT
189189
echo "prior-version=$PRIOR_VERSION" >> $GITHUB_OUTPUT
190190
191-
merge-change-log-to-main:
191+
update-apidiff-baseline-to-released-version:
192192
permissions:
193193
contents: write # for git push to PR branch
194194
runs-on: ubuntu-latest
195195
needs:
196196
- release
197197
steps:
198+
# add change log sync (if any) into this PR since the apidiff update
199+
# is required before any other PR can be merged anyway
198200
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
199201

200202
- name: Copy change log section from release branch
@@ -216,53 +218,6 @@ jobs:
216218
release_date=$(gh release view v$VERSION --json publishedAt --jq .publishedAt | sed 's/T.*//')
217219
RELEASE_DATE=$release_date .github/scripts/merge-change-log-after-release.sh
218220
219-
- name: Use CLA approved bot
220-
run: .github/scripts/use-cla-approved-bot.sh
221-
222-
- uses: actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e # v1.11.6
223-
id: otelbot-token
224-
with:
225-
app-id: ${{ vars.OTELBOT_APP_ID }}
226-
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
227-
228-
- name: Create pull request against main
229-
env:
230-
VERSION: ${{ needs.release.outputs.version }}
231-
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
232-
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
233-
run: |
234-
if git diff --quiet; then
235-
if [[ $VERSION == *.0 ]]; then
236-
echo there are no updates to merge, not creating pull request
237-
exit 0 # success
238-
else
239-
echo patch release notes did not get applied for some reason
240-
exit 1 # failure
241-
fi
242-
fi
243-
244-
message="Merge change log updates from $GITHUB_REF_NAME"
245-
body="Merge change log updates from \`$GITHUB_REF_NAME\`."
246-
branch="otelbot/merge-change-log-updates-from-${GITHUB_REF_NAME//\//-}"
247-
248-
git checkout -b $branch
249-
git commit -a -m "$message"
250-
git push --set-upstream origin $branch
251-
gh pr create --title "$message" \
252-
--body "$body" \
253-
--base main
254-
255-
update-apidiff-baseline-to-released-version:
256-
permissions:
257-
contents: write # for git push to PR branch
258-
runs-on: ubuntu-latest
259-
needs:
260-
- release
261-
steps:
262-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
263-
with:
264-
ref: main
265-
266221
- name: Wait for release to be available in maven central
267222
env:
268223
VERSION: ${{ needs.release.outputs.version }}

CHANGELOG.md

+64-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,75 @@
22

33
## Unreleased
44

5+
## Version 2.14.0 (2025-03-13)
6+
57
### Migration notes
68

79
- The `java.net.http.HttpClient` instrumentation package
810
`io.opentelemetry.instrumentation.httpclient` was deprecated in favor of the new package name
911
`io.opentelemetry.instrumentation.javahttpclient`
10-
- The class `io.opentelemetry.instrumentation.netty.v4.common.HttpRequestAndChannel` was
11-
renamed to `io.opentelemetry.instrumentation.netty.common.v4_0.HttpRequestAndChannel`
12+
- The experimental opt-in `jvm.buffer.memory.usage` metric was renamed to
13+
`jvm.buffer.memory.used` in order to follow general semantic convention naming
14+
- The Http `*TelemetryBuilder` generic signatures were simplified
15+
([#12858](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/12858))
16+
17+
### 🌟 New javaagent instrumentation
18+
19+
- AWS Bedrock instrumentation, following
20+
[Gen AI semantic conventions](https://github.com/open-telemetry/semantic-conventions/tree/main/docs/gen-ai#semantic-conventions-for-generative-ai-systems)
21+
([#13355](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13355),
22+
[#13408](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13408),
23+
[#13473](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13473),
24+
[#13410](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13410))
25+
- ActiveJ HTTP server
26+
([#13335](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13335))
27+
- Spring Pulsar
28+
([#13320](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13320))
29+
30+
### 🌟 New library instrumentation
31+
32+
- AWS Bedrock instrumentation, following
33+
[Gen AI semantic conventions](https://github.com/open-telemetry/semantic-conventions/tree/main/docs/gen-ai#semantic-conventions-for-generative-ai-systems)
34+
([#13355](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13355),
35+
[#13408](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13408),
36+
[#13473](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13473),
37+
[#13410](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13410))
38+
39+
### 📈 Enhancements
40+
41+
- Support virtual threads in Spring Scheduling instrumentation
42+
([#13370](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13370))
43+
- Redact query string values for http client spans
44+
([#13114](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13114))
45+
- Support attribute lowercase modifier in JMX metrics yaml definitions
46+
([#13385](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13385))
47+
- Add tapir path matching within pekko instrumentation
48+
([#13386](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13386))
49+
- Support latest Axis2 version
50+
([#13490](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13490))
51+
- Add instrumentation for Lambda Java interface HandleStreamRequest
52+
([#13466](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13466))
53+
- Remove usage of gRPC internal api
54+
([#13510](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13510))
55+
- Add options to disable gRPC per-message events
56+
([#13443](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13443))
57+
- Add @WithSpan option to break from existing context and start a new trace
58+
([#13112](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13112))
59+
60+
### 🛠️ Bug fixes
61+
62+
- Fix `NoSuchElementException` thrown by Akka instrumentation
63+
([#13360](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13360))
64+
- Fix Spring Boot Starter MDC instrumentation for Logback not injecting `trace_id`
65+
([#13391](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13391))
66+
- Fix opt-in invoke dynamic instrumentation mechanism in OpenJ9
67+
([#13282](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13282))
68+
- Fix spans in Pekko instrumentation on server timeout
69+
([#13435](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13435))
70+
- Avoid overriding user's `trace_id` in Log4j MDC instrumentation
71+
([#13479](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13479))
72+
- Fix gRPC message ID attribute
73+
([#13443](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/13443))
1274

1375
## Version 2.13.3 (2025-02-28)
1476

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ having to create a separate distribution or to fork this repository. For example
104104
custom samplers or span exporters, set new defaults, and embed it all in the agent to obtain a
105105
single jar file.
106106

107+
## Creating an agent distribution
108+
109+
[Distribution](examples/distro/README.md) provides guidance on creating a separate distribution, serving as a collection of examples for extending the functionality of the OpenTelemetry Java instrumentation agent. It also demonstrates how to repackage the agent while incorporating custom features.
110+
[Agent extensions](#creating-agent-extensions) are recommended instead for most users as they are simpler and do not require rebuilding with each OpenTelemetry Java agent release.
111+
107112
## Manually instrumenting
108113

109114
For most users, the out-of-the-box instrumentation is completely sufficient and nothing more has to
@@ -138,7 +143,7 @@ Triagers ([@open-telemetry/java-instrumentation-triagers](https://github.com/org
138143

139144
Approvers ([@open-telemetry/java-instrumentation-approvers](https://github.com/orgs/open-telemetry/teams/java-instrumentation-approvers)):
140145

141-
- [Gregor Zietlinger](https://github.com/zeitlinger), Grafana
146+
- [Gregor Zeitlinger](https://github.com/zeitlinger), Grafana
142147
- [Jack Berg](https://github.com/jack-berg), New Relic
143148
- [Jason Plumb](https://github.com/breedx-splk), Splunk
144149
- [Jay DeLuca](https://github.com/jaydeluca)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Comparing source compatibility of opentelemetry-instrumentation-annotations-2.14.0.jar against opentelemetry-instrumentation-annotations-2.13.0.jar
2+
**** MODIFIED ANNOTATION: PUBLIC ABSTRACT io.opentelemetry.instrumentation.annotations.WithSpan (not serializable)
3+
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0
4+
+++* NEW METHOD: PUBLIC(+) ABSTRACT(+) boolean inheritContext()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Comparing source compatibility of opentelemetry-instrumentation-api-2.14.0.jar against opentelemetry-instrumentation-api-2.13.0.jar
2+
No changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Comparing source compatibility of opentelemetry-spring-boot-autoconfigure-2.14.0.jar against opentelemetry-spring-boot-autoconfigure-2.13.0.jar
2+
No changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Comparing source compatibility of opentelemetry-spring-boot-starter-2.14.0.jar against opentelemetry-spring-boot-starter-2.13.0.jar
2+
No changes.
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Comparing source compatibility of opentelemetry-instrumentation-annotations-2.14.0-SNAPSHOT.jar against opentelemetry-instrumentation-annotations-2.13.3.jar
1+
Comparing source compatibility of opentelemetry-instrumentation-annotations-2.15.0-SNAPSHOT.jar against opentelemetry-instrumentation-annotations-2.14.0.jar
22
No changes.
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Comparing source compatibility of opentelemetry-instrumentation-api-2.14.0-SNAPSHOT.jar against opentelemetry-instrumentation-api-2.13.3.jar
1+
Comparing source compatibility of opentelemetry-instrumentation-api-2.15.0-SNAPSHOT.jar against opentelemetry-instrumentation-api-2.14.0.jar
22
No changes.
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Comparing source compatibility of opentelemetry-spring-boot-autoconfigure-2.14.0-SNAPSHOT.jar against opentelemetry-spring-boot-autoconfigure-2.13.3.jar
1+
Comparing source compatibility of opentelemetry-spring-boot-autoconfigure-2.15.0-SNAPSHOT.jar against opentelemetry-spring-boot-autoconfigure-2.14.0.jar
22
No changes.
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Comparing source compatibility of opentelemetry-spring-boot-starter-2.14.0-SNAPSHOT.jar against opentelemetry-spring-boot-starter-2.13.3.jar
1+
Comparing source compatibility of opentelemetry-spring-boot-starter-2.15.0-SNAPSHOT.jar against opentelemetry-spring-boot-starter-2.14.0.jar
22
No changes.

examples/distro/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ buildscript {
1414
dependencies {
1515
classpath "com.diffplug.spotless:spotless-plugin-gradle:7.0.2"
1616
classpath "com.gradleup.shadow:shadow-gradle-plugin:8.3.6"
17-
classpath "io.opentelemetry.instrumentation:gradle-plugins:2.14.0-alpha-SNAPSHOT"
17+
classpath "io.opentelemetry.instrumentation:gradle-plugins:2.15.0-alpha-SNAPSHOT"
1818
}
1919
}
2020

@@ -30,8 +30,8 @@ subprojects {
3030
opentelemetrySdk : "1.48.0",
3131

3232
// these lines are managed by .github/scripts/update-version.sh
33-
opentelemetryJavaagent : "2.14.0-SNAPSHOT",
34-
opentelemetryJavaagentAlpha: "2.14.0-alpha-SNAPSHOT",
33+
opentelemetryJavaagent : "2.15.0-SNAPSHOT",
34+
opentelemetryJavaagentAlpha: "2.15.0-alpha-SNAPSHOT",
3535

3636
autoservice : "1.1.1"
3737
]

examples/distro/smoke-tests/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
dependencies {
66
testImplementation("org.testcontainers:testcontainers:1.20.6")
77
testImplementation("com.fasterxml.jackson.core:jackson-databind:2.18.3")
8-
testImplementation("com.google.protobuf:protobuf-java-util:4.30.0")
8+
testImplementation("com.google.protobuf:protobuf-java-util:4.30.1")
99
testImplementation("com.squareup.okhttp3:okhttp:4.12.0")
1010
testImplementation("io.opentelemetry.proto:opentelemetry-proto:1.5.0-alpha")
1111
testImplementation("io.opentelemetry:opentelemetry-api")

examples/extension/build.gradle

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ plugins {
1313
id "com.gradleup.shadow" version "8.3.6"
1414
id "com.diffplug.spotless" version "7.0.2"
1515

16-
id "io.opentelemetry.instrumentation.muzzle-generation" version "2.14.0-alpha-SNAPSHOT"
17-
id "io.opentelemetry.instrumentation.muzzle-check" version "2.14.0-alpha-SNAPSHOT"
16+
id "io.opentelemetry.instrumentation.muzzle-generation" version "2.15.0-alpha-SNAPSHOT"
17+
id "io.opentelemetry.instrumentation.muzzle-check" version "2.15.0-alpha-SNAPSHOT"
1818
}
1919

2020
group 'io.opentelemetry.example'
@@ -26,8 +26,8 @@ ext {
2626
opentelemetrySdk : "1.48.0",
2727

2828
// these lines are managed by .github/scripts/update-version.sh
29-
opentelemetryJavaagent : "2.14.0-SNAPSHOT",
30-
opentelemetryJavaagentAlpha: "2.14.0-alpha-SNAPSHOT"
29+
opentelemetryJavaagent : "2.15.0-SNAPSHOT",
30+
opentelemetryJavaagentAlpha: "2.15.0-alpha-SNAPSHOT"
3131
]
3232

3333
deps = [
@@ -99,7 +99,7 @@ dependencies {
9999
//All dependencies below are only for tests
100100
testImplementation("org.testcontainers:testcontainers:1.20.6")
101101
testImplementation("com.fasterxml.jackson.core:jackson-databind:2.18.3")
102-
testImplementation("com.google.protobuf:protobuf-java-util:4.30.0")
102+
testImplementation("com.google.protobuf:protobuf-java-util:4.30.1")
103103
testImplementation("com.squareup.okhttp3:okhttp:4.12.0")
104104
testImplementation("io.opentelemetry:opentelemetry-api")
105105
testImplementation("io.opentelemetry.proto:opentelemetry-proto:1.5.0-alpha")

instrumentation-annotations/src/main/java/io/opentelemetry/instrumentation/annotations/WithSpan.java

+12
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package io.opentelemetry.instrumentation.annotations;
77

88
import io.opentelemetry.api.trace.SpanKind;
9+
import io.opentelemetry.context.Context;
910
import java.lang.annotation.ElementType;
1011
import java.lang.annotation.Retention;
1112
import java.lang.annotation.RetentionPolicy;
@@ -34,4 +35,15 @@
3435

3536
/** Specify the {@link SpanKind} of span to be created. Defaults to {@link SpanKind#INTERNAL}. */
3637
SpanKind kind() default SpanKind.INTERNAL;
38+
39+
/**
40+
* Specifies whether to inherit the current context when creating a span.
41+
*
42+
* <p>If set to {@code true} (default), the created span will use the current context as its
43+
* parent, remaining within the same trace.
44+
*
45+
* <p>If set to {@code false}, the created span will use {@link Context#root()} as its parent,
46+
* starting a new, independent trace.
47+
*/
48+
boolean inheritContext() default true;
3749
}

instrumentation/armeria/armeria-grpc-1.14/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/armeria/grpc/v1_14/ArmeriaGrpcTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void grpcInstrumentation() {
9898
.hasAttributesSatisfyingExactly(
9999
equalTo(
100100
MessageIncubatingAttributes.MESSAGE_TYPE, "RECEIVED"),
101-
equalTo(MessageIncubatingAttributes.MESSAGE_ID, 2L))),
101+
equalTo(MessageIncubatingAttributes.MESSAGE_ID, 1L))),
102102
span ->
103103
span.hasName("example.Greeter/SayHello")
104104
.hasKind(SpanKind.SERVER)
@@ -123,6 +123,6 @@ void grpcInstrumentation() {
123123
.hasName("message")
124124
.hasAttributesSatisfyingExactly(
125125
equalTo(MessageIncubatingAttributes.MESSAGE_TYPE, "SENT"),
126-
equalTo(MessageIncubatingAttributes.MESSAGE_ID, 2L)))));
126+
equalTo(MessageIncubatingAttributes.MESSAGE_ID, 1L)))));
127127
}
128128
}

instrumentation/grpc-1.6/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
| System property | Type | Default | Description |
44
|-------------------------------------------------------------|---------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
5+
| `otel.instrumentation.grpc.emit-message-events` | Boolean | `true` | Determines whether to emit span event for each individual message received and sent. |
56
| `otel.instrumentation.grpc.experimental-span-attributes` | Boolean | `false` | Enable the capture of experimental span attributes. |
67
| `otel.instrumentation.grpc.capture-metadata.client.request` | String | | A comma-separated list of request metadata keys. gRPC client instrumentation will capture metadata values corresponding to configured keys as span attributes. |
78
| `otel.instrumentation.grpc.capture-metadata.server.request` | String | | A comma-separated list of request metadata keys. gRPC server instrumentation will capture metadata values corresponding to configured keys as span attributes. |

instrumentation/grpc-1.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grpc/v1_6/GrpcSingletons.java

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ public final class GrpcSingletons {
2727
private static final AtomicReference<Context.Storage> STORAGE_REFERENCE = new AtomicReference<>();
2828

2929
static {
30+
boolean emitMessageEvents =
31+
AgentInstrumentationConfig.get()
32+
.getBoolean("otel.instrumentation.grpc.emit-message-events", true);
33+
3034
boolean experimentalSpanAttributes =
3135
AgentInstrumentationConfig.get()
3236
.getBoolean("otel.instrumentation.grpc.experimental-span-attributes", false);
@@ -40,6 +44,7 @@ public final class GrpcSingletons {
4044

4145
GrpcTelemetry telemetry =
4246
GrpcTelemetry.builder(GlobalOpenTelemetry.get())
47+
.setEmitMessageEvents(emitMessageEvents)
4348
.setCaptureExperimentalSpanAttributes(experimentalSpanAttributes)
4449
.setCapturedClientRequestMetadata(clientRequestMetadata)
4550
.setCapturedServerRequestMetadata(serverRequestMetadata)

instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTelemetry.java

+8-3
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,36 @@ public static GrpcTelemetryBuilder builder(OpenTelemetry openTelemetry) {
2929
private final Instrumenter<GrpcRequest, Status> clientInstrumenter;
3030
private final ContextPropagators propagators;
3131
private final boolean captureExperimentalSpanAttributes;
32+
private final boolean emitMessageEvents;
3233

3334
GrpcTelemetry(
3435
Instrumenter<GrpcRequest, Status> serverInstrumenter,
3536
Instrumenter<GrpcRequest, Status> clientInstrumenter,
3637
ContextPropagators propagators,
37-
boolean captureExperimentalSpanAttributes) {
38+
boolean captureExperimentalSpanAttributes,
39+
boolean emitMessageEvents) {
3840
this.serverInstrumenter = serverInstrumenter;
3941
this.clientInstrumenter = clientInstrumenter;
4042
this.propagators = propagators;
4143
this.captureExperimentalSpanAttributes = captureExperimentalSpanAttributes;
44+
this.emitMessageEvents = emitMessageEvents;
4245
}
4346

4447
/**
4548
* Returns a new {@link ClientInterceptor} for use with methods like {@link
4649
* io.grpc.ManagedChannelBuilder#intercept(ClientInterceptor...)}.
4750
*/
4851
public ClientInterceptor newClientInterceptor() {
49-
return new TracingClientInterceptor(clientInstrumenter, propagators);
52+
return new TracingClientInterceptor(
53+
clientInstrumenter, propagators, captureExperimentalSpanAttributes, emitMessageEvents);
5054
}
5155

5256
/**
5357
* Returns a new {@link ServerInterceptor} for use with methods like {@link
5458
* io.grpc.ServerBuilder#intercept(ServerInterceptor)}.
5559
*/
5660
public ServerInterceptor newServerInterceptor() {
57-
return new TracingServerInterceptor(serverInstrumenter, captureExperimentalSpanAttributes);
61+
return new TracingServerInterceptor(
62+
serverInstrumenter, captureExperimentalSpanAttributes, emitMessageEvents);
5863
}
5964
}

0 commit comments

Comments
 (0)