Skip to content

Commit

Permalink
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-i…
Browse files Browse the repository at this point in the history
…nstrumentation into indy-rmi
  • Loading branch information
SylvainJuge committed Jan 2, 2025
2 parents 9c251f0 + accd51b commit f381c67
Show file tree
Hide file tree
Showing 412 changed files with 7,446 additions and 3,579 deletions.
54 changes: 54 additions & 0 deletions .github/scripts/check-javaagent-suppression-keys.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash -e

# shellcheck disable=SC2044
for file in $(find instrumentation -name "*Module.java"); do

if ! grep -q "extends InstrumentationModule" "$file"; then
continue
fi

if [[ "$file" != *"/javaagent/src/"* ]]; then
continue
fi

# shellcheck disable=SC2001
module_name=$(echo "$file" | sed 's#.*/\([^/]*\)/javaagent/src/.*#\1#')
# shellcheck disable=SC2001
simple_module_name=$(echo "$module_name" | sed 's/-[0-9.]*$//')

if [[ "$simple_module_name" == *jaxrs* ]]; then
# TODO these need some work still
continue
fi
if [[ "$simple_module_name" == *jaxws* ]]; then
# TODO these need some work still
continue
fi
if [[ "$simple_module_name" == jdbc ]]; then
# TODO split jdbc-datasource out into separate instrumentation?
continue
fi
if [[ "$simple_module_name" == kafka-clients ]]; then
# TODO split kafka client metrics out into separate instrumentation?
continue
fi
if [[ "$simple_module_name" == quarkus-resteasy-reactive ]]; then
# TODO module is missing a base version
continue
fi

if [ "$module_name" == "$simple_module_name" ]; then
expected="super\(\n? *\"$simple_module_name\""
else
expected="super\(\n? *\"$simple_module_name\",\n? *\"$module_name\""
fi

echo "$module_name"

matches=$(perl -0 -ne "print if /$expected/" "$file" | wc -l)
if [ "$matches" == 0 ]; then
echo "Expected to find $expected in $file"
exit 1
fi

done
21 changes: 21 additions & 0 deletions .github/scripts/check-latest-dep-test-overrides.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash -e

# all missing version coverage should be documented in supported-libraries.md

if grep -r --include build.gradle.kts latestDepTestLibrary instrumentation \
| grep -v :+\" \
| grep -v "// see .* module" \
| grep -v "// see test suite below" \
| grep -v "// no longer applicable" \
| grep -v "// related dependency" \
| grep -v "// native on-by-default instrumentation after this version" \
| grep -v "// documented limitation" \
| grep -v "instrumentation/jaxrs-client/jaxrs-client-2.0-testing/build.gradle.kts"; then

echo
echo "Found an undocumented latestDepTestLibrary (see above)."
echo
echo "See .gith/scripts/check-latest-dep-test-overrides.sh in this repository"
echo "and add one of the required comments."
exit 1
fi

This file was deleted.

2 changes: 1 addition & 1 deletion .github/scripts/get-version.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash -e

grep -Po "val stableVersion = \"\K[0-9]+.[0-9]+.[0-9]+" version.gradle.kts
grep "val stableVersion = " version.gradle.kts | grep -Eo "[0-9]+.[0-9]+.[0-9]+"
27 changes: 0 additions & 27 deletions .github/scripts/markdown-link-check-config.json

This file was deleted.

17 changes: 0 additions & 17 deletions .github/scripts/markdown-link-check-with-retry.sh

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/auto-update-otel-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ jobs:
run: .github/scripts/gha-free-disk-space.sh

- name: Set up JDK for running Gradle
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: temurin
java-version-file: .java-version

- name: Setup Gradle
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2

- name: Update license report
run: ./gradlew generateLicenseReport
Expand Down
56 changes: 35 additions & 21 deletions .github/workflows/build-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ jobs:
run: .github/scripts/gha-free-disk-space.sh

- name: Set up JDK for running Gradle
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: temurin
java-version-file: .java-version

- name: Setup Gradle
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
with:
cache-read-only: ${{ inputs.cache-read-only }}
# gradle enterprise is used for the build cache
Expand All @@ -52,7 +52,7 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- uses: gradle/actions/wrapper-validation@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
- uses: gradle/actions/wrapper-validation@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2

license-check:
runs-on: ubuntu-latest
Expand All @@ -63,13 +63,13 @@ jobs:
run: .github/scripts/gha-free-disk-space.sh

- name: Set up JDK for running Gradle
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: temurin
java-version-file: .java-version

- name: Setup Gradle
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
with:
cache-read-only: ${{ inputs.cache-read-only }}
# gradle enterprise is used for the build cache
Expand Down Expand Up @@ -119,6 +119,20 @@ jobs:
exit 1
fi
check-javaagent-suppression-keys:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- run: .github/scripts/check-javaagent-suppression-keys.sh

