Skip to content

Commit 3e15a47

Browse files
Merge branch 'main' into main
2 parents 4318e35 + 1ac0bcf commit 3e15a47

File tree

130 files changed

+2705
-1030
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

+2705
-1030
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ body:
1616
- disk-buffering
1717
- gcp-auth-extension
1818
- gcp-resources
19+
- ibm-mq-metrics
1920
- jfr-connection
2021
- jfr-events
2122
- jmx-metrics

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ body:
1616
- disk-buffering
1717
- gcp-auth-extension
1818
- gcp-resources
19+
- ibm-mq-metrics
1920
- jfr-connection
2021
- jfr-events
2122
- jmx-metrics

.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: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,34 @@
1010
],
1111
prHourlyLimit: 5, // we have a large number of parallel runners
1212
labels: [
13-
'dependencies'
13+
'dependencies',
1414
],
1515
packageRules: [
1616
{
1717
// reduces the number of Renovate PRs
1818
// (patch updates are typically non-breaking)
19-
"groupName": "all patch versions",
20-
"matchUpdateTypes": ["patch"],
21-
"schedule": ["before 8am every weekday"]
19+
groupName: 'all patch versions',
20+
matchUpdateTypes: [
21+
'patch',
22+
],
23+
schedule: [
24+
'before 8am every weekday',
25+
],
2226
},
2327
{
2428
// avoids these Renovate PRs from trickling in throughout the week
2529
// (consolidating the review process)
26-
"matchUpdateTypes": ["minor", "major"],
27-
"schedule": ["before 8am on Monday"]
30+
matchUpdateTypes: [
31+
'minor',
32+
'major',
33+
],
34+
schedule: [
35+
'before 8am on Monday',
36+
],
37+
matchPackageNames: [
38+
'!io.opentelemetry:**',
39+
'!io.opentelemetry.*:**',
40+
],
2841
},
2942
{
3043
matchPackageNames: [
@@ -171,7 +184,7 @@
171184
customType: 'regex',
172185
datasourceTemplate: 'npm',
173186
managerFilePatterns: [
174-
'.github/workflows/**'
187+
'.github/workflows/**',
175188
],
176189
matchStrings: [
177190
'npx (?<depName>[^@]+)@(?<currentValue>[^\\s]+)',
@@ -181,7 +194,7 @@
181194
customType: 'regex',
182195
datasourceTemplate: 'java-version',
183196
managerFilePatterns: [
184-
'.github/workflows/**'
197+
'.github/workflows/**',
185198
],
186199
matchStrings: [
187200
'(?<currentValue>\\d+) # renovate: datasource=java-version',

.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: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: Reusable - Common
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
cache-read-only:
7+
type: boolean
8+
required: false
9+
no-build-cache:
10+
type: boolean
11+
required: false
12+
max-test-retries:
13+
type: number
14+
required: false
15+
default: 0
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
spotless:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
25+
26+
- name: Set up JDK for running Gradle
27+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
28+
with:
29+
distribution: temurin
30+
java-version: 17
31+
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
52+
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
53+
with:
54+
cache-read-only: ${{ inputs.cache-read-only }}
55+
56+
- name: Build
57+
run: ./gradlew build -x spotlessCheck -x test ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
58+
59+
test:
60+
name: Test
61+
runs-on: ${{ matrix.os }}
62+
strategy:
63+
fail-fast: false
64+
matrix:
65+
os:
66+
- ubuntu-latest
67+
- windows-latest
68+
test-java-version:
69+
- 8
70+
- 11
71+
- 17
72+
- 21
73+
- 24 # renovate: datasource=java-version
74+
steps:
75+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
76+
77+
- id: setup-java-test
78+
name: Set up Java ${{ matrix.test-java-version }} for tests
79+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
80+
with:
81+
distribution: temurin
82+
java-version: ${{ matrix.test-java-version }}
83+
84+
- id: setup-java
85+
name: Set up Java for build
86+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
87+
with:
88+
distribution: temurin
89+
java-version: 17
90+
91+
- name: Set up Gradle
92+
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
93+
with:
94+
cache-read-only: ${{ inputs.cache-read-only }}
95+
96+
- name: Test
97+
run: >
98+
./gradlew test
99+
"-PtestJavaVersion=${{ matrix.test-java-version }}"
100+
"-Porg.gradle.java.installations.paths=${{ steps.setup-java-test.outputs.path }}"
101+
"-Porg.gradle.java.installations.auto-download=false"
102+
"-PmaxTestRetries=${{ inputs.max-test-retries }}"
103+
${{ inputs.no-build-cache && '--no-build-cache' || '' }}
104+
105+
integration-test:
106+
runs-on: ubuntu-latest
107+
steps:
108+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
109+
110+
- name: Set up JDK for running Gradle
111+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
112+
with:
113+
distribution: temurin
114+
java-version: 17
115+
116+
- name: Set up Gradle
117+
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
118+
with:
119+
cache-read-only: ${{ inputs.cache-read-only }}
120+
121+
- name: Integration test
122+
run: ./gradlew integrationTest "-PmaxTestRetries=${{ inputs.max-test-retries }}" ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
123+
124+
- name: Save integration test results
125+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
126+
if: always()
127+
with:
128+
name: integration-test-results
129+
path: jmx-metrics/build/reports/tests/integrationTest
130+
131+
markdown-lint-check:
132+
uses: ./.github/workflows/reusable-markdown-lint.yml
133+
134+
misspell-check:
135+
uses: ./.github/workflows/reusable-misspell-check.yml
136+
137+
shell-script-check:
138+
uses: ./.github/workflows/reusable-shell-script-check.yml

.github/workflows/build-daily.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build Daily
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
# Run daily at 7:30 AM UTC
7+
- cron: '30 7 * * *'
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
common:
14+
uses: ./.github/workflows/build-common.yml
15+
with:
16+
no-build-cache: true
17+
18+
link-check:
19+
uses: ./.github/workflows/reusable-link-check.yml
20+
21+
workflow-notification:
22+
permissions:
23+
contents: read
24+
issues: write
25+
if: always()
26+
needs:
27+
- common
28+
- link-check
29+
uses: ./.github/workflows/reusable-workflow-notification.yml
30+
with:
31+
success: >-
32+
${{
33+
needs.common.result == 'success' &&
34+
needs.link-check.result == 'success'
35+
}}

0 commit comments

Comments
 (0)