Skip to content

Commit b6d4ce8

Browse files
committed
Merge branch 'main' into disk-buffering-api-implementation
# Conflicts: # disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/exporters/SpanToDiskExporter.java # disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/internal/exporter/ToDiskExporter.java # disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/internal/exporters/SignalStorageExporter.java # disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/internal/storage/StorageBuilder.java # disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/internal/utils/DebugLogger.java # disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/storage/impl/FileStorageConfiguration.java
2 parents a5fe36a + fa6a9c7 commit b6d4ce8

File tree

105 files changed

+1070
-795
lines changed

Some content is hidden

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

105 files changed

+1070
-795
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/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/build-common.yml

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,25 @@ permissions:
1818
contents: read
1919

2020
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+
2140
build:
2241
runs-on: ubuntu-latest
2342
steps:
@@ -29,13 +48,13 @@ jobs:
2948
distribution: temurin
3049
java-version: 17
3150

32-
- name: Set up gradle
51+
- name: Set up Gradle
3352
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
3453
with:
3554
cache-read-only: ${{ inputs.cache-read-only }}
3655

37-
- name: Gradle build and test
38-
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' || '' }}
3958

4059
test:
4160
name: Test
@@ -44,8 +63,6 @@ jobs:
4463
fail-fast: false
4564
matrix:
4665
os:
47-
- macos-latest
48-
- macos-13
4966
- ubuntu-latest
5067
- windows-latest
5168
test-java-version:
@@ -54,18 +71,6 @@ jobs:
5471
- 17
5572
- 21
5673
- 24 # renovate: datasource=java-version
57-
# macos-latest drops support for java 8 temurin. Run java 8 on macos-13. Run java 11, 17, 21 on macos-latest.
58-
exclude:
59-
- os: macos-latest
60-
test-java-version: 8
61-
- os: macos-13
62-
test-java-version: 11
63-
- os: macos-13
64-
test-java-version: 17
65-
- os: macos-13
66-
test-java-version: 21
67-
- os: macos-13
68-
test-java-version: 24 # renovate: datasource=java-version
6974
steps:
7075
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
7176

@@ -83,12 +88,12 @@ jobs:
8388
distribution: temurin
8489
java-version: 17
8590

86-
- name: Set up gradle
91+
- name: Set up Gradle
8792
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
8893
with:
8994
cache-read-only: ${{ inputs.cache-read-only }}
9095

91-
- name: Gradle test
96+
- name: Test
9297
run: >
9398
./gradlew test
9499
"-PtestJavaVersion=${{ matrix.test-java-version }}"
@@ -97,6 +102,10 @@ jobs:
97102
"-PmaxTestRetries=${{ inputs.max-test-retries }}"
98103
${{ inputs.no-build-cache && '--no-build-cache' || '' }}
99104
105+
- name: Build scan
106+
if: ${{ !cancelled() && hashFiles('build-scan.txt') != '' }}
107+
run: cat build-scan.txt
108+
100109
integration-test:
101110
runs-on: ubuntu-latest
102111
steps:
@@ -108,14 +117,18 @@ jobs:
108117
distribution: temurin
109118
java-version: 17
110119

111-
- name: Set up gradle
120+
- name: Set up Gradle
112121
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
113122
with:
114123
cache-read-only: ${{ inputs.cache-read-only }}
115124

116125
- name: Integration test
117126
run: ./gradlew integrationTest "-PmaxTestRetries=${{ inputs.max-test-retries }}" ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
118127

128+
- name: Build scan
129+
if: ${{ !cancelled() && hashFiles('build-scan.txt') != '' }}
130+
run: cat build-scan.txt
131+
119132
- name: Save integration test results
120133
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
121134
if: always()

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ 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

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 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

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

.github/workflows/release.yml

Lines changed: 3 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -11,59 +11,15 @@ permissions:
1111
contents: read
1212

1313
jobs:
14-
build:
15-
runs-on: ubuntu-latest
16-
steps:
17-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
18-
19-
- name: Set up JDK for running Gradle
20-
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
21-
with:
22-
distribution: temurin
23-
java-version: 17
24-
25-
- name: Set up gradle
26-
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
27-
- name: Gradle build
28-
run: ./gradlew build
29-
30-
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
31-
name: Save unit test results
32-
if: always()
33-
with:
34-
name: test-results
35-
path: jmx-metrics/build/reports/tests/test
36-
37-
integration-test:
38-
runs-on: ubuntu-latest
39-
steps:
40-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
41-
42-
- name: Set up JDK for running Gradle
43-
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
44-
with:
45-
distribution: temurin
46-
java-version: 17
47-
48-
- name: Set up gradle
49-
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
50-
- name: Integration test
51-
run: ./gradlew integrationTest
52-
53-
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
54-
name: Save integration test results
55-
if: always()
56-
with:
57-
name: integration-test-results
58-
path: jmx-metrics/build/reports/tests/integrationTest
14+
common:
15+
uses: ./.github/workflows/build-common.yml
5916

6017
release:
6118
permissions:
6219
contents: write # for creating the release
6320
runs-on: ubuntu-latest
6421
needs:
65-
- build
66-
- integration-test
22+
- common
6723
outputs:
6824
version: ${{ steps.create-github-release.outputs.version }}
6925
steps:

.github/workflows/reusable-link-check.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,34 @@ jobs:
2626
run: |
2727
merge_base=$(git merge-base origin/${{ github.base_ref }} HEAD)
2828
# Using lychee's default extension filter here to match when it runs against all files
29-
modified_files=$(git diff --name-only $merge_base...${{ github.event.pull_request.head.sha }} \
29+
# Note: --diff-filter=d filters out deleted files
30+
modified_files=$(git diff --name-only --diff-filter=d $merge_base...${{ github.event.pull_request.head.sha }} \
3031
| grep -E '\.(md|mkd|mdx|mdown|mdwn|mkdn|mkdown|markdown|html|htm|txt)$' \
3132
| tr '\n' ' ' || true)
3233
echo "files=$modified_files" >> $GITHUB_OUTPUT
3334
echo "Modified files: $modified_files"
3435
36+
- name: Check if lychee config was modified
37+
if: github.event_name == 'pull_request'
38+
id: config-check
39+
run: |
40+
merge_base=$(git merge-base origin/${{ github.base_ref }} HEAD)
41+
config_modified=$(git diff --name-only $merge_base...${{ github.event.pull_request.head.sha }} \
42+
| grep -E '\.github/scripts/(lychee-config\.toml|link-check\.sh|dependencies\.Dockerfile)$' || true)
43+
if [ -n "$config_modified" ]; then
44+
echo "modified=true" >> $GITHUB_OUTPUT
45+
else
46+
echo "modified=false" >> $GITHUB_OUTPUT
47+
fi
48+
3549
- name: Link check - all links (modified files only)
3650
if: github.event_name == 'pull_request' && steps.modified-files.outputs.files != ''
3751
env:
3852
GITHUB_TOKEN: ${{ github.token }}
3953
run: ./.github/scripts/link-check.sh ${{ steps.modified-files.outputs.files }}
4054

4155
- name: Link check - all links (all files)
42-
if: github.event_name != 'pull_request'
56+
if: github.event_name != 'pull_request' || steps.config-check.outputs.modified == 'true'
4357
env:
4458
GITHUB_TOKEN: ${{ github.token }}
4559
run: ./.github/scripts/link-check.sh

0 commit comments

Comments
 (0)