check-latest-dep-test-overrides:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- run: .github/scripts/check-latest-dep-test-overrides.sh

build:
runs-on: ubuntu-latest
steps:
Expand All @@ -128,7 +142,7 @@ jobs:
run: .github/scripts/gha-free-disk-space.sh

- name: Set up JDK for running Gradle
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: temurin
java-version-file: .java-version
Expand All @@ -138,7 +152,7 @@ jobs:
sed -i "s/org.gradle.jvmargs=/org.gradle.jvmargs=-Xmx3g /" gradle.properties
- name: Setup Gradle
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
with:
cache-read-only: ${{ inputs.cache-read-only }}
# gradle enterprise is used for the build cache
Expand All @@ -163,7 +177,7 @@ jobs:
fi
- name: Upload agent jar
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: opentelemetry-javaagent.jar
path: javaagent/build/libs/opentelemetry-javaagent-*-SNAPSHOT.jar
Expand All @@ -174,7 +188,7 @@ jobs:
mkdir sboms
cp javaagent/build/spdx/*.spdx.json sboms
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
- uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
name: Upload SBOMs
with:
name: opentelemetry-java-instrumentation-SBOM.zip
Expand Down Expand Up @@ -210,14 +224,14 @@ jobs:

- id: setup-test-java
name: Set up JDK ${{ matrix.test-java-version }}-${{ matrix.vm }} for running tests
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
# using zulu because new releases get published quickly
distribution: ${{ matrix.vm == 'hotspot' && 'zulu' || 'adopt-openj9'}}
java-version: ${{ matrix.test-java-version }}

- name: Set up JDK for running Gradle
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: temurin
java-version-file: .java-version
Expand All @@ -239,7 +253,7 @@ jobs:
run: .github/scripts/deadlock-detector.sh

- name: Setup Gradle
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
with:
# only push cache for one matrix option since github action cache space is limited
cache-read-only: ${{ inputs.cache-read-only || matrix.test-java-version != 11 || matrix.vm != 'hotspot' }}
Expand Down Expand Up @@ -278,15 +292,15 @@ jobs:

- name: Upload deadlock detector artifacts if any
if: failure()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: deadlock-detector-test-${{ matrix.test-java-version }}-${{ matrix.vm }}-${{ matrix.test-partition }}
path: /tmp/deadlock-detector-*
if-no-files-found: ignore

- name: Upload jvm crash dump files if any
if: failure()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: javacore-test-${{ matrix.test-java-version }}-${{ matrix.test-partition }}
path: |
Expand Down Expand Up @@ -329,13 +343,13 @@ jobs:
run: .github/scripts/gha-free-disk-space.sh

- name: Set up JDK for running Gradle
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: temurin
java-version-file: .java-version

- name: Set up Gradle cache
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
with:
# only push cache for one matrix option per OS since github action cache space is limited
cache-read-only: ${{ inputs.cache-read-only || matrix.smoke-test-suite != 'tomcat' }}
Expand All @@ -351,7 +365,7 @@ jobs:

- name: Upload jvm crash dump files if any
if: failure()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: javacore-smoke-test-${{ matrix.smoke-test-suite }}-${{ matrix.os }}
# we expect crash dumps either in root director or in smoke-tests
Expand All @@ -378,13 +392,13 @@ jobs:
run: .github/scripts/gha-free-disk-space.sh

- name: Set up JDK for running Gradle
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: temurin
java-version-file: .java-version

- name: Setup Gradle
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
with:
cache-read-only: ${{ inputs.cache-read-only }}

Expand All @@ -401,13 +415,13 @@ jobs:
run: .github/scripts/gha-free-disk-space.sh

- name: Set up JDK for running Gradle
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: temurin
java-version-file: .java-version

- name: Set up Gradle cache
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
with:
cache-read-only: ${{ inputs.cache-read-only }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ jobs:
run: .github/scripts/gha-free-disk-space.sh

- name: Set up JDK for running Gradle
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: temurin
java-version-file: .java-version

- name: Setup Gradle
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
with:
# gradle enterprise is used for the build cache
gradle-home-cache-excludes: caches/build-cache-1
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,28 @@ jobs:
run: .github/scripts/gha-free-disk-space.sh

- name: Set up Java 17
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: temurin
java-version-file: .java-version

- name: Initialize CodeQL
uses: github/codeql-action/init@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6
uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
with:
languages: java
# using "latest" helps to keep up with the latest Kotlin support
# see https://github.com/github/codeql-action/issues/1555#issuecomment-1452228433
tools: latest

- name: Setup Gradle
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2

- name: Build
# skipping build cache is needed so that all modules will be analyzed
run: ./gradlew assemble -x javadoc --no-build-cache --no-daemon

- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6
uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0

workflow-notification:
needs:
Expand Down
Loading

0 comments on commit f381c67

Please sign in to comment.