diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index bb722abef878..5c430b6bca7b 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -20,7 +20,7 @@ jobs: with: java-version: ${{ matrix.java }} - name: Set JDK ${{ matrix.java }} home - run: echo "::set-env name=JAVA_${{ matrix.java }}_HOME::${{ env.JAVA_HOME }}" + run: echo JAVA_${{ matrix.java }}_HOME=${{ env.JAVA_HOME }} >> $GITHUB_ENV - name: Set up JDK 11 for running Gradle if: matrix.java != 11 diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 87769dc5506f..c7d53708ce91 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [8, 11, 15] + java: [ 8, 11, 15 ] fail-fast: false steps: - uses: actions/checkout@v2 @@ -24,11 +24,14 @@ jobs: with: java-version: 11 + - name: Debug space + run: df -h + - name: Test uses: burrunan/gradle-cache-action@v1.5 with: job-id: jdk${{ matrix.java }} - arguments: testJava${{ matrix.java }} --stacktrace + arguments: testJava${{ matrix.java }} --stacktrace -x :smoke-tests:test - name: Aggregate test reports with ciMate if: always() @@ -40,3 +43,67 @@ jobs: wget -q https://get.cimate.io/release/linux/cimate chmod +x cimate ./cimate -v "**/TEST-*.xml" + + smoke-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK 11 for running Gradle + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Test + uses: burrunan/gradle-cache-action@v1.5 + with: + job-id: jdk11 + arguments: :smoke-tests:test + + - name: Aggregate test reports with ciMate + if: always() + continue-on-error: true + env: + CIMATE_PROJECT_ID: mz1jo49x + CIMATE_CI_KEY: "PR / smoke" + run: | + wget -q https://get.cimate.io/release/linux/cimate + chmod +x cimate + ./cimate -v "**/TEST-*.xml" + + setup-muzzle-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Check out repository + uses: actions/checkout@v2 + - name: Set up JDK 11 for running Gradle + uses: actions/setup-java@v1 + with: + java-version: 11 + - id: set-matrix + run: echo "::set-output name=matrix::{\"module\":[\"$(./gradlew -q instrumentation:listInstrumentations | xargs echo | sed 's/ /","/g')\"]}" + + muzzle: + needs: setup-muzzle-matrix + runs-on: ubuntu-latest + strategy: + matrix: ${{fromJson(needs.setup-muzzle-matrix.outputs.matrix)}} + fail-fast: false + steps: + - name: Check out repository + uses: actions/checkout@v2 + - name: Set up JDK 11 for running Gradle + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Run muzzle + run: ./gradlew ${{ matrix.module }}:muzzle --no-daemon + + accept-pr: + needs: [ test, smoke-test, muzzle ] + runs-on: ubuntu-latest + steps: + - name: Success + run: echo Build successful \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7126b1f7e0a8..b9b5396d75db 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -67,26 +67,3 @@ See [Debugging](docs/contributing/debugging.md) ### Understanding Muzzle See [Understanding Muzzle](docs/contributing/muzzle.md) - -### Maintainers, Approvers and Triagers - -Maintainers: - -- [Anuraag Agrawal](https://github.com/anuraaga), AWS -- [Nikita Salnikov-Tarnovski](https://github.com/iNikem), Splunk -- [Trask Stalnaker](https://github.com/trask), Microsoft -- [Tyler Benson](https://github.com/tylerbenson), DataDog - -Approvers: - -- [John Watson](https://github.com/jkwatson), Splunk -- [Mateusz Rzeszutek](https://github.com/mateuszrzeszutek), Splunk - -Triagers: - -- [Sergei Malafeev](https://github.com/malafeev), Lightstep - -#### Become a Triager, Approver or Maintainer - -See the [community membership document](https://github.com/open-telemetry/community/blob/master/community-membership.md) -in OpenTelemetry community repo. diff --git a/README.md b/README.md index 7c8df261a507..62f225fea08e 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,43 @@ -# OpenTelemetry Instrumentation for Java - -## Join the discussions! - -* Watch this repo :eye: -* Join the [Gitter channel](https://gitter.im/open-telemetry/opentelemetry-java-instrumentation) -* Join the [weekly meeting](https://github.com/open-telemetry/community#java-instrumentation) - -## Introduction - -This project provides a Java agent JAR that can be attached to any Java 7+ +--- + +
+ + Getting Started + • + Getting Involved + • + Getting In Touch + +
+ + + ++ + Contributing + • + Scope + • + Roadmap + +
+ +--- + +# OpenTelemetry Instrumentation for Java + +This project provides a Java agent JAR that can be attached to any Java 8+ application and dynamically injects bytecode to capture telemetry from a number of popular libraries and frameworks. The telemetry data can be exported in a variety of formats. @@ -212,6 +241,7 @@ provide the path to a JAR file including an SPI implementation using the system | [khttp](https://khttp.readthedocs.io) | 0.1+ | | [Kubernetes Client](https://github.com/kubernetes-client/java) | 7.0+ | | [Lettuce](https://github.com/lettuce-io/lettuce-core) | 4.0+ (not including 6.x yet) | +| [Log4j 1](https://logging.apache.org/log4j/1.2/) | 1.2+ | | [Log4j 2](https://logging.apache.org/log4j/2.x/) | 2.7+ | | [Logback](http://logback.qos.ch/) | 1.0+ | | [MongoDB Drivers](https://mongodb.github.io/mongo-java-driver/) | 3.3+ | @@ -261,6 +291,10 @@ you can enable it by add the following system property: See [Suppressing specific auto-instrumentation](docs/suppressing-instrumentation.md) +### Logger MDC auto-instrumentation + +See [Logger MDC auto-instrumentation](docs/logger-mdc-instrumentation.md) + ## Manually instrumenting > :warning: starting with 0.6.0, and prior to version 1.0.0, `opentelemetry-javaagent-all.jar` @@ -364,3 +398,27 @@ Debug logging negatively impacts the performance of your application. ## Roadmap to 1.0 (GA) See [GA Requirements](docs/ga-requirements.md) + +## Contributing + +See [CONTRIBUTING.md](CONTRIBUTING.md). + +Approvers ([@open-telemetry/java-instrumentation-approvers](https://github.com/orgs/open-telemetry/teams/java-instrumentation-approvers)): + +- [John Watson](https://github.com/jkwatson), Splunk +- [Mateusz Rzeszutek](https://github.com/mateuszrzeszutek), Splunk + +Maintainers ([@open-telemetry/java-instrumentation-maintainers](https://github.com/orgs/open-telemetry/teams/java-instrumentation-maintainers)): + +- [Anuraag Agrawal](https://github.com/anuraaga), AWS +- [Nikita Salnikov-Tarnovski](https://github.com/iNikem), Splunk +- [Trask Stalnaker](https://github.com/trask), Microsoft +- [Tyler Benson](https://github.com/tylerbenson), DataDog + +Learn more about roles in the [community repository](https://github.com/open-telemetry/community/blob/master/community-membership.md). + +Thanks to all the people who already contributed! + + + + diff --git a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/CallDepthThreadLocalMap.java b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/CallDepthThreadLocalMap.java index 73ba21f0d8bc..0eb35d726259 100644 --- a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/CallDepthThreadLocalMap.java +++ b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/CallDepthThreadLocalMap.java @@ -1,17 +1,6 @@ /* * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ package io.opentelemetry.instrumentation.auto.api; diff --git a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/ContextStore.java b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/ContextStore.java index 0ff0b7d3163e..1c80aafffdc5 100644 --- a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/ContextStore.java +++ b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/ContextStore.java @@ -1,17 +1,6 @@ /* * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ package io.opentelemetry.instrumentation.auto.api; diff --git a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/InstrumentationContext.java b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/InstrumentationContext.java index c9fa9d42d424..18ce013d8a70 100644 --- a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/InstrumentationContext.java +++ b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/InstrumentationContext.java @@ -1,17 +1,6 @@ /* * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ package io.opentelemetry.instrumentation.auto.api; diff --git a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/OpenTelemetrySdkAccess.java b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/OpenTelemetrySdkAccess.java index 377cf0e99383..95783efaa484 100644 --- a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/OpenTelemetrySdkAccess.java +++ b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/OpenTelemetrySdkAccess.java @@ -1,17 +1,6 @@ /* * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ package io.opentelemetry.instrumentation.auto.api; diff --git a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/Pair.java b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/Pair.java index aa0f0c5ad887..740cf8414a7a 100644 --- a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/Pair.java +++ b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/Pair.java @@ -1,17 +1,6 @@ /* * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ package io.opentelemetry.instrumentation.auto.api; diff --git a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/SafeServiceLoader.java b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/SafeServiceLoader.java index 486626041e00..8ebff9a8a2fc 100644 --- a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/SafeServiceLoader.java +++ b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/SafeServiceLoader.java @@ -1,17 +1,6 @@ /* * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ package io.opentelemetry.instrumentation.auto.api; diff --git a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/SpanWithScope.java b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/SpanWithScope.java index b5be498201b1..bebb13847824 100644 --- a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/SpanWithScope.java +++ b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/SpanWithScope.java @@ -1,17 +1,6 @@ /* * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ package io.opentelemetry.instrumentation.auto.api; diff --git a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/WeakMap.java b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/WeakMap.java index c9315c547adf..cda838dbd283 100644 --- a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/WeakMap.java +++ b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/WeakMap.java @@ -1,17 +1,6 @@ /* * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ package io.opentelemetry.instrumentation.auto.api; diff --git a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/concurrent/AdviceUtils.java b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/concurrent/AdviceUtils.java index a65228bb1959..a9ea705c8665 100644 --- a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/concurrent/AdviceUtils.java +++ b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/concurrent/AdviceUtils.java @@ -1,17 +1,6 @@ /* * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ package io.opentelemetry.instrumentation.auto.api.concurrent; diff --git a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/concurrent/CallableWrapper.java b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/concurrent/CallableWrapper.java index 8d734d8ac2ab..d01809bded7a 100644 --- a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/concurrent/CallableWrapper.java +++ b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/concurrent/CallableWrapper.java @@ -1,17 +1,6 @@ /* * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ package io.opentelemetry.instrumentation.auto.api.concurrent; diff --git a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/concurrent/ExecutorInstrumentationUtils.java b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/concurrent/ExecutorInstrumentationUtils.java index 2a6bf16dc439..9d12894e2723 100644 --- a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/concurrent/ExecutorInstrumentationUtils.java +++ b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/concurrent/ExecutorInstrumentationUtils.java @@ -1,17 +1,6 @@ /* * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ package io.opentelemetry.instrumentation.auto.api.concurrent; diff --git a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/concurrent/RunnableWrapper.java b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/concurrent/RunnableWrapper.java index 73a882daf3ca..44177b24df79 100644 --- a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/concurrent/RunnableWrapper.java +++ b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/concurrent/RunnableWrapper.java @@ -1,17 +1,6 @@ /* * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ package io.opentelemetry.instrumentation.auto.api.concurrent; diff --git a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/concurrent/State.java b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/concurrent/State.java index 4453ae6f532f..2f702b2fcdf2 100644 --- a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/concurrent/State.java +++ b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/concurrent/State.java @@ -1,17 +1,6 @@ /* * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ package io.opentelemetry.instrumentation.auto.api.concurrent; @@ -26,13 +15,7 @@ public class State { private static final Logger log = LoggerFactory.getLogger(State.class); - public static ContextStore.Factory