Skip to content

Commit c27c16f

Browse files
committed
Merge remote-tracking branch 'upstream/main' into baggage-declarative-config
2 parents e4c885f + 229264c commit c27c16f

File tree

60 files changed

+992
-486
lines changed

Some content is hidden

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

60 files changed

+992
-486
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 markdownlint-cli@0.45.0 -c .github/config/markdownlint.yml **/*.md`

.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: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ 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
@@ -20,7 +24,7 @@ jobs:
2024
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2125

2226
- name: Set up JDK for running Gradle
23-
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
27+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
2428
with:
2529
distribution: temurin
2630
java-version: 17
@@ -67,14 +71,14 @@ jobs:
6771

6872
- id: setup-java-test
6973
name: Set up Java ${{ matrix.test-java-version }} for tests
70-
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
74+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
7175
with:
7276
distribution: temurin
7377
java-version: ${{ matrix.test-java-version }}
7478

7579
- id: setup-java
7680
name: Set up Java for build
77-
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
81+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
7882
with:
7983
distribution: temurin
8084
java-version: 17
@@ -90,6 +94,7 @@ jobs:
9094
"-PtestJavaVersion=${{ matrix.test-java-version }}"
9195
"-Porg.gradle.java.installations.paths=${{ steps.setup-java-test.outputs.path }}"
9296
"-Porg.gradle.java.installations.auto-download=false"
97+
"-PmaxTestRetries=${{ inputs.max-test-retries }}"
9398
${{ inputs.no-build-cache && '--no-build-cache' || '' }}
9499
95100
integration-test:
@@ -98,7 +103,7 @@ jobs:
98103
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
99104

100105
- name: Set up JDK for running Gradle
101-
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
106+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
102107
with:
103108
distribution: temurin
104109
java-version: 17
@@ -109,7 +114,7 @@ jobs:
109114
cache-read-only: ${{ inputs.cache-read-only }}
110115

111116
- name: Integration test
112-
run: ./gradlew integrationTest ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
117+
run: ./gradlew integrationTest "-PmaxTestRetries=${{ inputs.max-test-retries }}" ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
113118

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

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2626

2727
- name: Set up JDK for running Gradle
28-
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
28+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
2929
with:
3030
distribution: temurin
3131
java-version: 17

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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}}"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Custom setup steps for GitHub Copilot coding agent to speed up Copilot's work on coding tasks
2+
name: "Copilot Setup Steps"
3+
4+
on:
5+
pull_request:
6+
paths:
7+
- .github/workflows/copilot-setup-steps.yml
8+
push:
9+
paths:
10+
- .github/workflows/copilot-setup-steps.yml
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
copilot-setup-steps: # Job name required by GitHub Copilot coding agent
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
23+
24+
- name: Set up JDK for running Gradle
25+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
26+
with:
27+
distribution: temurin
28+
java-version: 17
29+
30+
- name: Set up gradle
31+
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
32+
33+
- name: Build project and download dependencies
34+
run: ./gradlew build -x test

0 commit comments

Comments
 (0)