Skip to content

Commit 1c2794b

Browse files
Merge branch 'open-telemetry:main' into main
2 parents 2c68700 + d71dab4 commit 1c2794b

File tree

91 files changed

+1330
-728
lines changed

Some content is hidden

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

91 files changed

+1330
-728
lines changed

.github/copilot-instructions.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copilot Instructions for OpenTelemetry Java Contrib
2+
3+
This repository provides observability instrumentation for Java applications.
4+
5+
## Code Review Priorities
6+
7+
### Style Guide Compliance
8+
9+
**PRIORITY**: Verify that all code changes follow the [Style Guide](../docs/style-guide.md). Check:
10+
11+
- Code formatting (auto-formatting, static imports, class organization)
12+
- Java language conventions (`final` usage, `@Nullable` annotations, `Optional` usage)
13+
- Performance constraints (hot path allocations)
14+
- Implementation patterns (SPI registration, configuration conventions)
15+
- Gradle conventions (Kotlin DSL, plugin usage, module naming)
16+
- Documentation standards (README files, deprecation processes)
17+
18+
### Critical Areas
19+
20+
- **Public APIs**: Changes affect downstream users and require careful review
21+
- **Performance**: Instrumentation must have minimal overhead
22+
- **Thread Safety**: Ensure safe concurrent access patterns
23+
- **Memory Management**: Prevent leaks and excessive allocations
24+
25+
### Quality Standards
26+
27+
- Proper error handling with appropriate logging levels
28+
- OpenTelemetry specification and semantic convention compliance
29+
- Resource cleanup and lifecycle management
30+
- Comprehensive unit tests for new functionality
31+
32+
## Coding Agent Instructions
33+
34+
When implementing changes or new features:
35+
36+
1. Follow all [Style Guide](../docs/style-guide.md) conventions and the Code Review Priorities above
37+
2. Run tests to ensure they still pass (use `./gradlew test` and `./gradlew integrationTest` as needed)
38+
3. **Always run `./gradlew spotlessApply`** after making code changes to ensure proper formatting
39+
4. Run markdown lint to ensure it still passes: `npx [email protected] -c .github/config/markdownlint.yml **/*.md`

.github/renovate.json5

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,5 +202,15 @@
202202
depNameTemplate: 'java',
203203
extractVersionTemplate: '^(?<version>\\d+)',
204204
},
205+
{
206+
customType: 'regex',
207+
datasourceTemplate: 'github-releases',
208+
managerFilePatterns: [
209+
'**/build.gradle.kts',
210+
],
211+
matchStrings: [
212+
'"https://github.com/(?<depName>[^/]+/[^/]+)/zipball/(?<currentValue>.+?)"',
213+
],
214+
},
205215
],
206216
}

.github/scripts/draft-change-log-entries.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ component_names["consistent-sampling/"]="Consistent sampling"
3535
component_names["disk-buffering/"]="Disk buffering"
3636
component_names["gcp-resources/"]="GCP resources"
3737
component_names["gcp-auth-extension/"]="GCP authentication extension"
38+
component_names["ibm-mq-metrics/"]="IBM MQ metrics"
3839
component_names["inferred-spans/"]="Inferred spans"
3940
component_names["jfr-connection/"]="JFR connection"
4041
component_names["jfr-events/"]="JFR events"
@@ -44,6 +45,7 @@ component_names["kafka-exporter/"]="Kafka exporter"
4445
component_names["maven-extension/"]="Maven extension"
4546
component_names["micrometer-meter-provider/"]="Micrometer MeterProvider"
4647
component_names["noop-api/"]="No-op API"
48+
component_names["opamp-client/"]="OpAMP client"
4749
component_names["processors/"]="Telemetry processors"
4850
component_names["prometheus-client-bridge/"]="Prometheus client bridge"
4951
component_names["runtime-attach/"]="Runtime attach"

.github/scripts/lychee-config.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ max_concurrency = 4
66
# Check link anchors
77
include_fragments = true
88

