Skip to content

Commit 5c99096

Browse files
authored
Merge branch 'open-telemetry:main' into add-scopes-metrics
2 parents d8ac02f + 2fc47b5 commit 5c99096

File tree

74 files changed

+1078
-269
lines changed

Some content is hidden

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

74 files changed

+1078
-269
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.

docs/contributing/writing-instrumentation.md

+20
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,26 @@ All classes from the newly added bootstrap module will be loaded by the bootstra
402402
globally available within the JVM. **IMPORTANT: Note that you _cannot_ use any third-party libraries
403403
here, including the instrumented library - you can only use JDK and OpenTelemetry API classes.**
404404

405+
### Common Modules
406+
407+
When creating a common module shared among different instrumentations, the naming convention should
408+
include a version suffix that matches the major/minor version of the instrumented library specified
409+
in the common module's `build.gradle.kts`.
410+
411+
For example, if the common module's Gradle file contains the following dependency:
412+
413+
```kotlin
414+
dependencies {
415+
compileOnly("org.yarpc.client:rest:5.0.0")
416+
}
417+
```
418+
419+
Then the module should be named using the suffix `yarp-common-5.0`.
420+
421+
If the common module does not have a direct dependency on the instrumented library, no version
422+
suffix is required. Examples of such cases include modules named `lettuce-common` and
423+
`netty-common`.
424+
405425
## Writing Java agent unit tests
406426

407427
As mentioned before, tests in the `javaagent` module cannot access the javaagent instrumentation

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-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/builder/internal/DefaultHttpClientInstrumenterBuilder.java

+4-8
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,15 @@ public final class DefaultHttpClientInstrumenterBuilder<REQUEST, RESPONSE> {
5151

5252
private final List<AttributesExtractor<? super REQUEST, ? super RESPONSE>> additionalExtractors =
5353
new ArrayList<>();
54-
private Function<
55-
SpanStatusExtractor<? super REQUEST, ? super RESPONSE>,
56-
? extends SpanStatusExtractor<? super REQUEST, ? super RESPONSE>>
54+
private Function<SpanStatusExtractor<REQUEST, RESPONSE>, SpanStatusExtractor<REQUEST, RESPONSE>>
5755
statusExtractorTransformer = Function.identity();
5856
private final HttpClientAttributesExtractorBuilder<REQUEST, RESPONSE>
5957
httpAttributesExtractorBuilder;
6058
private final HttpClientAttributesGetter<REQUEST, RESPONSE> attributesGetter;
6159
private final HttpSpanNameExtractorBuilder<REQUEST> httpSpanNameExtractorBuilder;
6260

6361
@Nullable private final TextMapSetter<REQUEST> headerSetter;
64-
private Function<SpanNameExtractor<? super REQUEST>, ? extends SpanNameExtractor<? super REQUEST>>
62+
private Function<SpanNameExtractor<REQUEST>, ? extends SpanNameExtractor<REQUEST>>
6563
spanNameExtractorTransformer = Function.identity();
6664
private boolean emitExperimentalHttpClientMetrics = false;
6765
private Consumer<InstrumenterBuilder<REQUEST, RESPONSE>> builderCustomizer = b -> {};
@@ -112,9 +110,7 @@ public DefaultHttpClientInstrumenterBuilder<REQUEST, RESPONSE> addAttributesExtr
112110

113111
@CanIgnoreReturnValue
114112
public DefaultHttpClientInstrumenterBuilder<REQUEST, RESPONSE> setStatusExtractor(
115-
Function<
116-
SpanStatusExtractor<? super REQUEST, ? super RESPONSE>,
117-
? extends SpanStatusExtractor<? super REQUEST, ? super RESPONSE>>
113+
Function<SpanStatusExtractor<REQUEST, RESPONSE>, SpanStatusExtractor<REQUEST, RESPONSE>>
118114
statusExtractor) {
119115
this.statusExtractorTransformer = statusExtractor;
120116
return this;
@@ -193,7 +189,7 @@ public DefaultHttpClientInstrumenterBuilder<REQUEST, RESPONSE> setRedactQueryPar
193189
/** Sets custom {@link SpanNameExtractor} via transform function. */
194190
@CanIgnoreReturnValue
195191
public DefaultHttpClientInstrumenterBuilder<REQUEST, RESPONSE> setSpanNameExtractor(
196-
Function<SpanNameExtractor<? super REQUEST>, ? extends SpanNameExtractor<? super REQUEST>>
192+
Function<SpanNameExtractor<REQUEST>, SpanNameExtractor<REQUEST>>
197193
spanNameExtractorTransformer) {
198194
this.spanNameExtractorTransformer = spanNameExtractorTransformer;
199195
return this;

0 commit comments

Comments
 (0)