Skip to content

Commit bd4a7f8

Browse files
Merge branch 'main' into aerospike-client-instrumentation
2 parents e82bdcb + 2128d87 commit bd4a7f8

File tree

266 files changed

+9256
-1538
lines changed

Some content is hidden

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

266 files changed

+9256
-1538
lines changed

.github/ISSUE_TEMPLATE/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
contact_links:
2-
- name: GitHib Discussions
2+
- name: GitHub Discussions
33
url: https://github.com/open-telemetry/opentelemetry-java-instrumentation/discussions/new/choose
44
about: Please ask questions here.
55
- name: StackOverflow

.github/scripts/markdown-link-check-config.json

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
},
1717
{
1818
"pattern": "^http(s)?://logback\\.qos\\.ch"
19+
},
20+
{
21+
"pattern": "^https://micrometer\\.io"
1922
}
2023
]
2124
}

.github/workflows/release.yml

-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ jobs:
161161
gh release create --target $GITHUB_REF_NAME \
162162
--title "Version $VERSION" \
163163
--notes-file /tmp/release-notes.txt \
164-
--discussion-category announcements \
165164
v$VERSION \
166165
opentelemetry-javaagent.jar
167166

CHANGELOG.md

+122
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,128 @@
22

33
## Unreleased
44

5+
## Version 1.32.0 (2023-11-17)
6+
7+
### Migration notes
8+
9+
- Old server/client socket getter methods deprecated
10+
([#9716](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9716))
11+
12+
### 📈 Enhancements
13+
14+
- Allow enabling receive telemetry in kafka library instrumentation
15+
([#9693](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9693))
16+
- Add JdbcTelemetry and JdbcTelemetryBuilder
17+
([#9685](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9685))
18+
- Rename http.resend_count to http.request.resend_count
19+
([#9700](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9700))
20+
- Define `url.scheme` in terms of logical operation in HTTP server semconv
21+
(when opting in to new semconv)
22+
([#9698](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9698))
23+
- Generate only consumer span for sqs receive message
24+
([#9652](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9652))
25+
- Replace `(client|server).socket.(address|port)` attributes with `network.(peer|local).(address|port)`
26+
(when opting in to new semconv)
27+
([#9676](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9676))
28+
- Add capability for invokedynamic InstrumentationModules to inject proxies
29+
([#9565](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9565))
30+
- Make `network.transport` and `network.type` opt-in (when opting in to new semconv)
31+
([#9719](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9719))
32+
- Factor in `X-Forwarded-Host`/`Forwarded` when capturing `server.address` and `server.port`
33+
(when opting in to new semconv)
34+
([#9721](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9721))
35+
- Move class that should've been internal to internal package
36+
([#9725](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9725))
37+
- Only set `server.port` when `server.address` is set (when opting in to new semconv)
38+
([#9737](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9737))
39+
- Add messaging conventions to sqs spans
40+
([#9712](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9712))
41+
- Make the JDBC driver config work with the OTel starter
42+
([#9625](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9625))
43+
- Don't normalize the '-' character in HTTP header names when opting in to new semconv
44+
([#9735](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9735))
45+
- Add instrumentation for jaxws metro 3.0+
46+
([#9705](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9705))
47+
- Change `user_agent.original` from recommended to opt-in on HTTP client spans
48+
([#9776](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9776))
49+
- Change the precedence between `:authority` and `Host` headers
50+
([#9774](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9774))
51+
- Move capturing enduser.id attribute behind a flag
52+
([#9751](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9751),
53+
[#9788](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9788))
54+
- Remove conditional requirement on `network.peer.address` and `network.peer.port`
55+
(when opting in to new semconv)
56+
([#9775](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9775))
57+
- Change `client.port` from recommended to opt-in on HTTP server spans
58+
(when opting in to new semconv)
59+
([#9786](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9786))
60+
- Make `url.scheme` opt in for HTTP client metrics and make `server.port` required
61+
(when opting in to new semconv)
62+
([#9784](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9784))
63+
- Change `http.request.body.size` and `http.response.body.size` attributes from recommended to opt-in
64+
(when opting in to new semconv)
65+
([#9799](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9799))
66+
- Capture `http.route` in spring-cloud-gateway
67+
([#9597](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9597))
68+
- Always set messaging operation
69+
([#9791](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9791))
70+
- Change `network.protocol.name` from opt-in to conditionally required
71+
(when opting in to new semconv)
72+
([#9797](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9797))
73+
- Support specifying `spring.application.name` in the `bootstrap.properties`, `bootstrap.yml`
74+
and `bootstrap.yaml`
75+
([#9801](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9801))
76+
- Add process spans to aws-1 sqs instrumentation
77+
([#9796](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9796))
78+
- Implement capturing message headers for aws1 sqs spans
79+
([#9824](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9824))
80+
- Add process spans to aws2 sqs instrumentation
81+
([#9778](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9778))
82+
- Add `service.name` to MDC
83+
([#9647](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9647))
84+
- Capture enduser attributes in Spring Security
85+
([#9777](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9777))
86+
- Capture message id in aws1 sqs instrumentation
87+
([#9841](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9841))
88+
- Implement capturing message headers for aws2 sqs spans
89+
([#9842](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9842))
90+
- Move kafka metrics to separate instrumentation module
91+
([#9862](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9862))
92+
- Capture logback logger context properties
93+
([#9553](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9553))
94+
- Stable JVM semconv implementation: classes
95+
([#9821](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9821))
96+
- Stable JVM semconv implementation: threads
97+
([#9839](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9839))
98+
- Stable JVM semconv implementation: GC
99+
([#9890](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9890))
100+
- Bridge incubator metrics apis
101+
([#9884](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9884))
102+
- Ability to instrument logs before OTel injection into OTel appenders
103+
([#9798](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9798))
104+
- Suppress instrumentation based on suppress Context key
105+
([#9739](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9739))
106+
- Stable JVM semconv implementation: the rest
107+
([#9896](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9896))
108+
109+
### 🛠️ Bug fixes
110+
111+
- Fix armeria server instrumentation for http2
112+
([#9723](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9723))
113+
- Guard against null list from aws SQS lib
114+
([#9710](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9710))
115+
- Fix parsing port from mariadb jdbc url
116+
([#9863](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9863))
117+
118+
### 🧰 Tooling
119+
120+
- Improve disableShadowRelocate
121+
([#9715](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9715))
122+
- Allow injection of helper bytecode as resources
123+
([#9752](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9752))
124+
- Rewrite @Advice.Enter for indy advice
125+
([#9887](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/9887))
126+
5127
## Version 1.31.0 (2023-10-12)
6128

7129
### 🌟 New javaagent instrumentation

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ This repository also publishes standalone instrumentation for several libraries
5656
that can be used if you prefer that over using the Java agent.
5757
Please see the standalone library instrumentation column
5858
on [Supported Libraries](docs/supported-libraries.md#libraries--frameworks).
59-
if you are looking for documentation on using those.
59+
If you are looking for documentation on using those.
6060

6161
## Getting Started
6262

benchmark-overhead/build.gradle.kts

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ repositories {
1818
dependencies {
1919
implementation(enforcedPlatform("org.junit:junit-bom:5.10.1"))
2020

21-
testImplementation("org.testcontainers:testcontainers:1.19.1")
22-
testImplementation("org.testcontainers:postgresql:1.19.1")
21+
testImplementation("org.testcontainers:testcontainers:1.19.2")
22+
testImplementation("org.testcontainers:postgresql:1.19.2")
2323
testImplementation("org.junit.jupiter:junit-jupiter-api")
2424
testImplementation("org.junit.jupiter:junit-jupiter-params")
2525
testImplementation("com.squareup.okhttp3:okhttp:4.12.0")

conventions/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ dependencies {
6060
implementation("com.github.johnrengelman:shadow:8.1.1")
6161
implementation("org.apache.httpcomponents:httpclient:4.5.14")
6262
implementation("com.gradle.enterprise:com.gradle.enterprise.gradle.plugin:3.15.1")
63-
implementation("org.owasp:dependency-check-gradle:8.4.2")
63+
implementation("org.owasp:dependency-check-gradle:8.4.3")
6464
implementation("ru.vyarus:gradle-animalsniffer-plugin:1.7.1")
6565
// When updating, also update dependencyManagement/build.gradle.kts
6666
implementation("net.bytebuddy:byte-buddy-gradle-plugin:1.14.9")

conventions/src/main/kotlin/otel.java-conventions.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ codenarc {
407407
checkstyle {
408408
configFile = rootProject.file("buildscripts/checkstyle.xml")
409409
// this version should match the version of google_checks.xml used as basis for above configuration
410-
toolVersion = "10.12.4"
410+
toolVersion = "10.12.5"
411411
maxWarnings = 0
412412
}
413413

dependencyManagement/build.gradle.kts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ val dependencyVersions = hashMapOf<String, String>()
88
rootProject.extra["versions"] = dependencyVersions
99

1010
// this line is managed by .github/scripts/update-sdk-version.sh
11-
val otelSdkVersion = "1.31.0"
11+
val otelSdkVersion = "1.32.0"
1212
val otelSdkAlphaVersion = otelSdkVersion.replaceFirst("(-SNAPSHOT)?$".toRegex(), "-alpha$1")
1313

1414
// Need both BOM and groovy jars
@@ -33,7 +33,7 @@ val DEPENDENCY_BOMS = listOf(
3333
"io.opentelemetry:opentelemetry-bom:${otelSdkVersion}",
3434
"io.opentelemetry:opentelemetry-bom-alpha:${otelSdkAlphaVersion}",
3535
"org.junit:junit-bom:5.10.1",
36-
"org.testcontainers:testcontainers-bom:1.19.1",
36+
"org.testcontainers:testcontainers-bom:1.19.2",
3737
"org.spockframework:spock-bom:2.4-M1-groovy-4.0"
3838
)
3939

examples/distro/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ buildscript {
1414
dependencies {
1515
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.22.0"
1616
classpath "gradle.plugin.com.github.johnrengelman:shadow:8.0.0"
17-
classpath "io.opentelemetry.instrumentation:gradle-plugins:1.32.0-alpha-SNAPSHOT"
17+
classpath "io.opentelemetry.instrumentation:gradle-plugins:1.33.0-alpha-SNAPSHOT"
1818
}
1919
}
2020

@@ -27,11 +27,11 @@ subprojects {
2727
ext {
2828
versions = [
2929
// this line is managed by .github/scripts/update-sdk-version.sh
30-
opentelemetrySdk : "1.31.0",
30+
opentelemetrySdk : "1.32.0",
3131

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

3636
autoservice : "1.1.1",
3737
junit : "5.10.1"

examples/distro/smoke-tests/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ plugins {
33
}
44

55
dependencies {
6-
testImplementation("org.testcontainers:testcontainers:1.19.1")
6+
testImplementation("org.testcontainers:testcontainers:1.19.2")
77
testImplementation("com.fasterxml.jackson.core:jackson-databind:2.15.3")
8-
testImplementation("com.google.protobuf:protobuf-java-util:3.25.0")
8+
testImplementation("com.google.protobuf:protobuf-java-util:3.25.1")
99
testImplementation("com.squareup.okhttp3:okhttp:4.12.0")
1010
testImplementation("io.opentelemetry.proto:opentelemetry-proto:1.0.0-alpha")
1111
testImplementation("io.opentelemetry:opentelemetry-api")

examples/extension/build.gradle

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ plugins {
1313
id "com.github.johnrengelman.shadow" version "8.1.1"
1414
id "com.diffplug.spotless" version "6.22.0"
1515

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

2020
group 'io.opentelemetry.example'
@@ -23,11 +23,11 @@ version '1.0'
2323
ext {
2424
versions = [
2525
// this line is managed by .github/scripts/update-sdk-version.sh
26-
opentelemetrySdk : "1.31.0",
26+
opentelemetrySdk : "1.32.0",
2727

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

3232
junit : "5.10.1"
3333
]
@@ -99,9 +99,9 @@ dependencies {
9999
implementation 'org.apache.commons:commons-lang3:3.13.0'
100100

101101
//All dependencies below are only for tests
102-
testImplementation("org.testcontainers:testcontainers:1.19.1")
102+
testImplementation("org.testcontainers:testcontainers:1.19.2")
103103
testImplementation("com.fasterxml.jackson.core:jackson-databind:2.15.3")
104-
testImplementation("com.google.protobuf:protobuf-java-util:3.25.0")
104+
testImplementation("com.google.protobuf:protobuf-java-util:3.25.1")
105105
testImplementation("com.squareup.okhttp3:okhttp:4.12.0")
106106
testImplementation("io.opentelemetry:opentelemetry-api")
107107
testImplementation("io.opentelemetry.proto:opentelemetry-proto:1.0.0-alpha")

instrumentation-api/build.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ dependencies {
2020

2121
testImplementation(project(":testing-common"))
2222
testImplementation("io.opentelemetry:opentelemetry-sdk-testing")
23+
testImplementation("io.opentelemetry:opentelemetry-exporter-common")
2324
testImplementation("org.junit-pioneer:junit-pioneer")
2425

2526
jmhImplementation(project(":instrumentation-api-semconv"))

instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,8 @@ private String getSchemaUrl() {
354354
}
355355

356356
SpanSuppressor buildSpanSuppressor() {
357-
return spanSuppressionStrategy.create(getSpanKeysFromAttributesExtractors());
357+
return new SpanSuppressors.ByContextKey(
358+
spanSuppressionStrategy.create(getSpanKeysFromAttributesExtractors()));
358359
}
359360

360361
private Set<SpanKey> getSpanKeysFromAttributesExtractors() {

instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/SpanSuppressors.java

+46
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import io.opentelemetry.api.trace.SpanKind;
1111
import io.opentelemetry.context.Context;
1212
import io.opentelemetry.instrumentation.api.internal.SpanKey;
13+
import java.lang.reflect.InvocationTargetException;
14+
import java.lang.reflect.Method;
1315
import java.util.Map;
1416
import java.util.Set;
1517

@@ -85,4 +87,48 @@ public boolean shouldSuppress(Context parentContext, SpanKind spanKind) {
8587
return true;
8688
}
8789
}
90+
91+
static class ByContextKey implements SpanSuppressor {
92+
private final SpanSuppressor delegate;
93+
private final Method shouldSuppressInstrumentation;
94+
95+
ByContextKey(SpanSuppressor delegate) {
96+
this.delegate = delegate;
97+
Method shouldSuppressInstrumentation;
98+
try {
99+
Class<?> instrumentationUtil =
100+
Class.forName("io.opentelemetry.exporter.internal.InstrumentationUtil");
101+
shouldSuppressInstrumentation =
102+
instrumentationUtil.getDeclaredMethod("shouldSuppressInstrumentation", Context.class);
103+
} catch (ClassNotFoundException | NoSuchMethodException e) {
104+
shouldSuppressInstrumentation = null;
105+
}
106+
this.shouldSuppressInstrumentation = shouldSuppressInstrumentation;
107+
}
108+
109+
@Override
110+
public Context storeInContext(Context context, SpanKind spanKind, Span span) {
111+
return delegate.storeInContext(context, spanKind, span);
112+
}
113+
114+
@Override
115+
public boolean shouldSuppress(Context parentContext, SpanKind spanKind) {
116+
if (suppressByContextKey(parentContext)) {
117+
return true;
118+
}
119+
return delegate.shouldSuppress(parentContext, spanKind);
120+
}
121+
122+
private boolean suppressByContextKey(Context context) {
123+
if (shouldSuppressInstrumentation == null) {
124+
return false;
125+
}
126+
127+
try {
128+
return (boolean) shouldSuppressInstrumentation.invoke(null, context);
129+
} catch (IllegalAccessException | InvocationTargetException e) {
130+
return false;
131+
}
132+
}
133+
}
88134
}

0 commit comments

Comments
 (0)