9-
# excluding links to pull requests and issues is done for performance
10-
# sonatype snapshots are currrently unbrowseable
119
exclude = [
10+
# excluding links to pull requests and issues is done for performance
1211
"^https://github.com/open-telemetry/opentelemetry-java-contrib/(issues|pull)/\\d+$",
13-
'^https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/io/opentelemetry/contrib/$',
1412
]
15-
16-

.github/workflows/auto-spotless-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2020

2121
- name: Set up JDK for running Gradle
22-
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
22+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
2323
with:
2424
distribution: temurin
2525
java-version: 17

.github/workflows/backport.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212
jobs:
1313
backport:
1414
permissions:
15-
contents: write # for Git to git push
15+
contents: write # for git push to PR branch
1616
runs-on: ubuntu-latest
1717
steps:
1818
- run: |
@@ -48,6 +48,15 @@ jobs:
4848
4949
git checkout -b $branch
5050
git cherry-pick $commit
51+
52+
if git diff --name-only HEAD~1 HEAD | grep -q '^\.github/workflows/'; then
53+
echo "::error::This PR contains changes to workflow files (.github/workflows/)."
54+
echo "::error::Workflow files cannot be automatically backported because the standard"
55+
echo "::error::GitHub token doesn't have the required 'workflow' write permission."
56+
echo "::error::Please backport this PR manually."
57+
exit 1
58+
fi
59+
5160
git push --set-upstream origin $branch
5261
gh pr create --title "[$GITHUB_REF_NAME] $title" \
5362
--body "Clean cherry-pick of #$NUMBER to the \`$GITHUB_REF_NAME\` branch." \

.github/workflows/build-common.yml

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ on:
99
no-build-cache:
1010
type: boolean
1111
required: false
12+
max-test-retries:
13+
type: number
14+
required: false
15+
default: 0
1216

1317
permissions:
1418
contents: read
1519

1620
jobs:
17-
build:
21+
spotless:
1822
runs-on: ubuntu-latest
1923
steps:
2024
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -25,13 +29,32 @@ jobs:
2529
distribution: temurin
2630
java-version: 17
2731

28-
- name: Set up gradle
32+
- name: Set up Gradle
33+
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
34+
with:
35+
cache-read-only: ${{ inputs.cache-read-only }}
36+
37+
- name: Spotless
38+
run: ./gradlew spotlessCheck ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
39+
40+
build:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
44+
45+
- name: Set up JDK for running Gradle
46+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
47+
with:
48+
distribution: temurin
49+
java-version: 17
50+
51+
- name: Set up Gradle
2952
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
3053
with:
3154
cache-read-only: ${{ inputs.cache-read-only }}
3255

33-
- name: Gradle build and test
34-
run: ./gradlew build -x test ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
56+
- name: Build
57+
run: ./gradlew build -x spotlessCheck -x test ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
3558

3659
test:
3760
name: Test
@@ -40,8 +63,6 @@ jobs:
4063
fail-fast: false
4164
matrix:
4265
os:
43-
- macos-latest
44-
- macos-13
4566
- ubuntu-latest
4667
- windows-latest
4768
test-java-version:
@@ -50,66 +71,63 @@ jobs:
5071
- 17
5172
- 21
5273
- 24 # renovate: datasource=java-version
53-
# macos-latest drops support for java 8 temurin. Run java 8 on macos-13. Run java 11, 17, 21 on macos-latest.
54-
exclude:
55-
- os: macos-latest
56-
test-java-version: 8
57-
- os: macos-13
58-
test-java-version: 11
59-
- os: macos-13
60-
test-java-version: 17
61-
- os: macos-13
62-
test-java-version: 21
63-
- os: macos-13
64-
test-java-version: 24 # renovate: datasource=java-version
6574
steps:
6675
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
6776

6877
- id: setup-java-test
6978
name: Set up Java ${{ matrix.test-java-version }} for tests
70-
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
79+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
7180
with:
7281
distribution: temurin
7382
java-version: ${{ matrix.test-java-version }}
7483

7584
- id: setup-java
7685
name: Set up Java for build
77-
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
86+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
7887
with:
7988
distribution: temurin
8089
java-version: 17
8190

