Skip to content

Commit 96be1b9

Browse files
authored
Merge branch 'main' into indy-opentelemetry-api
2 parents 49638f7 + 3bfa0ef commit 96be1b9

File tree

130 files changed

+4171
-3142
lines changed

Some content is hidden

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

130 files changed

+4171
-3142
lines changed

.github/workflows/overhead-benchmark-daily.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,15 @@ jobs:
4242
- name: Copy results back to gh-pages branch
4343
run: rsync -avv benchmark-overhead/results/ gh-pages/benchmark-overhead/results/ && rm -rf benchmark-overhead/results
4444

45+
- name: Use CLA approved bot
46+
run: .github/scripts/use-cla-approved-bot.sh
47+
4548
- name: Commit updated results
46-
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4
47-
with:
48-
add: "benchmark-overhead/results"
49-
cwd: "./gh-pages"
50-
branch: "gh-pages"
51-
message: "update test result data"
52-
author_name: otelbot
53-
author_email: [email protected]
54-
committer_name: otelbot
55-
committer_email: [email protected]
49+
working-directory: ./gh-pages
50+
run: |
51+
git add benchmark-overhead/results
52+
git commit -m "update test result data"
53+
git push
5654
5755
workflow-notification:
5856
permissions:

CONTRIBUTING.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,28 @@ See [Running the tests](./docs/contributing/running-tests.md) for more details.
1515

1616
### Snapshot builds
1717

18-
For developers testing code changes before a release is complete, there are
19-
snapshot builds of the `main` branch. They are available from
20-
the Sonatype snapshot repository at `https://central.sonatype.com/repository/maven-snapshots/`
21-
([browse](https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/io/opentelemetry/)).
18+
For developers testing code changes before a release is complete, snapshot builds of the `main`
19+
branch are available from the Sonatype snapshot repository at `https://central.sonatype.com/repository/maven-snapshots/`.
20+
21+
To find the latest snapshot, check the maven metadata (replace `{LATEST_VERSION}` with the current
22+
stable release):
23+
24+
```
25+
https://central.sonatype.com/repository/maven-snapshots/io/opentelemetry/javaagent/opentelemetry-javaagent/{LATEST_VERSION}-SNAPSHOT/maven-metadata.xml
26+
```
27+
28+
Look for the `<timestamp>` and `<buildNumber>` in the XML response, then construct the download URL:
29+
30+
```
31+
https://central.sonatype.com/repository/maven-snapshots/io/opentelemetry/javaagent/opentelemetry-javaagent/{VERSION}-SNAPSHOT/opentelemetry-javaagent-{VERSION}-{TIMESTAMP}-{BUILD_NUMBER}.jar
32+
```
33+
34+
For example, if the metadata shows timestamp `20250925.160708` and build number `56` for version
35+
`2.21.0`, the snapshot JAR URL would be:
36+
37+
```
38+
https://central.sonatype.com/repository/maven-snapshots/io/opentelemetry/javaagent/opentelemetry-javaagent/2.21.0-SNAPSHOT/opentelemetry-javaagent-2.21.0-20250925.160708-56.jar
39+
```
2240

2341
### Building from source
2442

benchmark-overhead/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id("java")
3-
id("com.diffplug.spotless") version "7.2.1"
3+
id("com.diffplug.spotless") version "8.0.0"
44
}
55

66
spotless {

conventions/build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
`kotlin-dsl`
33
// When updating, update below in dependencies too
4-
id("com.diffplug.spotless") version "7.2.1"
4+
id("com.diffplug.spotless") version "8.0.0"
55
}
66

77
spotless {
@@ -54,12 +54,12 @@ dependencies {
5454
implementation("org.apache.maven:maven-aether-provider:3.3.9")
5555

5656
// When updating, update above in plugins too
57-
implementation("com.diffplug.spotless:spotless-plugin-gradle:7.2.1")
57+
implementation("com.diffplug.spotless:spotless-plugin-gradle:8.0.0")
5858
implementation("com.google.guava:guava:33.5.0-jre")
59-
implementation("com.gradleup.shadow:shadow-gradle-plugin:9.1.0")
59+
implementation("com.gradleup.shadow:shadow-gradle-plugin:9.2.1")
6060
implementation("org.apache.httpcomponents:httpclient:4.5.14")
6161
implementation("com.gradle.develocity:com.gradle.develocity.gradle.plugin:4.2")
62-
implementation("org.owasp:dependency-check-gradle:12.1.5")
62+
implementation("org.owasp:dependency-check-gradle:12.1.6")
6363
implementation("ru.vyarus:gradle-animalsniffer-plugin:2.0.1")
6464
implementation("org.spdx:spdx-gradle-plugin:0.9.0")
6565
// When updating, also update dependencyManagement/build.gradle.kts

custom-checks/src/test/java/io/opentelemetry/javaagent/customchecks/OtelInternalJavadocTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class OtelInternalJavadocTest {
1414
void test() {
1515
doTest(
1616
"internal/InternalJavadocPositiveCases.java",
17-
"""
17+
"""
1818
package io.opentelemetry.javaagent.customchecks.internal;
1919
2020
// BUG: Diagnostic contains: doesn't end with any of the applicable javadoc disclaimers
@@ -30,7 +30,7 @@ public static class Two {}
3030
""");
3131
doTest(
3232
"internal/InternalJavadocNegativeCases.java",
33-
"""
33+
"""
3434
package io.opentelemetry.javaagent.customchecks.internal;
3535
3636
/**

dependencyManagement/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ val DEPENDENCY_BOMS = listOf(
3737

3838
val autoServiceVersion = "1.1.1"
3939
val autoValueVersion = "1.11.0"
40-
val errorProneVersion = "2.41.0"
40+
val errorProneVersion = "2.42.0"
4141
val byteBuddyVersion = "1.17.7"
4242
val asmVersion = "9.8"
4343
val jmhVersion = "1.37"

docs/contributing/documenting-instrumentation.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,22 @@ configurations:
9696
description: Enables statement sanitization for database queries.
9797
type: boolean
9898
default: true
99+
override_telemetry: false
100+
additional_telemetry:
101+
- when: "default"
102+
metrics:
103+
- name: "metric.name"
104+
description: "Metric description"
105+
type: "COUNTER"
106+
unit: "1"
107+
attributes:
108+
- name: "attribute.name"
109+
type: "STRING"
110+
spans:
111+
- span_kind: "CLIENT"
112+
attributes:
113+
- name: "span.attribute"
114+
type: "STRING"
99115
```
100116
101117
### Description (required)
@@ -205,6 +221,82 @@ If an instrumentation is disabled by default, set `disabled_by_default: true`. T
205221
the instrumentation will not be active unless explicitly enabled by the user. If this field is omitted,
206222
it defaults to `false`, meaning the instrumentation is enabled by default.
207223

224+
### Manual Telemetry Documentation (optional)
225+
226+
You can manually document telemetry metadata (metrics and spans) directly in the `metadata.yaml` file
227+
using the `additional_telemetry` field. This is useful for:
228+
229+
- Documenting telemetry that may not be captured during automated test runs
230+
- Adding telemetry documentation when `.telemetry` files are not available
231+
- Providing additional context or details about emitted telemetry
232+
233+
#### additional_telemetry
234+
235+
The `additional_telemetry` field allows you to specify telemetry metadata organized by configuration
236+
conditions (`when` field):
237+
238+
```yaml
239+
additional_telemetry:
240+
- when: "default" # Telemetry emitted by default
241+
metrics:
242+
- name: "http.server.request.duration"
243+
description: "Duration of HTTP server requests"
244+
type: "HISTOGRAM"
245+
unit: "ms"
246+
attributes:
247+
- name: "http.method"
248+
type: "STRING"
249+
- name: "http.status_code"
250+
type: "LONG"
251+
spans:
252+
- span_kind: "SERVER"
253+
attributes:
254+
- name: "http.method"
255+
type: "STRING"
256+
- name: "http.url"
257+
type: "STRING"
258+
- when: "otel.instrumentation.example.experimental-metrics.enabled" # Telemetry enabled by configuration
259+
metrics:
260+
- name: "example.experimental.metric"
261+
description: "Experimental metric enabled by configuration"
262+
type: "COUNTER"
263+
unit: "1"
264+
```
265+
266+
Each telemetry entry includes:
267+
268+
- `when`: The configuration condition under which this telemetry is emitted. Use `"default"` for telemetry
269+
emitted by default, or specify the configuration option name for conditional telemetry.
270+
- `metrics`: List of metrics with their name, description, type, unit, and attributes
271+
- `spans`: List of span configurations with their span_kind and attributes
272+
273+
For metrics, supported `type` values include: `COUNTER`, `GAUGE`, `HISTOGRAM`, `EXPONENTIAL_HISTOGRAM`.
274+
275+
For spans, supported `span_kind` values include: `CLIENT`, `SERVER`, `PRODUCER`, `CONSUMER`, `INTERNAL`.
276+
277+
For attributes, supported `type` values include: `STRING`, `LONG`, `DOUBLE`, `BOOLEAN`.
278+
279+
#### override_telemetry
280+
281+
Set `override_telemetry: true` to completely replace any auto-generated telemetry data from `.telemetry`
282+
files. When this is enabled, only the manually documented telemetry in `additional_telemetry` will be
283+
used, and any `.telemetry` files will be ignored.
284+
285+
```yaml
286+
override_telemetry: true
287+
additional_telemetry:
288+
- when: "default"
289+
metrics:
290+
- name: "manually.documented.metric"
291+
description: "This completely replaces auto-generated telemetry"
292+
type: "GAUGE"
293+
unit: "bytes"
294+
```
295+
296+
If `override_telemetry` is `false` or omitted (default behavior), manual telemetry will be merged with
297+
auto-generated telemetry, with manual entries taking precedence in case of conflicts (same metric name
298+
or span kind within the same `when` condition).
299+
208300
## Instrumentation List (docs/instrumentation-list.md)
209301

210302
The contents of the `metadata.yaml` files are combined with other information about the instrumentation

docs/instrumentation-list.yaml

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,33 @@ libraries:
390390
default: ''
391391
telemetry:
392392
- when: default
393+
metrics:
394+
- name: rpc.client.duration
395+
description: The duration of an outbound RPC invocation.
396+
type: HISTOGRAM
397+
unit: ms
398+
attributes:
399+
- name: rpc.method
400+
type: STRING
401+
- name: rpc.service
402+
type: STRING
403+
- name: rpc.system
404+
type: STRING
405+
- name: server.address
406+
type: STRING
407+
- name: server.port
408+
type: LONG
409+
- name: rpc.server.duration
410+
description: The duration of an inbound RPC invocation.
411+
type: HISTOGRAM
412+
unit: ms
413+
attributes:
414+
- name: rpc.method
415+
type: STRING
416+
- name: rpc.service
417+
type: STRING
418+
- name: rpc.system
419+
type: STRING
393420
spans:
394421
- span_kind: CLIENT
395422
attributes:
@@ -6399,13 +6426,6 @@ libraries:
63996426
scope:
64006427
name: io.opentelemetry.runtime-telemetry-java8
64016428
rxjava:
6402-
- name: rxjava-1.0
6403-
source_path: instrumentation/rxjava/rxjava-1.0
6404-
scope:
6405-
name: io.opentelemetry.rxjava-1.0
6406-
target_versions:
6407-
library:
6408-
- io.reactivex:rxjava:1.0.7
64096429
- name: rxjava-2.0
64106430
source_path: instrumentation/rxjava/rxjava-2.0
64116431
scope:
@@ -7977,6 +7997,13 @@ internal:
79777997
source_path: instrumentation/internal/internal-lambda
79787998
scope:
79797999
name: io.opentelemetry.internal-lambda
8000+
- name: rxjava-1.0
8001+
source_path: instrumentation/rxjava/rxjava-1.0
8002+
scope:
8003+
name: io.opentelemetry.rxjava-1.0
8004+
target_versions:
8005+
library:
8006+
- io.reactivex:rxjava:1.0.7
79808007
- name: internal-eclipse-osgi-3.6
79818008
source_path: instrumentation/internal/internal-eclipse-osgi-3.6
79828009
scope:

examples/distro/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ buildscript {
1212
}
1313
}
1414
dependencies {
15-
classpath "com.diffplug.spotless:spotless-plugin-gradle:7.2.1"
16-
classpath "com.gradleup.shadow:shadow-gradle-plugin:9.1.0"
15+
classpath "com.diffplug.spotless:spotless-plugin-gradle:8.0.0"
16+
classpath "com.gradleup.shadow:shadow-gradle-plugin:9.2.1"
1717
classpath "io.opentelemetry.instrumentation:gradle-plugins:2.21.0-alpha-SNAPSHOT"
1818
}
1919
}

examples/extension/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ plugins {
1010
into a single jar.
1111
See https://imperceptiblethoughts.com/shadow/ for more details about Shadow plugin.
1212
*/
13-
id "com.gradleup.shadow" version "9.1.0"
14-
id "com.diffplug.spotless" version "7.2.1"
13+
id "com.gradleup.shadow" version "9.2.1"
14+
id "com.diffplug.spotless" version "8.0.0"
1515

1616
id "io.opentelemetry.instrumentation.muzzle-generation" version "2.21.0-alpha-SNAPSHOT"
1717
id "io.opentelemetry.instrumentation.muzzle-check" version "2.21.0-alpha-SNAPSHOT"
@@ -95,7 +95,7 @@ dependencies {
9595
Only dependencies added to `implementation` configuration will be picked up by Shadow plugin
9696
and added to the resulting jar for our extension's distribution.
9797
*/
98-
implementation 'org.apache.commons:commons-lang3:3.18.0'
98+
implementation 'org.apache.commons:commons-lang3:3.19.0'
9999

100100
//All dependencies below are only for tests
101101
testImplementation("org.testcontainers:testcontainers:1.21.3")

0 commit comments

Comments
 (0)