82-
- name: Set up gradle
91+
- name: Set up Gradle
8392
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
8493
with:
8594
cache-read-only: ${{ inputs.cache-read-only }}
8695

87-
- name: Gradle test
96+
- name: Test
8897
run: >
8998
./gradlew test
9099
"-PtestJavaVersion=${{ matrix.test-java-version }}"
91100
"-Porg.gradle.java.installations.paths=${{ steps.setup-java-test.outputs.path }}"
92101
"-Porg.gradle.java.installations.auto-download=false"
93-
${{ inputs.no-build-cache && '--no-build-cache' || '' }}
102+
"-PmaxTestRetries=${{ inputs.max-test-retries }}"
103+
${{ inputs.no-build-cache && '--no-build-cache' || '' }}
104+
105+
- name: Build scan
106+
if: ${{ !cancelled() && hashFiles('build-scan.txt') != '' }}
107+
run: cat build-scan.txt
94108

95109
integration-test:
96110
runs-on: ubuntu-latest
97111
steps:
98112
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
99113

100114
- name: Set up JDK for running Gradle
101-
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
115+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
102116
with:
103117
distribution: temurin
104118
java-version: 17
105119

106-
- name: Set up gradle
120+
- name: Set up Gradle
107121
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
108122
with:
109123
cache-read-only: ${{ inputs.cache-read-only }}
110124

111125
- name: Integration test
112-
run: ./gradlew integrationTest ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
126+
run: ./gradlew integrationTest "-PmaxTestRetries=${{ inputs.max-test-retries }}" ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
127+
128+
- name: Build scan
129+
if: ${{ !cancelled() && hashFiles('build-scan.txt') != '' }}
130+
run: cat build-scan.txt
113131

114132
- name: Save integration test results
115133
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2

.github/workflows/build-pull-request.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ permissions:
88
contents: read
99

1010
concurrency:
11-
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1212
cancel-in-progress: true
1313

1414
jobs:
1515
common:
1616
uses: ./.github/workflows/build-common.yml
1717
with:
1818
cache-read-only: true
19+
# retry in merge queue to avoid unnecessary failures
20+
max-test-retries: ${{ github.event_name == 'merge_group' && 5 || 0 }}
1921

2022
link-check:
2123
uses: ./.github/workflows/reusable-link-check.yml

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ jobs:
2121
needs:
2222
- common
2323
runs-on: ubuntu-latest
24+
# skipping release branches because the versions in those branches are not snapshots
25+
if: github.ref_name == 'main' && github.repository == 'open-telemetry/opentelemetry-java-contrib'
2426
steps:
2527
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2628

2729
- name: Set up JDK for running Gradle
28-
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
30+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
2931
with:
3032
distribution: temurin
3133
java-version: 17

.github/workflows/codeql.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: CodeQL
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
- release/*
84
pull_request:
95
branches:
106
- main
@@ -15,6 +11,10 @@ on:
1511
# - https://github.com/github/codeql-action/issues/1537
1612
# - https://github.com/github/codeql-action/issues/2691
1713
# merge_group:
14+
push:
15+
branches:
16+
- main
17+
- release/*
1818
schedule:
1919
- cron: "29 13 * * 2" # weekly at 13:29 UTC on Tuesday
2020

@@ -40,7 +40,7 @@ jobs:
4040

4141
- name: Set up Java 17
4242
if: matrix.language == 'java'
43-
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
43+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
4444
with:
4545
distribution: temurin
4646
java-version: 17
@@ -50,7 +50,7 @@ jobs:
5050
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
5151

5252
- name: Initialize CodeQL
53-
uses: github/codeql-action/init@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.10
53+
uses: github/codeql-action/init@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.11
5454
with:
5555
languages: ${{ matrix.language }}
5656
# using "linked" helps to keep up with the latest Kotlin support
@@ -65,6 +65,6 @@ jobs:
6565
run: ./gradlew assemble --no-build-cache --no-daemon
6666

6767
- name: Perform CodeQL analysis
68-
uses: github/codeql-action/analyze@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.10
68+
uses: github/codeql-action/analyze@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.11
6969
with:
7070
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)