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

+ +

+ + Build Status + + + GitHub release (latest by date including pre-releases) + + + Bintray + + Beta +

+ +

+ + Contributing +   •   + Scope +   •   + Roadmap + +

+ +--- + +# OpenTelemetry Icon 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 FACTORY = - new ContextStore.Factory() { - @Override - public State create() { - return new State(); - } - }; + public static final ContextStore.Factory FACTORY = State::new; private final AtomicReference parentContextRef = new AtomicReference<>(null); diff --git a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/jdbc/DBInfo.java b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/jdbc/DBInfo.java index d4943a884bd0..fe85cbcf9632 100644 --- a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/jdbc/DBInfo.java +++ b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/jdbc/DBInfo.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.jdbc; diff --git a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/jdbc/DbSystem.java b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/jdbc/DbSystem.java index c983b2c43887..d4c7ca8332aa 100644 --- a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/jdbc/DbSystem.java +++ b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/jdbc/DbSystem.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.jdbc; diff --git a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/jdbc/JDBCConnectionUrlParser.java b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/jdbc/JDBCConnectionUrlParser.java index f602f1c84f95..3b276d7ea82a 100644 --- a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/jdbc/JDBCConnectionUrlParser.java +++ b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/jdbc/JDBCConnectionUrlParser.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.jdbc; diff --git a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/rmi/ThreadLocalContext.java b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/rmi/ThreadLocalContext.java index b3ab86d29541..f22281e40f7c 100644 --- a/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/rmi/ThreadLocalContext.java +++ b/auto-api/src/main/java/io/opentelemetry/instrumentation/auto/api/rmi/ThreadLocalContext.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.rmi; diff --git a/auto-api/src/test/groovy/io/opentelemetry/instrumentation/auto/api/CallDepthThreadLocalMapTest.groovy b/auto-api/src/test/groovy/io/opentelemetry/instrumentation/auto/api/CallDepthThreadLocalMapTest.groovy index aec7a791cb95..fed4375ab6e7 100644 --- a/auto-api/src/test/groovy/io/opentelemetry/instrumentation/auto/api/CallDepthThreadLocalMapTest.groovy +++ b/auto-api/src/test/groovy/io/opentelemetry/instrumentation/auto/api/CallDepthThreadLocalMapTest.groovy @@ -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/test/groovy/io/opentelemetry/instrumentation/auto/api/WeakMapTest.groovy b/auto-api/src/test/groovy/io/opentelemetry/instrumentation/auto/api/WeakMapTest.groovy index ca8d972e661c..32d235383fac 100644 --- a/auto-api/src/test/groovy/io/opentelemetry/instrumentation/auto/api/WeakMapTest.groovy +++ b/auto-api/src/test/groovy/io/opentelemetry/instrumentation/auto/api/WeakMapTest.groovy @@ -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/benchmark-integration/jetty-perftest/src/main/java/io/opentelemetry/perftest/Worker.java b/benchmark-integration/jetty-perftest/src/main/java/io/opentelemetry/perftest/Worker.java index 180a6e82c920..5f9346818624 100644 --- a/benchmark-integration/jetty-perftest/src/main/java/io/opentelemetry/perftest/Worker.java +++ b/benchmark-integration/jetty-perftest/src/main/java/io/opentelemetry/perftest/Worker.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.perftest; diff --git a/benchmark-integration/jetty-perftest/src/main/java/io/opentelemetry/perftest/jetty/JettyPerftest.java b/benchmark-integration/jetty-perftest/src/main/java/io/opentelemetry/perftest/jetty/JettyPerftest.java index 6f9640bf276b..7c0c7bcdba95 100644 --- a/benchmark-integration/jetty-perftest/src/main/java/io/opentelemetry/perftest/jetty/JettyPerftest.java +++ b/benchmark-integration/jetty-perftest/src/main/java/io/opentelemetry/perftest/jetty/JettyPerftest.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.perftest.jetty; diff --git a/benchmark/src/jmh/java/io/opentelemetry/benchmark/ClassRetransformingBenchmark.java b/benchmark/src/jmh/java/io/opentelemetry/benchmark/ClassRetransformingBenchmark.java index 5cdf8fc8b73a..a6153a0ed6af 100644 --- a/benchmark/src/jmh/java/io/opentelemetry/benchmark/ClassRetransformingBenchmark.java +++ b/benchmark/src/jmh/java/io/opentelemetry/benchmark/ClassRetransformingBenchmark.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.benchmark; diff --git a/benchmark/src/jmh/java/io/opentelemetry/benchmark/HttpBenchmark.java b/benchmark/src/jmh/java/io/opentelemetry/benchmark/HttpBenchmark.java index c33257591b26..5e5a4d6051c8 100644 --- a/benchmark/src/jmh/java/io/opentelemetry/benchmark/HttpBenchmark.java +++ b/benchmark/src/jmh/java/io/opentelemetry/benchmark/HttpBenchmark.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.benchmark; diff --git a/benchmark/src/jmh/java/io/opentelemetry/benchmark/TypeMatchingBenchmark.java b/benchmark/src/jmh/java/io/opentelemetry/benchmark/TypeMatchingBenchmark.java index 316781005809..6fd1ba87fe3f 100644 --- a/benchmark/src/jmh/java/io/opentelemetry/benchmark/TypeMatchingBenchmark.java +++ b/benchmark/src/jmh/java/io/opentelemetry/benchmark/TypeMatchingBenchmark.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.benchmark; diff --git a/benchmark/src/jmh/java/io/opentelemetry/benchmark/UsedMemoryProfiler.java b/benchmark/src/jmh/java/io/opentelemetry/benchmark/UsedMemoryProfiler.java index 21cbfb4beb6b..841340ea3850 100644 --- a/benchmark/src/jmh/java/io/opentelemetry/benchmark/UsedMemoryProfiler.java +++ b/benchmark/src/jmh/java/io/opentelemetry/benchmark/UsedMemoryProfiler.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.benchmark; diff --git a/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/A.java b/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/A.java index 01935ef57870..d6839843c3af 100644 --- a/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/A.java +++ b/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/A.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.benchmark.classes; diff --git a/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/B.java b/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/B.java index b11c24f10f5f..09ddc8982a55 100644 --- a/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/B.java +++ b/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/B.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.benchmark.classes; diff --git a/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/C.java b/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/C.java index 960765ff7e1a..fcea86d1a75d 100644 --- a/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/C.java +++ b/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/C.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.benchmark.classes; diff --git a/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/D.java b/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/D.java index 52e5f3c27887..f10767bd027f 100644 --- a/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/D.java +++ b/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/D.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.benchmark.classes; diff --git a/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/E.java b/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/E.java index 795c5aac1f8f..aac14d396f4e 100644 --- a/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/E.java +++ b/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/E.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.benchmark.classes; diff --git a/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/F.java b/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/F.java index cf9f1b3abb79..4be54768f14e 100644 --- a/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/F.java +++ b/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/F.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.benchmark.classes; diff --git a/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/HttpClass.java b/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/HttpClass.java index fa5b7beecdb3..5a9300bda234 100644 --- a/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/HttpClass.java +++ b/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/HttpClass.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.benchmark.classes; diff --git a/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/TracedClass.java b/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/TracedClass.java index ee480129789e..e8468cdb52f8 100644 --- a/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/TracedClass.java +++ b/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/TracedClass.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.benchmark.classes; diff --git a/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/UntracedClass.java b/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/UntracedClass.java index 43fdeb89cffc..4e36faf5e9e5 100644 --- a/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/UntracedClass.java +++ b/benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/UntracedClass.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.benchmark.classes; diff --git a/build.gradle b/build.gradle index 026818ffb249..73e8796f9790 100644 --- a/build.gradle +++ b/build.gradle @@ -16,8 +16,8 @@ plugins { id "com.github.johnrengelman.shadow" version "6.0.0" - id "com.diffplug.gradle.spotless" version "4.3.0" - id "com.github.spotbugs" version "4.0.1" + id "com.diffplug.spotless" version "5.6.1" + id "com.github.spotbugs" version "4.5.1" id "net.ltgt.errorprone" version "1.2.1" apply false } @@ -26,11 +26,10 @@ release { defaultVersionStrategy = Strategies.SNAPSHOT } -def isCI = System.getenv("CI") != null - allprojects { group = 'io.opentelemetry.instrumentation.auto' + ext.isCI = System.getenv("CI") != null if (isCI) { buildDir = "$rootDir/workspace/${projectDir.path.replace(rootDir.path, '')}/build/" } @@ -62,7 +61,7 @@ allprojects { } } -apply plugin: 'com.diffplug.gradle.spotless' +apply plugin: 'com.diffplug.spotless' spotless { // this formatting is applied at the root level, as some of these files are not in a submodules diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle new file mode 100644 index 000000000000..ebf456d77a3e --- /dev/null +++ b/buildSrc/build.gradle @@ -0,0 +1,52 @@ +plugins { + id 'groovy' + id 'java-gradle-plugin' + id "com.diffplug.spotless" version "5.6.1" +} + +spotless { + java { + googleJavaFormat() + licenseHeaderFile rootProject.file('../gradle/enforcement/spotless.license.java'), '(package|import|public)' + target 'src/**/*.java' + } + groovy { + licenseHeaderFile rootProject.file('../gradle/enforcement/spotless.license.java'), '(package|import|class)' + } +} + +gradlePlugin { + plugins { + create("muzzle-plugin") { + id = "muzzle" + implementationClass = "MuzzlePlugin" + } + create("auto-instrumentation-plugin") { + id = "io.opentelemetry.instrumentation.auto-instrumentation" + implementationClass = "io.opentelemetry.instrumentation.gradle.AutoInstrumentationPlugin" + } + } +} + +repositories { + mavenLocal() + jcenter() + mavenCentral() +} + +dependencies { + implementation(gradleApi()) + implementation(localGroovy()) + + implementation group: "org.eclipse.aether", name: "aether-connector-basic", version: "1.1.0" + implementation group: "org.eclipse.aether", name: "aether-transport-http", version: "1.1.0" + implementation group: "org.apache.maven", name: "maven-aether-provider", version: "3.3.9" + + implementation group: "com.google.guava", name: "guava", version: "20.0" + implementation group: "org.ow2.asm", name: "asm", version: "7.0-beta" + implementation group: "org.ow2.asm", name: "asm-tree", version: "7.0-beta" + implementation group: "org.apache.httpcomponents", name: "httpclient", version: "4.5.10" + + testImplementation group: "org.spockframework", name: "spock-core", version: "1.3-groovy-2.5" + testImplementation group: "org.codehaus.groovy", name: "groovy-all", version: "2.5.8" +} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts deleted file mode 100644 index 6f0fa79e61b1..000000000000 --- a/buildSrc/build.gradle.kts +++ /dev/null @@ -1,41 +0,0 @@ -plugins { - groovy - `java-gradle-plugin` - id("com.diffplug.gradle.spotless") version "4.3.0" -} - -gradlePlugin { - plugins { - create("muzzle-plugin") { - id = "muzzle" - implementationClass = "MuzzlePlugin" - } - create("auto-instrumentation-plugin") { - id = "io.opentelemetry.instrumentation.auto-instrumentation" - implementationClass = "io.opentelemetry.instrumentation.gradle.AutoInstrumentationPlugin" - } - } -} - -repositories { - mavenLocal() - jcenter() - mavenCentral() -} - -dependencies { - implementation(gradleApi()) - implementation(localGroovy()) - - implementation("org.eclipse.aether", "aether-connector-basic", "1.1.0") - implementation("org.eclipse.aether", "aether-transport-http", "1.1.0") - implementation("org.apache.maven", "maven-aether-provider", "3.3.9") - - implementation("com.google.guava", "guava", "20.0") - implementation("org.ow2.asm", "asm", "7.0-beta") - implementation("org.ow2.asm", "asm-tree", "7.0-beta") - implementation("org.apache.httpcomponents:httpclient:4.5.10") - - testImplementation("org.spockframework", "spock-core", "1.3-groovy-2.5") - testImplementation("org.codehaus.groovy", "groovy-all", "2.5.8") -} diff --git a/buildSrc/src/main/groovy/MuzzlePlugin.groovy b/buildSrc/src/main/groovy/MuzzlePlugin.groovy index 7f9f016d123d..c9a4bcf20450 100644 --- a/buildSrc/src/main/groovy/MuzzlePlugin.groovy +++ b/buildSrc/src/main/groovy/MuzzlePlugin.groovy @@ -1,3 +1,8 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + import java.lang.reflect.Method import java.security.SecureClassLoader import java.util.concurrent.atomic.AtomicReference diff --git a/buildSrc/src/main/java/io/opentelemetry/instrumentation/gradle/AutoInstrumentationPlugin.java b/buildSrc/src/main/java/io/opentelemetry/instrumentation/gradle/AutoInstrumentationPlugin.java index 94494bbe0a30..05c17a593441 100644 --- a/buildSrc/src/main/java/io/opentelemetry/instrumentation/gradle/AutoInstrumentationPlugin.java +++ b/buildSrc/src/main/java/io/opentelemetry/instrumentation/gradle/AutoInstrumentationPlugin.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.gradle; @@ -41,15 +30,16 @@ public class AutoInstrumentationPlugin implements Plugin { /** - * An exact copy of {@code io.opentelemetry.javaagent.tooling.Constants#BOOTSTRAP_PACKAGE_PREFIXES}. We - * can't reference it directly since this file needs to be compiled before the other packages. + * An exact copy of {@code + * io.opentelemetry.javaagent.tooling.Constants#BOOTSTRAP_PACKAGE_PREFIXES}. We can't reference it + * directly since this file needs to be compiled before the other packages. */ public static final String[] BOOTSTRAP_PACKAGE_PREFIXES_COPY = { - "io.opentelemetry.javaagent.common.exec", - "io.opentelemetry.javaagent.slf4j", - "io.opentelemetry.javaagent.bootstrap", - "io.opentelemetry.javaagent.shaded", - "io.opentelemetry.instrumentation.auto.api", + "io.opentelemetry.javaagent.common.exec", + "io.opentelemetry.javaagent.slf4j", + "io.opentelemetry.javaagent.bootstrap", + "io.opentelemetry.javaagent.shaded", + "io.opentelemetry.instrumentation.auto.api", }; // Aditional classes we need only for tests and aren't shared with the agent business logic. @@ -57,36 +47,38 @@ public class AutoInstrumentationPlugin implements Plugin { static { String[] testBS = { - "io.opentelemetry.instrumentation.api", - "io.opentelemetry.OpenTelemetry", // OpenTelemetry API - "io.opentelemetry.common", // OpenTelemetry API - "io.opentelemetry.context", // OpenTelemetry API (context prop) - "io.opentelemetry.correlationcontext", // OpenTelemetry API - "io.opentelemetry.internal", // OpenTelemetry API - "io.opentelemetry.metrics", // OpenTelemetry API - "io.opentelemetry.trace", // OpenTelemetry API - "io.grpc.Context", // OpenTelemetry API dependency - "io.grpc.Deadline", // OpenTelemetry API dependency - "io.grpc.PersistentHashArrayMappedTrie", // OpenTelemetry API dependency - "io.grpc.ThreadLocalContextStorage", // OpenTelemetry API dependency - "org.slf4j", - "ch.qos.logback", - // Tomcat's servlet classes must be on boostrap - // when running tomcat test - "javax.servlet.ServletContainerInitializer", - "javax.servlet.ServletContext" + "io.opentelemetry.instrumentation.api", + "io.opentelemetry.OpenTelemetry", // OpenTelemetry API + "io.opentelemetry.common", // OpenTelemetry API + "io.opentelemetry.baggage", // OpenTelemetry API + "io.opentelemetry.context", // OpenTelemetry API (context prop) + "io.opentelemetry.internal", // OpenTelemetry API + "io.opentelemetry.metrics", // OpenTelemetry API + "io.opentelemetry.trace", // OpenTelemetry API + "io.grpc.Context", // OpenTelemetry API dependency + "io.grpc.Deadline", // OpenTelemetry API dependency + "io.grpc.PersistentHashArrayMappedTrie", // OpenTelemetry API dependency + "io.grpc.ThreadLocalContextStorage", // OpenTelemetry API dependency + "org.slf4j", + "ch.qos.logback", + // Tomcat's servlet classes must be on boostrap + // when running tomcat test + "javax.servlet.ServletContainerInitializer", + "javax.servlet.ServletContext" }; TEST_BOOTSTRAP_PREFIXES = Arrays.copyOf( BOOTSTRAP_PACKAGE_PREFIXES_COPY, BOOTSTRAP_PACKAGE_PREFIXES_COPY.length + testBS.length); - System.arraycopy(testBS, 0, TEST_BOOTSTRAP_PREFIXES, BOOTSTRAP_PACKAGE_PREFIXES_COPY.length, - testBS.length); + System.arraycopy( + testBS, 0, TEST_BOOTSTRAP_PREFIXES, BOOTSTRAP_PACKAGE_PREFIXES_COPY.length, testBS.length); for (int i = 0; i < TEST_BOOTSTRAP_PREFIXES.length; i++) { TEST_BOOTSTRAP_PREFIXES[i] = TEST_BOOTSTRAP_PREFIXES[i].replace('.', '/'); } } + private static final String[] NOT_BOOTSTRAP_PREFIXES = {"io/grpc/Contexts"}; + @Override public void apply(Project project) { project.getPlugins().apply(JavaLibraryPlugin.class); @@ -144,8 +136,10 @@ public void apply(Project project) { }); task.dependsOn(bootstrapJar); - task.getJvmArgumentProviders().add(new InstrumentationTestArgs( - new File(project.getBuildDir(), "libs/" + bootstrapJarName))); + task.getJvmArgumentProviders() + .add( + new InstrumentationTestArgs( + new File(project.getBuildDir(), "libs/" + bootstrapJarName))); }); } @@ -163,11 +157,17 @@ public InstrumentationTestArgs(File bootstrapJar) { @Override public Iterable asArguments() { - return Arrays.asList("-Xbootclasspath/a:" + bootstrapJar.getAbsolutePath(), "-Dnet.bytebuddy.raw=true"); + return Arrays.asList( + "-Xbootclasspath/a:" + bootstrapJar.getAbsolutePath(), "-Dnet.bytebuddy.raw=true"); } } private static boolean isBootstrapClass(String filePath) { + for (String notBootstrapName : NOT_BOOTSTRAP_PREFIXES) { + if (filePath.startsWith(notBootstrapName)) { + return false; + } + } for (String testBootstrapPrefix : TEST_BOOTSTRAP_PREFIXES) { if (filePath.startsWith(testBootstrapPrefix)) { return true; diff --git a/buildSrc/src/test/groovy/RangeQueryTest.groovy b/buildSrc/src/test/groovy/RangeQueryTest.groovy index 2576a23fe2b3..f3b30d5028ed 100644 --- a/buildSrc/src/test/groovy/RangeQueryTest.groovy +++ b/buildSrc/src/test/groovy/RangeQueryTest.groovy @@ -1,3 +1,8 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + import org.eclipse.aether.RepositorySystem import org.eclipse.aether.RepositorySystemSession import org.eclipse.aether.artifact.Artifact diff --git a/docs/logger-mdc-instrumentation.md b/docs/logger-mdc-instrumentation.md new file mode 100644 index 000000000000..acfc289a8c13 --- /dev/null +++ b/docs/logger-mdc-instrumentation.md @@ -0,0 +1,36 @@ +# Logger MDC auto-instrumentation + +The Mapped Diagnostic Context (MDC) is + +> an instrument for distinguishing interleaved log output from different sources. +> — [log4j MDC documentation](http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/MDC.html) + +It contains thread-local contextual information which is later copied to each logging event captured +by a logging library. + +The OTel Java agent injects several pieces of information about the current span into each logging +event's MDC copy: + +- `traceId` - the current trace id + (same as `TracingContextUtils.getCurrentSpan().getContext().getTraceIdAsHexString()`); +- `spanId` - the current span id + (same as `TracingContextUtils.getCurrentSpan().getContext().getSpanIdAsHexString()`); +- `sampled` - a boolean flag marking whether the current span is sampled or not + (same as `TracingContextUtils.getCurrentSpan().getContext().isSampled()`). + +Those three pieces of information can be included in log statements produced by the logging library +by specifying them in the pattern/format. Example for Spring Boot configuration (which uses logback): + +```properties +logging.pattern.console = %d{yyyy-MM-dd HH:mm:ss} - %logger{36} - %msg t:%X{traceId} s:%X{spanId} %n +``` + +This way any services or tools that parse the application logs can correlate traces/spans with log statements. + +## Supported logging libraries + +| Library | Version | +|---------|---------| +| Log4j 1 | 1.2+ | +| Log4j 2 | 2.7+ | +| Logback | 1.0+ | diff --git a/docs/suppressing-instrumentation.md b/docs/suppressing-instrumentation.md index 465fefa46afd..68c668cfe820 100644 --- a/docs/suppressing-instrumentation.md +++ b/docs/suppressing-instrumentation.md @@ -1,7 +1,7 @@ ## Suppressing specific auto-instrumentation You can suppress auto-instrumentation of specific libraries by using -`-Dota.integration.[id].enabled=false`. +`-Dotel.integration.[id].enabled=false`. where `id` is the instrumentation `id`: diff --git a/gradle/codenarc.gradle b/gradle/codenarc.gradle index 3c3799c7c114..837d212f742b 100644 --- a/gradle/codenarc.gradle +++ b/gradle/codenarc.gradle @@ -7,7 +7,3 @@ dependencies { codenarc { configFile rootProject.file('gradle/enforcement/codenarc.groovy') } - -//codenarcTest { -// configFile rootProject.file('gradle/enforcement/codenarcTest.groovy') -//} diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 9783ddadce92..2f6c7d21e3ec 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -11,9 +11,10 @@ ext { // Check https://oss.jfrog.org/libs-snapshot/io/opentelemetry/ for latest snapshot version. // Snapshot versions are often split across versions (based on jfrog's whim and relative age of // each module), best to keep these separate until GA - opentelemetry : '0.9.0-20200925.025016-49', - opentelemetryOther : '0.9.0-20200925.025016-49', - opentelemetryAnother: '0.9.0-20200925.025016-49', + opentelemetry : '0.9.1', + opentelemetryOther : '0.9.1', + opentelemetryAnother: '0.9.1', + opentelemetryBaggage: '0.9.1', slf4j : "1.7.30", guava : "20.0", // Last version to support Java 7 @@ -31,21 +32,24 @@ ext { checkerFramework : "3.6.1", errorprone : "2.4.0", nullaway : "0.8.0", - autoValue : "1.7.4" + autoValue : "1.7.4", + systemLambda : "1.1.0", + prometheus : "0.9.0" ] deps = [ // OpenTelemetry opentelemetryApi : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-api', version: versions.opentelemetry), - opentelemetryContextProp : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-context-prop', version: versions.opentelemetryOther), + opentelemetryContextProp : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-context-prop', version: versions.opentelemetryAnother), opentelemetryAutoAnnotations: dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-extension-auto-annotations', version: versions.opentelemetryOther), - opentelemetryTraceProps : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-extension-trace-propagators', version: versions.opentelemetryOther), - opentelemetrySdk : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-sdk', version: versions.opentelemetryOther), + opentelemetryTraceProps : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-extension-trace-propagators', version: versions.opentelemetry), + opentelemetrySdk : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-sdk', version: versions.opentelemetry), opentelemetryJaeger : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-exporters-jaeger', version: versions.opentelemetry), - opentelemetryOtlp : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-exporters-otlp', version: versions.opentelemetry), - opentelemetryZipkin : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-exporters-zipkin', version: versions.opentelemetryOther), + opentelemetryOtlp : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-exporters-otlp', version: versions.opentelemetryAnother), + opentelemetryZipkin : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-exporters-zipkin', version: versions.opentelemetry), + opentelemetryPrometheus : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-exporters-prometheus', version: versions.opentelemetry), opentelemetryLogging : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-exporters-logging', version: versions.opentelemetry), - opentelemetryProto : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-proto', version: versions.opentelemetryOther), + opentelemetryProto : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-proto', version: versions.opentelemetry), // General slf4j : "org.slf4j:slf4j-api:${versions.slf4j}", @@ -61,6 +65,10 @@ ext { autoValueAnnotations : "com.google.auto.value:auto-value-annotations:${versions.autoValue}", // annotation processor autoValue : "com.google.auto.value:auto-value:${versions.autoValue}", + prometheus : [ + dependencies.create(group: 'io.prometheus', name: 'simpleclient', version: "${versions.prometheus}"), + dependencies.create(group: 'io.prometheus', name: 'simpleclient_httpserver', version: "${versions.prometheus}"), + ], // Testing @@ -72,7 +80,8 @@ ext { dependencies.create(group: 'org.objenesis', name: 'objenesis', version: '2.6') // Last version to support Java7 ], groovy : "org.codehaus.groovy:groovy-all:${versions.groovy}", - testcontainers : "org.testcontainers:testcontainers:1.12.2", + systemLambda : "com.github.stefanbirkner:system-lambda:${versions.systemLambda}", + testcontainers : "org.testcontainers:testcontainers:1.15.0-rc2", testLogging : [ dependencies.create(group: 'ch.qos.logback', name: 'logback-classic', version: versions.logback), dependencies.create(group: 'org.slf4j', name: 'log4j-over-slf4j', version: versions.slf4j), diff --git a/gradle/enforcement/codenarc.groovy b/gradle/enforcement/codenarc.groovy index 4361a4c11c70..bf13e492cd13 100644 --- a/gradle/enforcement/codenarc.groovy +++ b/gradle/enforcement/codenarc.groovy @@ -308,7 +308,8 @@ ruleset { FieldName { regex = '^_?[a-z][a-zA-Z0-9]*$' finalRegex = '^_?[a-z][a-zA-Z0-9]*$' - staticFinalRegex = '^logger$|^[A-Z][A-Z_0-9]*$|^serialVersionUID$' + // can be either constant (ABC_XYZ) or non-constant (abcXyz) + staticFinalRegex = '^[A-Z][A-Z_0-9]*$|^_?[a-z][a-zA-Z0-9]*$' } InterfaceName MethodName { diff --git a/gradle/enforcement/codenarcTest.groovy b/gradle/enforcement/codenarcTest.groovy deleted file mode 100644 index 585b1ba174ab..000000000000 --- a/gradle/enforcement/codenarcTest.groovy +++ /dev/null @@ -1,411 +0,0 @@ -ruleset { - // rulesets/basic.xml - /* - AssertWithinFinallyBlock - AssignmentInConditional - BigDecimalInstantiation - BitwiseOperatorInConditional - BooleanGetBoolean - BrokenNullCheck - BrokenOddnessCheck - ClassForName - ComparisonOfTwoConstants - ComparisonWithSelf - ConstantAssertExpression - ConstantIfExpression - ConstantTernaryExpression - DeadCode - DoubleNegative - DuplicateCaseStatement - DuplicateMapKey - DuplicateSetValue - EmptyCatchBlock - EmptyClass - EmptyElseBlock - EmptyFinallyBlock - EmptyForStatement - EmptyIfStatement - EmptyInstanceInitializer - EmptyMethod - EmptyStaticInitializer - EmptySwitchStatement - EmptySynchronizedStatement - EmptyTryBlock - EmptyWhileStatement - EqualsAndHashCode - EqualsOverloaded - ExplicitGarbageCollection - ForLoopShouldBeWhileLoop - HardCodedWindowsFileSeparator - HardCodedWindowsRootDirectory - IntegerGetInteger - RandomDoubleCoercedToZero - RemoveAllOnSelf - ReturnFromFinallyBlock - ThrowExceptionFromFinallyBlock - */ - - // rulesets/braces.xml - ElseBlockBraces - ForStatementBraces - IfStatementBraces - WhileStatementBraces - - // rulesets/concurrency.xml - /* - BusyWait - DoubleCheckedLocking - InconsistentPropertyLocking - InconsistentPropertySynchronization - NestedSynchronization - StaticCalendarField - StaticConnection - StaticDateFormatField - StaticMatcherField - StaticSimpleDateFormatField - SynchronizedMethod - SynchronizedOnBoxedPrimitive - SynchronizedOnGetClass - SynchronizedOnReentrantLock - SynchronizedOnString - SynchronizedOnThis - SynchronizedReadObjectMethod - SystemRunFinalizersOnExit - ThisReferenceEscapesConstructor - ThreadGroup - ThreadLocalNotStaticFinal - ThreadYield - UseOfNotifyMethod - VolatileArrayField - VolatileLongOrDoubleField - WaitOutsideOfWhileLoop - */ - - // rulesets/convention.xml - /* - ConfusingTernary - CouldBeElvis - HashtableIsObsolete - IfStatementCouldBeTernary - InvertedIfElse - LongLiteralWithLowerCaseL - ParameterReassignment - TernaryCouldBeElvis - VectorIsObsolete - */ - - // rulesets/design.xml - /* - AbstractClassWithPublicConstructor - AbstractClassWithoutAbstractMethod - BooleanMethodReturnsNull - BuilderMethodWithSideEffects - CloneableWithoutClone - CloseWithoutCloseable - CompareToWithoutComparable - ConstantsOnlyInterface - EmptyMethodInAbstractClass - FinalClassWithProtectedMember - ImplementationAsType - LocaleSetDefault - PrivateFieldCouldBeFinal - PublicInstanceField - ReturnsNullInsteadOfEmptyArray - ReturnsNullInsteadOfEmptyCollection - SimpleDateFormatMissingLocale - StatelessSingleton - */ - - // rulesets/dry.xml - /* - DuplicateListLiteral - DuplicateMapLiteral - DuplicateNumberLiteral - DuplicateStringLiteral - */ - - // rulesets/enhanced.xml - /* - CloneWithoutCloneable - JUnitAssertEqualsConstantActualValue - UnsafeImplementationAsMap - */ - - // rulesets/exceptions.xml - /* - CatchArrayIndexOutOfBoundsException - CatchError - CatchException - CatchIllegalMonitorStateException - CatchIndexOutOfBoundsException - CatchNullPointerException - CatchRuntimeException - CatchThrowable - ConfusingClassNamedException - ExceptionExtendsError - ExceptionNotThrown - MissingNewInThrowStatement - ReturnNullFromCatchBlock - SwallowThreadDeath - ThrowError - ThrowException - ThrowNullPointerException - ThrowRuntimeException - ThrowThrowable - */ - - // rulesets/formatting.xml - /* - BracesForClass - BracesForForLoop - BracesForIfElse - BracesForMethod - BracesForTryCatchFinally - ClassJavadoc - ClosureStatementOnOpeningLineOfMultipleLineClosure - LineLength - SpaceAfterCatch - SpaceAfterClosingBrace - SpaceAfterComma - SpaceAfterFor - SpaceAfterIf - SpaceAfterOpeningBrace - SpaceAfterSemicolon - SpaceAfterSwitch - SpaceAfterWhile - SpaceAroundClosureArrow - SpaceAroundMapEntryColon - SpaceAroundOperator - SpaceBeforeClosingBrace - SpaceBeforeOpeningBrace - */ - - // rulesets/generic.xml - /* - IllegalClassMember - IllegalClassReference - IllegalPackageReference - IllegalRegex - IllegalString - RequiredRegex - RequiredString - StatelessClass - */ - - // rulesets/grails.xml - /* - GrailsDomainHasEquals - GrailsDomainHasToString - GrailsDomainReservedSqlKeywordName - GrailsDomainWithServiceReference - GrailsDuplicateConstraint - GrailsDuplicateMapping - GrailsPublicControllerMethod - GrailsServletContextReference - GrailsSessionReference // DEPRECATED - GrailsStatelessService - */ - - // rulesets/groovyism.xml - /* - AssignCollectionSort - AssignCollectionUnique - ClosureAsLastMethodParameter - CollectAllIsDeprecated - ConfusingMultipleReturns - ExplicitArrayListInstantiation - ExplicitCallToAndMethod - ExplicitCallToCompareToMethod - ExplicitCallToDivMethod - ExplicitCallToEqualsMethod - ExplicitCallToGetAtMethod - ExplicitCallToLeftShiftMethod - ExplicitCallToMinusMethod - ExplicitCallToModMethod - ExplicitCallToMultiplyMethod - ExplicitCallToOrMethod - ExplicitCallToPlusMethod - ExplicitCallToPowerMethod - ExplicitCallToRightShiftMethod - ExplicitCallToXorMethod - ExplicitHashMapInstantiation - ExplicitHashSetInstantiation - ExplicitLinkedHashMapInstantiation - ExplicitLinkedListInstantiation - ExplicitStackInstantiation - ExplicitTreeSetInstantiation - GStringAsMapKey - GStringExpressionWithinString - GetterMethodCouldBeProperty - GroovyLangImmutable - UseCollectMany - UseCollectNested - */ - - // rulesets/imports.xml - DuplicateImport - ImportFromSamePackage -// ImportFromSunPackages -// MisorderedStaticImports - UnnecessaryGroovyImport - UnusedImport - - // rulesets/jdbc.xml - /* - DirectConnectionManagement - JdbcConnectionReference - JdbcResultSetReference - JdbcStatementReference - */ - - // rulesets/junit.xml - /* - ChainedTest - CoupledTestCase - JUnitAssertAlwaysFails - JUnitAssertAlwaysSucceeds - JUnitFailWithoutMessage - JUnitLostTest - JUnitPublicField - JUnitPublicNonTestMethod - JUnitSetUpCallsSuper - JUnitStyleAssertions - JUnitTearDownCallsSuper - JUnitTestMethodWithoutAssert - JUnitUnnecessarySetUp - JUnitUnnecessaryTearDown - JUnitUnnecessaryThrowsException - SpockIgnoreRestUsed - UnnecessaryFail - UseAssertEqualsInsteadOfAssertTrue - UseAssertFalseInsteadOfNegation - UseAssertNullInsteadOfAssertEquals - UseAssertSameInsteadOfAssertTrue - UseAssertTrueInsteadOfAssertEquals - UseAssertTrueInsteadOfNegation - */ - - // rulesets/logging.xml - /* - LoggerForDifferentClass - LoggerWithWrongModifiers - LoggingSwallowsStacktrace - MultipleLoggers - PrintStackTrace - Println - SystemErrPrint - SystemOutPrint - */ - - // rulesets/naming.xml - AbstractClassName - ClassName { - regex = '^[A-Z][\\$a-zA-Z0-9]*(? + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gradle/spotbugs.gradle b/gradle/spotbugs.gradle index 4e5d0ade6b32..34918ea06e10 100644 --- a/gradle/spotbugs.gradle +++ b/gradle/spotbugs.gradle @@ -2,10 +2,29 @@ allprojects { apply plugin: 'com.github.spotbugs' spotbugs { - ignoreFailures = true + ignoreFailures = false reportLevel = "high" omitVisitors = ["FindDeadLocalStores"] effort = "max" + excludeFilter = file("$rootDir/gradle/spotbugs-exclude.xml") } + spotbugsTest { + reports { + html.enabled = !isCI + xml.enabled = isCI + html { + stylesheet = 'fancy-hist.xsl' + } + } + } + spotbugsMain { + reports { + html.enabled = !isCI + xml.enabled = isCI + html { + stylesheet = 'fancy-hist.xsl' + } + } + } } diff --git a/gradle/spotless.gradle b/gradle/spotless.gradle index 3e5e6879ab8f..ab659d44af2f 100644 --- a/gradle/spotless.gradle +++ b/gradle/spotless.gradle @@ -1,4 +1,4 @@ -apply plugin: 'com.diffplug.gradle.spotless' +apply plugin: 'com.diffplug.spotless' spotless { java { @@ -21,7 +21,7 @@ spotless { } format 'misc', { // not using '**/...' to help keep spotless fast - target '.gitignore', '*.md', 'src/**/.md', '*.sh' + target '.gitignore', '*.md', 'src/**/*.md', '*.sh', 'src/**/*.properties' indentWithSpaces() trimTrailingWhitespace() endWithNewline() diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/InstrumentationVersion.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/InstrumentationVersion.java index 30cca5d7e2fd..8082f60c7ac5 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/InstrumentationVersion.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/InstrumentationVersion.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.api; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/MoreAttributes.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/MoreAttributes.java index 3818bf18d315..2aa4ad894405 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/MoreAttributes.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/MoreAttributes.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.api; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/config/CollectionParsers.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/config/CollectionParsers.java index 62cc7855ad5d..0af51a43e540 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/config/CollectionParsers.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/config/CollectionParsers.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.api.config; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/config/Config.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/config/Config.java index 1cfc27aba9c1..a2cd69b66606 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/config/Config.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/config/Config.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.api.config; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/config/MethodsConfigurationParser.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/config/MethodsConfigurationParser.java index 3e4a52b02c9b..a2e0de6ccfae 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/config/MethodsConfigurationParser.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/config/MethodsConfigurationParser.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.api.config; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/context/ContextPropagationDebug.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/context/ContextPropagationDebug.java index 014ae1d6956a..0a5adfb0e9d7 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/context/ContextPropagationDebug.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/context/ContextPropagationDebug.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.api.context; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/decorator/BaseDecorator.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/decorator/BaseDecorator.java index 57486c67cd16..bb2881f8aed4 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/decorator/BaseDecorator.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/decorator/BaseDecorator.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.api.decorator; @@ -22,7 +11,7 @@ import io.grpc.Context; import io.opentelemetry.context.propagation.TextMapPropagator; import io.opentelemetry.trace.Span; -import io.opentelemetry.trace.Status; +import io.opentelemetry.trace.StatusCanonicalCode; import io.opentelemetry.trace.attributes.SemanticAttributes; import java.lang.reflect.Method; import java.net.InetAddress; @@ -56,12 +45,12 @@ public Span beforeFinish(Span span) { public Span onError(Span span, Throwable throwable) { assert span != null; if (throwable != null) { - onComplete(span, Status.UNKNOWN, throwable); + onComplete(span, StatusCanonicalCode.ERROR, throwable); } return span; } - public Span onComplete(Span span, Status status, Throwable throwable) { + public Span onComplete(Span span, StatusCanonicalCode status, Throwable throwable) { assert span != null; span.setStatus(status); if (throwable != null) { diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/decorator/ClientDecorator.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/decorator/ClientDecorator.java index fa82f5b85eed..1ae61c4f35e4 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/decorator/ClientDecorator.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/decorator/ClientDecorator.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.api.decorator; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/decorator/HttpStatusConverter.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/decorator/HttpStatusConverter.java index a8e547c6f92c..fb057aba1ec9 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/decorator/HttpStatusConverter.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/decorator/HttpStatusConverter.java @@ -1,59 +1,21 @@ /* * 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.api.decorator; -import io.opentelemetry.trace.Status; +import io.opentelemetry.trace.StatusCanonicalCode; public final class HttpStatusConverter { // https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/http.md#status - public static Status statusFromHttpStatus(int httpStatus) { + public static StatusCanonicalCode statusFromHttpStatus(int httpStatus) { if (httpStatus >= 100 && httpStatus < 400) { - return Status.OK; + return StatusCanonicalCode.UNSET; } - switch (httpStatus) { - case 401: - return Status.UNAUTHENTICATED; - case 403: - return Status.PERMISSION_DENIED; - case 404: - return Status.NOT_FOUND; - case 429: - return Status.RESOURCE_EXHAUSTED; - case 501: - return Status.UNIMPLEMENTED; - case 503: - return Status.UNAVAILABLE; - case 504: - return Status.DEADLINE_EXCEEDED; - default: - // fall through - } - - if (httpStatus >= 400 && httpStatus < 500) { - return Status.INVALID_ARGUMENT; - } - - if (httpStatus >= 500 && httpStatus < 600) { - return Status.INTERNAL; - } - - return Status.UNKNOWN; + return StatusCanonicalCode.ERROR; } private HttpStatusConverter() {} diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/log/LoggingContextConstants.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/log/LoggingContextConstants.java index 87b122c633fe..33afca60198b 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/log/LoggingContextConstants.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/log/LoggingContextConstants.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.api.log; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/BaseTracer.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/BaseTracer.java index 2a5999b37403..366b30b127b0 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/BaseTracer.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/BaseTracer.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.api.tracer; @@ -23,7 +12,7 @@ import io.opentelemetry.trace.EndSpanOptions; import io.opentelemetry.trace.Span; import io.opentelemetry.trace.Span.Kind; -import io.opentelemetry.trace.Status; +import io.opentelemetry.trace.StatusCanonicalCode; import io.opentelemetry.trace.Tracer; import java.lang.reflect.Method; import java.util.concurrent.ExecutionException; @@ -136,7 +125,7 @@ public void endExceptionally(Span span, Throwable throwable) { } public void endExceptionally(Span span, Throwable throwable, long endTimeNanos) { - span.setStatus(Status.INTERNAL); + span.setStatus(StatusCanonicalCode.ERROR); onError(span, unwrapThrowable(throwable)); end(span, endTimeNanos); } diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/DatabaseClientTracer.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/DatabaseClientTracer.java index 22fb89a67716..9c5bc5ee4cac 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/DatabaseClientTracer.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/DatabaseClientTracer.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.api.tracer; @@ -25,7 +14,7 @@ import io.opentelemetry.context.Scope; import io.opentelemetry.instrumentation.api.tracer.utils.NetPeerUtils; import io.opentelemetry.trace.Span; -import io.opentelemetry.trace.Status; +import io.opentelemetry.trace.StatusCanonicalCode; import io.opentelemetry.trace.Tracer; import io.opentelemetry.trace.attributes.SemanticAttributes; import java.net.InetSocketAddress; @@ -105,7 +94,7 @@ protected Span onConnection(Span span, CONNECTION connection) { @Override protected void onError(Span span, Throwable throwable) { if (throwable != null) { - span.setStatus(Status.UNKNOWN); + span.setStatus(StatusCanonicalCode.ERROR); addThrowable( span, throwable instanceof ExecutionException ? throwable.getCause() : throwable); } diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/HttpClientTracer.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/HttpClientTracer.java index e8c1be6fbfca..e79979b2d77d 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/HttpClientTracer.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/HttpClientTracer.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.api.tracer; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/HttpServerTracer.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/HttpServerTracer.java index 36020fc8b961..7c1be9730b5a 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/HttpServerTracer.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/HttpServerTracer.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.api.tracer; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/RpcClientTracer.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/RpcClientTracer.java index ac8eb1eb4d16..a1db44d31764 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/RpcClientTracer.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/RpcClientTracer.java @@ -1,19 +1,16 @@ /* * 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.api.tracer; -public abstract class RpcClientTracer extends BaseTracer {} +import io.opentelemetry.trace.Tracer; + +public abstract class RpcClientTracer extends BaseTracer { + protected RpcClientTracer() {} + + protected RpcClientTracer(Tracer tracer) { + super(tracer); + } +} diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/RpcServerTracer.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/RpcServerTracer.java index f3f85c2c738d..f361aa5fd931 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/RpcServerTracer.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/RpcServerTracer.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.api.tracer; @@ -20,9 +9,16 @@ import io.grpc.Context; import io.opentelemetry.context.propagation.TextMapPropagator; +import io.opentelemetry.trace.Tracer; public abstract class RpcServerTracer extends BaseTracer { + protected RpcServerTracer() {} + + protected RpcServerTracer(Tracer tracer) { + super(tracer); + } + protected abstract TextMapPropagator.Getter getGetter(); protected Context extract(C carrier, TextMapPropagator.Getter getter) { diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/utils/NetPeerUtils.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/utils/NetPeerUtils.java index 284cfd2a534f..c640cb97d8c7 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/utils/NetPeerUtils.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/utils/NetPeerUtils.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.api.tracer.utils; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbCassandraSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbCassandraSemanticConvention.java index a48efb51a908..574432b17904 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbCassandraSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbCassandraSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbCassandraSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbCassandraSpan.java index c83f604297a5..2e95d737e584 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbCassandraSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbCassandraSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbHbaseSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbHbaseSemanticConvention.java index 010b8cbce0da..6e17e5eaa47d 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbHbaseSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbHbaseSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbHbaseSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbHbaseSpan.java index cec1f0122d4b..1909ab202fa6 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbHbaseSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbHbaseSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbMongodbSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbMongodbSemanticConvention.java index 5f59f5a842b0..9946acaa5155 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbMongodbSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbMongodbSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbMongodbSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbMongodbSpan.java index ca56d0a39456..c9ebef5be770 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbMongodbSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbMongodbSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbMssqlSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbMssqlSemanticConvention.java index 2542ba5968d9..1a9f0cd97c32 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbMssqlSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbMssqlSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbMssqlSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbMssqlSpan.java index e026f3ab320a..d8d5b0cbbc90 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbMssqlSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbMssqlSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbRedisSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbRedisSemanticConvention.java index 2cd6680cdac9..81d9c193fb42 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbRedisSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbRedisSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbRedisSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbRedisSpan.java index c9371fc5ef52..c2ab32f54998 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbRedisSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbRedisSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbSemanticConvention.java index 7c1d8254b728..12803c127a27 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbSpan.java index 17fb5611639d..05929c8e27f3 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DbSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DelegatingSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DelegatingSpan.java index 6e314b0b9baa..193e99aa878d 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DelegatingSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/DelegatingSpan.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.api.typedspan; @@ -19,10 +8,10 @@ import io.opentelemetry.common.AttributeKey; import io.opentelemetry.common.Attributes; import io.opentelemetry.trace.EndSpanOptions; -import io.opentelemetry.trace.Event; import io.opentelemetry.trace.Span; import io.opentelemetry.trace.SpanContext; -import io.opentelemetry.trace.Status; +import io.opentelemetry.trace.StatusCanonicalCode; +import org.checkerframework.checker.nullness.qual.Nullable; public class DelegatingSpan implements Span { protected final Span delegate; @@ -77,18 +66,13 @@ public void addEvent(String name, Attributes attributes, long timestamp) { } @Override - public void addEvent(Event event) { - delegate.addEvent(event); - } - - @Override - public void addEvent(Event event, long timestamp) { - delegate.addEvent(event, timestamp); + public void setStatus(StatusCanonicalCode status) { + delegate.setStatus(status); } @Override - public void setStatus(Status status) { - delegate.setStatus(status); + public void setStatus(StatusCanonicalCode status, @Nullable String description) { + delegate.setStatus(status, description); } @Override diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasDatasourceSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasDatasourceSemanticConvention.java index c944ed15591a..12cb5e601319 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasDatasourceSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasDatasourceSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasDatasourceSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasDatasourceSpan.java index 4ba0791302b4..5ea1c58de026 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasDatasourceSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasDatasourceSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasHttpSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasHttpSemanticConvention.java index f3a5467779f6..c147424520a9 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasHttpSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasHttpSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasHttpSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasHttpSpan.java index 53541917877c..38b41f2f4f6d 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasHttpSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasHttpSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasPubsubSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasPubsubSemanticConvention.java index 282b44ec643f..f1782dcd6bd6 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasPubsubSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasPubsubSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasPubsubSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasPubsubSpan.java index 01616e0a18cf..d23ff524512c 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasPubsubSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasPubsubSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasSpanSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasSpanSemanticConvention.java index b39bd292537e..330583e79511 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasSpanSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasSpanSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasSpanSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasSpanSpan.java index 3a61ae32bfd0..0cab57e21930 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasSpanSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasSpanSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasTimerSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasTimerSemanticConvention.java index 9192cdaa360f..0bb77093278a 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasTimerSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasTimerSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasTimerSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasTimerSpan.java index 1dd788b08174..b5af8a37b6de 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasTimerSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/FaasTimerSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/GrpcClientSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/GrpcClientSemanticConvention.java index 3a248c395e4d..60d7561febe2 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/GrpcClientSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/GrpcClientSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/GrpcClientSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/GrpcClientSpan.java index fd1e57e6ba4d..9e522d5177c5 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/GrpcClientSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/GrpcClientSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/GrpcServerSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/GrpcServerSemanticConvention.java index 31e21720c930..283a21178009 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/GrpcServerSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/GrpcServerSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/GrpcServerSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/GrpcServerSpan.java index df3830280e3e..5efe044d8dd0 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/GrpcServerSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/GrpcServerSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpClientSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpClientSemanticConvention.java index 55a53fb78869..4bd4c65f2215 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpClientSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpClientSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpClientSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpClientSpan.java index 11e75a800b45..bdf1c3277217 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpClientSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpClientSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpSemanticConvention.java index 855a0035909a..3735414477f3 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpServerSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpServerSemanticConvention.java index 0431ffdd421d..73daed027723 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpServerSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpServerSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpServerSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpServerSpan.java index 758e2c97867d..a9c09e9e61e4 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpServerSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpServerSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpSpan.java index b445597d2cff..ebb3fcb29a59 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/HttpSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/IdentitySemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/IdentitySemanticConvention.java index 1ef1d376d841..2bfacedf012b 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/IdentitySemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/IdentitySemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/IdentitySpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/IdentitySpan.java index 97af17c2f50f..c786a5f09a7f 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/IdentitySpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/IdentitySpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSemanticConvention.java index 645855b70bf7..9b3a0ab6a566 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSpan.java index c5042161695c..9d6f5bd8c292 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSynchronousSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSynchronousSemanticConvention.java index 4733716c52f1..43f84b43c86b 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSynchronousSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSynchronousSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSynchronousSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSynchronousSpan.java index c48f9fa21706..f880b3114d5f 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSynchronousSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSynchronousSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingProducerSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingProducerSemanticConvention.java index 8c7308517dc7..1ae390fa9dde 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingProducerSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingProducerSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingProducerSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingProducerSpan.java index 63344527ca80..7fd8806fabbe 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingProducerSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingProducerSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingProducerSynchronousSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingProducerSynchronousSemanticConvention.java index 68ee5a4ac451..831ba1403a3c 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingProducerSynchronousSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingProducerSynchronousSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingProducerSynchronousSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingProducerSynchronousSpan.java index bb1d3db537fc..78d76dabf505 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingProducerSynchronousSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingProducerSynchronousSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingSemanticConvention.java index 103cde0243ba..b43a493d6be1 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingSpan.java index 56042dcdb33d..cd9b4ef6514c 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/NetworkSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/NetworkSemanticConvention.java index 7079a6d8e261..c9e18e0f9cb2 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/NetworkSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/NetworkSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/NetworkSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/NetworkSpan.java index edeace0c3c9a..06046fbeb354 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/NetworkSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/NetworkSpan.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/RpcSemanticConvention.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/RpcSemanticConvention.java index a38def9e45cd..dd381c4cd823 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/RpcSemanticConvention.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/RpcSemanticConvention.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.api.typedspan; diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/RpcSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/RpcSpan.java index fa4250130647..2d34857ee4fb 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/RpcSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/RpcSpan.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.api.typedspan; diff --git a/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/config/ConfigTest.groovy b/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/config/ConfigTest.groovy index 6cbbddd4791b..caa48d906d6e 100644 --- a/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/config/ConfigTest.groovy +++ b/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/config/ConfigTest.groovy @@ -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.api.config diff --git a/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/config/MethodsConfigurationParserTest.groovy b/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/config/MethodsConfigurationParserTest.groovy index 591f259ac887..fc70d5eb9fce 100644 --- a/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/config/MethodsConfigurationParserTest.groovy +++ b/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/config/MethodsConfigurationParserTest.groovy @@ -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.api.config diff --git a/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/decorator/BaseDecoratorTest.groovy b/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/decorator/BaseDecoratorTest.groovy index a726b65bf0f9..75c1e5fe2bd8 100644 --- a/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/decorator/BaseDecoratorTest.groovy +++ b/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/decorator/BaseDecoratorTest.groovy @@ -1,37 +1,26 @@ /* * 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.api.decorator -import static io.opentelemetry.auto.test.utils.ConfigUtils.updateConfig - +import io.opentelemetry.auto.test.utils.ConfigUtils import io.opentelemetry.trace.Span -import io.opentelemetry.trace.Status +import io.opentelemetry.trace.StatusCanonicalCode import io.opentelemetry.trace.attributes.SemanticAttributes import spock.lang.Shared import spock.lang.Specification class BaseDecoratorTest extends Specification { + static final PREVIOUS_CONFIG = ConfigUtils.updateConfig { + it.setProperty( + "otel.endpoint.peer.service.mapping", + "1.2.3.4=catservice,dogs.com=dogsservice") + } - static { - updateConfig { - System.setProperty( - "otel.endpoint.peer.service.mapping", - "1.2.3.4=catservice,dogs.com=dogsservice,opentelemetry.io=specservice") - } + def cleanupSpec() { + ConfigUtils.setConfig(PREVIOUS_CONFIG) } @Shared @@ -98,7 +87,7 @@ class BaseDecoratorTest extends Specification { then: if (error) { - 1 * span.setStatus(Status.UNKNOWN) + 1 * span.setStatus(StatusCanonicalCode.ERROR) 1 * span.recordException(error) } 0 * _ @@ -120,8 +109,8 @@ class BaseDecoratorTest extends Specification { where: error | status - new Exception() | Status.INTERNAL - null | Status.OK + new Exception() | StatusCanonicalCode.ERROR + null | StatusCanonicalCode.OK } def "test beforeFinish"() { diff --git a/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/decorator/ClientDecoratorTest.groovy b/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/decorator/ClientDecoratorTest.groovy index bbf184f352d7..ee18c5794bd9 100644 --- a/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/decorator/ClientDecoratorTest.groovy +++ b/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/decorator/ClientDecoratorTest.groovy @@ -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.api.decorator diff --git a/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/decorator/HttpStatusConverterTest.groovy b/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/decorator/HttpStatusConverterTest.groovy index 19a4a8872196..4c016e7ce19f 100644 --- a/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/decorator/HttpStatusConverterTest.groovy +++ b/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/decorator/HttpStatusConverterTest.groovy @@ -1,22 +1,11 @@ /* * 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.api.decorator -import io.opentelemetry.trace.Status +import io.opentelemetry.trace.StatusCanonicalCode import spock.lang.Specification class HttpStatusConverterTest extends Specification { @@ -31,75 +20,75 @@ class HttpStatusConverterTest extends Specification { // https://en.wikipedia.org/wiki/List_of_HTTP_status_codes where: httpStatus | expectedStatus - 100 | Status.OK - 101 | Status.OK - 102 | Status.OK - 103 | Status.OK + 100 | StatusCanonicalCode.UNSET + 101 | StatusCanonicalCode.UNSET + 102 | StatusCanonicalCode.UNSET + 103 | StatusCanonicalCode.UNSET - 200 | Status.OK - 201 | Status.OK - 202 | Status.OK - 203 | Status.OK - 204 | Status.OK - 205 | Status.OK - 206 | Status.OK - 207 | Status.OK - 208 | Status.OK - 226 | Status.OK + 200 | StatusCanonicalCode.UNSET + 201 | StatusCanonicalCode.UNSET + 202 | StatusCanonicalCode.UNSET + 203 | StatusCanonicalCode.UNSET + 204 | StatusCanonicalCode.UNSET + 205 | StatusCanonicalCode.UNSET + 206 | StatusCanonicalCode.UNSET + 207 | StatusCanonicalCode.UNSET + 208 | StatusCanonicalCode.UNSET + 226 | StatusCanonicalCode.UNSET - 300 | Status.OK - 301 | Status.OK - 302 | Status.OK - 303 | Status.OK - 304 | Status.OK - 305 | Status.OK - 306 | Status.OK - 307 | Status.OK - 308 | Status.OK + 300 | StatusCanonicalCode.UNSET + 301 | StatusCanonicalCode.UNSET + 302 | StatusCanonicalCode.UNSET + 303 | StatusCanonicalCode.UNSET + 304 | StatusCanonicalCode.UNSET + 305 | StatusCanonicalCode.UNSET + 306 | StatusCanonicalCode.UNSET + 307 | StatusCanonicalCode.UNSET + 308 | StatusCanonicalCode.UNSET - 400 | Status.INVALID_ARGUMENT - 401 | Status.UNAUTHENTICATED - 403 | Status.PERMISSION_DENIED - 404 | Status.NOT_FOUND - 405 | Status.INVALID_ARGUMENT - 406 | Status.INVALID_ARGUMENT - 407 | Status.INVALID_ARGUMENT - 408 | Status.INVALID_ARGUMENT - 409 | Status.INVALID_ARGUMENT - 410 | Status.INVALID_ARGUMENT - 411 | Status.INVALID_ARGUMENT - 412 | Status.INVALID_ARGUMENT - 413 | Status.INVALID_ARGUMENT - 414 | Status.INVALID_ARGUMENT - 415 | Status.INVALID_ARGUMENT - 416 | Status.INVALID_ARGUMENT - 417 | Status.INVALID_ARGUMENT - 418 | Status.INVALID_ARGUMENT - 421 | Status.INVALID_ARGUMENT - 422 | Status.INVALID_ARGUMENT - 423 | Status.INVALID_ARGUMENT - 424 | Status.INVALID_ARGUMENT - 425 | Status.INVALID_ARGUMENT - 426 | Status.INVALID_ARGUMENT - 428 | Status.INVALID_ARGUMENT - 429 | Status.RESOURCE_EXHAUSTED - 431 | Status.INVALID_ARGUMENT - 451 | Status.INVALID_ARGUMENT + 400 | StatusCanonicalCode.ERROR + 401 | StatusCanonicalCode.ERROR + 403 | StatusCanonicalCode.ERROR + 404 | StatusCanonicalCode.ERROR + 405 | StatusCanonicalCode.ERROR + 406 | StatusCanonicalCode.ERROR + 407 | StatusCanonicalCode.ERROR + 408 | StatusCanonicalCode.ERROR + 409 | StatusCanonicalCode.ERROR + 410 | StatusCanonicalCode.ERROR + 411 | StatusCanonicalCode.ERROR + 412 | StatusCanonicalCode.ERROR + 413 | StatusCanonicalCode.ERROR + 414 | StatusCanonicalCode.ERROR + 415 | StatusCanonicalCode.ERROR + 416 | StatusCanonicalCode.ERROR + 417 | StatusCanonicalCode.ERROR + 418 | StatusCanonicalCode.ERROR + 421 | StatusCanonicalCode.ERROR + 422 | StatusCanonicalCode.ERROR + 423 | StatusCanonicalCode.ERROR + 424 | StatusCanonicalCode.ERROR + 425 | StatusCanonicalCode.ERROR + 426 | StatusCanonicalCode.ERROR + 428 | StatusCanonicalCode.ERROR + 429 | StatusCanonicalCode.ERROR + 431 | StatusCanonicalCode.ERROR + 451 | StatusCanonicalCode.ERROR - 500 | Status.INTERNAL - 501 | Status.UNIMPLEMENTED - 502 | Status.INTERNAL - 503 | Status.UNAVAILABLE - 504 | Status.DEADLINE_EXCEEDED - 505 | Status.INTERNAL - 506 | Status.INTERNAL - 507 | Status.INTERNAL - 508 | Status.INTERNAL - 510 | Status.INTERNAL - 511 | Status.INTERNAL + 500 | StatusCanonicalCode.ERROR + 501 | StatusCanonicalCode.ERROR + 502 | StatusCanonicalCode.ERROR + 503 | StatusCanonicalCode.ERROR + 504 | StatusCanonicalCode.ERROR + 505 | StatusCanonicalCode.ERROR + 506 | StatusCanonicalCode.ERROR + 507 | StatusCanonicalCode.ERROR + 508 | StatusCanonicalCode.ERROR + 510 | StatusCanonicalCode.ERROR + 511 | StatusCanonicalCode.ERROR // Don't exist - 99 | Status.UNKNOWN - 600 | Status.UNKNOWN + 99 | StatusCanonicalCode.ERROR + 600 | StatusCanonicalCode.ERROR } } diff --git a/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/tracer/BaseTracerTest.groovy b/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/tracer/BaseTracerTest.groovy index 733b12605420..ea5d5501db12 100644 --- a/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/tracer/BaseTracerTest.groovy +++ b/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/tracer/BaseTracerTest.groovy @@ -1,21 +1,11 @@ /* * 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.api.tracer + import io.opentelemetry.trace.Span import spock.lang.Shared import spock.lang.Specification @@ -49,4 +39,3 @@ class BaseTracerTest extends Specification { } } } - \ No newline at end of file diff --git a/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/tracer/HttpClientTracerTest.groovy b/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/tracer/HttpClientTracerTest.groovy index 79bbab30a692..91ad1bea3eec 100644 --- a/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/tracer/HttpClientTracerTest.groovy +++ b/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/tracer/HttpClientTracerTest.groovy @@ -1,23 +1,11 @@ /* * 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.api.tracer -import static io.opentelemetry.auto.test.utils.ConfigUtils.updateConfig - +import io.opentelemetry.auto.test.utils.ConfigUtils import io.opentelemetry.context.propagation.TextMapPropagator import io.opentelemetry.instrumentation.api.decorator.HttpStatusConverter import io.opentelemetry.trace.Span @@ -25,19 +13,21 @@ import io.opentelemetry.trace.attributes.SemanticAttributes import spock.lang.Shared class HttpClientTracerTest extends BaseTracerTest { - static { - updateConfig { - System.setProperty( - "otel.endpoint.peer.service.mapping", - "myhost-mapped=reservation-service") - } + static final PREVIOUS_CONFIG = ConfigUtils.updateConfig { + it.setProperty( + "otel.endpoint.peer.service.mapping", + "1.2.3.4=catservice,dogs.com=dogsservice") + } + + def cleanupSpec() { + ConfigUtils.setConfig(PREVIOUS_CONFIG) } @Shared def testUrl = new URI("http://myhost:123/somepath") @Shared - def testUrlMapped = new URI("http://myhost-mapped:123/somepath") + def testUrlMapped = new URI("http://dogs.com:123/somepath") @Shared def testUserAgent = "Apache HttpClient" @@ -83,7 +73,7 @@ class HttpClientTracerTest extends BaseTracerTest { 1 * span.setAttribute(SemanticAttributes.HTTP_URL, "$req.url") 1 * span.setAttribute(SemanticAttributes.NET_PEER_NAME, req.url.host) 1 * span.setAttribute(SemanticAttributes.NET_PEER_PORT, req.url.port) - 1 * span.setAttribute(SemanticAttributes.PEER_SERVICE, "reservation-service") + 1 * span.setAttribute(SemanticAttributes.PEER_SERVICE, "dogsservice") 1 * span.setAttribute(SemanticAttributes.HTTP_USER_AGENT, req["User-Agent"]) 1 * span.setAttribute(SemanticAttributes.HTTP_FLAVOR, "1.1") } diff --git a/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/tracer/NetPeerUtilsTest.groovy b/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/tracer/NetPeerUtilsTest.groovy index bc206b1c52b7..261e42787bbc 100644 --- a/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/tracer/NetPeerUtilsTest.groovy +++ b/instrumentation-api/src/test/groovy/io/opentelemetry/instrumentation/api/tracer/NetPeerUtilsTest.groovy @@ -1,34 +1,23 @@ /* * 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.api.tracer -import static io.opentelemetry.auto.test.utils.ConfigUtils.updateConfig - +import io.opentelemetry.auto.test.utils.ConfigUtils import io.opentelemetry.instrumentation.api.tracer.utils.NetPeerUtils import io.opentelemetry.trace.attributes.SemanticAttributes class NetPeerUtilsTest extends BaseTracerTest { + static final PREVIOUS_CONFIG = ConfigUtils.updateConfig { + it.setProperty( + "otel.endpoint.peer.service.mapping", + "1.2.3.4=catservice,dogs.com=dogsservice") + } - static { - updateConfig { - System.setProperty( - "otel.endpoint.peer.service.mapping", - "1.2.3.4=catservice,dogs.com=dogsservice,opentelemetry.io=specservice") - } + def cleanupSpec() { + ConfigUtils.setConfig(PREVIOUS_CONFIG) } def "test setAttributes"() { @@ -72,4 +61,3 @@ class NetPeerUtilsTest extends BaseTracerTest { new InetSocketAddress("github.com", 999) | null } } - \ No newline at end of file diff --git a/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/decorator/SampleJavaClass.java b/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/decorator/SampleJavaClass.java index 0880cf723e23..918b2ea75de2 100644 --- a/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/decorator/SampleJavaClass.java +++ b/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/decorator/SampleJavaClass.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.api.decorator; diff --git a/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/tracer/HttpServerTracerTest.java b/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/tracer/HttpServerTracerTest.java index 0b06b848882c..fb27162afc53 100644 --- a/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/tracer/HttpServerTracerTest.java +++ b/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/tracer/HttpServerTracerTest.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.api.tracer; diff --git a/instrumentation-core/reactor-3.1/src/main/java/io/opentelemetry/instrumentation/reactor/TracingOperator.java b/instrumentation-core/reactor-3.1/src/main/java/io/opentelemetry/instrumentation/reactor/TracingOperator.java index 2481e422103e..89f0a566f31c 100644 --- a/instrumentation-core/reactor-3.1/src/main/java/io/opentelemetry/instrumentation/reactor/TracingOperator.java +++ b/instrumentation-core/reactor-3.1/src/main/java/io/opentelemetry/instrumentation/reactor/TracingOperator.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.reactor; diff --git a/instrumentation-core/reactor-3.1/src/main/java/io/opentelemetry/instrumentation/reactor/TracingSubscriber.java b/instrumentation-core/reactor-3.1/src/main/java/io/opentelemetry/instrumentation/reactor/TracingSubscriber.java index 5b3820137a68..2a527d6ff885 100644 --- a/instrumentation-core/reactor-3.1/src/main/java/io/opentelemetry/instrumentation/reactor/TracingSubscriber.java +++ b/instrumentation-core/reactor-3.1/src/main/java/io/opentelemetry/instrumentation/reactor/TracingSubscriber.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.reactor; diff --git a/instrumentation-core/reactor-3.1/src/test/groovy/io/opentelemetry/instrumentation/reactor/HooksTest.groovy b/instrumentation-core/reactor-3.1/src/test/groovy/io/opentelemetry/instrumentation/reactor/HooksTest.groovy index 34af91d18736..a13ed12c6c2e 100644 --- a/instrumentation-core/reactor-3.1/src/test/groovy/io/opentelemetry/instrumentation/reactor/HooksTest.groovy +++ b/instrumentation-core/reactor-3.1/src/test/groovy/io/opentelemetry/instrumentation/reactor/HooksTest.groovy @@ -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.reactor diff --git a/instrumentation-core/reactor-3.1/src/test/groovy/io/opentelemetry/instrumentation/reactor/ReactorCoreTest.groovy b/instrumentation-core/reactor-3.1/src/test/groovy/io/opentelemetry/instrumentation/reactor/ReactorCoreTest.groovy index cdac6b03a22e..8b1a2f9d9a15 100644 --- a/instrumentation-core/reactor-3.1/src/test/groovy/io/opentelemetry/instrumentation/reactor/ReactorCoreTest.groovy +++ b/instrumentation-core/reactor-3.1/src/test/groovy/io/opentelemetry/instrumentation/reactor/ReactorCoreTest.groovy @@ -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.reactor @@ -79,7 +68,7 @@ class ReactorCoreTest extends InstrumentationTestRunner { } where: - name | expected | workSpans | publisherSupplier + paramName | expected | workSpans | publisherSupplier "basic mono" | 2 | 1 | { -> Mono.just(1).map(addOne) } "two operations mono" | 4 | 2 | { -> Mono.just(2).map(addOne).map(addOne) } "delayed mono" | 4 | 1 | { -> @@ -115,10 +104,10 @@ class ReactorCoreTest extends InstrumentationTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "trace-parent" + name "trace-parent" errored true errorEvent(RuntimeException, EXCEPTION_MESSAGE) - parent() + hasNoParent() } // It's important that we don't attach errors at the Reactor level so that we don't @@ -130,9 +119,9 @@ class ReactorCoreTest extends InstrumentationTestRunner { } where: - name | publisherSupplier - "mono" | { -> Mono.error(new RuntimeException(EXCEPTION_MESSAGE)) } - "flux" | { -> Flux.error(new RuntimeException(EXCEPTION_MESSAGE)) } + paramName | publisherSupplier + "mono" | { -> Mono.error(new RuntimeException(EXCEPTION_MESSAGE)) } + "flux" | { -> Flux.error(new RuntimeException(EXCEPTION_MESSAGE)) } } def "Publisher step '#name' test"() { @@ -146,10 +135,10 @@ class ReactorCoreTest extends InstrumentationTestRunner { assertTraces(1) { trace(0, workSpans + 2) { span(0) { - operationName "trace-parent" + name "trace-parent" errored true errorEvent(RuntimeException, EXCEPTION_MESSAGE) - parent() + hasNoParent() } // It's important that we don't attach errors at the Reactor level so that we don't @@ -160,7 +149,7 @@ class ReactorCoreTest extends InstrumentationTestRunner { for (int i = 0; i < workSpans; i++) { span(i + 2) { - operationName "add one" + name "add one" childOf span(1) attributes { } @@ -170,7 +159,7 @@ class ReactorCoreTest extends InstrumentationTestRunner { } where: - name | workSpans | publisherSupplier + paramName | workSpans | publisherSupplier "basic mono failure" | 1 | { -> Mono.just(1).map(addOne).map({ throwException() }) } "basic flux failure" | 1 | { -> Flux.fromIterable([5, 6]).map(addOne).map({ throwException() }) @@ -185,8 +174,8 @@ class ReactorCoreTest extends InstrumentationTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "trace-parent" - parent() + name "trace-parent" + hasNoParent() attributes { } } @@ -196,7 +185,7 @@ class ReactorCoreTest extends InstrumentationTestRunner { } where: - name | publisherSupplier + paramName | publisherSupplier "basic mono" | { -> Mono.just(1) } "basic flux" | { -> Flux.fromIterable([5, 6]) } } @@ -209,8 +198,8 @@ class ReactorCoreTest extends InstrumentationTestRunner { assertTraces(1) { trace(0, workSpans + 2) { span(0) { - operationName "trace-parent" - parent() + name "trace-parent" + hasNoParent() attributes { } } @@ -219,7 +208,7 @@ class ReactorCoreTest extends InstrumentationTestRunner { for (int i = 0; i < workSpans; i++) { span(i + 2) { - operationName "add one" + name "add one" childOf span(1) attributes { } @@ -229,7 +218,7 @@ class ReactorCoreTest extends InstrumentationTestRunner { } where: - name | workSpans | publisherSupplier + paramName | workSpans | publisherSupplier "basic mono" | 3 | { -> Mono.just(1).map(addOne).map(addOne).then(Mono.just(1).map(addOne)) } @@ -276,7 +265,7 @@ class ReactorCoreTest extends InstrumentationTestRunner { } where: - name | workItems | publisherSupplier + paramName | workItems | publisherSupplier "basic mono" | 1 | { -> Mono.just(1).map(addOne) } "basic flux" | 2 | { -> Flux.fromIterable([1, 2]).map(addOne) } } diff --git a/instrumentation-core/servlet/src/main/java/io/opentelemetry/instrumentation/servlet/HttpServletRequestGetter.java b/instrumentation-core/servlet/src/main/java/io/opentelemetry/instrumentation/servlet/HttpServletRequestGetter.java index 7e7d5acf1d75..0cf9549c3dc0 100644 --- a/instrumentation-core/servlet/src/main/java/io/opentelemetry/instrumentation/servlet/HttpServletRequestGetter.java +++ b/instrumentation-core/servlet/src/main/java/io/opentelemetry/instrumentation/servlet/HttpServletRequestGetter.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.servlet; diff --git a/instrumentation-core/servlet/src/main/java/io/opentelemetry/instrumentation/servlet/ServletHttpServerTracer.java b/instrumentation-core/servlet/src/main/java/io/opentelemetry/instrumentation/servlet/ServletHttpServerTracer.java index 530ca85b70c5..5cad5c1338c3 100644 --- a/instrumentation-core/servlet/src/main/java/io/opentelemetry/instrumentation/servlet/ServletHttpServerTracer.java +++ b/instrumentation-core/servlet/src/main/java/io/opentelemetry/instrumentation/servlet/ServletHttpServerTracer.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.servlet; diff --git a/instrumentation/akka-context-propagation-2.5/src/main/java/io/opentelemetry/instrumentation/auto/akkaconcurrent/AkkaForkJoinPoolInstrumentation.java b/instrumentation/akka-context-propagation-2.5/src/main/java/io/opentelemetry/instrumentation/auto/akkaconcurrent/AkkaForkJoinPoolInstrumentation.java index 0713ec8fea5b..6ab1c900bfd5 100644 --- a/instrumentation/akka-context-propagation-2.5/src/main/java/io/opentelemetry/instrumentation/auto/akkaconcurrent/AkkaForkJoinPoolInstrumentation.java +++ b/instrumentation/akka-context-propagation-2.5/src/main/java/io/opentelemetry/instrumentation/auto/akkaconcurrent/AkkaForkJoinPoolInstrumentation.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.akkaconcurrent; diff --git a/instrumentation/akka-context-propagation-2.5/src/main/java/io/opentelemetry/instrumentation/auto/akkaconcurrent/AkkaForkJoinTaskInstrumentation.java b/instrumentation/akka-context-propagation-2.5/src/main/java/io/opentelemetry/instrumentation/auto/akkaconcurrent/AkkaForkJoinTaskInstrumentation.java index 2286855542c6..e657841912a0 100644 --- a/instrumentation/akka-context-propagation-2.5/src/main/java/io/opentelemetry/instrumentation/auto/akkaconcurrent/AkkaForkJoinTaskInstrumentation.java +++ b/instrumentation/akka-context-propagation-2.5/src/main/java/io/opentelemetry/instrumentation/auto/akkaconcurrent/AkkaForkJoinTaskInstrumentation.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.akkaconcurrent; diff --git a/instrumentation/akka-context-propagation-2.5/src/test/groovy/AkkaActorTest.groovy b/instrumentation/akka-context-propagation-2.5/src/test/groovy/AkkaActorTest.groovy index 1204b1e86b15..a553a45db1e8 100644 --- a/instrumentation/akka-context-propagation-2.5/src/test/groovy/AkkaActorTest.groovy +++ b/instrumentation/akka-context-propagation-2.5/src/test/groovy/AkkaActorTest.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestRunner @@ -27,12 +16,12 @@ class AkkaActorTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "parent" + name "parent" attributes { } } span(1) { - operationName "$expectedGreeting, Akka" + name "$expectedGreeting, Akka" childOf span(0) attributes { } diff --git a/instrumentation/akka-context-propagation-2.5/src/test/groovy/AkkaExecutorInstrumentationTest.groovy b/instrumentation/akka-context-propagation-2.5/src/test/groovy/AkkaExecutorInstrumentationTest.groovy index 8c3b71f578ad..453c5a1daef8 100644 --- a/instrumentation/akka-context-propagation-2.5/src/test/groovy/AkkaExecutorInstrumentationTest.groovy +++ b/instrumentation/akka-context-propagation-2.5/src/test/groovy/AkkaExecutorInstrumentationTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace diff --git a/instrumentation/akka-context-propagation-2.5/src/test/scala/AkkaActors.scala b/instrumentation/akka-context-propagation-2.5/src/test/scala/AkkaActors.scala index ec0ec91bb201..95a11ae4b364 100644 --- a/instrumentation/akka-context-propagation-2.5/src/test/scala/AkkaActors.scala +++ b/instrumentation/akka-context-propagation-2.5/src/test/scala/AkkaActors.scala @@ -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 */ import akka.actor.{Actor, ActorLogging, ActorRef, ActorSystem, Props} diff --git a/instrumentation/akka-context-propagation-2.5/src/test/scala/AkkaAsyncChild.java b/instrumentation/akka-context-propagation-2.5/src/test/scala/AkkaAsyncChild.java index 4cc808322841..78021407ddae 100644 --- a/instrumentation/akka-context-propagation-2.5/src/test/scala/AkkaAsyncChild.java +++ b/instrumentation/akka-context-propagation-2.5/src/test/scala/AkkaAsyncChild.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 */ import akka.dispatch.forkjoin.ForkJoinTask; diff --git a/instrumentation/akka-http-10.0/src/main/java/io/opentelemetry/instrumentation/auto/akkahttp/AkkaHttpClientInstrumentation.java b/instrumentation/akka-http-10.0/src/main/java/io/opentelemetry/instrumentation/auto/akkahttp/AkkaHttpClientInstrumentation.java index 54b630a93fb0..1d5b5cb20586 100644 --- a/instrumentation/akka-http-10.0/src/main/java/io/opentelemetry/instrumentation/auto/akkahttp/AkkaHttpClientInstrumentation.java +++ b/instrumentation/akka-http-10.0/src/main/java/io/opentelemetry/instrumentation/auto/akkahttp/AkkaHttpClientInstrumentation.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.akkahttp; diff --git a/instrumentation/akka-http-10.0/src/main/java/io/opentelemetry/instrumentation/auto/akkahttp/AkkaHttpClientTracer.java b/instrumentation/akka-http-10.0/src/main/java/io/opentelemetry/instrumentation/auto/akkahttp/AkkaHttpClientTracer.java index 1890d797bee2..d86a40d4f4d2 100644 --- a/instrumentation/akka-http-10.0/src/main/java/io/opentelemetry/instrumentation/auto/akkahttp/AkkaHttpClientTracer.java +++ b/instrumentation/akka-http-10.0/src/main/java/io/opentelemetry/instrumentation/auto/akkahttp/AkkaHttpClientTracer.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.akkahttp; diff --git a/instrumentation/akka-http-10.0/src/main/java/io/opentelemetry/instrumentation/auto/akkahttp/AkkaHttpServerHeaders.java b/instrumentation/akka-http-10.0/src/main/java/io/opentelemetry/instrumentation/auto/akkahttp/AkkaHttpServerHeaders.java index 942c317fdb44..8ad652b8ff63 100644 --- a/instrumentation/akka-http-10.0/src/main/java/io/opentelemetry/instrumentation/auto/akkahttp/AkkaHttpServerHeaders.java +++ b/instrumentation/akka-http-10.0/src/main/java/io/opentelemetry/instrumentation/auto/akkahttp/AkkaHttpServerHeaders.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.akkahttp; diff --git a/instrumentation/akka-http-10.0/src/main/java/io/opentelemetry/instrumentation/auto/akkahttp/AkkaHttpServerInstrumentation.java b/instrumentation/akka-http-10.0/src/main/java/io/opentelemetry/instrumentation/auto/akkahttp/AkkaHttpServerInstrumentation.java index 6f727190084b..38363482a688 100644 --- a/instrumentation/akka-http-10.0/src/main/java/io/opentelemetry/instrumentation/auto/akkahttp/AkkaHttpServerInstrumentation.java +++ b/instrumentation/akka-http-10.0/src/main/java/io/opentelemetry/instrumentation/auto/akkahttp/AkkaHttpServerInstrumentation.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.akkahttp; diff --git a/instrumentation/akka-http-10.0/src/main/java/io/opentelemetry/instrumentation/auto/akkahttp/AkkaHttpServerTracer.java b/instrumentation/akka-http-10.0/src/main/java/io/opentelemetry/instrumentation/auto/akkahttp/AkkaHttpServerTracer.java index 604a1312297f..3ac31f6821ea 100644 --- a/instrumentation/akka-http-10.0/src/main/java/io/opentelemetry/instrumentation/auto/akkahttp/AkkaHttpServerTracer.java +++ b/instrumentation/akka-http-10.0/src/main/java/io/opentelemetry/instrumentation/auto/akkahttp/AkkaHttpServerTracer.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.akkahttp; diff --git a/instrumentation/akka-http-10.0/src/test/groovy/AkkaHttpClientInstrumentationTest.groovy b/instrumentation/akka-http-10.0/src/test/groovy/AkkaHttpClientInstrumentationTest.groovy index c4e843ca3d7d..55d1b239a65b 100644 --- a/instrumentation/akka-http-10.0/src/test/groovy/AkkaHttpClientInstrumentationTest.groovy +++ b/instrumentation/akka-http-10.0/src/test/groovy/AkkaHttpClientInstrumentationTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -74,9 +63,9 @@ class AkkaHttpClientInstrumentationTest extends HttpClientTest { assertTraces(1) { trace(0, 1) { span(0) { - parent() - operationName HttpClientTracer.DEFAULT_SPAN_NAME - spanKind CLIENT + hasNoParent() + name HttpClientTracer.DEFAULT_SPAN_NAME + kind CLIENT errored true errorEvent(NullPointerException) } diff --git a/instrumentation/akka-http-10.0/src/test/groovy/AkkaHttpServerInstrumentationTest.groovy b/instrumentation/akka-http-10.0/src/test/groovy/AkkaHttpServerInstrumentationTest.groovy index b6b7a97a725b..d1ba085ff273 100644 --- a/instrumentation/akka-http-10.0/src/test/groovy/AkkaHttpServerInstrumentationTest.groovy +++ b/instrumentation/akka-http-10.0/src/test/groovy/AkkaHttpServerInstrumentationTest.groovy @@ -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 */ import io.opentelemetry.auto.test.base.HttpServerTest diff --git a/instrumentation/akka-http-10.0/src/test/scala/AkkaHttpTestAsyncWebServer.scala b/instrumentation/akka-http-10.0/src/test/scala/AkkaHttpTestAsyncWebServer.scala index 328e07dc3415..a9a2a19a5adf 100644 --- a/instrumentation/akka-http-10.0/src/test/scala/AkkaHttpTestAsyncWebServer.scala +++ b/instrumentation/akka-http-10.0/src/test/scala/AkkaHttpTestAsyncWebServer.scala @@ -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 */ import akka.actor.ActorSystem diff --git a/instrumentation/akka-http-10.0/src/test/scala/AkkaHttpTestSyncWebServer.scala b/instrumentation/akka-http-10.0/src/test/scala/AkkaHttpTestSyncWebServer.scala index 4df5c8287501..daa176627602 100644 --- a/instrumentation/akka-http-10.0/src/test/scala/AkkaHttpTestSyncWebServer.scala +++ b/instrumentation/akka-http-10.0/src/test/scala/AkkaHttpTestSyncWebServer.scala @@ -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 */ import akka.actor.ActorSystem diff --git a/instrumentation/akka-http-10.0/src/test/scala/AkkaHttpTestWebServer.scala b/instrumentation/akka-http-10.0/src/test/scala/AkkaHttpTestWebServer.scala index c1eff3a4f2da..24b9998d8437 100644 --- a/instrumentation/akka-http-10.0/src/test/scala/AkkaHttpTestWebServer.scala +++ b/instrumentation/akka-http-10.0/src/test/scala/AkkaHttpTestWebServer.scala @@ -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 */ import akka.actor.ActorSystem diff --git a/instrumentation/apache-httpasyncclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpasyncclient/ApacheHttpAsyncClientInstrumentation.java b/instrumentation/apache-httpasyncclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpasyncclient/ApacheHttpAsyncClientInstrumentation.java index 82efb60402de..480e9b4eede3 100644 --- a/instrumentation/apache-httpasyncclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpasyncclient/ApacheHttpAsyncClientInstrumentation.java +++ b/instrumentation/apache-httpasyncclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpasyncclient/ApacheHttpAsyncClientInstrumentation.java @@ -1,26 +1,15 @@ /* * 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.apachehttpasyncclient; +import static io.opentelemetry.context.ContextUtils.withScopedContext; import static io.opentelemetry.instrumentation.api.tracer.HttpClientTracer.DEFAULT_SPAN_NAME; import static io.opentelemetry.instrumentation.auto.apachehttpasyncclient.ApacheHttpAsyncClientTracer.TRACER; import static io.opentelemetry.javaagent.tooling.ClassLoaderMatcher.hasClassesNamed; import static io.opentelemetry.javaagent.tooling.bytebuddy.matcher.AgentElementMatchers.implementsInterface; -import static io.opentelemetry.trace.TracingContextUtils.currentContextWith; import static java.util.Collections.singletonMap; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import static net.bytebuddy.matcher.ElementMatchers.named; @@ -28,6 +17,7 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArguments; import com.google.auto.service.AutoService; +import io.grpc.Context; import io.opentelemetry.context.Scope; import io.opentelemetry.javaagent.tooling.Instrumenter; import io.opentelemetry.trace.Span; @@ -98,12 +88,12 @@ public static Span methodEnter( @Advice.Argument(2) HttpContext context, @Advice.Argument(value = 3, readOnly = false) FutureCallback futureCallback) { - Span parentSpan = TRACER.getCurrentSpan(); + Context parentContext = Context.current(); Span clientSpan = TRACER.startSpan(DEFAULT_SPAN_NAME, Kind.CLIENT); requestProducer = new DelegatingRequestProducer(clientSpan, requestProducer); futureCallback = - new TraceContinuedFutureCallback(parentSpan, clientSpan, context, futureCallback); + new TraceContinuedFutureCallback(parentContext, clientSpan, context, futureCallback); return clientSpan; } @@ -176,14 +166,14 @@ public void close() throws IOException { } public static class TraceContinuedFutureCallback implements FutureCallback { - private final Span parentSpan; + private final Context parentContext; private final Span clientSpan; private final HttpContext context; private final FutureCallback delegate; public TraceContinuedFutureCallback( - Span parentSpan, Span clientSpan, HttpContext context, FutureCallback delegate) { - this.parentSpan = parentSpan; + Context parentContext, Span clientSpan, HttpContext context, FutureCallback delegate) { + this.parentContext = parentContext; this.clientSpan = clientSpan; this.context = context; // Note: this can be null in real life, so we have to handle this carefully @@ -194,10 +184,10 @@ public TraceContinuedFutureCallback( public void completed(T result) { TRACER.end(clientSpan, getResponse(context)); - if (parentSpan == null) { + if (parentContext == null) { completeDelegate(result); } else { - try (Scope scope = currentContextWith(parentSpan)) { + try (Scope scope = withScopedContext(parentContext)) { completeDelegate(result); } } @@ -208,10 +198,10 @@ public void failed(Exception ex) { // end span before calling delegate TRACER.endExceptionally(clientSpan, getResponse(context), ex); - if (parentSpan == null) { + if (parentContext == null) { failDelegate(ex); } else { - try (Scope scope = currentContextWith(parentSpan)) { + try (Scope scope = withScopedContext(parentContext)) { failDelegate(ex); } } @@ -222,10 +212,10 @@ public void cancelled() { // end span before calling delegate TRACER.end(clientSpan, getResponse(context)); - if (parentSpan == null) { + if (parentContext == null) { cancelDelegate(); } else { - try (Scope scope = currentContextWith(parentSpan)) { + try (Scope scope = withScopedContext(parentContext)) { cancelDelegate(); } } diff --git a/instrumentation/apache-httpasyncclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpasyncclient/ApacheHttpAsyncClientTracer.java b/instrumentation/apache-httpasyncclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpasyncclient/ApacheHttpAsyncClientTracer.java index 75e279ff9506..31a86218e6a4 100644 --- a/instrumentation/apache-httpasyncclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpasyncclient/ApacheHttpAsyncClientTracer.java +++ b/instrumentation/apache-httpasyncclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpasyncclient/ApacheHttpAsyncClientTracer.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.apachehttpasyncclient; diff --git a/instrumentation/apache-httpasyncclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpasyncclient/ApacheHttpClientRedirectInstrumentation.java b/instrumentation/apache-httpasyncclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpasyncclient/ApacheHttpClientRedirectInstrumentation.java index 8028eb65fabc..e6254cfbcfb5 100644 --- a/instrumentation/apache-httpasyncclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpasyncclient/ApacheHttpClientRedirectInstrumentation.java +++ b/instrumentation/apache-httpasyncclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpasyncclient/ApacheHttpClientRedirectInstrumentation.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.apachehttpasyncclient; diff --git a/instrumentation/apache-httpasyncclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpasyncclient/HttpHeadersInjectAdapter.java b/instrumentation/apache-httpasyncclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpasyncclient/HttpHeadersInjectAdapter.java index b9a76c13b7cb..58c3f653113e 100644 --- a/instrumentation/apache-httpasyncclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpasyncclient/HttpHeadersInjectAdapter.java +++ b/instrumentation/apache-httpasyncclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpasyncclient/HttpHeadersInjectAdapter.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.apachehttpasyncclient; diff --git a/instrumentation/apache-httpasyncclient-4.0/src/test/groovy/ApacheHttpAsyncClientCallbackTest.groovy b/instrumentation/apache-httpasyncclient-4.0/src/test/groovy/ApacheHttpAsyncClientCallbackTest.groovy index 7a803a2fd49c..f59834f0896e 100644 --- a/instrumentation/apache-httpasyncclient-4.0/src/test/groovy/ApacheHttpAsyncClientCallbackTest.groovy +++ b/instrumentation/apache-httpasyncclient-4.0/src/test/groovy/ApacheHttpAsyncClientCallbackTest.groovy @@ -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 */ import io.opentelemetry.auto.test.base.HttpClientTest diff --git a/instrumentation/apache-httpasyncclient-4.0/src/test/groovy/ApacheHttpAsyncClientNullCallbackTest.groovy b/instrumentation/apache-httpasyncclient-4.0/src/test/groovy/ApacheHttpAsyncClientNullCallbackTest.groovy index d9f3fa78962c..24a06ee631ae 100644 --- a/instrumentation/apache-httpasyncclient-4.0/src/test/groovy/ApacheHttpAsyncClientNullCallbackTest.groovy +++ b/instrumentation/apache-httpasyncclient-4.0/src/test/groovy/ApacheHttpAsyncClientNullCallbackTest.groovy @@ -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 */ import io.opentelemetry.auto.test.base.HttpClientTest diff --git a/instrumentation/apache-httpasyncclient-4.0/src/test/groovy/ApacheHttpAsyncClientTest.groovy b/instrumentation/apache-httpasyncclient-4.0/src/test/groovy/ApacheHttpAsyncClientTest.groovy index cad38fa0f368..8d7b24032348 100644 --- a/instrumentation/apache-httpasyncclient-4.0/src/test/groovy/ApacheHttpAsyncClientTest.groovy +++ b/instrumentation/apache-httpasyncclient-4.0/src/test/groovy/ApacheHttpAsyncClientTest.groovy @@ -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 */ import io.opentelemetry.auto.test.base.HttpClientTest diff --git a/instrumentation/apache-httpasyncclient-4.0/src/test/groovy/HttpUriRequest.groovy b/instrumentation/apache-httpasyncclient-4.0/src/test/groovy/HttpUriRequest.groovy index b5cf7cfd399c..4a3c7bd57bb1 100644 --- a/instrumentation/apache-httpasyncclient-4.0/src/test/groovy/HttpUriRequest.groovy +++ b/instrumentation/apache-httpasyncclient-4.0/src/test/groovy/HttpUriRequest.groovy @@ -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 */ import org.apache.http.client.methods.HttpRequestBase diff --git a/instrumentation/apache-httpclient/apache-httpclient-2.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v2_0/CommonsHttpClientInstrumentation.java b/instrumentation/apache-httpclient/apache-httpclient-2.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v2_0/CommonsHttpClientInstrumentation.java index 2d1f7041960d..eda770051f86 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-2.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v2_0/CommonsHttpClientInstrumentation.java +++ b/instrumentation/apache-httpclient/apache-httpclient-2.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v2_0/CommonsHttpClientInstrumentation.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.apachehttpclient.v2_0; diff --git a/instrumentation/apache-httpclient/apache-httpclient-2.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v2_0/CommonsHttpClientTracer.java b/instrumentation/apache-httpclient/apache-httpclient-2.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v2_0/CommonsHttpClientTracer.java index 4ce1794426fb..537f298a3344 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-2.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v2_0/CommonsHttpClientTracer.java +++ b/instrumentation/apache-httpclient/apache-httpclient-2.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v2_0/CommonsHttpClientTracer.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.apachehttpclient.v2_0; diff --git a/instrumentation/apache-httpclient/apache-httpclient-2.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v2_0/HttpHeadersInjectAdapter.java b/instrumentation/apache-httpclient/apache-httpclient-2.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v2_0/HttpHeadersInjectAdapter.java index dae59e47d695..a68f42e3e23c 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-2.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v2_0/HttpHeadersInjectAdapter.java +++ b/instrumentation/apache-httpclient/apache-httpclient-2.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v2_0/HttpHeadersInjectAdapter.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.apachehttpclient.v2_0; diff --git a/instrumentation/apache-httpclient/apache-httpclient-2.0/src/test/groovy/CommonsHttpClientTest.groovy b/instrumentation/apache-httpclient/apache-httpclient-2.0/src/test/groovy/CommonsHttpClientTest.groovy index 6e677fea50b2..c662fbe38518 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-2.0/src/test/groovy/CommonsHttpClientTest.groovy +++ b/instrumentation/apache-httpclient/apache-httpclient-2.0/src/test/groovy/CommonsHttpClientTest.groovy @@ -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 */ import io.opentelemetry.auto.test.base.HttpClientTest diff --git a/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/ApacheHttpClientHelper.java b/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/ApacheHttpClientHelper.java index f63b72d6498f..d18c3ab64351 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/ApacheHttpClientHelper.java +++ b/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/ApacheHttpClientHelper.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.apachehttpclient.v4_0; diff --git a/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/ApacheHttpClientInstrumentation.java b/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/ApacheHttpClientInstrumentation.java index 17849880e67a..37505d958929 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/ApacheHttpClientInstrumentation.java +++ b/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/ApacheHttpClientInstrumentation.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.apachehttpclient.v4_0; diff --git a/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/ApacheHttpClientTracer.java b/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/ApacheHttpClientTracer.java index 327e83988f50..400705c738b4 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/ApacheHttpClientTracer.java +++ b/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/ApacheHttpClientTracer.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.apachehttpclient.v4_0; diff --git a/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/HostAndRequestAsHttpUriRequest.java b/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/HostAndRequestAsHttpUriRequest.java index 3b29fecccd96..0539fb3bf901 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/HostAndRequestAsHttpUriRequest.java +++ b/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/HostAndRequestAsHttpUriRequest.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.apachehttpclient.v4_0; diff --git a/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/HttpHeadersInjectAdapter.java b/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/HttpHeadersInjectAdapter.java index 630e07b80aa5..2807af95f7bb 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/HttpHeadersInjectAdapter.java +++ b/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/HttpHeadersInjectAdapter.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.apachehttpclient.v4_0; diff --git a/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/WrappingStatusSettingResponseHandler.java b/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/WrappingStatusSettingResponseHandler.java index 48c78ffac65e..cc32378ccfdc 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/WrappingStatusSettingResponseHandler.java +++ b/instrumentation/apache-httpclient/apache-httpclient-4.0/src/main/java/io/opentelemetry/instrumentation/auto/apachehttpclient/v4_0/WrappingStatusSettingResponseHandler.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.apachehttpclient.v4_0; diff --git a/instrumentation/apache-httpclient/apache-httpclient-4.0/src/test/groovy/ApacheHttpClientResponseHandlerTest.groovy b/instrumentation/apache-httpclient/apache-httpclient-4.0/src/test/groovy/ApacheHttpClientResponseHandlerTest.groovy index 046946e5048f..e3e394dca7e8 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-4.0/src/test/groovy/ApacheHttpClientResponseHandlerTest.groovy +++ b/instrumentation/apache-httpclient/apache-httpclient-4.0/src/test/groovy/ApacheHttpClientResponseHandlerTest.groovy @@ -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 */ import io.opentelemetry.auto.test.base.HttpClientTest diff --git a/instrumentation/apache-httpclient/apache-httpclient-4.0/src/test/groovy/ApacheHttpClientTest.groovy b/instrumentation/apache-httpclient/apache-httpclient-4.0/src/test/groovy/ApacheHttpClientTest.groovy index 531f6d336b45..84dbd4fbfaa8 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-4.0/src/test/groovy/ApacheHttpClientTest.groovy +++ b/instrumentation/apache-httpclient/apache-httpclient-4.0/src/test/groovy/ApacheHttpClientTest.groovy @@ -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 */ import io.opentelemetry.auto.test.base.HttpClientTest diff --git a/instrumentation/apache-httpclient/apache-httpclient-4.0/src/test/groovy/HttpUriRequest.groovy b/instrumentation/apache-httpclient/apache-httpclient-4.0/src/test/groovy/HttpUriRequest.groovy index b5cf7cfd399c..4a3c7bd57bb1 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-4.0/src/test/groovy/HttpUriRequest.groovy +++ b/instrumentation/apache-httpclient/apache-httpclient-4.0/src/test/groovy/HttpUriRequest.groovy @@ -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 */ import org.apache.http.client.methods.HttpRequestBase diff --git a/instrumentation/armeria-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/armeria/v1_0/AbstractArmeriaInstrumentation.java b/instrumentation/armeria-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/armeria/v1_0/AbstractArmeriaInstrumentation.java index 6fe1e1a68ace..5974f446cda9 100644 --- a/instrumentation/armeria-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/armeria/v1_0/AbstractArmeriaInstrumentation.java +++ b/instrumentation/armeria-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/armeria/v1_0/AbstractArmeriaInstrumentation.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.armeria.v1_0; diff --git a/instrumentation/armeria-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaDecorators.java b/instrumentation/armeria-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaDecorators.java index e0ab0f8bf74b..4fa464a5748a 100644 --- a/instrumentation/armeria-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaDecorators.java +++ b/instrumentation/armeria-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaDecorators.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.armeria.v1_0; diff --git a/instrumentation/armeria-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaServerBuilderInstrumentation.java b/instrumentation/armeria-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaServerBuilderInstrumentation.java index 3ee77bb5d803..69be97fd81f6 100644 --- a/instrumentation/armeria-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaServerBuilderInstrumentation.java +++ b/instrumentation/armeria-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaServerBuilderInstrumentation.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.armeria.v1_0; diff --git a/instrumentation/armeria-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaServerInstrumentation.java b/instrumentation/armeria-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaServerInstrumentation.java index 901f65e9e683..9356da74721b 100644 --- a/instrumentation/armeria-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaServerInstrumentation.java +++ b/instrumentation/armeria-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaServerInstrumentation.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.armeria.v1_0; diff --git a/instrumentation/armeria-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaWebClientBuilderInstrumentation.java b/instrumentation/armeria-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaWebClientBuilderInstrumentation.java index eace2cc68a92..54d22778cf7e 100644 --- a/instrumentation/armeria-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaWebClientBuilderInstrumentation.java +++ b/instrumentation/armeria-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaWebClientBuilderInstrumentation.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.armeria.v1_0; diff --git a/instrumentation/armeria-1.0/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaNoDuplicateInstrumentationTest.groovy b/instrumentation/armeria-1.0/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaNoDuplicateInstrumentationTest.groovy index de7bb0ba8046..ca98a3eeabb5 100644 --- a/instrumentation/armeria-1.0/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaNoDuplicateInstrumentationTest.groovy +++ b/instrumentation/armeria-1.0/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaNoDuplicateInstrumentationTest.groovy @@ -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.armeria.v1_0 diff --git a/instrumentation/armeria-1.0/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaTest.groovy b/instrumentation/armeria-1.0/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaTest.groovy index de65b65591f7..da3c04a7b2ff 100644 --- a/instrumentation/armeria-1.0/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaTest.groovy +++ b/instrumentation/armeria-1.0/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/armeria/v1_0/ArmeriaTest.groovy @@ -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.armeria.v1_0 diff --git a/instrumentation/armeria-1.0/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_0/client/ArmeriaClientTracer.java b/instrumentation/armeria-1.0/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_0/client/ArmeriaClientTracer.java index 4b98f083cb37..9a4f0a7bb07b 100644 --- a/instrumentation/armeria-1.0/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_0/client/ArmeriaClientTracer.java +++ b/instrumentation/armeria-1.0/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_0/client/ArmeriaClientTracer.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.armeria.v1_0.client; diff --git a/instrumentation/armeria-1.0/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_0/client/OpenTelemetryClient.java b/instrumentation/armeria-1.0/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_0/client/OpenTelemetryClient.java index c3f17a9408e9..34866d721144 100644 --- a/instrumentation/armeria-1.0/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_0/client/OpenTelemetryClient.java +++ b/instrumentation/armeria-1.0/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_0/client/OpenTelemetryClient.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.armeria.v1_0.client; diff --git a/instrumentation/armeria-1.0/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_0/server/ArmeriaServerTracer.java b/instrumentation/armeria-1.0/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_0/server/ArmeriaServerTracer.java index 2e8f5f65e249..240367546bc6 100644 --- a/instrumentation/armeria-1.0/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_0/server/ArmeriaServerTracer.java +++ b/instrumentation/armeria-1.0/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_0/server/ArmeriaServerTracer.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.armeria.v1_0.server; diff --git a/instrumentation/armeria-1.0/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_0/server/OpenTelemetryService.java b/instrumentation/armeria-1.0/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_0/server/OpenTelemetryService.java index 03c58da0356b..83ab7ffd3dad 100644 --- a/instrumentation/armeria-1.0/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_0/server/OpenTelemetryService.java +++ b/instrumentation/armeria-1.0/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_0/server/OpenTelemetryService.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.armeria.v1_0.server; diff --git a/instrumentation/armeria-1.0/library/src/test/groovy/io/opentelemetry/instrumentation/armeria/v1_0/ArmeriaTest.groovy b/instrumentation/armeria-1.0/library/src/test/groovy/io/opentelemetry/instrumentation/armeria/v1_0/ArmeriaTest.groovy index 722e742b52c3..65781187c021 100644 --- a/instrumentation/armeria-1.0/library/src/test/groovy/io/opentelemetry/instrumentation/armeria/v1_0/ArmeriaTest.groovy +++ b/instrumentation/armeria-1.0/library/src/test/groovy/io/opentelemetry/instrumentation/armeria/v1_0/ArmeriaTest.groovy @@ -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.armeria.v1_0 diff --git a/instrumentation/armeria-1.0/testing/src/main/groovy/io/opentelemetry/instrumentation/armeria/v1_0/AbstractArmeriaTest.groovy b/instrumentation/armeria-1.0/testing/src/main/groovy/io/opentelemetry/instrumentation/armeria/v1_0/AbstractArmeriaTest.groovy index edabce4951c0..501ba20d48e8 100644 --- a/instrumentation/armeria-1.0/testing/src/main/groovy/io/opentelemetry/instrumentation/armeria/v1_0/AbstractArmeriaTest.groovy +++ b/instrumentation/armeria-1.0/testing/src/main/groovy/io/opentelemetry/instrumentation/armeria/v1_0/AbstractArmeriaTest.groovy @@ -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.armeria.v1_0 @@ -64,10 +53,10 @@ abstract class AbstractArmeriaTest extends InstrumentationSpecification { assertTraces(1) { trace(0, 2) { span(0) { - operationName("HTTP ${method}") - spanKind CLIENT + name("HTTP ${method}") + kind CLIENT errored code != 200 - parent() + hasNoParent() attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -81,8 +70,8 @@ abstract class AbstractArmeriaTest extends InstrumentationSpecification { } } span(1) { - operationName(spanName) - spanKind SERVER + name(spanName) + kind SERVER childOf span(0) errored code != 200 if (path == "/exception") { diff --git a/instrumentation/aws-lambda-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/awslambda/v1_0/AbstractAwsLambdaInstrumentation.java b/instrumentation/aws-lambda-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/awslambda/v1_0/AbstractAwsLambdaInstrumentation.java index 2e0d3e441ea2..8ed68b47396a 100644 --- a/instrumentation/aws-lambda-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/awslambda/v1_0/AbstractAwsLambdaInstrumentation.java +++ b/instrumentation/aws-lambda-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/awslambda/v1_0/AbstractAwsLambdaInstrumentation.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.awslambda.v1_0; @@ -30,7 +19,8 @@ public final String[] helperClassNames() { packageName + ".AwsLambdaInstrumentationHelper", "io.opentelemetry.instrumentation.awslambda.v1_0.AwsLambdaTracer", "io.opentelemetry.instrumentation.awslambda.v1_0.AwsLambdaMessageTracer", - "io.opentelemetry.instrumentation.awslambda.v1_0.AwsLambdaMessageTracer$MapGetter" + "io.opentelemetry.instrumentation.awslambda.v1_0.AwsLambdaUtil", + "io.opentelemetry.instrumentation.awslambda.v1_0.AwsLambdaUtil$MapGetter" }; } } diff --git a/instrumentation/aws-lambda-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/awslambda/v1_0/AwsLambdaInstrumentationHelper.java b/instrumentation/aws-lambda-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/awslambda/v1_0/AwsLambdaInstrumentationHelper.java index 62d7a8cb23c2..0f520e738434 100644 --- a/instrumentation/aws-lambda-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/awslambda/v1_0/AwsLambdaInstrumentationHelper.java +++ b/instrumentation/aws-lambda-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/awslambda/v1_0/AwsLambdaInstrumentationHelper.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.awslambda.v1_0; diff --git a/instrumentation/aws-lambda-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/awslambda/v1_0/AwsLambdaRequestHandlerInstrumentation.java b/instrumentation/aws-lambda-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/awslambda/v1_0/AwsLambdaRequestHandlerInstrumentation.java index 76862c7df4c3..aaa30b3316f5 100644 --- a/instrumentation/aws-lambda-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/awslambda/v1_0/AwsLambdaRequestHandlerInstrumentation.java +++ b/instrumentation/aws-lambda-1.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/awslambda/v1_0/AwsLambdaRequestHandlerInstrumentation.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.awslambda.v1_0; diff --git a/instrumentation/aws-lambda-1.0/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/awslambda/v1_0/AwsLambdaSqsHandlerTest.groovy b/instrumentation/aws-lambda-1.0/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/awslambda/v1_0/AwsLambdaSqsHandlerTest.groovy index 7cac80334c68..9a14e32b2765 100644 --- a/instrumentation/aws-lambda-1.0/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/awslambda/v1_0/AwsLambdaSqsHandlerTest.groovy +++ b/instrumentation/aws-lambda-1.0/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/awslambda/v1_0/AwsLambdaSqsHandlerTest.groovy @@ -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.awslambda.v1_0 diff --git a/instrumentation/aws-lambda-1.0/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/awslambda/v1_0/AwsLambdaTest.groovy b/instrumentation/aws-lambda-1.0/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/awslambda/v1_0/AwsLambdaTest.groovy index 23d76da367ad..7e80080d09bb 100644 --- a/instrumentation/aws-lambda-1.0/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/awslambda/v1_0/AwsLambdaTest.groovy +++ b/instrumentation/aws-lambda-1.0/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/awslambda/v1_0/AwsLambdaTest.groovy @@ -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.awslambda.v1_0 diff --git a/instrumentation/aws-lambda-1.0/library/README.md b/instrumentation/aws-lambda-1.0/library/README.md index 06edd0eaa8ed..0280cc76a20a 100644 --- a/instrumentation/aws-lambda-1.0/library/README.md +++ b/instrumentation/aws-lambda-1.0/library/README.md @@ -43,28 +43,6 @@ Maven: ``` -And in your code as early as possible, configure the `AwsXrayPropagator` along with any other -propagators you use. If in doubt, you can configure X-Ray along with the default W3C propagator like -this in a static block of your handler. - -```java -class MyRequestHandler extends TracingRequestHandler { - - static { - OpenTelemetry.setPropagators( - DefaultContextPropagators.builder() - .addTextMapPropagator(HttpTraceContext.getInstance()) - .addTextMapPropagator(AwsXrayPropagator.getInstance()) - .build()); - } - - @Override - protected String doHandleRequest(String input, Context context) { - // logic - } -} -``` - ## SQS Handler This package provides a special handler for SQS-triggered functions to include messaging data. @@ -94,3 +72,35 @@ public class MyBatchHandler extends TracingSQSEventHandler { } } ``` + +## Trace propagation + +This instrumentation supports propagating traces using the `X-Amzn-Trace-Id` format for both normal +requests and SQS requests. To enable this propagation, in your code as early as possible, +configure the `AwsXrayPropagator` along with any other propagators you use. If in doubt, you can +configure X-Ray along with the default W3C propagator like this in a static block of your handler. + +```java +class MyRequestHandler extends TracingRequestHandler { + + static { + OpenTelemetry.setPropagators( + DefaultContextPropagators.builder() + .addTextMapPropagator(HttpTraceContext.getInstance()) + .addTextMapPropagator(AwsXrayPropagator.getInstance()) + .build()); + } + + @Override + protected String doHandleRequest(String input, Context context) { + // logic + } +} +``` + +If you are using this instrumentation with SQS, you should always enable the `AwsXrayPropagator` to +allow linking between messages in a backend-agnostic way. + +Otherwise, only enable the above if you are using AWS X-Ray as your tracing backend. You should not +enable the X-Ray propagator if you are not using X-Ray as it will cause the spans in Lambda to not +have the correct parent/child connection between client and server spans. diff --git a/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaMessageTracer.java b/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaMessageTracer.java index 4fb21c3b7c8c..2aa766a4bda2 100644 --- a/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaMessageTracer.java +++ b/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaMessageTracer.java @@ -1,27 +1,13 @@ /* * 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.awslambda.v1_0; import com.amazonaws.services.lambda.runtime.events.SQSEvent; import com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage; -import io.grpc.Context; -import io.opentelemetry.OpenTelemetry; import io.opentelemetry.context.Scope; -import io.opentelemetry.context.propagation.TextMapPropagator.Getter; import io.opentelemetry.instrumentation.api.tracer.BaseTracer; import io.opentelemetry.trace.Span; import io.opentelemetry.trace.Span.Kind; @@ -29,12 +15,9 @@ import io.opentelemetry.trace.Tracer; import io.opentelemetry.trace.TracingContextUtils; import io.opentelemetry.trace.attributes.SemanticAttributes; -import java.util.Collections; -import java.util.Map; public class AwsLambdaMessageTracer extends BaseTracer { - private static final String AWS_TRACE_HEADER_PROPAGATOR_KEY = "X-Amzn-Trace-Id"; private static final String AWS_TRACE_HEADER_SQS_ATTRIBUTE_KEY = "AWSTraceHeader"; public AwsLambdaMessageTracer() {} @@ -93,32 +76,14 @@ public Scope startScope(Span span) { private void addLinkToMessageParent(SQSMessage message, Span.Builder span) { String parentHeader = message.getAttributes().get(AWS_TRACE_HEADER_SQS_ATTRIBUTE_KEY); if (parentHeader != null) { - SpanContext parentCtx = TracingContextUtils.getSpan(extractParent(parentHeader)).getContext(); + SpanContext parentCtx = + TracingContextUtils.getSpan(AwsLambdaUtil.extractParent(parentHeader)).getContext(); if (parentCtx.isValid()) { span.addLink(parentCtx); } } } - private static Context extractParent(String parentHeader) { - return OpenTelemetry.getPropagators() - .getTextMapPropagator() - .extract( - Context.current(), - Collections.singletonMap(AWS_TRACE_HEADER_PROPAGATOR_KEY, parentHeader), - MapGetter.INSTANCE); - } - - private static class MapGetter implements Getter> { - - private static final MapGetter INSTANCE = new MapGetter(); - - @Override - public String get(Map map, String s) { - return map.get(s); - } - } - @Override protected String getInstrumentationName() { return "io.opentelemetry.aws-lambda-1.0"; diff --git a/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaTracer.java b/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaTracer.java index 6b823674705b..3664d1a7b070 100644 --- a/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaTracer.java +++ b/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaTracer.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.awslambda.v1_0; @@ -29,6 +18,8 @@ public class AwsLambdaTracer extends BaseTracer { + private static final String AWS_TRACE_HEADER_ENV_KEY = "_X_AMZN_TRACE_ID"; + public AwsLambdaTracer() {} public AwsLambdaTracer(Tracer tracer) { @@ -38,6 +29,12 @@ public AwsLambdaTracer(Tracer tracer) { Span.Builder createSpan(Context context) { Span.Builder span = tracer.spanBuilder(context.getFunctionName()); span.setAttribute(SemanticAttributes.FAAS_EXECUTION, context.getAwsRequestId()); + + String parentTraceHeader = System.getenv(AWS_TRACE_HEADER_ENV_KEY); + if (parentTraceHeader != null) { + span.setParent(AwsLambdaUtil.extractParent(parentTraceHeader)); + } + return span; } diff --git a/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaUtil.java b/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaUtil.java new file mode 100644 index 000000000000..12ae233859b6 --- /dev/null +++ b/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaUtil.java @@ -0,0 +1,37 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.instrumentation.awslambda.v1_0; + +import io.grpc.Context; +import io.opentelemetry.OpenTelemetry; +import io.opentelemetry.context.propagation.TextMapPropagator.Getter; +import java.util.Collections; +import java.util.Map; + +final class AwsLambdaUtil { + private static final String AWS_TRACE_HEADER_PROPAGATOR_KEY = "X-Amzn-Trace-Id"; + + static Context extractParent(String parentHeader) { + return OpenTelemetry.getPropagators() + .getTextMapPropagator() + .extract( + Context.current(), + Collections.singletonMap(AWS_TRACE_HEADER_PROPAGATOR_KEY, parentHeader), + MapGetter.INSTANCE); + } + + private static class MapGetter implements Getter> { + + private static final MapGetter INSTANCE = new MapGetter(); + + @Override + public String get(Map map, String s) { + return map.get(s); + } + } + + private AwsLambdaUtil() {} +} diff --git a/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/TracingRequestHandler.java b/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/TracingRequestHandler.java index 532bf85f043b..aad31bdfc0d3 100644 --- a/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/TracingRequestHandler.java +++ b/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/TracingRequestHandler.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.awslambda.v1_0; @@ -68,7 +57,7 @@ public final O handleRequest(I input, Context context) { } else { tracer.end(span); } - OpenTelemetrySdk.getTracerProvider().forceFlush().join(1, TimeUnit.SECONDS); + OpenTelemetrySdk.getTracerManagement().forceFlush().join(1, TimeUnit.SECONDS); } } diff --git a/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/TracingSQSEventHandler.java b/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/TracingSQSEventHandler.java index bdb0a1fecf3f..6985281868da 100644 --- a/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/TracingSQSEventHandler.java +++ b/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/TracingSQSEventHandler.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.awslambda.v1_0; @@ -64,7 +53,7 @@ public Void doHandleRequest(SQSEvent event, Context context) { } else { tracer.end(span); } - OpenTelemetrySdk.getTracerProvider().forceFlush().join(1, TimeUnit.SECONDS); + OpenTelemetrySdk.getTracerManagement().forceFlush().join(1, TimeUnit.SECONDS); } return null; } diff --git a/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/TracingSQSMessageHandler.java b/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/TracingSQSMessageHandler.java index d006318e025e..9af41232d202 100644 --- a/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/TracingSQSMessageHandler.java +++ b/instrumentation/aws-lambda-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/TracingSQSMessageHandler.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.awslambda.v1_0; diff --git a/instrumentation/aws-lambda-1.0/library/src/test/groovy/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaSqsHandlerTest.groovy b/instrumentation/aws-lambda-1.0/library/src/test/groovy/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaSqsHandlerTest.groovy index c6601c6768e8..6ea22212a172 100644 --- a/instrumentation/aws-lambda-1.0/library/src/test/groovy/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaSqsHandlerTest.groovy +++ b/instrumentation/aws-lambda-1.0/library/src/test/groovy/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaSqsHandlerTest.groovy @@ -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.awslambda.v1_0 diff --git a/instrumentation/aws-lambda-1.0/library/src/test/groovy/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaSqsMessageHandlerTest.groovy b/instrumentation/aws-lambda-1.0/library/src/test/groovy/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaSqsMessageHandlerTest.groovy index 062e6faa6b73..694abc475ef1 100644 --- a/instrumentation/aws-lambda-1.0/library/src/test/groovy/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaSqsMessageHandlerTest.groovy +++ b/instrumentation/aws-lambda-1.0/library/src/test/groovy/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaSqsMessageHandlerTest.groovy @@ -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.awslambda.v1_0 @@ -74,16 +63,16 @@ class AwsLambdaSqsMessageHandlerTest extends InstrumentationSpecification implem assertTraces(1) { trace(0, 4) { span(0) { - operationName("my_function") - spanKind SERVER + name("my_function") + kind SERVER attributes { "${SemanticAttributes.FAAS_EXECUTION.key}" "1-22-333" } } span(1) { - operationName("queue1 process") - spanKind CONSUMER - parentId(span(0).spanId) + name("queue1 process") + kind CONSUMER + parentSpanId(span(0).spanId) attributes { "${SemanticAttributes.MESSAGING_SYSTEM.key}" "AmazonSQS" "${SemanticAttributes.MESSAGING_OPERATION.key}" "process" @@ -92,9 +81,9 @@ class AwsLambdaSqsMessageHandlerTest extends InstrumentationSpecification implem hasLink("5759e988bd862e3fe1be46a994272793", "53995c3f42cd8ad9") } span(2) { - operationName("queue1 process") - spanKind CONSUMER - parentId(span(1).spanId) + name("queue1 process") + kind CONSUMER + parentSpanId(span(1).spanId) attributes { "${SemanticAttributes.MESSAGING_SYSTEM.key}" "AmazonSQS" "${SemanticAttributes.MESSAGING_OPERATION.key}" "process" @@ -104,9 +93,9 @@ class AwsLambdaSqsMessageHandlerTest extends InstrumentationSpecification implem hasLink("5759e988bd862e3fe1be46a994272793", "53995c3f42cd8ad8") } span(3) { - operationName("queue1 process") - spanKind CONSUMER - parentId(span(1).spanId) + name("queue1 process") + kind CONSUMER + parentSpanId(span(1).spanId) attributes { "${SemanticAttributes.MESSAGING_SYSTEM.key}" "AmazonSQS" "${SemanticAttributes.MESSAGING_OPERATION.key}" "process" diff --git a/instrumentation/aws-lambda-1.0/library/src/test/groovy/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaTest.groovy b/instrumentation/aws-lambda-1.0/library/src/test/groovy/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaTest.groovy index d34eda792414..ef21b8f0a48d 100644 --- a/instrumentation/aws-lambda-1.0/library/src/test/groovy/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaTest.groovy +++ b/instrumentation/aws-lambda-1.0/library/src/test/groovy/io/opentelemetry/instrumentation/awslambda/v1_0/AwsLambdaTest.groovy @@ -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.awslambda.v1_0 diff --git a/instrumentation/aws-lambda-1.0/testing/aws-lambda-1.0-testing.gradle b/instrumentation/aws-lambda-1.0/testing/aws-lambda-1.0-testing.gradle index f0f4c51b4373..aec56779d436 100644 --- a/instrumentation/aws-lambda-1.0/testing/aws-lambda-1.0-testing.gradle +++ b/instrumentation/aws-lambda-1.0/testing/aws-lambda-1.0-testing.gradle @@ -28,4 +28,5 @@ dependencies { implementation deps.opentelemetryApi implementation deps.opentelemetryTraceProps implementation deps.spock + implementation deps.systemLambda } diff --git a/instrumentation/aws-lambda-1.0/testing/src/main/groovy/io/opentelemetry/instrumentation/awslambda/v1_0/AbstractAwsLambdaRequestHandlerTest.groovy b/instrumentation/aws-lambda-1.0/testing/src/main/groovy/io/opentelemetry/instrumentation/awslambda/v1_0/AbstractAwsLambdaRequestHandlerTest.groovy index d58c4da1138b..d6e8fb14f501 100644 --- a/instrumentation/aws-lambda-1.0/testing/src/main/groovy/io/opentelemetry/instrumentation/awslambda/v1_0/AbstractAwsLambdaRequestHandlerTest.groovy +++ b/instrumentation/aws-lambda-1.0/testing/src/main/groovy/io/opentelemetry/instrumentation/awslambda/v1_0/AbstractAwsLambdaRequestHandlerTest.groovy @@ -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.awslambda.v1_0 @@ -20,11 +9,25 @@ import static io.opentelemetry.trace.Span.Kind.SERVER import com.amazonaws.services.lambda.runtime.Context import com.amazonaws.services.lambda.runtime.RequestHandler +import com.github.stefanbirkner.systemlambda.SystemLambda +import io.opentelemetry.OpenTelemetry import io.opentelemetry.auto.test.InstrumentationSpecification +import io.opentelemetry.context.propagation.DefaultContextPropagators +import io.opentelemetry.extensions.trace.propagation.AwsXRayPropagator import io.opentelemetry.trace.attributes.SemanticAttributes +import io.opentelemetry.trace.propagation.HttpTraceContext abstract class AbstractAwsLambdaRequestHandlerTest extends InstrumentationSpecification { + // Lambda instrumentation requires XRay propagator to be enabled. + static { + def propagators = DefaultContextPropagators.builder() + .addTextMapPropagator(HttpTraceContext.instance) + .addTextMapPropagator(AwsXRayPropagator.instance) + .build() + OpenTelemetry.setPropagators(propagators) + } + protected static String doHandleRequest(String input, Context context) { if (input == "hello") { return "world" @@ -47,8 +50,8 @@ abstract class AbstractAwsLambdaRequestHandlerTest extends InstrumentationSpecif assertTraces(1) { trace(0, 1) { span(0) { - operationName("my_function") - spanKind SERVER + name("my_function") + kind SERVER attributes { "${SemanticAttributes.FAAS_EXECUTION.key}" "1-22-333" } @@ -75,8 +78,8 @@ abstract class AbstractAwsLambdaRequestHandlerTest extends InstrumentationSpecif assertTraces(1) { trace(0, 1) { span(0) { - operationName("my_function") - spanKind SERVER + name("my_function") + kind SERVER errored true errorEvent(IllegalArgumentException, "bad argument") attributes { @@ -86,4 +89,33 @@ abstract class AbstractAwsLambdaRequestHandlerTest extends InstrumentationSpecif } } } + + def "handler links to lambda trace"() { + when: + def context = Mock(Context) + context.getFunctionName() >> "my_function" + context.getAwsRequestId() >> "1-22-333" + + def result + SystemLambda.withEnvironmentVariable("_X_AMZN_TRACE_ID", "Root=1-8a3c60f7-d188f8fa79d48a391a778fa6;Parent=0000000000000456;Sampled=1") + .execute({ + result = handler().handleRequest("hello", context) + }) + + then: + result == "world" + assertTraces(1) { + trace(0, 1) { + span(0) { + name("my_function") + kind SERVER + parentSpanId("0000000000000456") + traceId("8a3c60f7d188f8fa79d48a391a778fa6") + attributes { + "${SemanticAttributes.FAAS_EXECUTION.key}" "1-22-333" + } + } + } + } + } } diff --git a/instrumentation/aws-lambda-1.0/testing/src/main/groovy/io/opentelemetry/instrumentation/awslambda/v1_0/AbstractAwsLambdaSqsHandlerTest.groovy b/instrumentation/aws-lambda-1.0/testing/src/main/groovy/io/opentelemetry/instrumentation/awslambda/v1_0/AbstractAwsLambdaSqsHandlerTest.groovy index 32f0eef84743..5845ecd29737 100644 --- a/instrumentation/aws-lambda-1.0/testing/src/main/groovy/io/opentelemetry/instrumentation/awslambda/v1_0/AbstractAwsLambdaSqsHandlerTest.groovy +++ b/instrumentation/aws-lambda-1.0/testing/src/main/groovy/io/opentelemetry/instrumentation/awslambda/v1_0/AbstractAwsLambdaSqsHandlerTest.groovy @@ -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.awslambda.v1_0 @@ -69,16 +58,16 @@ abstract class AbstractAwsLambdaSqsHandlerTest extends InstrumentationSpecificat assertTraces(1) { trace(0, 2) { span(0) { - operationName("my_function") - spanKind SERVER + name("my_function") + kind SERVER attributes { "${SemanticAttributes.FAAS_EXECUTION.key}" "1-22-333" } } span(1) { - operationName("queue1 process") - spanKind CONSUMER - parentId(span(0).spanId) + name("queue1 process") + kind CONSUMER + parentSpanId(span(0).spanId) attributes { "${SemanticAttributes.MESSAGING_SYSTEM.key}" "AmazonSQS" "${SemanticAttributes.MESSAGING_OPERATION.key}" "process" @@ -114,16 +103,16 @@ abstract class AbstractAwsLambdaSqsHandlerTest extends InstrumentationSpecificat assertTraces(1) { trace(0, 2) { span(0) { - operationName("my_function") - spanKind SERVER + name("my_function") + kind SERVER attributes { "${SemanticAttributes.FAAS_EXECUTION.key}" "1-22-333" } } span(1) { - operationName("multiple_sources process") - spanKind CONSUMER - parentId(span(0).spanId) + name("multiple_sources process") + kind CONSUMER + parentSpanId(span(0).spanId) attributes { "${SemanticAttributes.MESSAGING_SYSTEM.key}" "AmazonSQS" "${SemanticAttributes.MESSAGING_OPERATION.key}" "process" diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/AWSClientInstrumentation.java b/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/AWSClientInstrumentation.java index ffc0329f8413..cf5d06c9e117 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/AWSClientInstrumentation.java +++ b/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/AWSClientInstrumentation.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.awssdk.v1_11; diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/AWSHttpClientInstrumentation.java b/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/AWSHttpClientInstrumentation.java index 0abe33e2dde4..d623f9c5b5a8 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/AWSHttpClientInstrumentation.java +++ b/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/AWSHttpClientInstrumentation.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.awssdk.v1_11; diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/AwsSdkClientTracer.java b/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/AwsSdkClientTracer.java index 29985325176f..5e9a6514c9dd 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/AwsSdkClientTracer.java +++ b/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/AwsSdkClientTracer.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.awssdk.v1_11; diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/RequestInstrumentation.java b/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/RequestInstrumentation.java index 065aa2039e09..8689662cc75f 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/RequestInstrumentation.java +++ b/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/RequestInstrumentation.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.awssdk.v1_11; diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/RequestMeta.java b/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/RequestMeta.java index 8ee991763c6b..c2036532b2bc 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/RequestMeta.java +++ b/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/RequestMeta.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.awssdk.v1_11; diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/TracingRequestHandler.java b/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/TracingRequestHandler.java index aa7bc62b9d51..eda9bbce00cc 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/TracingRequestHandler.java +++ b/instrumentation/aws-sdk/aws-sdk-1.11/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v1_11/TracingRequestHandler.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.awssdk.v1_11; diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/src/test/groovy/AWS1ClientTest.groovy b/instrumentation/aws-sdk/aws-sdk-1.11/src/test/groovy/AWS1ClientTest.groovy index 6fc03a5bff65..a2fc20434e7d 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/src/test/groovy/AWS1ClientTest.groovy +++ b/instrumentation/aws-sdk/aws-sdk-1.11/src/test/groovy/AWS1ClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.server.http.TestHttpServer.httpServer @@ -147,10 +136,10 @@ class AWS1ClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "$service.$operation" - spanKind CLIENT + name "$service.$operation" + kind CLIENT errored false - parent() + hasNoParent() attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" "${SemanticAttributes.HTTP_URL.key()}" "$server.address" @@ -223,11 +212,11 @@ class AWS1ClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "$service.$operation" - spanKind CLIENT + name "$service.$operation" + kind CLIENT errored true errorEvent SdkClientException, ~/Unable to execute HTTP request/ - parent() + hasNoParent() attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" "${SemanticAttributes.HTTP_URL.key()}" "http://localhost:${UNUSABLE_PORT}" @@ -271,11 +260,11 @@ class AWS1ClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "S3.HeadBucket" - spanKind CLIENT + name "S3.HeadBucket" + kind CLIENT errored true errorEvent RuntimeException, "bad handler" - parent() + hasNoParent() attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" "${SemanticAttributes.HTTP_URL.key()}" "https://s3.amazonaws.com" @@ -316,15 +305,15 @@ class AWS1ClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "S3.GetObject" - spanKind CLIENT + name "S3.GetObject" + kind CLIENT errored true try { errorEvent AmazonClientException, ~/Unable to execute HTTP request/ } catch (AssertionError e) { errorEvent SdkClientException, "Unable to execute HTTP request: Request did not complete before the request timeout configuration." } - parent() + hasNoParent() attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" "${SemanticAttributes.HTTP_URL.key()}" "$server.address" diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/src/test_before_1_11_106/groovy/AWS0ClientTest.groovy b/instrumentation/aws-sdk/aws-sdk-1.11/src/test_before_1_11_106/groovy/AWS0ClientTest.groovy index 8666ebf8efd5..ebe5711f5c02 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/src/test_before_1_11_106/groovy/AWS0ClientTest.groovy +++ b/instrumentation/aws-sdk/aws-sdk-1.11/src/test_before_1_11_106/groovy/AWS0ClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.server.http.TestHttpServer.httpServer @@ -110,10 +99,10 @@ class AWS0ClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "$service.$operation" - spanKind CLIENT + name "$service.$operation" + kind CLIENT errored false - parent() + hasNoParent() attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" "${SemanticAttributes.HTTP_URL.key()}" "$server.address" @@ -168,11 +157,11 @@ class AWS0ClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "$service.$operation" - spanKind CLIENT + name "$service.$operation" + kind CLIENT errored true errorEvent AmazonClientException, ~/Unable to execute HTTP request/ - parent() + hasNoParent() attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" "${SemanticAttributes.HTTP_URL.key()}" "http://localhost:${UNUSABLE_PORT}" @@ -216,11 +205,11 @@ class AWS0ClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "S3.GetObject" - spanKind CLIENT + name "S3.GetObject" + kind CLIENT errored true errorEvent RuntimeException, "bad handler" - parent() + hasNoParent() attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" "${SemanticAttributes.HTTP_URL.key()}" "https://s3.amazonaws.com" @@ -262,11 +251,11 @@ class AWS0ClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "S3.GetObject" - spanKind CLIENT + name "S3.GetObject" + kind CLIENT errored true errorEvent AmazonClientException, ~/Unable to execute HTTP request/ - parent() + hasNoParent() attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" "${SemanticAttributes.HTTP_URL.key()}" "$server.address" diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/auto/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v2_2/AbstractAwsClientInstrumentation.java b/instrumentation/aws-sdk/aws-sdk-2.2/auto/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v2_2/AbstractAwsClientInstrumentation.java index a5fadac6ba80..e24350a039c0 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/auto/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v2_2/AbstractAwsClientInstrumentation.java +++ b/instrumentation/aws-sdk/aws-sdk-2.2/auto/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v2_2/AbstractAwsClientInstrumentation.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.awssdk.v2_2; diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/auto/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v2_2/AwsClientInstrumentation.java b/instrumentation/aws-sdk/aws-sdk-2.2/auto/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v2_2/AwsClientInstrumentation.java index 7a2dd5ec9fe3..c14363ffaa27 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/auto/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v2_2/AwsClientInstrumentation.java +++ b/instrumentation/aws-sdk/aws-sdk-2.2/auto/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v2_2/AwsClientInstrumentation.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.awssdk.v2_2; diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/auto/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v2_2/AwsHttpClientInstrumentation.java b/instrumentation/aws-sdk/aws-sdk-2.2/auto/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v2_2/AwsHttpClientInstrumentation.java index e603a44362c0..9fe8fa141f0a 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/auto/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v2_2/AwsHttpClientInstrumentation.java +++ b/instrumentation/aws-sdk/aws-sdk-2.2/auto/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v2_2/AwsHttpClientInstrumentation.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.awssdk.v2_2; diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/auto/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v2_2/TracingExecutionInterceptor.java b/instrumentation/aws-sdk/aws-sdk-2.2/auto/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v2_2/TracingExecutionInterceptor.java index 6fbf1aa04072..749526f1d4bc 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/auto/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v2_2/TracingExecutionInterceptor.java +++ b/instrumentation/aws-sdk/aws-sdk-2.2/auto/src/main/java/io/opentelemetry/instrumentation/auto/awssdk/v2_2/TracingExecutionInterceptor.java @@ -1,26 +1,14 @@ /* * 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.awssdk.v2_2; +import io.grpc.Context; import io.opentelemetry.context.ContextUtils; import io.opentelemetry.context.Scope; -import io.opentelemetry.instrumentation.api.decorator.ClientDecorator; import io.opentelemetry.instrumentation.awssdk.v2_2.AwsSdk; -import io.opentelemetry.trace.Span; import java.io.InputStream; import java.nio.ByteBuffer; import java.util.Optional; @@ -111,12 +99,11 @@ public Optional modifyAsyncHttpContent( public void beforeTransmission( BeforeTransmission context, ExecutionAttributes executionAttributes) { delegate.beforeTransmission(context, executionAttributes); - Span span = AwsSdk.getSpanFromAttributes(executionAttributes); - if (span != null) { + Context parentContext = AwsSdk.getContextFromAttributes(executionAttributes); + if (parentContext != null) { // This scope will be closed by AwsHttpClientInstrumentation since ExecutionInterceptor API // doesn't provide a way to run code in the same thread after transmission has been scheduled. - ScopeHolder.CURRENT.set( - ContextUtils.withScopedContext(ClientDecorator.currentContextWith(span))); + ScopeHolder.CURRENT.set(ContextUtils.withScopedContext(parentContext)); } } diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/auto/src/test/groovy/Aws2ClientTest.groovy b/instrumentation/aws-sdk/aws-sdk-2.2/auto/src/test/groovy/Aws2ClientTest.groovy index 1685f0fcce4e..c605d3641567 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/auto/src/test/groovy/Aws2ClientTest.groovy +++ b/instrumentation/aws-sdk/aws-sdk-2.2/auto/src/test/groovy/Aws2ClientTest.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestTrait diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdk.java b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdk.java index 95b521971454..956d379e881f 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdk.java +++ b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdk.java @@ -1,24 +1,16 @@ /* * 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.awssdk.v2_2; -import static io.opentelemetry.instrumentation.awssdk.v2_2.TracingExecutionInterceptor.SPAN_ATTRIBUTE; +import static io.opentelemetry.instrumentation.awssdk.v2_2.TracingExecutionInterceptor.CONTEXT_ATTRIBUTE; +import static io.opentelemetry.trace.TracingContextUtils.getSpan; +import io.grpc.Context; import io.opentelemetry.OpenTelemetry; +import io.opentelemetry.trace.DefaultSpan; import io.opentelemetry.trace.Span; import io.opentelemetry.trace.Span.Kind; import io.opentelemetry.trace.Tracer; @@ -73,6 +65,15 @@ public static ExecutionInterceptor newInterceptor(Kind kind) { * no span set. */ public static Span getSpanFromAttributes(ExecutionAttributes attributes) { - return attributes.getAttribute(SPAN_ATTRIBUTE); + Context context = getContextFromAttributes(attributes); + return context == null ? DefaultSpan.getInvalid() : getSpan(context); + } + + /** + * Returns the {@link Span} stored in the {@link ExecutionAttributes}, or {@code null} if there is + * no span set. + */ + public static Context getContextFromAttributes(ExecutionAttributes attributes) { + return attributes.getAttribute(CONTEXT_ATTRIBUTE); } } diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkHttpClientTracer.java b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkHttpClientTracer.java index b522aa5a2b1c..6d9398209d00 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkHttpClientTracer.java +++ b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkHttpClientTracer.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.awssdk.v2_2; diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/DbRequestDecorator.java b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/DbRequestDecorator.java index f9aa4ea4a290..f261ce3f5c9a 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/DbRequestDecorator.java +++ b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/DbRequestDecorator.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.awssdk.v2_2; diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/RequestType.java b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/RequestType.java index 70102784bd43..020e189dac00 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/RequestType.java +++ b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/RequestType.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.awssdk.v2_2; diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/SdkRequestDecorator.java b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/SdkRequestDecorator.java index 93b86583ca8d..9b8657a567ff 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/SdkRequestDecorator.java +++ b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/SdkRequestDecorator.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.awssdk.v2_2; diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/TracingExecutionInterceptor.java b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/TracingExecutionInterceptor.java index 84d3454d12bc..94d0987281ce 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/TracingExecutionInterceptor.java +++ b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/TracingExecutionInterceptor.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.awssdk.v2_2; @@ -19,6 +8,7 @@ import static io.opentelemetry.instrumentation.awssdk.v2_2.AwsSdk.getSpanFromAttributes; import static io.opentelemetry.instrumentation.awssdk.v2_2.AwsSdkHttpClientTracer.TRACER; import static io.opentelemetry.instrumentation.awssdk.v2_2.RequestType.ofSdkRequest; +import static io.opentelemetry.trace.TracingContextUtils.withSpan; import io.opentelemetry.trace.Span; import io.opentelemetry.trace.Span.Kind; @@ -38,8 +28,8 @@ /** AWS request execution interceptor */ final class TracingExecutionInterceptor implements ExecutionInterceptor { - static final ExecutionAttribute SPAN_ATTRIBUTE = - new ExecutionAttribute<>("io.opentelemetry.auto.Span"); + static final ExecutionAttribute CONTEXT_ATTRIBUTE = + new ExecutionAttribute<>("io.opentelemetry.auto.Context"); static final ExecutionAttribute REQUEST_TYPE_ATTRIBUTE = new ExecutionAttribute<>("io.opentelemetry.auto.aws.RequestType"); @@ -85,7 +75,7 @@ private RequestType getTypeFromAttributes(ExecutionAttributes executionAttribute public void beforeExecution( Context.BeforeExecution context, ExecutionAttributes executionAttributes) { Span span = TRACER.getOrCreateSpan(spanName(executionAttributes), AwsSdk.tracer(), kind); - executionAttributes.putAttribute(SPAN_ATTRIBUTE, span); + executionAttributes.putAttribute(CONTEXT_ATTRIBUTE, withSpan(span, io.grpc.Context.current())); RequestType type = ofSdkRequest(context.request()); if (type != null) { executionAttributes.putAttribute(REQUEST_TYPE_ATTRIBUTE, type); @@ -96,7 +86,7 @@ public void beforeExecution( public void afterMarshalling( Context.AfterMarshalling context, ExecutionAttributes executionAttributes) { Span span = getSpanFromAttributes(executionAttributes); - if (span != null) { + if (span.getContext().isValid()) { TRACER.onRequest(span, context.httpRequest()); SdkRequestDecorator decorator = decorator(executionAttributes); if (decorator != null) { @@ -133,7 +123,7 @@ private void decorateWithExAttributesData(Span span, ExecutionAttributes attribu public void afterExecution( Context.AfterExecution context, ExecutionAttributes executionAttributes) { Span span = getSpanFromAttributes(executionAttributes); - if (span != null) { + if (span.getContext().isValid()) { clearAttributes(executionAttributes); TRACER.afterExecution(span, context.httpRequest()); onSdkResponse(span, context.response()); @@ -151,14 +141,14 @@ private void onSdkResponse(Span span, SdkResponse response) { public void onExecutionFailure( Context.FailedExecution context, ExecutionAttributes executionAttributes) { Span span = getSpanFromAttributes(executionAttributes); - if (span != null) { + if (span.getContext().isValid()) { clearAttributes(executionAttributes); TRACER.endExceptionally(span, context.exception()); } } private void clearAttributes(ExecutionAttributes executionAttributes) { - executionAttributes.putAttribute(SPAN_ATTRIBUTE, null); + executionAttributes.putAttribute(CONTEXT_ATTRIBUTE, null); executionAttributes.putAttribute(REQUEST_TYPE_ATTRIBUTE, null); } diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/test/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/Aws2ClientTest.groovy b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/test/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/Aws2ClientTest.groovy index 6dd29df381fb..6ef589b6da9a 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/test/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/Aws2ClientTest.groovy +++ b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/test/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/Aws2ClientTest.groovy @@ -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.awssdk.v2_2 diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2ClientTest.groovy b/instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2ClientTest.groovy index e0369b66b75c..b4358bb507e9 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2ClientTest.groovy +++ b/instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2ClientTest.groovy @@ -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.awssdk.v2_2 @@ -134,10 +123,10 @@ abstract class AbstractAws2ClientTest extends InstrumentationSpecification { assertTraces(1) { trace(0, 1) { span(0) { - operationName "$service.$operation" - spanKind CLIENT + name "$service.$operation" + kind CLIENT errored false - parent() + hasNoParent() attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" "${SemanticAttributes.NET_PEER_NAME.key()}" "localhost" @@ -207,10 +196,10 @@ abstract class AbstractAws2ClientTest extends InstrumentationSpecification { assertTraces(1) { trace(0, 1) { span(0) { - operationName "$service.$operation" - spanKind CLIENT + name "$service.$operation" + kind CLIENT errored false - parent() + hasNoParent() attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" "${SemanticAttributes.NET_PEER_NAME.key()}" "localhost" @@ -295,10 +284,10 @@ abstract class AbstractAws2ClientTest extends InstrumentationSpecification { assertTraces(1) { trace(0, 1) { span(0) { - operationName "$service.$operation" - spanKind CLIENT + name "$service.$operation" + kind CLIENT errored false - parent() + hasNoParent() attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" "${SemanticAttributes.NET_PEER_NAME.key()}" "localhost" @@ -394,11 +383,11 @@ abstract class AbstractAws2ClientTest extends InstrumentationSpecification { assertTraces(1) { trace(0, 1) { span(0) { - operationName "S3.GetObject" - spanKind CLIENT + name "S3.GetObject" + kind CLIENT errored true errorEvent SdkClientException, "Unable to execute HTTP request: Read timed out" - parent() + hasNoParent() attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" "${SemanticAttributes.NET_PEER_NAME.key()}" "localhost" diff --git a/instrumentation/cassandra/cassandra-3.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v3_0/CassandraClientInstrumentation.java b/instrumentation/cassandra/cassandra-3.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v3_0/CassandraClientInstrumentation.java index 4b8421838afa..8dff52e37e54 100644 --- a/instrumentation/cassandra/cassandra-3.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v3_0/CassandraClientInstrumentation.java +++ b/instrumentation/cassandra/cassandra-3.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v3_0/CassandraClientInstrumentation.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.cassandra.v3_0; diff --git a/instrumentation/cassandra/cassandra-3.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v3_0/CassandraDatabaseClientTracer.java b/instrumentation/cassandra/cassandra-3.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v3_0/CassandraDatabaseClientTracer.java index c0627b21f6c9..cf3782a708a9 100644 --- a/instrumentation/cassandra/cassandra-3.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v3_0/CassandraDatabaseClientTracer.java +++ b/instrumentation/cassandra/cassandra-3.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v3_0/CassandraDatabaseClientTracer.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.cassandra.v3_0; diff --git a/instrumentation/cassandra/cassandra-3.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v3_0/TracingSession.java b/instrumentation/cassandra/cassandra-3.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v3_0/TracingSession.java index 51866aae4c7e..5900ee8104c0 100644 --- a/instrumentation/cassandra/cassandra-3.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v3_0/TracingSession.java +++ b/instrumentation/cassandra/cassandra-3.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v3_0/TracingSession.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.cassandra.v3_0; diff --git a/instrumentation/cassandra/cassandra-3.0/src/test/groovy/CassandraClientTest.groovy b/instrumentation/cassandra/cassandra-3.0/src/test/groovy/CassandraClientTest.groovy index 43657fa5f661..2334c7266869 100644 --- a/instrumentation/cassandra/cassandra-3.0/src/test/groovy/CassandraClientTest.groovy +++ b/instrumentation/cassandra/cassandra-3.0/src/test/groovy/CassandraClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.basicSpan @@ -130,10 +119,10 @@ class CassandraClientTest extends AgentTestRunner { def cassandraSpan(TraceAssert trace, int index, String statement, String keyspace, Object parentSpan = null, Throwable exception = null) { trace.span(index) { - operationName statement - spanKind CLIENT + name statement + kind CLIENT if (parentSpan == null) { - parent() + hasNoParent() } else { childOf((SpanData) parentSpan) } diff --git a/instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v4_0/CassandraClientAdvice.java b/instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v4_0/CassandraClientAdvice.java index 10b32296e614..26cf12da772c 100644 --- a/instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v4_0/CassandraClientAdvice.java +++ b/instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v4_0/CassandraClientAdvice.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.cassandra.v4_0; diff --git a/instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v4_0/CassandraClientInstrumentation.java b/instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v4_0/CassandraClientInstrumentation.java index c3cbf5a5f281..b853a3db8451 100644 --- a/instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v4_0/CassandraClientInstrumentation.java +++ b/instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v4_0/CassandraClientInstrumentation.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.cassandra.v4_0; diff --git a/instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v4_0/CassandraDatabaseClientTracer.java b/instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v4_0/CassandraDatabaseClientTracer.java index 28bacba41e38..736236b2e136 100644 --- a/instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v4_0/CassandraDatabaseClientTracer.java +++ b/instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v4_0/CassandraDatabaseClientTracer.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.cassandra.v4_0; diff --git a/instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v4_0/CompletionStageFunction.java b/instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v4_0/CompletionStageFunction.java index 5b21354a62d0..8c9eccb2c2b5 100644 --- a/instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v4_0/CompletionStageFunction.java +++ b/instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v4_0/CompletionStageFunction.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.cassandra.v4_0; @@ -31,5 +20,5 @@ public Object apply(Object session) { return session; } return new TracingCqlSession((CqlSession) session); - }; + } } diff --git a/instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v4_0/TracingCqlSession.java b/instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v4_0/TracingCqlSession.java index 8a8b384ef5ac..a1087f0f40ff 100644 --- a/instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v4_0/TracingCqlSession.java +++ b/instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/instrumentation/auto/cassandra/v4_0/TracingCqlSession.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.cassandra.v4_0; diff --git a/instrumentation/cassandra/cassandra-4.0/src/test/groovy/CassandraClientTest.groovy b/instrumentation/cassandra/cassandra-4.0/src/test/groovy/CassandraClientTest.groovy index 280c0e8394c5..857e07112a48 100644 --- a/instrumentation/cassandra/cassandra-4.0/src/test/groovy/CassandraClientTest.groovy +++ b/instrumentation/cassandra/cassandra-4.0/src/test/groovy/CassandraClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.basicSpan @@ -100,10 +89,10 @@ class CassandraClientTest extends AgentTestRunner { def cassandraSpan(TraceAssert trace, int index, String statement, String keyspace, Object parentSpan = null, Throwable exception = null) { trace.span(index) { - operationName statement - spanKind CLIENT + name statement + kind CLIENT if (parentSpan == null) { - parent() + hasNoParent() } else { childOf((SpanData) parentSpan) } diff --git a/instrumentation/cdi-testing/src/test/groovy/CDIContainerTest.groovy b/instrumentation/cdi-testing/src/test/groovy/CDIContainerTest.groovy index 896d2bdc6a4e..67c6f0673517 100644 --- a/instrumentation/cdi-testing/src/test/groovy/CDIContainerTest.groovy +++ b/instrumentation/cdi-testing/src/test/groovy/CDIContainerTest.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestRunner diff --git a/instrumentation/cdi-testing/src/test/java/TestBean.java b/instrumentation/cdi-testing/src/test/java/TestBean.java index 0a7fdc8c9aae..d7fba0156045 100644 --- a/instrumentation/cdi-testing/src/test/java/TestBean.java +++ b/instrumentation/cdi-testing/src/test/java/TestBean.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 */ public class TestBean { diff --git a/instrumentation/couchbase/couchbase-2.0/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_0/CouchbaseBucketInstrumentation.java b/instrumentation/couchbase/couchbase-2.0/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_0/CouchbaseBucketInstrumentation.java index b803fa5a1d69..be08259a48b7 100644 --- a/instrumentation/couchbase/couchbase-2.0/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_0/CouchbaseBucketInstrumentation.java +++ b/instrumentation/couchbase/couchbase-2.0/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_0/CouchbaseBucketInstrumentation.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.couchbase.v2_0; diff --git a/instrumentation/couchbase/couchbase-2.0/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_0/CouchbaseClientTracer.java b/instrumentation/couchbase/couchbase-2.0/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_0/CouchbaseClientTracer.java index ec98ff902c30..02de795f5883 100644 --- a/instrumentation/couchbase/couchbase-2.0/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_0/CouchbaseClientTracer.java +++ b/instrumentation/couchbase/couchbase-2.0/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_0/CouchbaseClientTracer.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.couchbase.v2_0; diff --git a/instrumentation/couchbase/couchbase-2.0/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_0/CouchbaseClusterInstrumentation.java b/instrumentation/couchbase/couchbase-2.0/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_0/CouchbaseClusterInstrumentation.java index 2e2a9b015c93..048d94cbf2cb 100644 --- a/instrumentation/couchbase/couchbase-2.0/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_0/CouchbaseClusterInstrumentation.java +++ b/instrumentation/couchbase/couchbase-2.0/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_0/CouchbaseClusterInstrumentation.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.couchbase.v2_0; diff --git a/instrumentation/couchbase/couchbase-2.0/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_0/CouchbaseOnSubscribe.java b/instrumentation/couchbase/couchbase-2.0/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_0/CouchbaseOnSubscribe.java index 402fb92efd6d..1d4c27419387 100644 --- a/instrumentation/couchbase/couchbase-2.0/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_0/CouchbaseOnSubscribe.java +++ b/instrumentation/couchbase/couchbase-2.0/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_0/CouchbaseOnSubscribe.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.couchbase.v2_0; diff --git a/instrumentation/couchbase/couchbase-2.0/src/test/groovy/CouchbaseAsyncClientTest.groovy b/instrumentation/couchbase/couchbase-2.0/src/test/groovy/CouchbaseAsyncClientTest.groovy index e127dc986ba8..43b302320fb8 100644 --- a/instrumentation/couchbase/couchbase-2.0/src/test/groovy/CouchbaseAsyncClientTest.groovy +++ b/instrumentation/couchbase/couchbase-2.0/src/test/groovy/CouchbaseAsyncClientTest.groovy @@ -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 */ class CouchbaseAsyncClientTest extends AbstractCouchbaseAsyncClientTest { diff --git a/instrumentation/couchbase/couchbase-2.0/src/test/groovy/CouchbaseClientTest.groovy b/instrumentation/couchbase/couchbase-2.0/src/test/groovy/CouchbaseClientTest.groovy index 99e8a3cde0e6..aed568b0b0eb 100644 --- a/instrumentation/couchbase/couchbase-2.0/src/test/groovy/CouchbaseClientTest.groovy +++ b/instrumentation/couchbase/couchbase-2.0/src/test/groovy/CouchbaseClientTest.groovy @@ -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 */ class CouchbaseClientTest extends AbstractCouchbaseClientTest { diff --git a/instrumentation/couchbase/couchbase-2.0/src/test/groovy/springdata/CouchbaseSpringRepositoryTest.groovy b/instrumentation/couchbase/couchbase-2.0/src/test/groovy/springdata/CouchbaseSpringRepositoryTest.groovy index b3469ea49feb..b59b287da506 100644 --- a/instrumentation/couchbase/couchbase-2.0/src/test/groovy/springdata/CouchbaseSpringRepositoryTest.groovy +++ b/instrumentation/couchbase/couchbase-2.0/src/test/groovy/springdata/CouchbaseSpringRepositoryTest.groovy @@ -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 springdata diff --git a/instrumentation/couchbase/couchbase-2.0/src/test/groovy/springdata/CouchbaseSpringTemplateTest.groovy b/instrumentation/couchbase/couchbase-2.0/src/test/groovy/springdata/CouchbaseSpringTemplateTest.groovy index 84caf0997c19..3f355463f071 100644 --- a/instrumentation/couchbase/couchbase-2.0/src/test/groovy/springdata/CouchbaseSpringTemplateTest.groovy +++ b/instrumentation/couchbase/couchbase-2.0/src/test/groovy/springdata/CouchbaseSpringTemplateTest.groovy @@ -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 springdata diff --git a/instrumentation/couchbase/couchbase-2.6/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_6/CouchbaseCoreInstrumentation.java b/instrumentation/couchbase/couchbase-2.6/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_6/CouchbaseCoreInstrumentation.java index 8d2d96950710..d733f97c99b7 100644 --- a/instrumentation/couchbase/couchbase-2.6/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_6/CouchbaseCoreInstrumentation.java +++ b/instrumentation/couchbase/couchbase-2.6/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_6/CouchbaseCoreInstrumentation.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.couchbase.v2_6; diff --git a/instrumentation/couchbase/couchbase-2.6/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_6/CouchbaseNetworkInstrumentation.java b/instrumentation/couchbase/couchbase-2.6/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_6/CouchbaseNetworkInstrumentation.java index 7af8bf3a0292..74221b5c2274 100644 --- a/instrumentation/couchbase/couchbase-2.6/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_6/CouchbaseNetworkInstrumentation.java +++ b/instrumentation/couchbase/couchbase-2.6/src/main/java/io/opentelemetry/instrumentation/auto/couchbase/v2_6/CouchbaseNetworkInstrumentation.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.couchbase.v2_6; diff --git a/instrumentation/couchbase/couchbase-2.6/src/test/groovy/CouchbaseAsyncClient26Test.groovy b/instrumentation/couchbase/couchbase-2.6/src/test/groovy/CouchbaseAsyncClient26Test.groovy index 21f506da5456..7886aade7464 100644 --- a/instrumentation/couchbase/couchbase-2.6/src/test/groovy/CouchbaseAsyncClient26Test.groovy +++ b/instrumentation/couchbase/couchbase-2.6/src/test/groovy/CouchbaseAsyncClient26Test.groovy @@ -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 */ import io.opentelemetry.auto.test.asserts.TraceAssert diff --git a/instrumentation/couchbase/couchbase-2.6/src/test/groovy/CouchbaseClient26Test.groovy b/instrumentation/couchbase/couchbase-2.6/src/test/groovy/CouchbaseClient26Test.groovy index 3db0cf69893e..da1b9dbd8b60 100644 --- a/instrumentation/couchbase/couchbase-2.6/src/test/groovy/CouchbaseClient26Test.groovy +++ b/instrumentation/couchbase/couchbase-2.6/src/test/groovy/CouchbaseClient26Test.groovy @@ -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 */ import io.opentelemetry.auto.test.asserts.TraceAssert diff --git a/instrumentation/couchbase/couchbase-2.6/src/test/groovy/CouchbaseSpanUtil.groovy b/instrumentation/couchbase/couchbase-2.6/src/test/groovy/CouchbaseSpanUtil.groovy index 3bd7c818e330..1aab3e8cef97 100644 --- a/instrumentation/couchbase/couchbase-2.6/src/test/groovy/CouchbaseSpanUtil.groovy +++ b/instrumentation/couchbase/couchbase-2.6/src/test/groovy/CouchbaseSpanUtil.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -23,13 +12,13 @@ import io.opentelemetry.trace.attributes.SemanticAttributes class CouchbaseSpanUtil { // Reusable span assertion method. Cannot directly override AbstractCouchbaseTest.assertCouchbaseSpan because // Of the class hierarchy of these tests - static void assertCouchbaseCall(TraceAssert trace, int index, Object name, String bucketName = null, Object parentSpan = null) { + static void assertCouchbaseCall(TraceAssert trace, int index, Object spanName, String bucketName = null, Object parentSpan = null) { trace.span(index) { - operationName name - spanKind CLIENT + name spanName + kind CLIENT errored false if (parentSpan == null) { - parent() + hasNoParent() } else { childOf((SpanData) parentSpan) } @@ -52,7 +41,7 @@ class CouchbaseSpanUtil { // that do have operation ids "couchbase.operation_id" { it == null || String } - "${SemanticAttributes.DB_STATEMENT.key()}" name + "${SemanticAttributes.DB_STATEMENT.key()}" spanName } } } diff --git a/instrumentation/couchbase/couchbase-2.6/src/test/groovy/springdata/CouchbaseSpringRepository26Test.groovy b/instrumentation/couchbase/couchbase-2.6/src/test/groovy/springdata/CouchbaseSpringRepository26Test.groovy index dafd7b89578a..57826aa1f6d8 100644 --- a/instrumentation/couchbase/couchbase-2.6/src/test/groovy/springdata/CouchbaseSpringRepository26Test.groovy +++ b/instrumentation/couchbase/couchbase-2.6/src/test/groovy/springdata/CouchbaseSpringRepository26Test.groovy @@ -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 springdata diff --git a/instrumentation/couchbase/couchbase-2.6/src/test/groovy/springdata/CouchbaseSpringTemplate26Test.groovy b/instrumentation/couchbase/couchbase-2.6/src/test/groovy/springdata/CouchbaseSpringTemplate26Test.groovy index 1ce7bf8898e0..f3dd353d8497 100644 --- a/instrumentation/couchbase/couchbase-2.6/src/test/groovy/springdata/CouchbaseSpringTemplate26Test.groovy +++ b/instrumentation/couchbase/couchbase-2.6/src/test/groovy/springdata/CouchbaseSpringTemplate26Test.groovy @@ -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 springdata diff --git a/instrumentation/couchbase/couchbase-testing/src/main/groovy/AbstractCouchbaseAsyncClientTest.groovy b/instrumentation/couchbase/couchbase-testing/src/main/groovy/AbstractCouchbaseAsyncClientTest.groovy index 4daf423034d1..a552476da39a 100644 --- a/instrumentation/couchbase/couchbase-testing/src/main/groovy/AbstractCouchbaseAsyncClientTest.groovy +++ b/instrumentation/couchbase/couchbase-testing/src/main/groovy/AbstractCouchbaseAsyncClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.basicSpan diff --git a/instrumentation/couchbase/couchbase-testing/src/main/groovy/AbstractCouchbaseClientTest.groovy b/instrumentation/couchbase/couchbase-testing/src/main/groovy/AbstractCouchbaseClientTest.groovy index 81192612a2a5..aa8aade36f1c 100644 --- a/instrumentation/couchbase/couchbase-testing/src/main/groovy/AbstractCouchbaseClientTest.groovy +++ b/instrumentation/couchbase/couchbase-testing/src/main/groovy/AbstractCouchbaseClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.basicSpan diff --git a/instrumentation/couchbase/couchbase-testing/src/main/groovy/springdata/AbstractCouchbaseSpringRepositoryTest.groovy b/instrumentation/couchbase/couchbase-testing/src/main/groovy/springdata/AbstractCouchbaseSpringRepositoryTest.groovy index 6a5f9191ed2e..eac93e7241b6 100644 --- a/instrumentation/couchbase/couchbase-testing/src/main/groovy/springdata/AbstractCouchbaseSpringRepositoryTest.groovy +++ b/instrumentation/couchbase/couchbase-testing/src/main/groovy/springdata/AbstractCouchbaseSpringRepositoryTest.groovy @@ -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 springdata diff --git a/instrumentation/couchbase/couchbase-testing/src/main/groovy/springdata/AbstractCouchbaseSpringTemplateTest.groovy b/instrumentation/couchbase/couchbase-testing/src/main/groovy/springdata/AbstractCouchbaseSpringTemplateTest.groovy index bcb57f07b159..eea79bc3bd88 100644 --- a/instrumentation/couchbase/couchbase-testing/src/main/groovy/springdata/AbstractCouchbaseSpringTemplateTest.groovy +++ b/instrumentation/couchbase/couchbase-testing/src/main/groovy/springdata/AbstractCouchbaseSpringTemplateTest.groovy @@ -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 springdata diff --git a/instrumentation/couchbase/couchbase-testing/src/main/groovy/springdata/CouchbaseConfig.groovy b/instrumentation/couchbase/couchbase-testing/src/main/groovy/springdata/CouchbaseConfig.groovy index a774674f0fe1..83dc540a12b8 100644 --- a/instrumentation/couchbase/couchbase-testing/src/main/groovy/springdata/CouchbaseConfig.groovy +++ b/instrumentation/couchbase/couchbase-testing/src/main/groovy/springdata/CouchbaseConfig.groovy @@ -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 springdata diff --git a/instrumentation/couchbase/couchbase-testing/src/main/groovy/springdata/Doc.groovy b/instrumentation/couchbase/couchbase-testing/src/main/groovy/springdata/Doc.groovy index e34dfbe26dff..4ae0b7707981 100644 --- a/instrumentation/couchbase/couchbase-testing/src/main/groovy/springdata/Doc.groovy +++ b/instrumentation/couchbase/couchbase-testing/src/main/groovy/springdata/Doc.groovy @@ -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 springdata diff --git a/instrumentation/couchbase/couchbase-testing/src/main/groovy/springdata/DocRepository.groovy b/instrumentation/couchbase/couchbase-testing/src/main/groovy/springdata/DocRepository.groovy index 34ea01d70e87..520befd4afb7 100644 --- a/instrumentation/couchbase/couchbase-testing/src/main/groovy/springdata/DocRepository.groovy +++ b/instrumentation/couchbase/couchbase-testing/src/main/groovy/springdata/DocRepository.groovy @@ -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 springdata diff --git a/instrumentation/couchbase/couchbase-testing/src/main/groovy/util/AbstractCouchbaseTest.groovy b/instrumentation/couchbase/couchbase-testing/src/main/groovy/util/AbstractCouchbaseTest.groovy index 0a22086c2436..3f079f06ff8f 100644 --- a/instrumentation/couchbase/couchbase-testing/src/main/groovy/util/AbstractCouchbaseTest.groovy +++ b/instrumentation/couchbase/couchbase-testing/src/main/groovy/util/AbstractCouchbaseTest.groovy @@ -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 util @@ -114,13 +103,13 @@ abstract class AbstractCouchbaseTest extends AgentTestRunner { .socketConnectTimeout(timeout.intValue()) } - void assertCouchbaseCall(TraceAssert trace, int index, Object name, String bucketName = null, Object parentSpan = null) { + void assertCouchbaseCall(TraceAssert trace, int index, Object spanName, String bucketName = null, Object parentSpan = null) { trace.span(index) { - operationName name - spanKind CLIENT + name spanName + kind CLIENT errored false if (parentSpan == null) { - parent() + hasNoParent() } else { childOf((SpanData) parentSpan) } @@ -129,7 +118,7 @@ abstract class AbstractCouchbaseTest extends AgentTestRunner { if (bucketName != null) { "${SemanticAttributes.DB_NAME.key()}" bucketName } - "${SemanticAttributes.DB_STATEMENT.key()}" name + "${SemanticAttributes.DB_STATEMENT.key()}" spanName } } } diff --git a/instrumentation/dropwizard-testing/src/test/groovy/DropwizardAsyncTest.groovy b/instrumentation/dropwizard-testing/src/test/groovy/DropwizardAsyncTest.groovy index 7d6e37d39bea..cf06951a25eb 100644 --- a/instrumentation/dropwizard-testing/src/test/groovy/DropwizardAsyncTest.groovy +++ b/instrumentation/dropwizard-testing/src/test/groovy/DropwizardAsyncTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.ERROR diff --git a/instrumentation/dropwizard-testing/src/test/groovy/DropwizardTest.groovy b/instrumentation/dropwizard-testing/src/test/groovy/DropwizardTest.groovy index 40c02feab899..386d5bb8eb38 100644 --- a/instrumentation/dropwizard-testing/src/test/groovy/DropwizardTest.groovy +++ b/instrumentation/dropwizard-testing/src/test/groovy/DropwizardTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.ERROR @@ -88,8 +77,8 @@ class DropwizardTest extends HttpServerTest { @Override void handlerSpan(TraceAssert trace, int index, Object parent, String method = "GET", ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName "${this.testResource().simpleName}.${endpoint.name().toLowerCase()}" - spanKind INTERNAL + name "${this.testResource().simpleName}.${endpoint.name().toLowerCase()}" + kind INTERNAL errored endpoint == EXCEPTION if (endpoint == EXCEPTION) { errorEvent(Exception, EXCEPTION.body) @@ -101,14 +90,14 @@ class DropwizardTest extends HttpServerTest { @Override void serverSpan(TraceAssert trace, int index, String traceID = null, String parentID = null, String method = "GET", Long responseContentLength = null, ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName "$method ${endpoint == PATH_PARAM ? "/path/{id}/param" : endpoint.resolvePath(address).path}" - spanKind SERVER + name "$method ${endpoint == PATH_PARAM ? "/path/{id}/param" : endpoint.resolvePath(address).path}" + kind SERVER errored endpoint.errored if (parentID != null) { traceId traceID - parentId parentID + parentSpanId parentID } else { - parent() + hasNoParent() } attributes { // dropwizard reports peer ip as the client ip diff --git a/instrumentation/dropwizard-views-0.7/src/main/java/io/opentelemetry/instrumentation/auto/dropwizardviews/DropwizardViewInstrumentation.java b/instrumentation/dropwizard-views-0.7/src/main/java/io/opentelemetry/instrumentation/auto/dropwizardviews/DropwizardViewInstrumentation.java index ba852c9c5441..fcc746a10520 100644 --- a/instrumentation/dropwizard-views-0.7/src/main/java/io/opentelemetry/instrumentation/auto/dropwizardviews/DropwizardViewInstrumentation.java +++ b/instrumentation/dropwizard-views-0.7/src/main/java/io/opentelemetry/instrumentation/auto/dropwizardviews/DropwizardViewInstrumentation.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.dropwizardviews; @@ -32,7 +21,7 @@ import io.opentelemetry.instrumentation.auto.api.SpanWithScope; import io.opentelemetry.javaagent.tooling.Instrumenter; import io.opentelemetry.trace.Span; -import io.opentelemetry.trace.Status; +import io.opentelemetry.trace.StatusCanonicalCode; import io.opentelemetry.trace.Tracer; import java.util.Map; import net.bytebuddy.asm.Advice; @@ -94,7 +83,7 @@ public static void stopSpan( } Span span = spanWithScope.getSpan(); if (throwable != null) { - span.setStatus(Status.UNKNOWN); + span.setStatus(StatusCanonicalCode.ERROR); BaseDecorator.addThrowable(span, throwable); } span.end(); diff --git a/instrumentation/dropwizard-views-0.7/src/test/groovy/ViewRenderTest.groovy b/instrumentation/dropwizard-views-0.7/src/test/groovy/ViewRenderTest.groovy index 633b24947134..30143c4432a6 100644 --- a/instrumentation/dropwizard-views-0.7/src/test/groovy/ViewRenderTest.groovy +++ b/instrumentation/dropwizard-views-0.7/src/test/groovy/ViewRenderTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.basicSpan @@ -40,7 +29,7 @@ class ViewRenderTest extends AgentTestRunner { trace(0, 2) { basicSpan(it, 0, "parent") span(1) { - operationName "Render $template" + name "Render $template" childOf span(0) } } diff --git a/instrumentation/elasticsearch/elasticsearch-rest-5.0/src/latestDepTest/groovy/Elasticsearch6RestClientTest.groovy b/instrumentation/elasticsearch/elasticsearch-rest-5.0/src/latestDepTest/groovy/Elasticsearch6RestClientTest.groovy index dc562f40ede0..6bc54cde6585 100644 --- a/instrumentation/elasticsearch/elasticsearch-rest-5.0/src/latestDepTest/groovy/Elasticsearch6RestClientTest.groovy +++ b/instrumentation/elasticsearch/elasticsearch-rest-5.0/src/latestDepTest/groovy/Elasticsearch6RestClientTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -94,9 +83,9 @@ class Elasticsearch6RestClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "GET _cluster/health" - spanKind CLIENT - parent() + name "GET _cluster/health" + kind CLIENT + hasNoParent() attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" httpTransportAddress.address "${SemanticAttributes.NET_PEER_PORT.key()}" httpTransportAddress.port @@ -107,8 +96,8 @@ class Elasticsearch6RestClientTest extends AgentTestRunner { } } span(1) { - operationName expectedOperationName("GET") - spanKind CLIENT + name expectedOperationName("GET") + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" diff --git a/instrumentation/elasticsearch/elasticsearch-rest-5.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/rest/v5_0/Elasticsearch5RestClientInstrumentation.java b/instrumentation/elasticsearch/elasticsearch-rest-5.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/rest/v5_0/Elasticsearch5RestClientInstrumentation.java index fbfe77dfcad2..e8d89ca6f3c7 100644 --- a/instrumentation/elasticsearch/elasticsearch-rest-5.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/rest/v5_0/Elasticsearch5RestClientInstrumentation.java +++ b/instrumentation/elasticsearch/elasticsearch-rest-5.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/rest/v5_0/Elasticsearch5RestClientInstrumentation.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.elasticsearch.rest.v5_0; diff --git a/instrumentation/elasticsearch/elasticsearch-rest-5.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/rest/v5_0/RestResponseListener.java b/instrumentation/elasticsearch/elasticsearch-rest-5.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/rest/v5_0/RestResponseListener.java index 97d83854892c..11fda8e0a7ee 100644 --- a/instrumentation/elasticsearch/elasticsearch-rest-5.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/rest/v5_0/RestResponseListener.java +++ b/instrumentation/elasticsearch/elasticsearch-rest-5.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/rest/v5_0/RestResponseListener.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.elasticsearch.rest.v5_0; diff --git a/instrumentation/elasticsearch/elasticsearch-rest-5.0/src/test/groovy/Elasticsearch5RestClientTest.groovy b/instrumentation/elasticsearch/elasticsearch-rest-5.0/src/test/groovy/Elasticsearch5RestClientTest.groovy index e7d87ca63814..70cb462c03aa 100644 --- a/instrumentation/elasticsearch/elasticsearch-rest-5.0/src/test/groovy/Elasticsearch5RestClientTest.groovy +++ b/instrumentation/elasticsearch/elasticsearch-rest-5.0/src/test/groovy/Elasticsearch5RestClientTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -98,9 +87,9 @@ class Elasticsearch5RestClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "GET _cluster/health" - spanKind CLIENT - parent() + name "GET _cluster/health" + kind CLIENT + hasNoParent() attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" httpTransportAddress.address "${SemanticAttributes.NET_PEER_PORT.key()}" httpTransportAddress.port @@ -111,8 +100,8 @@ class Elasticsearch5RestClientTest extends AgentTestRunner { } } span(1) { - operationName expectedOperationName("GET") - spanKind CLIENT + name expectedOperationName("GET") + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" diff --git a/instrumentation/elasticsearch/elasticsearch-rest-6.4/src/latestDepTest/groovy/Elasticsearch6RestClientTest.groovy b/instrumentation/elasticsearch/elasticsearch-rest-6.4/src/latestDepTest/groovy/Elasticsearch6RestClientTest.groovy index 0c46824e2a61..89806d3c8ecf 100644 --- a/instrumentation/elasticsearch/elasticsearch-rest-6.4/src/latestDepTest/groovy/Elasticsearch6RestClientTest.groovy +++ b/instrumentation/elasticsearch/elasticsearch-rest-6.4/src/latestDepTest/groovy/Elasticsearch6RestClientTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -99,9 +88,9 @@ class Elasticsearch6RestClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "GET _cluster/health" - spanKind CLIENT - parent() + name "GET _cluster/health" + kind CLIENT + hasNoParent() attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" httpTransportAddress.address "${SemanticAttributes.NET_PEER_PORT.key()}" httpTransportAddress.port @@ -112,8 +101,8 @@ class Elasticsearch6RestClientTest extends AgentTestRunner { } } span(1) { - operationName expectedOperationName("GET") - spanKind CLIENT + name expectedOperationName("GET") + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" diff --git a/instrumentation/elasticsearch/elasticsearch-rest-6.4/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/rest/v6_4/Elasticsearch6RestClientInstrumentation.java b/instrumentation/elasticsearch/elasticsearch-rest-6.4/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/rest/v6_4/Elasticsearch6RestClientInstrumentation.java index 7bddf45a155f..f14cd5f59faa 100644 --- a/instrumentation/elasticsearch/elasticsearch-rest-6.4/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/rest/v6_4/Elasticsearch6RestClientInstrumentation.java +++ b/instrumentation/elasticsearch/elasticsearch-rest-6.4/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/rest/v6_4/Elasticsearch6RestClientInstrumentation.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.elasticsearch.rest.v6_4; diff --git a/instrumentation/elasticsearch/elasticsearch-rest-6.4/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/rest/v6_4/RestResponseListener.java b/instrumentation/elasticsearch/elasticsearch-rest-6.4/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/rest/v6_4/RestResponseListener.java index 581381a0fd63..8c9fbfeb470e 100644 --- a/instrumentation/elasticsearch/elasticsearch-rest-6.4/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/rest/v6_4/RestResponseListener.java +++ b/instrumentation/elasticsearch/elasticsearch-rest-6.4/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/rest/v6_4/RestResponseListener.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.elasticsearch.rest.v6_4; diff --git a/instrumentation/elasticsearch/elasticsearch-rest-6.4/src/test/groovy/Elasticsearch6RestClientTest.groovy b/instrumentation/elasticsearch/elasticsearch-rest-6.4/src/test/groovy/Elasticsearch6RestClientTest.groovy index ff1da93277a6..f4c5e6342f5f 100644 --- a/instrumentation/elasticsearch/elasticsearch-rest-6.4/src/test/groovy/Elasticsearch6RestClientTest.groovy +++ b/instrumentation/elasticsearch/elasticsearch-rest-6.4/src/test/groovy/Elasticsearch6RestClientTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -94,9 +83,9 @@ class Elasticsearch6RestClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "GET _cluster/health" - spanKind CLIENT - parent() + name "GET _cluster/health" + kind CLIENT + hasNoParent() attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" httpTransportAddress.address "${SemanticAttributes.NET_PEER_PORT.key()}" httpTransportAddress.port @@ -107,8 +96,8 @@ class Elasticsearch6RestClientTest extends AgentTestRunner { } } span(1) { - operationName expectedOperationName("GET") - spanKind CLIENT + name expectedOperationName("GET") + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" diff --git a/instrumentation/elasticsearch/elasticsearch-rest-common/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/rest/ElasticsearchRestClientTracer.java b/instrumentation/elasticsearch/elasticsearch-rest-common/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/rest/ElasticsearchRestClientTracer.java index 3f8ab3b27daa..cf138dda614f 100644 --- a/instrumentation/elasticsearch/elasticsearch-rest-common/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/rest/ElasticsearchRestClientTracer.java +++ b/instrumentation/elasticsearch/elasticsearch-rest-common/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/rest/ElasticsearchRestClientTracer.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.elasticsearch.rest; diff --git a/instrumentation/elasticsearch/elasticsearch-transport-5.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v5_0/Elasticsearch5TransportClientInstrumentation.java b/instrumentation/elasticsearch/elasticsearch-transport-5.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v5_0/Elasticsearch5TransportClientInstrumentation.java index c8821c1e0500..f986fa3e136e 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-5.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v5_0/Elasticsearch5TransportClientInstrumentation.java +++ b/instrumentation/elasticsearch/elasticsearch-transport-5.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v5_0/Elasticsearch5TransportClientInstrumentation.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.elasticsearch.transport.v5_0; diff --git a/instrumentation/elasticsearch/elasticsearch-transport-5.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v5_0/TransportActionListener.java b/instrumentation/elasticsearch/elasticsearch-transport-5.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v5_0/TransportActionListener.java index 63d68d7842fc..7042acc029cb 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-5.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v5_0/TransportActionListener.java +++ b/instrumentation/elasticsearch/elasticsearch-transport-5.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v5_0/TransportActionListener.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.elasticsearch.transport.v5_0; diff --git a/instrumentation/elasticsearch/elasticsearch-transport-5.0/src/test/groovy/Elasticsearch5NodeClientTest.groovy b/instrumentation/elasticsearch/elasticsearch-transport-5.0/src/test/groovy/Elasticsearch5NodeClientTest.groovy index 0bacc986fe0d..61a832a9d0c8 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-5.0/src/test/groovy/Elasticsearch5NodeClientTest.groovy +++ b/instrumentation/elasticsearch/elasticsearch-transport-5.0/src/test/groovy/Elasticsearch5NodeClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace @@ -86,8 +75,8 @@ class Elasticsearch5NodeClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "ClusterHealthAction" - spanKind CLIENT + name "ClusterHealthAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "ClusterHealthAction" @@ -110,10 +99,10 @@ class Elasticsearch5NodeClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GetAction" + name "GetAction" errored true errorEvent IndexNotFoundException, "no such index" - spanKind CLIENT + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "GetAction" @@ -173,8 +162,8 @@ class Elasticsearch5NodeClientTest extends AgentTestRunner { assertTraces(5) { trace(0, 1) { span(0) { - operationName "CreateIndexAction" - spanKind CLIENT + name "CreateIndexAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "CreateIndexAction" @@ -186,8 +175,8 @@ class Elasticsearch5NodeClientTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "ClusterHealthAction" - spanKind CLIENT + name "ClusterHealthAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "ClusterHealthAction" @@ -198,8 +187,8 @@ class Elasticsearch5NodeClientTest extends AgentTestRunner { } trace(2, 1) { span(0) { - operationName "GetAction" - spanKind CLIENT + name "GetAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "GetAction" @@ -214,8 +203,8 @@ class Elasticsearch5NodeClientTest extends AgentTestRunner { } trace(3, 2) { span(0) { - operationName "IndexAction" - spanKind CLIENT + name "IndexAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "IndexAction" @@ -230,8 +219,8 @@ class Elasticsearch5NodeClientTest extends AgentTestRunner { } } span(1) { - operationName "PutMappingAction" - spanKind CLIENT + name "PutMappingAction" + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" @@ -243,8 +232,8 @@ class Elasticsearch5NodeClientTest extends AgentTestRunner { } trace(4, 1) { span(0) { - operationName "GetAction" - spanKind CLIENT + name "GetAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "GetAction" diff --git a/instrumentation/elasticsearch/elasticsearch-transport-5.0/src/test/groovy/Elasticsearch5TransportClientTest.groovy b/instrumentation/elasticsearch/elasticsearch-transport-5.0/src/test/groovy/Elasticsearch5TransportClientTest.groovy index 5f8c2820fb54..8db4562487c5 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-5.0/src/test/groovy/Elasticsearch5TransportClientTest.groovy +++ b/instrumentation/elasticsearch/elasticsearch-transport-5.0/src/test/groovy/Elasticsearch5TransportClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace @@ -102,8 +91,8 @@ class Elasticsearch5TransportClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "ClusterHealthAction" - spanKind CLIENT + name "ClusterHealthAction" + kind CLIENT attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" tcpPublishAddress.host == tcpPublishAddress.address ? null : tcpPublishAddress.host "${SemanticAttributes.NET_PEER_IP.key()}" tcpPublishAddress.address @@ -129,8 +118,8 @@ class Elasticsearch5TransportClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GetAction" - spanKind CLIENT + name "GetAction" + kind CLIENT errored true errorEvent RemoteTransportException, String attributes { @@ -199,8 +188,8 @@ class Elasticsearch5TransportClientTest extends AgentTestRunner { } trace(0, 1) { span(0) { - operationName "CreateIndexAction" - spanKind CLIENT + name "CreateIndexAction" + kind CLIENT attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" tcpPublishAddress.host == tcpPublishAddress.address ? null : tcpPublishAddress.host "${SemanticAttributes.NET_PEER_IP.key()}" tcpPublishAddress.address @@ -215,8 +204,8 @@ class Elasticsearch5TransportClientTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "GetAction" - spanKind CLIENT + name "GetAction" + kind CLIENT attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" tcpPublishAddress.host == tcpPublishAddress.address ? null : tcpPublishAddress.host "${SemanticAttributes.NET_PEER_IP.key()}" tcpPublishAddress.address @@ -234,8 +223,8 @@ class Elasticsearch5TransportClientTest extends AgentTestRunner { } trace(2, 1) { span(0) { - operationName "PutMappingAction" - spanKind CLIENT + name "PutMappingAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "PutMappingAction" @@ -246,8 +235,8 @@ class Elasticsearch5TransportClientTest extends AgentTestRunner { } trace(3, 1) { span(0) { - operationName "IndexAction" - spanKind CLIENT + name "IndexAction" + kind CLIENT attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" tcpPublishAddress.host == tcpPublishAddress.address ? null : tcpPublishAddress.host "${SemanticAttributes.NET_PEER_IP.key()}" tcpPublishAddress.address @@ -267,8 +256,8 @@ class Elasticsearch5TransportClientTest extends AgentTestRunner { } trace(4, 1) { span(0) { - operationName "GetAction" - spanKind CLIENT + name "GetAction" + kind CLIENT attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" tcpPublishAddress.host == tcpPublishAddress.address ? null : tcpPublishAddress.address "${SemanticAttributes.NET_PEER_IP.key()}" tcpPublishAddress.address diff --git a/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v5_3/Elasticsearch53TransportClientInstrumentation.java b/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v5_3/Elasticsearch53TransportClientInstrumentation.java index 9e7fa7226e37..8c7e4c289577 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v5_3/Elasticsearch53TransportClientInstrumentation.java +++ b/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v5_3/Elasticsearch53TransportClientInstrumentation.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.elasticsearch.transport.v5_3; diff --git a/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v5_3/TransportActionListener.java b/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v5_3/TransportActionListener.java index 8dab68134980..e6f96f34de1b 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v5_3/TransportActionListener.java +++ b/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v5_3/TransportActionListener.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.elasticsearch.transport.v5_3; diff --git a/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/Elasticsearch53NodeClientTest.groovy b/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/Elasticsearch53NodeClientTest.groovy index 2b6f6a1cc969..1e33301b1ec7 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/Elasticsearch53NodeClientTest.groovy +++ b/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/Elasticsearch53NodeClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace @@ -86,8 +75,8 @@ class Elasticsearch53NodeClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "ClusterHealthAction" - spanKind CLIENT + name "ClusterHealthAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "ClusterHealthAction" @@ -110,8 +99,8 @@ class Elasticsearch53NodeClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GetAction" - spanKind CLIENT + name "GetAction" + kind CLIENT errored true errorEvent IndexNotFoundException, "no such index" attributes { @@ -173,8 +162,8 @@ class Elasticsearch53NodeClientTest extends AgentTestRunner { assertTraces(5) { trace(0, 1) { span(0) { - operationName "CreateIndexAction" - spanKind CLIENT + name "CreateIndexAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "CreateIndexAction" @@ -186,8 +175,8 @@ class Elasticsearch53NodeClientTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "ClusterHealthAction" - spanKind CLIENT + name "ClusterHealthAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "ClusterHealthAction" @@ -198,8 +187,8 @@ class Elasticsearch53NodeClientTest extends AgentTestRunner { } trace(2, 1) { span(0) { - operationName "GetAction" - spanKind CLIENT + name "GetAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "GetAction" @@ -214,8 +203,8 @@ class Elasticsearch53NodeClientTest extends AgentTestRunner { } trace(3, 2) { span(0) { - operationName "IndexAction" - spanKind CLIENT + name "IndexAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "IndexAction" @@ -231,8 +220,8 @@ class Elasticsearch53NodeClientTest extends AgentTestRunner { } } span(1) { - operationName "PutMappingAction" - spanKind CLIENT + name "PutMappingAction" + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" @@ -244,8 +233,8 @@ class Elasticsearch53NodeClientTest extends AgentTestRunner { } trace(4, 1) { span(0) { - operationName "GetAction" - spanKind CLIENT + name "GetAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "GetAction" diff --git a/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/Elasticsearch53TransportClientTest.groovy b/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/Elasticsearch53TransportClientTest.groovy index c911674a11fe..a1c9889f3b23 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/Elasticsearch53TransportClientTest.groovy +++ b/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/Elasticsearch53TransportClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace @@ -103,8 +92,8 @@ class Elasticsearch53TransportClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "ClusterHealthAction" - spanKind CLIENT + name "ClusterHealthAction" + kind CLIENT attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" tcpPublishAddress.host == tcpPublishAddress.address ? null : tcpPublishAddress.address "${SemanticAttributes.NET_PEER_IP.key()}" tcpPublishAddress.address @@ -130,8 +119,8 @@ class Elasticsearch53TransportClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GetAction" - spanKind CLIENT + name "GetAction" + kind CLIENT errored true errorEvent RemoteTransportException, String attributes { @@ -200,8 +189,8 @@ class Elasticsearch53TransportClientTest extends AgentTestRunner { } trace(0, 1) { span(0) { - operationName "CreateIndexAction" - spanKind CLIENT + name "CreateIndexAction" + kind CLIENT attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" tcpPublishAddress.host == tcpPublishAddress.address ? null : tcpPublishAddress.address "${SemanticAttributes.NET_PEER_IP.key()}" tcpPublishAddress.address @@ -216,8 +205,8 @@ class Elasticsearch53TransportClientTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "GetAction" - spanKind CLIENT + name "GetAction" + kind CLIENT attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" tcpPublishAddress.host == tcpPublishAddress.address ? null : tcpPublishAddress.address "${SemanticAttributes.NET_PEER_IP.key()}" tcpPublishAddress.address @@ -235,8 +224,8 @@ class Elasticsearch53TransportClientTest extends AgentTestRunner { } trace(2, 1) { span(0) { - operationName "PutMappingAction" - spanKind CLIENT + name "PutMappingAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "PutMappingAction" @@ -247,8 +236,8 @@ class Elasticsearch53TransportClientTest extends AgentTestRunner { } trace(3, 1) { span(0) { - operationName "IndexAction" - spanKind CLIENT + name "IndexAction" + kind CLIENT attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" tcpPublishAddress.host == tcpPublishAddress.address ? null : tcpPublishAddress.address "${SemanticAttributes.NET_PEER_IP.key()}" tcpPublishAddress.address @@ -269,8 +258,8 @@ class Elasticsearch53TransportClientTest extends AgentTestRunner { } trace(4, 1) { span(0) { - operationName "GetAction" - spanKind CLIENT + name "GetAction" + kind CLIENT attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" tcpPublishAddress.host == tcpPublishAddress.address ? null : tcpPublishAddress.address "${SemanticAttributes.NET_PEER_IP.key()}" tcpPublishAddress.address diff --git a/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/Config.groovy b/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/Config.groovy index a1158ea5699a..5f51802f760f 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/Config.groovy +++ b/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/Config.groovy @@ -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 springdata diff --git a/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/Doc.groovy b/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/Doc.groovy index c38221710586..b2b35f103737 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/Doc.groovy +++ b/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/Doc.groovy @@ -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 springdata diff --git a/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/DocRepository.groovy b/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/DocRepository.groovy index f792e9a28a76..dca62c1028f8 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/DocRepository.groovy +++ b/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/DocRepository.groovy @@ -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 springdata diff --git a/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/Elasticsearch53SpringRepositoryTest.groovy b/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/Elasticsearch53SpringRepositoryTest.groovy index a44870dcf784..34236eb0b6de 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/Elasticsearch53SpringRepositoryTest.groovy +++ b/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/Elasticsearch53SpringRepositoryTest.groovy @@ -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 springdata @@ -81,14 +70,14 @@ class Elasticsearch53SpringRepositoryTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "CrudRepository.findAll" - spanKind INTERNAL + name "CrudRepository.findAll" + kind INTERNAL attributes { } } span(1) { - operationName "SearchAction" - spanKind CLIENT + name "SearchAction" + kind CLIENT errored false childOf span(0) attributes { @@ -118,14 +107,14 @@ class Elasticsearch53SpringRepositoryTest extends AgentTestRunner { assertTraces(1) { trace(0, 4) { span(0) { - operationName "ElasticsearchRepository.index" - spanKind INTERNAL + name "ElasticsearchRepository.index" + kind INTERNAL attributes { } } span(1) { - operationName "IndexAction" - spanKind CLIENT + name "IndexAction" + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" @@ -142,8 +131,8 @@ class Elasticsearch53SpringRepositoryTest extends AgentTestRunner { } } span(2) { - operationName "PutMappingAction" - spanKind CLIENT + name "PutMappingAction" + kind CLIENT childOf span(1) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" @@ -153,8 +142,8 @@ class Elasticsearch53SpringRepositoryTest extends AgentTestRunner { } } span(3) { - operationName "RefreshAction" - spanKind CLIENT + name "RefreshAction" + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" @@ -178,14 +167,14 @@ class Elasticsearch53SpringRepositoryTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "CrudRepository.findById" - spanKind INTERNAL + name "CrudRepository.findById" + kind INTERNAL attributes { } } span(1) { - operationName "GetAction" - spanKind CLIENT + name "GetAction" + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" @@ -213,14 +202,14 @@ class Elasticsearch53SpringRepositoryTest extends AgentTestRunner { assertTraces(2) { trace(0, 3) { span(0) { - operationName "ElasticsearchRepository.index" - spanKind INTERNAL + name "ElasticsearchRepository.index" + kind INTERNAL attributes { } } span(1) { - operationName "IndexAction" - spanKind CLIENT + name "IndexAction" + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" @@ -237,8 +226,8 @@ class Elasticsearch53SpringRepositoryTest extends AgentTestRunner { } } span(2) { - operationName "RefreshAction" - spanKind CLIENT + name "RefreshAction" + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" @@ -254,14 +243,14 @@ class Elasticsearch53SpringRepositoryTest extends AgentTestRunner { } trace(1, 2) { span(0) { - operationName "CrudRepository.findById" - spanKind INTERNAL + name "CrudRepository.findById" + kind INTERNAL attributes { } } span(1) { - operationName "GetAction" - spanKind CLIENT + name "GetAction" + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" @@ -288,14 +277,14 @@ class Elasticsearch53SpringRepositoryTest extends AgentTestRunner { assertTraces(2) { trace(0, 3) { span(0) { - operationName "CrudRepository.deleteById" - spanKind INTERNAL + name "CrudRepository.deleteById" + kind INTERNAL attributes { } } span(1) { - operationName "DeleteAction" - spanKind CLIENT + name "DeleteAction" + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" @@ -311,8 +300,8 @@ class Elasticsearch53SpringRepositoryTest extends AgentTestRunner { } } span(2) { - operationName "RefreshAction" - spanKind CLIENT + name "RefreshAction" + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" @@ -329,14 +318,14 @@ class Elasticsearch53SpringRepositoryTest extends AgentTestRunner { trace(1, 2) { span(0) { - operationName "CrudRepository.findAll" - spanKind INTERNAL + name "CrudRepository.findAll" + kind INTERNAL attributes { } } span(1) { - operationName "SearchAction" - spanKind CLIENT + name "SearchAction" + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" diff --git a/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/Elasticsearch53SpringTemplateTest.groovy b/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/Elasticsearch53SpringTemplateTest.groovy index 7abba68386c2..ddafe26a4b17 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/Elasticsearch53SpringTemplateTest.groovy +++ b/instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/Elasticsearch53SpringTemplateTest.groovy @@ -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 springdata @@ -104,8 +93,8 @@ class Elasticsearch53SpringTemplateTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "RefreshAction" - spanKind CLIENT + name "RefreshAction" + kind CLIENT errored true errorEvent IndexNotFoundException, "no such index" attributes { @@ -155,8 +144,8 @@ class Elasticsearch53SpringTemplateTest extends AgentTestRunner { assertTraces(6) { trace(0, 1) { span(0) { - operationName "CreateIndexAction" - spanKind CLIENT + name "CreateIndexAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "CreateIndexAction" @@ -168,8 +157,8 @@ class Elasticsearch53SpringTemplateTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "ClusterHealthAction" - spanKind CLIENT + name "ClusterHealthAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "ClusterHealthAction" @@ -180,8 +169,8 @@ class Elasticsearch53SpringTemplateTest extends AgentTestRunner { } trace(2, 1) { span(0) { - operationName "SearchAction" - spanKind CLIENT + name "SearchAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "SearchAction" @@ -194,8 +183,8 @@ class Elasticsearch53SpringTemplateTest extends AgentTestRunner { } trace(3, 2) { span(0) { - operationName "IndexAction" - spanKind CLIENT + name "IndexAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "IndexAction" @@ -211,8 +200,8 @@ class Elasticsearch53SpringTemplateTest extends AgentTestRunner { } } span(1) { - operationName "PutMappingAction" - spanKind CLIENT + name "PutMappingAction" + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" @@ -224,8 +213,8 @@ class Elasticsearch53SpringTemplateTest extends AgentTestRunner { } trace(4, 1) { span(0) { - operationName "RefreshAction" - spanKind CLIENT + name "RefreshAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "RefreshAction" @@ -240,8 +229,8 @@ class Elasticsearch53SpringTemplateTest extends AgentTestRunner { } trace(5, 1) { span(0) { - operationName "SearchAction" - spanKind CLIENT + name "SearchAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "SearchAction" @@ -318,8 +307,8 @@ class Elasticsearch53SpringTemplateTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SearchAction" - spanKind CLIENT + name "SearchAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "SearchAction" diff --git a/instrumentation/elasticsearch/elasticsearch-transport-6.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v6_0/Elasticsearch6TransportClientInstrumentation.java b/instrumentation/elasticsearch/elasticsearch-transport-6.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v6_0/Elasticsearch6TransportClientInstrumentation.java index 7ca9b5f6ab20..26d0b6e2618e 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-6.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v6_0/Elasticsearch6TransportClientInstrumentation.java +++ b/instrumentation/elasticsearch/elasticsearch-transport-6.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v6_0/Elasticsearch6TransportClientInstrumentation.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.elasticsearch.transport.v6_0; diff --git a/instrumentation/elasticsearch/elasticsearch-transport-6.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v6_0/TransportActionListener.java b/instrumentation/elasticsearch/elasticsearch-transport-6.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v6_0/TransportActionListener.java index e10907819b53..591144d42ba6 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-6.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v6_0/TransportActionListener.java +++ b/instrumentation/elasticsearch/elasticsearch-transport-6.0/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/v6_0/TransportActionListener.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.elasticsearch.transport.v6_0; diff --git a/instrumentation/elasticsearch/elasticsearch-transport-6.0/src/test/groovy/Elasticsearch6NodeClientTest.groovy b/instrumentation/elasticsearch/elasticsearch-transport-6.0/src/test/groovy/Elasticsearch6NodeClientTest.groovy index 382a74cd3b87..19c51c95806b 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-6.0/src/test/groovy/Elasticsearch6NodeClientTest.groovy +++ b/instrumentation/elasticsearch/elasticsearch-transport-6.0/src/test/groovy/Elasticsearch6NodeClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace @@ -83,8 +72,8 @@ class Elasticsearch6NodeClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "ClusterHealthAction" - spanKind CLIENT + name "ClusterHealthAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "ClusterHealthAction" @@ -107,8 +96,8 @@ class Elasticsearch6NodeClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GetAction" - spanKind CLIENT + name "GetAction" + kind CLIENT errored true errorEvent IndexNotFoundException, "no such index" attributes { @@ -169,8 +158,8 @@ class Elasticsearch6NodeClientTest extends AgentTestRunner { assertTraces(4) { trace(0, 1) { span(0) { - operationName "CreateIndexAction" - spanKind CLIENT + name "CreateIndexAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "CreateIndexAction" @@ -182,8 +171,8 @@ class Elasticsearch6NodeClientTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "GetAction" - spanKind CLIENT + name "GetAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "GetAction" @@ -198,8 +187,8 @@ class Elasticsearch6NodeClientTest extends AgentTestRunner { } trace(2, 2) { span(0) { - operationName "IndexAction" - spanKind CLIENT + name "IndexAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "IndexAction" @@ -215,8 +204,8 @@ class Elasticsearch6NodeClientTest extends AgentTestRunner { } } span(1) { - operationName "PutMappingAction" - spanKind CLIENT + name "PutMappingAction" + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" @@ -228,8 +217,8 @@ class Elasticsearch6NodeClientTest extends AgentTestRunner { } trace(3, 1) { span(0) { - operationName "GetAction" - spanKind CLIENT + name "GetAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "GetAction" diff --git a/instrumentation/elasticsearch/elasticsearch-transport-6.0/src/test/groovy/Elasticsearch6TransportClientTest.groovy b/instrumentation/elasticsearch/elasticsearch-transport-6.0/src/test/groovy/Elasticsearch6TransportClientTest.groovy index 7fbb42d8c3d0..7a07459b0062 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-6.0/src/test/groovy/Elasticsearch6TransportClientTest.groovy +++ b/instrumentation/elasticsearch/elasticsearch-transport-6.0/src/test/groovy/Elasticsearch6TransportClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace @@ -98,8 +87,8 @@ class Elasticsearch6TransportClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "ClusterHealthAction" - spanKind CLIENT + name "ClusterHealthAction" + kind CLIENT attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" "localhost" "${SemanticAttributes.NET_PEER_IP.key()}" tcpPublishAddress.address @@ -125,8 +114,8 @@ class Elasticsearch6TransportClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GetAction" - spanKind CLIENT + name "GetAction" + kind CLIENT errored true errorEvent RemoteTransportException, String attributes { @@ -195,8 +184,8 @@ class Elasticsearch6TransportClientTest extends AgentTestRunner { } trace(0, 1) { span(0) { - operationName "CreateIndexAction" - spanKind CLIENT + name "CreateIndexAction" + kind CLIENT attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" "localhost" "${SemanticAttributes.NET_PEER_IP.key()}" tcpPublishAddress.address @@ -211,8 +200,8 @@ class Elasticsearch6TransportClientTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "GetAction" - spanKind CLIENT + name "GetAction" + kind CLIENT attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" "localhost" "${SemanticAttributes.NET_PEER_IP.key()}" tcpPublishAddress.address @@ -230,8 +219,8 @@ class Elasticsearch6TransportClientTest extends AgentTestRunner { } trace(2, 1) { span(0) { - operationName "PutMappingAction" - spanKind CLIENT + name "PutMappingAction" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "elasticsearch" "${SemanticAttributes.DB_OPERATION.key()}" "PutMappingAction" @@ -242,8 +231,8 @@ class Elasticsearch6TransportClientTest extends AgentTestRunner { } trace(3, 1) { span(0) { - operationName "IndexAction" - spanKind CLIENT + name "IndexAction" + kind CLIENT attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" "localhost" "${SemanticAttributes.NET_PEER_IP.key()}" tcpPublishAddress.address @@ -264,8 +253,8 @@ class Elasticsearch6TransportClientTest extends AgentTestRunner { } trace(4, 1) { span(0) { - operationName "GetAction" - spanKind CLIENT + name "GetAction" + kind CLIENT attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" "localhost" "${SemanticAttributes.NET_PEER_IP.key()}" tcpPublishAddress.address diff --git a/instrumentation/elasticsearch/elasticsearch-transport-common/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/ElasticsearchTransportClientTracer.java b/instrumentation/elasticsearch/elasticsearch-transport-common/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/ElasticsearchTransportClientTracer.java index a482f8eef12d..a62da79614ee 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-common/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/ElasticsearchTransportClientTracer.java +++ b/instrumentation/elasticsearch/elasticsearch-transport-common/src/main/java/io/opentelemetry/instrumentation/auto/elasticsearch/transport/ElasticsearchTransportClientTracer.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.elasticsearch.transport; diff --git a/instrumentation/external-annotations/src/main/java/io/opentelemetry/instrumentation/auto/traceannotation/AbstractTraceAnnotationInstrumentation.java b/instrumentation/external-annotations/src/main/java/io/opentelemetry/instrumentation/auto/traceannotation/AbstractTraceAnnotationInstrumentation.java index abb5e1b8dbd7..df4361eb8f58 100644 --- a/instrumentation/external-annotations/src/main/java/io/opentelemetry/instrumentation/auto/traceannotation/AbstractTraceAnnotationInstrumentation.java +++ b/instrumentation/external-annotations/src/main/java/io/opentelemetry/instrumentation/auto/traceannotation/AbstractTraceAnnotationInstrumentation.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.traceannotation; diff --git a/instrumentation/external-annotations/src/main/java/io/opentelemetry/instrumentation/auto/traceannotation/TraceAdvice.java b/instrumentation/external-annotations/src/main/java/io/opentelemetry/instrumentation/auto/traceannotation/TraceAdvice.java index 42b4064a8baa..cd6cbd41b0fc 100644 --- a/instrumentation/external-annotations/src/main/java/io/opentelemetry/instrumentation/auto/traceannotation/TraceAdvice.java +++ b/instrumentation/external-annotations/src/main/java/io/opentelemetry/instrumentation/auto/traceannotation/TraceAdvice.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.traceannotation; diff --git a/instrumentation/external-annotations/src/main/java/io/opentelemetry/instrumentation/auto/traceannotation/TraceAnnotationTracer.java b/instrumentation/external-annotations/src/main/java/io/opentelemetry/instrumentation/auto/traceannotation/TraceAnnotationTracer.java index f7661c09eeba..82d5e21d4f98 100644 --- a/instrumentation/external-annotations/src/main/java/io/opentelemetry/instrumentation/auto/traceannotation/TraceAnnotationTracer.java +++ b/instrumentation/external-annotations/src/main/java/io/opentelemetry/instrumentation/auto/traceannotation/TraceAnnotationTracer.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.traceannotation; diff --git a/instrumentation/external-annotations/src/main/java/io/opentelemetry/instrumentation/auto/traceannotation/TraceAnnotationsInstrumentation.java b/instrumentation/external-annotations/src/main/java/io/opentelemetry/instrumentation/auto/traceannotation/TraceAnnotationsInstrumentation.java index 68b77d54b0c9..71152c1e79db 100644 --- a/instrumentation/external-annotations/src/main/java/io/opentelemetry/instrumentation/auto/traceannotation/TraceAnnotationsInstrumentation.java +++ b/instrumentation/external-annotations/src/main/java/io/opentelemetry/instrumentation/auto/traceannotation/TraceAnnotationsInstrumentation.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.traceannotation; diff --git a/instrumentation/external-annotations/src/main/java/io/opentelemetry/instrumentation/auto/traceannotation/TraceConfigInstrumentation.java b/instrumentation/external-annotations/src/main/java/io/opentelemetry/instrumentation/auto/traceannotation/TraceConfigInstrumentation.java index 1ffa400a2e5f..e22d5920c61e 100644 --- a/instrumentation/external-annotations/src/main/java/io/opentelemetry/instrumentation/auto/traceannotation/TraceConfigInstrumentation.java +++ b/instrumentation/external-annotations/src/main/java/io/opentelemetry/instrumentation/auto/traceannotation/TraceConfigInstrumentation.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.traceannotation; @@ -79,6 +68,11 @@ public AgentBuilder instrument(AgentBuilder agentBuilder) { return agentBuilder; } + @Override + public int getOrder() { + return 0; + } + // Not Using AutoService to hook up this instrumentation public static class TracerClassInstrumentation extends Default { private final String className; diff --git a/instrumentation/external-annotations/src/test/groovy/ConfiguredTraceAnnotationsTest.groovy b/instrumentation/external-annotations/src/test/groovy/ConfiguredTraceAnnotationsTest.groovy index e588f11c889a..5a9a883b9a56 100644 --- a/instrumentation/external-annotations/src/test/groovy/ConfiguredTraceAnnotationsTest.groovy +++ b/instrumentation/external-annotations/src/test/groovy/ConfiguredTraceAnnotationsTest.groovy @@ -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 */ import static io.opentelemetry.instrumentation.auto.traceannotation.TraceAnnotationsInstrumentation.DEFAULT_ANNOTATIONS @@ -23,17 +12,12 @@ import io.opentelemetry.test.annotation.SayTracedHello import java.util.concurrent.Callable class ConfiguredTraceAnnotationsTest extends AgentTestRunner { - - static { - ConfigUtils.updateConfig { - System.setProperty("otel.trace.annotations", "package.Class\$Name;${OuterClass.InterestingMethod.name}") - } + static final PREVIOUS_CONFIG = ConfigUtils.updateConfigAndResetInstrumentation { + it.setProperty("otel.trace.annotations", "package.Class\$Name;${OuterClass.InterestingMethod.name}") } - def cleanupSpec() { - ConfigUtils.updateConfig { - System.clearProperty("otel.trace.annotations") - } + def specCleanup() { + ConfigUtils.setConfig(PREVIOUS_CONFIG) } def "method with disabled NewRelic annotation should be ignored"() { @@ -52,7 +36,7 @@ class ConfiguredTraceAnnotationsTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "AnnotationTracedCallable.call" + name "AnnotationTracedCallable.call" attributes { } } @@ -62,11 +46,11 @@ class ConfiguredTraceAnnotationsTest extends AgentTestRunner { def "test configuration #value"() { setup: - ConfigUtils.updateConfig { + def previousConfig = ConfigUtils.updateConfig { if (value) { - System.properties.setProperty("otel.trace.annotations", value) + it.setProperty("otel.trace.annotations", value) } else { - System.clearProperty("otel.trace.annotations") + it.remove("otel.trace.annotations") } } @@ -74,7 +58,7 @@ class ConfiguredTraceAnnotationsTest extends AgentTestRunner { new TraceAnnotationsInstrumentation().additionalTraceAnnotations == expected.toSet() cleanup: - System.clearProperty("otel.trace.annotations") + ConfigUtils.setConfig(previousConfig) where: value | expected diff --git a/instrumentation/external-annotations/src/test/groovy/TraceAnnotationsTest.groovy b/instrumentation/external-annotations/src/test/groovy/TraceAnnotationsTest.groovy index 25b8b59dd2f0..d57753ccbd56 100644 --- a/instrumentation/external-annotations/src/test/groovy/TraceAnnotationsTest.groovy +++ b/instrumentation/external-annotations/src/test/groovy/TraceAnnotationsTest.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestRunner @@ -30,8 +19,8 @@ class TraceAnnotationsTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SayTracedHello.sayHello" - parent() + name "SayTracedHello.sayHello" + hasNoParent() errored false attributes { "myattr" "test" @@ -50,15 +39,15 @@ class TraceAnnotationsTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName "SayTracedHello.sayHELLOsayHA" - parent() + name "SayTracedHello.sayHELLOsayHA" + hasNoParent() errored false attributes { "myattr" "test2" } } span(1) { - operationName "SayTracedHello.sayHello" + name "SayTracedHello.sayHello" childOf span(0) errored false attributes { @@ -66,7 +55,7 @@ class TraceAnnotationsTest extends AgentTestRunner { } } span(2) { - operationName "SayTracedHello.sayHello" + name "SayTracedHello.sayHello" childOf span(0) errored false attributes { @@ -90,7 +79,7 @@ class TraceAnnotationsTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SayTracedHello.sayERROR" + name "SayTracedHello.sayERROR" errored true errorEvent(error.class) } @@ -107,7 +96,7 @@ class TraceAnnotationsTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SayTracedHello\$1.call" + name "SayTracedHello\$1.call" attributes { } } @@ -128,13 +117,13 @@ class TraceAnnotationsTest extends AgentTestRunner { assertTraces(2) { trace(0, 1) { span(0) { - operationName "SayTracedHello\$1.call" + name "SayTracedHello\$1.call" attributes { } } trace(1, 1) { span(0) { - operationName "TraceAnnotationsTest\$1.call" + name "TraceAnnotationsTest\$1.call" attributes { } } diff --git a/instrumentation/external-annotations/src/test/groovy/TraceConfigTest.groovy b/instrumentation/external-annotations/src/test/groovy/TraceConfigTest.groovy index 9d90bda79aaa..11d412ed3d1d 100644 --- a/instrumentation/external-annotations/src/test/groovy/TraceConfigTest.groovy +++ b/instrumentation/external-annotations/src/test/groovy/TraceConfigTest.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestRunner @@ -19,17 +8,12 @@ import io.opentelemetry.auto.test.utils.ConfigUtils import java.util.concurrent.Callable class TraceConfigTest extends AgentTestRunner { - - static { - ConfigUtils.updateConfig { - System.setProperty("otel.trace.methods", "package.ClassName[method1,method2];${ConfigTracedCallable.name}[call]") - } + static final PREVIOUS_CONFIG = ConfigUtils.updateConfigAndResetInstrumentation { + it.setProperty("otel.trace.methods", "package.ClassName[method1,method2];${ConfigTracedCallable.name}[call]") } def cleanupSpec() { - ConfigUtils.updateConfig { - System.clearProperty("otel.trace.methods") - } + ConfigUtils.setConfig(PREVIOUS_CONFIG) } class ConfigTracedCallable implements Callable { @@ -47,7 +31,7 @@ class TraceConfigTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "ConfigTracedCallable.call" + name "ConfigTracedCallable.call" attributes { } } diff --git a/instrumentation/external-annotations/src/test/groovy/TraceProvidersTest.groovy b/instrumentation/external-annotations/src/test/groovy/TraceProvidersTest.groovy index 71a78ec328ed..1039f9c0ee15 100644 --- a/instrumentation/external-annotations/src/test/groovy/TraceProvidersTest.groovy +++ b/instrumentation/external-annotations/src/test/groovy/TraceProvidersTest.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestRunner @@ -22,18 +11,13 @@ import io.opentelemetry.test.annotation.SayTracedHello * This test verifies that Otel supports various 3rd-party trace annotations */ class TraceProvidersTest extends AgentTestRunner { - - static { - ConfigUtils.updateConfig { - //Don't bother to instrument inner closures of this test class - System.setProperty("otel.trace.classes.exclude", TraceProvidersTest.name + "*") - } + //Don't bother to instrument inner closures of this test class + static final PREVIOUS_CONFIG = ConfigUtils.updateConfigAndResetInstrumentation { + it.setProperty("otel.trace.classes.exclude", TraceProvidersTest.name + "*") } def cleanupSpec() { - ConfigUtils.updateConfig { - System.clearProperty("otel.trace.classes.exclude") - } + ConfigUtils.setConfig(PREVIOUS_CONFIG) } def "should support #provider"(String provider) { @@ -44,8 +28,8 @@ class TraceProvidersTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SayTracedHello.${provider.toLowerCase()}" - parent() + name "SayTracedHello.${provider.toLowerCase()}" + hasNoParent() errored false attributes { "providerAttr" provider diff --git a/instrumentation/external-annotations/src/test/groovy/TracedMethodsExclusionTest.groovy b/instrumentation/external-annotations/src/test/groovy/TracedMethodsExclusionTest.groovy index 1f41b3988b63..d60adc31f290 100644 --- a/instrumentation/external-annotations/src/test/groovy/TracedMethodsExclusionTest.groovy +++ b/instrumentation/external-annotations/src/test/groovy/TracedMethodsExclusionTest.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestRunner @@ -19,19 +8,15 @@ import io.opentelemetry.auto.test.utils.ConfigUtils import io.opentracing.contrib.dropwizard.Trace class TracedMethodsExclusionTest extends AgentTestRunner { - - static { - ConfigUtils.updateConfig { - System.setProperty("otel.trace.methods", "${TestClass.name}[included,excluded]") - System.setProperty("otel.trace.annotated.methods.exclude", "${TestClass.name}[excluded,annotatedButExcluded]") - } + static final PREVIOUS_CONFIG = ConfigUtils.updateConfigAndResetInstrumentation { + // remove trace annotations in case previous tests have set it + it.remove("otel.trace.annotations") + it.setProperty("otel.trace.methods", "${TestClass.name}[included,excluded]") + it.setProperty("otel.trace.annotated.methods.exclude", "${TestClass.name}[excluded,annotatedButExcluded]") } def cleanupSpec() { - ConfigUtils.updateConfig { - System.clearProperty("otel.trace.methods") - System.clearProperty("otel.trace.annotated.methods.exclude") - } + ConfigUtils.setConfig(PREVIOUS_CONFIG) } static class TestClass { @@ -75,14 +60,14 @@ class TracedMethodsExclusionTest extends AgentTestRunner { assertTraces(2) { trace(0, 1) { span(0) { - operationName "TestClass.included" + name "TestClass.included" attributes { } } } trace(1, 1) { span(0) { - operationName "TestClass.annotated" + name "TestClass.annotated" attributes { } } diff --git a/instrumentation/external-annotations/src/test/java/OuterClass.java b/instrumentation/external-annotations/src/test/java/OuterClass.java index cc8f01c0c455..5fb43c2330f9 100644 --- a/instrumentation/external-annotations/src/test/java/OuterClass.java +++ b/instrumentation/external-annotations/src/test/java/OuterClass.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 */ import static java.lang.annotation.ElementType.METHOD; diff --git a/instrumentation/external-annotations/src/test/java/io/opentelemetry/test/annotation/SayTracedHello.java b/instrumentation/external-annotations/src/test/java/io/opentelemetry/test/annotation/SayTracedHello.java index ebb136dc8ea6..f3cb053ee6b1 100644 --- a/instrumentation/external-annotations/src/test/java/io/opentelemetry/test/annotation/SayTracedHello.java +++ b/instrumentation/external-annotations/src/test/java/io/opentelemetry/test/annotation/SayTracedHello.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.test.annotation; diff --git a/instrumentation/finatra-2.9/src/latestDepTest/groovy/FinatraServerLatestTest.groovy b/instrumentation/finatra-2.9/src/latestDepTest/groovy/FinatraServerLatestTest.groovy index 0a68d29ab04a..8e81aabe0523 100644 --- a/instrumentation/finatra-2.9/src/latestDepTest/groovy/FinatraServerLatestTest.groovy +++ b/instrumentation/finatra-2.9/src/latestDepTest/groovy/FinatraServerLatestTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.SUCCESS @@ -95,8 +84,8 @@ class FinatraServerLatestTest extends HttpServerTest { @Override void handlerSpan(TraceAssert trace, int index, Object parent, String method = "GET", ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName "FinatraController" - spanKind INTERNAL + name "FinatraController" + kind INTERNAL childOf(parent as SpanData) // Finatra doesn't propagate the stack trace or exception to the instrumentation // so the normal errorAttributes() method can't be used diff --git a/instrumentation/finatra-2.9/src/latestDepTest/scala/FinatraController.scala b/instrumentation/finatra-2.9/src/latestDepTest/scala/FinatraController.scala index b1b75ba6c321..97fef999bfa6 100644 --- a/instrumentation/finatra-2.9/src/latestDepTest/scala/FinatraController.scala +++ b/instrumentation/finatra-2.9/src/latestDepTest/scala/FinatraController.scala @@ -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 */ import com.twitter.finagle.http.{Request, Response} diff --git a/instrumentation/finatra-2.9/src/latestDepTest/scala/FinatraServer.scala b/instrumentation/finatra-2.9/src/latestDepTest/scala/FinatraServer.scala index 94f5ec2ed752..9a7405e55745 100644 --- a/instrumentation/finatra-2.9/src/latestDepTest/scala/FinatraServer.scala +++ b/instrumentation/finatra-2.9/src/latestDepTest/scala/FinatraServer.scala @@ -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 */ import com.twitter.finagle.http.Request diff --git a/instrumentation/finatra-2.9/src/latestDepTest/scala/ResponseSettingExceptionMapper.scala b/instrumentation/finatra-2.9/src/latestDepTest/scala/ResponseSettingExceptionMapper.scala index b14b262fc132..dbc7841e47dd 100644 --- a/instrumentation/finatra-2.9/src/latestDepTest/scala/ResponseSettingExceptionMapper.scala +++ b/instrumentation/finatra-2.9/src/latestDepTest/scala/ResponseSettingExceptionMapper.scala @@ -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 */ import com.twitter.finagle.http.{Request, Response} diff --git a/instrumentation/finatra-2.9/src/main/java/io/opentelemetry/instrumentation/auto/finatra/FinatraInstrumentation.java b/instrumentation/finatra-2.9/src/main/java/io/opentelemetry/instrumentation/auto/finatra/FinatraInstrumentation.java index 230942ed2a65..a3e2938184b1 100644 --- a/instrumentation/finatra-2.9/src/main/java/io/opentelemetry/instrumentation/auto/finatra/FinatraInstrumentation.java +++ b/instrumentation/finatra-2.9/src/main/java/io/opentelemetry/instrumentation/auto/finatra/FinatraInstrumentation.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.finatra; diff --git a/instrumentation/finatra-2.9/src/main/java/io/opentelemetry/instrumentation/auto/finatra/FinatraTracer.java b/instrumentation/finatra-2.9/src/main/java/io/opentelemetry/instrumentation/auto/finatra/FinatraTracer.java index 4a0bd6c7f146..2b304be63591 100644 --- a/instrumentation/finatra-2.9/src/main/java/io/opentelemetry/instrumentation/auto/finatra/FinatraTracer.java +++ b/instrumentation/finatra-2.9/src/main/java/io/opentelemetry/instrumentation/auto/finatra/FinatraTracer.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.finatra; diff --git a/instrumentation/finatra-2.9/src/test/groovy/FinatraServerTest.groovy b/instrumentation/finatra-2.9/src/test/groovy/FinatraServerTest.groovy index 950c7a03217c..2c8f5980703d 100644 --- a/instrumentation/finatra-2.9/src/test/groovy/FinatraServerTest.groovy +++ b/instrumentation/finatra-2.9/src/test/groovy/FinatraServerTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.PATH_PARAM @@ -84,8 +73,8 @@ class FinatraServerTest extends HttpServerTest { @Override void handlerSpan(TraceAssert trace, int index, Object parent, String method = "GET", ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName "FinatraController" - spanKind INTERNAL + name "FinatraController" + kind INTERNAL childOf(parent as SpanData) // Finatra doesn't propagate the stack trace or exception to the instrumentation // so the normal errorAttributes() method can't be used @@ -98,14 +87,14 @@ class FinatraServerTest extends HttpServerTest { @Override void serverSpan(TraceAssert trace, int index, String traceID = null, String parentID = null, String method = "GET", Long responseContentLength = null, ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName endpoint == PATH_PARAM ? "/path/:id/param" : endpoint.resolvePath(address).path - spanKind SERVER + name endpoint == PATH_PARAM ? "/path/:id/param" : endpoint.resolvePath(address).path + kind SERVER errored endpoint.errored if (parentID != null) { traceId traceID - parentId parentID + parentSpanId parentID } else { - parent() + hasNoParent() } attributes { "${SemanticAttributes.NET_PEER_PORT.key()}" Long diff --git a/instrumentation/finatra-2.9/src/test/scala/FinatraController.scala b/instrumentation/finatra-2.9/src/test/scala/FinatraController.scala index 3a5519e9676c..b9f0d5d0c088 100644 --- a/instrumentation/finatra-2.9/src/test/scala/FinatraController.scala +++ b/instrumentation/finatra-2.9/src/test/scala/FinatraController.scala @@ -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 */ import com.twitter.finagle.http.{Request, Response} diff --git a/instrumentation/finatra-2.9/src/test/scala/FinatraServer.scala b/instrumentation/finatra-2.9/src/test/scala/FinatraServer.scala index 94f5ec2ed752..9a7405e55745 100644 --- a/instrumentation/finatra-2.9/src/test/scala/FinatraServer.scala +++ b/instrumentation/finatra-2.9/src/test/scala/FinatraServer.scala @@ -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 */ import com.twitter.finagle.http.Request diff --git a/instrumentation/finatra-2.9/src/test/scala/ResponseSettingExceptionMapper.scala b/instrumentation/finatra-2.9/src/test/scala/ResponseSettingExceptionMapper.scala index b14b262fc132..dbc7841e47dd 100644 --- a/instrumentation/finatra-2.9/src/test/scala/ResponseSettingExceptionMapper.scala +++ b/instrumentation/finatra-2.9/src/test/scala/ResponseSettingExceptionMapper.scala @@ -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 */ import com.twitter.finagle.http.{Request, Response} diff --git a/instrumentation/geode-1.4/src/main/java/io/opentelemetry/instrumentation/auto/geode/GeodeInstrumentation.java b/instrumentation/geode-1.4/src/main/java/io/opentelemetry/instrumentation/auto/geode/GeodeInstrumentation.java index b4acad91eee2..67b2774b8ae1 100644 --- a/instrumentation/geode-1.4/src/main/java/io/opentelemetry/instrumentation/auto/geode/GeodeInstrumentation.java +++ b/instrumentation/geode-1.4/src/main/java/io/opentelemetry/instrumentation/auto/geode/GeodeInstrumentation.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.geode; diff --git a/instrumentation/geode-1.4/src/main/java/io/opentelemetry/instrumentation/auto/geode/GeodeTracer.java b/instrumentation/geode-1.4/src/main/java/io/opentelemetry/instrumentation/auto/geode/GeodeTracer.java index c93d11271cb8..7a35535832a8 100644 --- a/instrumentation/geode-1.4/src/main/java/io/opentelemetry/instrumentation/auto/geode/GeodeTracer.java +++ b/instrumentation/geode-1.4/src/main/java/io/opentelemetry/instrumentation/auto/geode/GeodeTracer.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.geode; @@ -26,7 +15,7 @@ import org.apache.geode.cache.Region; public class GeodeTracer extends DatabaseClientTracer, String> { - public static GeodeTracer TRACER = new GeodeTracer(); + public static final GeodeTracer TRACER = new GeodeTracer(); public Span startSpan(String operation, Region connection, String query) { String normalizedQuery = normalizeQuery(query); diff --git a/instrumentation/geode-1.4/src/test/groovy/PutGetTest.groovy b/instrumentation/geode-1.4/src/test/groovy/PutGetTest.groovy index c4ad4d18e97a..e7b21fe332bd 100644 --- a/instrumentation/geode-1.4/src/test/groovy/PutGetTest.groovy +++ b/instrumentation/geode-1.4/src/test/groovy/PutGetTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace @@ -123,13 +112,13 @@ class PutGetTest extends AgentTestRunner { assertTraces(1) { trace(0, 4) { span(0) { - operationName "someTrace" - spanKind INTERNAL + name "someTrace" + kind INTERNAL errored false } span(1) { - operationName "clear" - spanKind CLIENT + name "clear" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "geode" @@ -138,8 +127,8 @@ class PutGetTest extends AgentTestRunner { } } span(2) { - operationName "put" - spanKind CLIENT + name "put" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "geode" @@ -148,8 +137,8 @@ class PutGetTest extends AgentTestRunner { } } span(3) { - operationName verb - spanKind CLIENT + name verb + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "geode" diff --git a/instrumentation/google-http-client-1.19/src/main/java/io/opentelemetry/instrumentation/auto/googlehttpclient/GoogleHttpClientInstrumentation.java b/instrumentation/google-http-client-1.19/src/main/java/io/opentelemetry/instrumentation/auto/googlehttpclient/GoogleHttpClientInstrumentation.java index 1e1a97759e92..d98d521b1b82 100644 --- a/instrumentation/google-http-client-1.19/src/main/java/io/opentelemetry/instrumentation/auto/googlehttpclient/GoogleHttpClientInstrumentation.java +++ b/instrumentation/google-http-client-1.19/src/main/java/io/opentelemetry/instrumentation/auto/googlehttpclient/GoogleHttpClientInstrumentation.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.googlehttpclient; @@ -34,7 +23,7 @@ import io.opentelemetry.instrumentation.auto.api.InstrumentationContext; import io.opentelemetry.javaagent.tooling.Instrumenter; import io.opentelemetry.trace.Span; -import io.opentelemetry.trace.Status; +import io.opentelemetry.trace.StatusCanonicalCode; import io.opentelemetry.trace.TracingContextUtils; import java.util.HashMap; import java.util.Map; @@ -127,7 +116,7 @@ public static void methodExit( // If HttpRequest.setThrowExceptionOnExecuteError is set to false, there are no exceptions // for a failed request. Thus, check the response code if (response != null && !response.isSuccessStatusCode()) { - span.setStatus(Status.UNKNOWN); + span.setStatus(StatusCanonicalCode.ERROR); } } } diff --git a/instrumentation/google-http-client-1.19/src/main/java/io/opentelemetry/instrumentation/auto/googlehttpclient/GoogleHttpClientTracer.java b/instrumentation/google-http-client-1.19/src/main/java/io/opentelemetry/instrumentation/auto/googlehttpclient/GoogleHttpClientTracer.java index 350502c27803..7aa3d1741607 100644 --- a/instrumentation/google-http-client-1.19/src/main/java/io/opentelemetry/instrumentation/auto/googlehttpclient/GoogleHttpClientTracer.java +++ b/instrumentation/google-http-client-1.19/src/main/java/io/opentelemetry/instrumentation/auto/googlehttpclient/GoogleHttpClientTracer.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.googlehttpclient; diff --git a/instrumentation/google-http-client-1.19/src/main/java/io/opentelemetry/instrumentation/auto/googlehttpclient/HeadersInjectAdapter.java b/instrumentation/google-http-client-1.19/src/main/java/io/opentelemetry/instrumentation/auto/googlehttpclient/HeadersInjectAdapter.java index 0fd7c52ad42a..c19f137a148b 100644 --- a/instrumentation/google-http-client-1.19/src/main/java/io/opentelemetry/instrumentation/auto/googlehttpclient/HeadersInjectAdapter.java +++ b/instrumentation/google-http-client-1.19/src/main/java/io/opentelemetry/instrumentation/auto/googlehttpclient/HeadersInjectAdapter.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.googlehttpclient; diff --git a/instrumentation/google-http-client-1.19/src/test/groovy/AbstractGoogleHttpClientTest.groovy b/instrumentation/google-http-client-1.19/src/test/groovy/AbstractGoogleHttpClientTest.groovy index d14c907d4603..04bd4fb4c9b2 100644 --- a/instrumentation/google-http-client-1.19/src/test/groovy/AbstractGoogleHttpClientTest.groovy +++ b/instrumentation/google-http-client-1.19/src/test/groovy/AbstractGoogleHttpClientTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -75,7 +64,7 @@ abstract class AbstractGoogleHttpClientTest extends HttpClientTest { assertTraces(1) { trace(0, 2) { span(0) { - spanKind CLIENT + kind CLIENT errored true attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" diff --git a/instrumentation/google-http-client-1.19/src/test/groovy/GoogleHttpClientAsyncTest.groovy b/instrumentation/google-http-client-1.19/src/test/groovy/GoogleHttpClientAsyncTest.groovy index 96aec2223dff..9ae715a6fd82 100644 --- a/instrumentation/google-http-client-1.19/src/test/groovy/GoogleHttpClientAsyncTest.groovy +++ b/instrumentation/google-http-client-1.19/src/test/groovy/GoogleHttpClientAsyncTest.groovy @@ -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 */ import com.google.api.client.http.HttpRequest diff --git a/instrumentation/google-http-client-1.19/src/test/groovy/GoogleHttpClientTest.groovy b/instrumentation/google-http-client-1.19/src/test/groovy/GoogleHttpClientTest.groovy index 9f33e763ca30..c30bcd4c915d 100644 --- a/instrumentation/google-http-client-1.19/src/test/groovy/GoogleHttpClientTest.groovy +++ b/instrumentation/google-http-client-1.19/src/test/groovy/GoogleHttpClientTest.groovy @@ -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 */ import com.google.api.client.http.HttpRequest diff --git a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/DefaultFilterChainAdvice.java b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/DefaultFilterChainAdvice.java index d186c61fe93b..e0b3e2304ce1 100644 --- a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/DefaultFilterChainAdvice.java +++ b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/DefaultFilterChainAdvice.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.grizzly; diff --git a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/DefaultFilterChainInstrumentation.java b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/DefaultFilterChainInstrumentation.java index 20c6c427103b..af0ba91d1717 100644 --- a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/DefaultFilterChainInstrumentation.java +++ b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/DefaultFilterChainInstrumentation.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.grizzly; diff --git a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/ExtractAdapter.java b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/ExtractAdapter.java index ef4a977de469..0ea453c04d65 100644 --- a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/ExtractAdapter.java +++ b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/ExtractAdapter.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.grizzly; diff --git a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/FilterAdvice.java b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/FilterAdvice.java index dc7aaca6bf6b..ca52d7bb38ff 100644 --- a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/FilterAdvice.java +++ b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/FilterAdvice.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.grizzly; diff --git a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/FilterInstrumentation.java b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/FilterInstrumentation.java index f1b124956ef9..10a64c7cd3c9 100644 --- a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/FilterInstrumentation.java +++ b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/FilterInstrumentation.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.grizzly; diff --git a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/GrizzlyHttpServerTracer.java b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/GrizzlyHttpServerTracer.java index ee8d89567e88..5c902c666fc4 100644 --- a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/GrizzlyHttpServerTracer.java +++ b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/GrizzlyHttpServerTracer.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.grizzly; diff --git a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/HttpCodecFilterAdvice.java b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/HttpCodecFilterAdvice.java index 8ee4b7c9b793..511582bc3b32 100644 --- a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/HttpCodecFilterAdvice.java +++ b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/HttpCodecFilterAdvice.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.grizzly; diff --git a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/HttpCodecFilterInstrumentation.java b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/HttpCodecFilterInstrumentation.java index 2f3b7f6ebfc2..63f734113f4d 100644 --- a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/HttpCodecFilterInstrumentation.java +++ b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/HttpCodecFilterInstrumentation.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.grizzly; diff --git a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/HttpCodecFilterOldAdvice.java b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/HttpCodecFilterOldAdvice.java index c1f9a5107a18..2e08a111c590 100644 --- a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/HttpCodecFilterOldAdvice.java +++ b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/HttpCodecFilterOldAdvice.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.grizzly; diff --git a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/HttpServerFilterAdvice.java b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/HttpServerFilterAdvice.java index d979d7d485f9..b42d0c4eca7c 100644 --- a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/HttpServerFilterAdvice.java +++ b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/HttpServerFilterAdvice.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.grizzly; diff --git a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/HttpServerFilterInstrumentation.java b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/HttpServerFilterInstrumentation.java index 7867b1df6655..f777904088f7 100644 --- a/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/HttpServerFilterInstrumentation.java +++ b/instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/HttpServerFilterInstrumentation.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.grizzly; diff --git a/instrumentation/grizzly-2.0/src/test/groovy/GrizzlyAsyncTest.groovy b/instrumentation/grizzly-2.0/src/test/groovy/GrizzlyAsyncTest.groovy index 69169f911c81..e3b7b13e451c 100644 --- a/instrumentation/grizzly-2.0/src/test/groovy/GrizzlyAsyncTest.groovy +++ b/instrumentation/grizzly-2.0/src/test/groovy/GrizzlyAsyncTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.ERROR diff --git a/instrumentation/grizzly-2.0/src/test/groovy/GrizzlyFilterchainServerTest.groovy b/instrumentation/grizzly-2.0/src/test/groovy/GrizzlyFilterchainServerTest.groovy index 5f51048016ee..6a4574b84f5f 100644 --- a/instrumentation/grizzly-2.0/src/test/groovy/GrizzlyFilterchainServerTest.groovy +++ b/instrumentation/grizzly-2.0/src/test/groovy/GrizzlyFilterchainServerTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.AUTH_REQUIRED diff --git a/instrumentation/grizzly-2.0/src/test/groovy/GrizzlyIOStrategyTest.groovy b/instrumentation/grizzly-2.0/src/test/groovy/GrizzlyIOStrategyTest.groovy index 7087fe94fb03..6f12ee447af2 100644 --- a/instrumentation/grizzly-2.0/src/test/groovy/GrizzlyIOStrategyTest.groovy +++ b/instrumentation/grizzly-2.0/src/test/groovy/GrizzlyIOStrategyTest.groovy @@ -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 */ import org.glassfish.grizzly.IOStrategy diff --git a/instrumentation/grizzly-2.0/src/test/groovy/GrizzlyTest.groovy b/instrumentation/grizzly-2.0/src/test/groovy/GrizzlyTest.groovy index be9e41ed99bc..795a9a699d48 100644 --- a/instrumentation/grizzly-2.0/src/test/groovy/GrizzlyTest.groovy +++ b/instrumentation/grizzly-2.0/src/test/groovy/GrizzlyTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.ERROR diff --git a/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyClientRequestAdvice.java b/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyClientRequestAdvice.java index 169f50115ff1..12337faa2128 100644 --- a/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyClientRequestAdvice.java +++ b/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyClientRequestAdvice.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.grizzly.client; diff --git a/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyClientRequestInstrumentation.java b/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyClientRequestInstrumentation.java index 8b70368ba01b..03efd69e45e5 100644 --- a/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyClientRequestInstrumentation.java +++ b/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyClientRequestInstrumentation.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.grizzly.client; diff --git a/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyClientResponseAdvice.java b/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyClientResponseAdvice.java index 9e653ff67601..bd33dc886691 100644 --- a/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyClientResponseAdvice.java +++ b/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyClientResponseAdvice.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.grizzly.client; diff --git a/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyClientResponseInstrumentation.java b/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyClientResponseInstrumentation.java index bd13de86df9d..dbec667894b2 100644 --- a/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyClientResponseInstrumentation.java +++ b/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyClientResponseInstrumentation.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.grizzly.client; diff --git a/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyClientTracer.java b/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyClientTracer.java index b057cfdc1dec..daed2a3ef90f 100644 --- a/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyClientTracer.java +++ b/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyClientTracer.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.grizzly.client; diff --git a/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyInjectAdapter.java b/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyInjectAdapter.java index 4ba5dc9755bd..2bebcde860d0 100644 --- a/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyInjectAdapter.java +++ b/instrumentation/grizzly-client-1.9/src/main/java/io/opentelemetry/instrumentation/auto/grizzly/client/GrizzlyInjectAdapter.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.grizzly.client; diff --git a/instrumentation/grizzly-client-1.9/src/test/groovy/GrizzlyAsyncHttpClientTest.groovy b/instrumentation/grizzly-client-1.9/src/test/groovy/GrizzlyAsyncHttpClientTest.groovy index f541357b6abe..086746634939 100644 --- a/instrumentation/grizzly-client-1.9/src/test/groovy/GrizzlyAsyncHttpClientTest.groovy +++ b/instrumentation/grizzly-client-1.9/src/test/groovy/GrizzlyAsyncHttpClientTest.groovy @@ -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 */ import com.ning.http.client.AsyncCompletionHandler diff --git a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/client/GrpcInjectAdapter.java b/instrumentation/grpc-1.5/auto/grpc-1.5-auto.gradle similarity index 50% rename from instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/client/GrpcInjectAdapter.java rename to instrumentation/grpc-1.5/auto/grpc-1.5-auto.gradle index 9dff4775a424..603cb3f08159 100644 --- a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/client/GrpcInjectAdapter.java +++ b/instrumentation/grpc-1.5/auto/grpc-1.5-auto.gradle @@ -14,17 +14,26 @@ * limitations under the License. */ -package io.opentelemetry.instrumentation.auto.grpc.client; +apply from: "$rootDir/gradle/instrumentation.gradle" -import io.grpc.Metadata; -import io.opentelemetry.context.propagation.TextMapPropagator; +muzzle { + pass { + group = "io.grpc" + module = "grpc-core" + versions = "[1.5.0,)" + } +} -public final class GrpcInjectAdapter implements TextMapPropagator.Setter { +def grpcVersion = '1.5.0' - public static final GrpcInjectAdapter SETTER = new GrpcInjectAdapter(); +dependencies { + implementation project(':instrumentation:grpc-1.5:library') - @Override - public void set(Metadata carrier, String key, String value) { - carrier.put(Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER), value); - } -} + library group: 'io.grpc', name: 'grpc-core', version: grpcVersion + + testLibrary group: 'io.grpc', name: 'grpc-netty', version: grpcVersion + testLibrary group: 'io.grpc', name: 'grpc-protobuf', version: grpcVersion + testLibrary group: 'io.grpc', name: 'grpc-stub', version: grpcVersion + + testImplementation project(':instrumentation:grpc-1.5:testing') +} \ No newline at end of file diff --git a/instrumentation/grpc-1.5/auto/src/main/java/io/opentelemetry/instrumentation/auto/grpc/v1_5/AbstractGrpcInstrumentation.java b/instrumentation/grpc-1.5/auto/src/main/java/io/opentelemetry/instrumentation/auto/grpc/v1_5/AbstractGrpcInstrumentation.java new file mode 100644 index 000000000000..b5099712f4f2 --- /dev/null +++ b/instrumentation/grpc-1.5/auto/src/main/java/io/opentelemetry/instrumentation/auto/grpc/v1_5/AbstractGrpcInstrumentation.java @@ -0,0 +1,32 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.instrumentation.auto.grpc.v1_5; + +import io.opentelemetry.javaagent.tooling.Instrumenter; + +abstract class AbstractGrpcInstrumentation extends Instrumenter.Default { + + public AbstractGrpcInstrumentation() { + super("grpc"); + } + + @Override + public final String[] helperClassNames() { + return new String[] { + "io.opentelemetry.instrumentation.grpc.v1_5.common.GrpcHelper", + "io.opentelemetry.instrumentation.grpc.v1_5.client.GrpcClientTracer", + "io.opentelemetry.instrumentation.grpc.v1_5.client.GrpcInjectAdapter", + "io.opentelemetry.instrumentation.grpc.v1_5.client.TracingClientInterceptor", + "io.opentelemetry.instrumentation.grpc.v1_5.client.TracingClientInterceptor$TracingClientCall", + "io.opentelemetry.instrumentation.grpc.v1_5.client.TracingClientInterceptor$TracingClientCallListener", + "io.opentelemetry.instrumentation.grpc.v1_5.server.GrpcExtractAdapter", + "io.opentelemetry.instrumentation.grpc.v1_5.server.GrpcServerTracer", + "io.opentelemetry.instrumentation.grpc.v1_5.server.TracingServerInterceptor", + "io.opentelemetry.instrumentation.grpc.v1_5.server.TracingServerInterceptor$TracingServerCall", + "io.opentelemetry.instrumentation.grpc.v1_5.server.TracingServerInterceptor$TracingServerCallListener", + }; + } +} diff --git a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/client/GrpcClientBuilderBuildInstrumentation.java b/instrumentation/grpc-1.5/auto/src/main/java/io/opentelemetry/instrumentation/auto/grpc/v1_5/GrpcClientBuilderBuildInstrumentation.java similarity index 59% rename from instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/client/GrpcClientBuilderBuildInstrumentation.java rename to instrumentation/grpc-1.5/auto/src/main/java/io/opentelemetry/instrumentation/auto/grpc/v1_5/GrpcClientBuilderBuildInstrumentation.java index c5553e560c42..9d0606a97689 100644 --- a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/client/GrpcClientBuilderBuildInstrumentation.java +++ b/instrumentation/grpc-1.5/auto/src/main/java/io/opentelemetry/instrumentation/auto/grpc/v1_5/GrpcClientBuilderBuildInstrumentation.java @@ -1,20 +1,9 @@ /* * 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.grpc.client; +package io.opentelemetry.instrumentation.auto.grpc.v1_5; import static io.opentelemetry.javaagent.tooling.bytebuddy.matcher.AgentElementMatchers.extendsClass; import static java.util.Collections.singletonMap; @@ -24,11 +13,8 @@ import com.google.auto.service.AutoService; import io.grpc.ClientInterceptor; -import io.grpc.ManagedChannelBuilder; -import io.opentelemetry.instrumentation.auto.api.ContextStore; -import io.opentelemetry.instrumentation.auto.api.InstrumentationContext; +import io.opentelemetry.instrumentation.grpc.v1_5.client.TracingClientInterceptor; import io.opentelemetry.javaagent.tooling.Instrumenter; -import java.net.InetSocketAddress; import java.util.List; import java.util.Map; import net.bytebuddy.asm.Advice; @@ -37,7 +23,7 @@ import net.bytebuddy.matcher.ElementMatcher; @AutoService(Instrumenter.class) -public class GrpcClientBuilderBuildInstrumentation extends AbstractGrpcClientInstrumentation { +public class GrpcClientBuilderBuildInstrumentation extends AbstractGrpcInstrumentation { @Override public ElementMatcher typeMatcher() { @@ -56,7 +42,6 @@ public static class AddInterceptorAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static void addInterceptor( - @Advice.This ManagedChannelBuilder thiz, @Advice.FieldValue("interceptors") List interceptors) { boolean shouldRegister = true; for (ClientInterceptor interceptor : interceptors) { @@ -66,10 +51,7 @@ public static void addInterceptor( } } if (shouldRegister) { - ContextStore contextStore = - InstrumentationContext.get(ManagedChannelBuilder.class, InetSocketAddress.class); - InetSocketAddress sockAddr = contextStore.get(thiz); - interceptors.add(0, new TracingClientInterceptor(sockAddr)); + interceptors.add(0, TracingClientInterceptor.newInterceptor()); } } } diff --git a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/server/GrpcServerBuilderInstrumentation.java b/instrumentation/grpc-1.5/auto/src/main/java/io/opentelemetry/instrumentation/auto/grpc/v1_5/GrpcServerBuilderInstrumentation.java similarity index 54% rename from instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/server/GrpcServerBuilderInstrumentation.java rename to instrumentation/grpc-1.5/auto/src/main/java/io/opentelemetry/instrumentation/auto/grpc/v1_5/GrpcServerBuilderInstrumentation.java index 7cca7a2e3403..46330d6159ce 100644 --- a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/server/GrpcServerBuilderInstrumentation.java +++ b/instrumentation/grpc-1.5/auto/src/main/java/io/opentelemetry/instrumentation/auto/grpc/v1_5/GrpcServerBuilderInstrumentation.java @@ -1,20 +1,9 @@ /* * 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.grpc.server; +package io.opentelemetry.instrumentation.auto.grpc.v1_5; import static java.util.Collections.singletonMap; import static net.bytebuddy.matcher.ElementMatchers.isMethod; @@ -22,6 +11,7 @@ import com.google.auto.service.AutoService; import io.grpc.ServerInterceptor; +import io.opentelemetry.instrumentation.grpc.v1_5.server.TracingServerInterceptor; import io.opentelemetry.javaagent.tooling.Instrumenter; import java.util.List; import java.util.Map; @@ -31,29 +21,13 @@ import net.bytebuddy.matcher.ElementMatcher; @AutoService(Instrumenter.class) -public class GrpcServerBuilderInstrumentation extends Instrumenter.Default { - - public GrpcServerBuilderInstrumentation() { - super("grpc", "grpc-server"); - } +public class GrpcServerBuilderInstrumentation extends AbstractGrpcInstrumentation { @Override public ElementMatcher typeMatcher() { return named("io.grpc.internal.AbstractServerImplBuilder"); } - @Override - public String[] helperClassNames() { - return new String[] { - packageName + ".GrpcServerTracer", - packageName + ".GrpcExtractAdapter", - packageName + ".TracingServerInterceptor", - packageName + ".TracingServerInterceptor$TracingServerCall", - packageName + ".TracingServerInterceptor$TracingServerCallListener", - "io.opentelemetry.instrumentation.auto.grpc.common.GrpcHelper", - }; - } - @Override public Map, String> transformers() { return singletonMap( @@ -74,7 +48,7 @@ public static void addInterceptor( } } if (shouldRegister) { - interceptors.add(0, TracingServerInterceptor.INSTANCE); + interceptors.add(0, TracingServerInterceptor.newInterceptor()); } } } diff --git a/instrumentation/grpc-1.5/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/grpc/v1_5/GrpcStreamingTest.groovy b/instrumentation/grpc-1.5/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/grpc/v1_5/GrpcStreamingTest.groovy new file mode 100644 index 000000000000..44bfe4c8efe3 --- /dev/null +++ b/instrumentation/grpc-1.5/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/grpc/v1_5/GrpcStreamingTest.groovy @@ -0,0 +1,23 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.instrumentation.auto.grpc.v1_5 + +import io.grpc.ManagedChannelBuilder +import io.grpc.ServerBuilder +import io.opentelemetry.auto.test.AgentTestTrait +import io.opentelemetry.instrumentation.grpc.v1_5.AbstractGrpcStreamingTest + +class GrpcStreamingTest extends AbstractGrpcStreamingTest implements AgentTestTrait { + @Override + ServerBuilder configureServer(ServerBuilder server) { + return server + } + + @Override + ManagedChannelBuilder configureClient(ManagedChannelBuilder client) { + return client + } +} diff --git a/instrumentation/grpc-1.5/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/grpc/v1_5/GrpcTest.groovy b/instrumentation/grpc-1.5/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/grpc/v1_5/GrpcTest.groovy new file mode 100644 index 000000000000..c71badac5cbc --- /dev/null +++ b/instrumentation/grpc-1.5/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/grpc/v1_5/GrpcTest.groovy @@ -0,0 +1,23 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.instrumentation.auto.grpc.v1_5 + +import io.grpc.ManagedChannelBuilder +import io.grpc.ServerBuilder +import io.opentelemetry.auto.test.AgentTestTrait +import io.opentelemetry.instrumentation.grpc.v1_5.AbstractGrpcTest + +class GrpcTest extends AbstractGrpcTest implements AgentTestTrait { + @Override + ServerBuilder configureServer(ServerBuilder server) { + return server + } + + @Override + ManagedChannelBuilder configureClient(ManagedChannelBuilder client) { + return client + } +} diff --git a/instrumentation/grpc-1.5/grpc-1.5.gradle b/instrumentation/grpc-1.5/grpc-1.5.gradle deleted file mode 100644 index 2efff6398c04..000000000000 --- a/instrumentation/grpc-1.5/grpc-1.5.gradle +++ /dev/null @@ -1,54 +0,0 @@ -apply from: "$rootDir/gradle/instrumentation.gradle" - -apply plugin: 'com.google.protobuf' -apply plugin: 'idea' - -muzzle { - pass { - group = "io.grpc" - module = "grpc-core" - versions = "[1.5.0,)" - } -} - -buildscript { - repositories { - mavenLocal() - jcenter() - mavenCentral() - } - dependencies { - classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.12' - } -} - -def grpcVersion = '1.5.0' -protobuf { - protoc { - // Download compiler rather than using locally installed version: - artifact = 'com.google.protobuf:protoc:3.3.0' - } - plugins { - grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" } - } - generateProtoTasks { - all()*.plugins { grpc {} } - } -} - -dependencies { - library group: 'io.grpc', name: 'grpc-core', version: grpcVersion - - testLibrary group: 'io.grpc', name: 'grpc-netty', version: grpcVersion - testLibrary group: 'io.grpc', name: 'grpc-protobuf', version: grpcVersion - testLibrary group: 'io.grpc', name: 'grpc-stub', version: grpcVersion - - testImplementation group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2' - - // this instrumentation needs to be able to be able to reference the OpenTelemetry API's gRPC Context - // that is shaded in the bootstrap class loader (for sending telemetry to the agent), - // separately from the gRPC Context that is brought by gRPC - compileOnly project(path: ':opentelemetry-api-beta-shaded-for-instrumenting', configuration: 'shadow') - - testImplementation project(path: ':opentelemetry-api-beta-shaded-for-instrumenting', configuration: 'shadow') -} diff --git a/instrumentation/grpc-1.5/library/grpc-1.5-library.gradle b/instrumentation/grpc-1.5/library/grpc-1.5-library.gradle new file mode 100644 index 000000000000..6d5810f25106 --- /dev/null +++ b/instrumentation/grpc-1.5/library/grpc-1.5-library.gradle @@ -0,0 +1,13 @@ +apply from: "$rootDir/gradle/instrumentation-library.gradle" + +def grpcVersion = '1.5.0' + +dependencies { + library group: 'io.grpc', name: 'grpc-core', version: grpcVersion + + testLibrary group: 'io.grpc', name: 'grpc-netty', version: grpcVersion + testLibrary group: 'io.grpc', name: 'grpc-protobuf', version: grpcVersion + testLibrary group: 'io.grpc', name: 'grpc-stub', version: grpcVersion + + testImplementation project(':instrumentation:grpc-1.5:testing') +} \ No newline at end of file diff --git a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/client/GrpcClientTracer.java b/instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/client/GrpcClientTracer.java similarity index 52% rename from instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/client/GrpcClientTracer.java rename to instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/client/GrpcClientTracer.java index f03edd181083..d30520821adc 100644 --- a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/client/GrpcClientTracer.java +++ b/instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/client/GrpcClientTracer.java @@ -1,32 +1,27 @@ /* * 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.grpc.client; +package io.opentelemetry.instrumentation.grpc.v1_5.client; import static io.opentelemetry.trace.Span.Kind.CLIENT; import io.grpc.Status; import io.opentelemetry.instrumentation.api.tracer.RpcClientTracer; -import io.opentelemetry.instrumentation.auto.grpc.common.GrpcHelper; +import io.opentelemetry.instrumentation.grpc.v1_5.common.GrpcHelper; import io.opentelemetry.trace.Span; import io.opentelemetry.trace.Span.Builder; +import io.opentelemetry.trace.Tracer; import io.opentelemetry.trace.attributes.SemanticAttributes; public class GrpcClientTracer extends RpcClientTracer { - public static final GrpcClientTracer TRACER = new GrpcClientTracer(); + + protected GrpcClientTracer() {} + + protected GrpcClientTracer(Tracer tracer) { + super(tracer); + } public Span startSpan(String name) { Builder spanBuilder = tracer.spanBuilder(name).setSpanKind(CLIENT); @@ -35,7 +30,7 @@ public Span startSpan(String name) { } public void endSpan(Span span, Status status) { - span.setStatus(GrpcHelper.statusFromGrpcStatus(status)); + span.setStatus(GrpcHelper.statusFromGrpcStatus(status), status.getDescription()); end(span); } @@ -43,7 +38,7 @@ public void endSpan(Span span, Status status) { protected void onError(Span span, Throwable throwable) { Status grpcStatus = Status.fromThrowable(throwable); super.onError(span, grpcStatus.getCause()); - span.setStatus(GrpcHelper.statusFromGrpcStatus(grpcStatus)); + span.setStatus(GrpcHelper.statusFromGrpcStatus(grpcStatus), grpcStatus.getDescription()); } @Override diff --git a/instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/client/GrpcInjectAdapter.java b/instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/client/GrpcInjectAdapter.java new file mode 100644 index 000000000000..6e0a08cccb50 --- /dev/null +++ b/instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/client/GrpcInjectAdapter.java @@ -0,0 +1,19 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.instrumentation.grpc.v1_5.client; + +import io.grpc.Metadata; +import io.opentelemetry.context.propagation.TextMapPropagator; + +final class GrpcInjectAdapter implements TextMapPropagator.Setter { + + static final GrpcInjectAdapter SETTER = new GrpcInjectAdapter(); + + @Override + public void set(Metadata carrier, String key, String value) { + carrier.put(Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER), value); + } +} diff --git a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/client/TracingClientInterceptor.java b/instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/client/TracingClientInterceptor.java similarity index 52% rename from instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/client/TracingClientInterceptor.java rename to instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/client/TracingClientInterceptor.java index 337d8a7cf53a..aa029f48e849 100644 --- a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/client/TracingClientInterceptor.java +++ b/instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/client/TracingClientInterceptor.java @@ -1,108 +1,117 @@ /* * 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.grpc.client; +package io.opentelemetry.instrumentation.grpc.v1_5.client; import static io.opentelemetry.context.ContextUtils.withScopedContext; -import static io.opentelemetry.instrumentation.auto.grpc.client.GrpcClientTracer.TRACER; -import static io.opentelemetry.instrumentation.auto.grpc.client.GrpcInjectAdapter.SETTER; -import static io.opentelemetry.trace.TracingContextUtils.getSpan; +import static io.opentelemetry.instrumentation.grpc.v1_5.client.GrpcInjectAdapter.SETTER; import static io.opentelemetry.trace.TracingContextUtils.withSpan; import io.grpc.CallOptions; import io.grpc.Channel; import io.grpc.ClientCall; +import io.grpc.ClientCall.Listener; import io.grpc.ClientInterceptor; import io.grpc.Context; import io.grpc.ForwardingClientCall; import io.grpc.ForwardingClientCallListener; +import io.grpc.Grpc; import io.grpc.Metadata; import io.grpc.MethodDescriptor; import io.grpc.Status; import io.opentelemetry.OpenTelemetry; import io.opentelemetry.common.Attributes; import io.opentelemetry.context.Scope; -import io.opentelemetry.instrumentation.auto.grpc.common.GrpcHelper; +import io.opentelemetry.instrumentation.api.tracer.utils.NetPeerUtils; +import io.opentelemetry.instrumentation.grpc.v1_5.common.GrpcHelper; import io.opentelemetry.trace.Span; +import io.opentelemetry.trace.Tracer; import io.opentelemetry.trace.attributes.SemanticAttributes; import java.net.InetSocketAddress; +import java.net.SocketAddress; import java.util.concurrent.atomic.AtomicLong; public class TracingClientInterceptor implements ClientInterceptor { - private final InetSocketAddress peerAddress; - public TracingClientInterceptor(InetSocketAddress peerAddress) { - this.peerAddress = peerAddress; + public static ClientInterceptor newInterceptor() { + return newInterceptor(new GrpcClientTracer()); + } + + public static ClientInterceptor newInterceptor(Tracer tracer) { + return newInterceptor(new GrpcClientTracer(tracer)); + } + + public static ClientInterceptor newInterceptor(GrpcClientTracer tracer) { + return new TracingClientInterceptor(tracer); + } + + private final GrpcClientTracer tracer; + + private TracingClientInterceptor(GrpcClientTracer tracer) { + this.tracer = tracer; } @Override public ClientCall interceptCall( MethodDescriptor method, CallOptions callOptions, Channel next) { - String methodName = method.getFullMethodName(); - Span span = TRACER.startSpan(methodName); + Span span = tracer.startSpan(methodName); + GrpcHelper.prepareSpan(span, methodName); Context context = withSpan(span, Context.current()); + final ClientCall result; try (Scope ignored = withScopedContext(context)) { - GrpcHelper.prepareSpan(span, methodName, peerAddress, false); - - ClientCall result; try { // call other interceptors result = next.newCall(method, callOptions); } catch (Throwable e) { - TRACER.endExceptionally(span, e); + tracer.endExceptionally(span, e); throw e; } - return new TracingClientCall<>(context, result); } + + SocketAddress address = result.getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR); + if (address instanceof InetSocketAddress) { + InetSocketAddress inetSocketAddress = (InetSocketAddress) address; + NetPeerUtils.setNetPeer(span, inetSocketAddress); + } + + return new TracingClientCall<>(result, span, context, tracer); } static final class TracingClientCall extends ForwardingClientCall.SimpleForwardingClientCall { - final Context context; - TracingClientCall(Context context, ClientCall delegate) { + private final Span span; + private final Context context; + private final GrpcClientTracer tracer; + + TracingClientCall( + ClientCall delegate, Span span, Context context, GrpcClientTracer tracer) { super(delegate); + this.span = span; this.context = context; + this.tracer = tracer; } @Override public void start(Listener responseListener, Metadata headers) { - // this reference to io.grpc.Context will be shaded during the build - // see instrumentation.gradle: "relocate OpenTelemetry API dependency usage" - // (luckily the grpc instrumentation doesn't need to reference unshaded grpc Context, so we - // don't need to worry about distinguishing them like in the opentelemetry-api - // instrumentation) OpenTelemetry.getPropagators().getTextMapPropagator().inject(context, headers, SETTER); - try (Scope ignored = withScopedContext(context)) { - super.start(new TracingClientCallListener<>(context, responseListener), headers); + try { + super.start(new TracingClientCallListener<>(responseListener, span, tracer), headers); } catch (Throwable e) { - Span span = getSpan(context); - TRACER.endExceptionally(span, e); + tracer.endExceptionally(span, e); throw e; } } @Override public void sendMessage(ReqT message) { - try (Scope ignored = withScopedContext(context)) { + try { super.sendMessage(message); } catch (Throwable e) { - Span span = getSpan(context); - TRACER.endExceptionally(span, e); + tracer.endExceptionally(span, e); throw e; } } @@ -110,17 +119,19 @@ public void sendMessage(ReqT message) { static final class TracingClientCallListener extends ForwardingClientCallListener.SimpleForwardingClientCallListener { - private final Context context; + private final Span span; + private final GrpcClientTracer tracer; + private final AtomicLong messageId = new AtomicLong(); - TracingClientCallListener(Context context, ClientCall.Listener delegate) { + TracingClientCallListener(Listener delegate, Span span, GrpcClientTracer tracer) { super(delegate); - this.context = context; + this.span = span; + this.tracer = tracer; } @Override public void onMessage(RespT message) { - Span span = getSpan(context); Attributes attributes = Attributes.of( SemanticAttributes.GRPC_MESSAGE_TYPE, @@ -128,30 +139,30 @@ public void onMessage(RespT message) { SemanticAttributes.GRPC_MESSAGE_ID, messageId.incrementAndGet()); span.addEvent("message", attributes); - try (Scope ignored = withScopedContext(context)) { + try { delegate().onMessage(message); + } catch (Throwable e) { + tracer.addThrowable(span, e); } } @Override public void onClose(Status status, Metadata trailers) { - Span span = getSpan(context); - try (Scope ignored = withScopedContext(context)) { + try { delegate().onClose(status, trailers); } catch (Throwable e) { - TRACER.endExceptionally(span, e); + tracer.endExceptionally(span, e); throw e; } - TRACER.endSpan(span, status); + tracer.endSpan(span, status); } @Override public void onReady() { - try (Scope ignored = withScopedContext(context)) { + try { delegate().onReady(); } catch (Throwable e) { - Span span = getSpan(context); - TRACER.endExceptionally(span, e); + tracer.endExceptionally(span, e); throw e; } } diff --git a/instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/common/GrpcHelper.java b/instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/common/GrpcHelper.java new file mode 100644 index 000000000000..9290c497efa2 --- /dev/null +++ b/instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/common/GrpcHelper.java @@ -0,0 +1,35 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.instrumentation.grpc.v1_5.common; + +import io.grpc.Status.Code; +import io.opentelemetry.trace.Span; +import io.opentelemetry.trace.StatusCanonicalCode; +import io.opentelemetry.trace.attributes.SemanticAttributes; + +public final class GrpcHelper { + public static void prepareSpan(Span span, String fullMethodName) { + + int slash = fullMethodName.indexOf('/'); + String serviceName = slash == -1 ? fullMethodName : fullMethodName.substring(0, slash); + String methodName = slash == -1 ? null : fullMethodName.substring(slash + 1); + + span.setAttribute(SemanticAttributes.RPC_SERVICE, serviceName); + if (methodName != null) { + span.setAttribute(SemanticAttributes.RPC_METHOD, methodName); + } + } + + public static StatusCanonicalCode statusFromGrpcStatus(io.grpc.Status grpcStatus) { + return codeFromGrpcCode(grpcStatus.getCode()); + } + + private static StatusCanonicalCode codeFromGrpcCode(Code grpcCode) { + return grpcCode.equals(Code.OK) ? StatusCanonicalCode.UNSET : StatusCanonicalCode.ERROR; + } + + private GrpcHelper() {} +} diff --git a/instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/server/GrpcExtractAdapter.java b/instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/server/GrpcExtractAdapter.java new file mode 100644 index 000000000000..bba05392389c --- /dev/null +++ b/instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/server/GrpcExtractAdapter.java @@ -0,0 +1,19 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.instrumentation.grpc.v1_5.server; + +import io.grpc.Metadata; +import io.opentelemetry.context.propagation.TextMapPropagator; + +final class GrpcExtractAdapter implements TextMapPropagator.Getter { + + static final GrpcExtractAdapter GETTER = new GrpcExtractAdapter(); + + @Override + public String get(Metadata carrier, String key) { + return carrier.get(Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER)); + } +} diff --git a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/server/GrpcServerTracer.java b/instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/server/GrpcServerTracer.java similarity index 60% rename from instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/server/GrpcServerTracer.java rename to instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/server/GrpcServerTracer.java index a56a27bc9f82..a57f07aa9dd7 100644 --- a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/server/GrpcServerTracer.java +++ b/instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/server/GrpcServerTracer.java @@ -1,20 +1,9 @@ /* * 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.grpc.server; +package io.opentelemetry.instrumentation.grpc.v1_5.server; import static io.opentelemetry.trace.Span.Kind.SERVER; @@ -22,13 +11,19 @@ import io.grpc.Status; import io.opentelemetry.context.propagation.TextMapPropagator.Getter; import io.opentelemetry.instrumentation.api.tracer.RpcServerTracer; -import io.opentelemetry.instrumentation.auto.grpc.common.GrpcHelper; +import io.opentelemetry.instrumentation.grpc.v1_5.common.GrpcHelper; import io.opentelemetry.trace.Span; import io.opentelemetry.trace.Span.Builder; +import io.opentelemetry.trace.Tracer; import io.opentelemetry.trace.attributes.SemanticAttributes; public class GrpcServerTracer extends RpcServerTracer { - public static final GrpcServerTracer TRACER = new GrpcServerTracer(); + + GrpcServerTracer() {} + + GrpcServerTracer(Tracer tracer) { + super(tracer); + } public Span startSpan(String name, Metadata headers) { Builder spanBuilder = @@ -38,7 +33,7 @@ public Span startSpan(String name, Metadata headers) { } public void setStatus(Span span, Status status) { - span.setStatus(GrpcHelper.statusFromGrpcStatus(status)); + span.setStatus(GrpcHelper.statusFromGrpcStatus(status), status.getDescription()); if (status.getCause() != null) { addThrowable(span, status.getCause()); } @@ -48,7 +43,7 @@ public void setStatus(Span span, Status status) { protected void onError(Span span, Throwable throwable) { Status grpcStatus = Status.fromThrowable(throwable); super.onError(span, grpcStatus.getCause()); - span.setStatus(GrpcHelper.statusFromGrpcStatus(grpcStatus)); + span.setStatus(GrpcHelper.statusFromGrpcStatus(grpcStatus), grpcStatus.getDescription()); } @Override diff --git a/instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/server/TracingServerInterceptor.java b/instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/server/TracingServerInterceptor.java new file mode 100644 index 000000000000..680b089f8385 --- /dev/null +++ b/instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/server/TracingServerInterceptor.java @@ -0,0 +1,170 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.instrumentation.grpc.v1_5.server; + +import io.grpc.Context; +import io.grpc.Contexts; +import io.grpc.ForwardingServerCall; +import io.grpc.ForwardingServerCallListener; +import io.grpc.Grpc; +import io.grpc.Metadata; +import io.grpc.ServerCall; +import io.grpc.ServerCall.Listener; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; +import io.grpc.Status; +import io.opentelemetry.common.Attributes; +import io.opentelemetry.instrumentation.grpc.v1_5.common.GrpcHelper; +import io.opentelemetry.trace.Span; +import io.opentelemetry.trace.Tracer; +import io.opentelemetry.trace.TracingContextUtils; +import io.opentelemetry.trace.attributes.SemanticAttributes; +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.util.concurrent.atomic.AtomicLong; + +public class TracingServerInterceptor implements ServerInterceptor { + + public static ServerInterceptor newInterceptor() { + return newInterceptor(new GrpcServerTracer()); + } + + public static ServerInterceptor newInterceptor(Tracer tracer) { + return newInterceptor(new GrpcServerTracer(tracer)); + } + + public static ServerInterceptor newInterceptor(GrpcServerTracer tracer) { + return new TracingServerInterceptor(tracer); + } + + private final GrpcServerTracer tracer; + + private TracingServerInterceptor(GrpcServerTracer tracer) { + this.tracer = tracer; + } + + @Override + public ServerCall.Listener interceptCall( + ServerCall call, Metadata headers, ServerCallHandler next) { + + String methodName = call.getMethodDescriptor().getFullMethodName(); + Span span = tracer.startSpan(methodName, headers); + + SocketAddress address = call.getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR); + if (address instanceof InetSocketAddress) { + InetSocketAddress inetSocketAddress = (InetSocketAddress) address; + span.setAttribute(SemanticAttributes.NET_PEER_PORT, inetSocketAddress.getPort()); + span.setAttribute( + SemanticAttributes.NET_PEER_IP, inetSocketAddress.getAddress().getHostAddress()); + } + GrpcHelper.prepareSpan(span, methodName); + + Context context = TracingContextUtils.withSpan(span, Context.current()); + + try { + return new TracingServerCallListener<>( + Contexts.interceptCall( + context, new TracingServerCall<>(call, span, tracer), headers, next), + span, + tracer); + } catch (Throwable e) { + tracer.endExceptionally(span, e); + throw e; + } + } + + static final class TracingServerCall + extends ForwardingServerCall.SimpleForwardingServerCall { + private final Span span; + private final GrpcServerTracer tracer; + + TracingServerCall(ServerCall delegate, Span span, GrpcServerTracer tracer) { + super(delegate); + this.span = span; + this.tracer = tracer; + } + + @Override + public void close(Status status, Metadata trailers) { + tracer.setStatus(span, status); + try { + delegate().close(status, trailers); + } catch (Throwable e) { + tracer.endExceptionally(span, e); + throw e; + } + } + } + + static final class TracingServerCallListener + extends ForwardingServerCallListener.SimpleForwardingServerCallListener { + private final Span span; + private final GrpcServerTracer tracer; + + private final AtomicLong messageId = new AtomicLong(); + + TracingServerCallListener(Listener delegate, Span span, GrpcServerTracer tracer) { + super(delegate); + this.span = span; + this.tracer = tracer; + } + + @Override + public void onMessage(ReqT message) { + Attributes attributes = + Attributes.of( + SemanticAttributes.GRPC_MESSAGE_TYPE, + "RECEIVED", + SemanticAttributes.GRPC_MESSAGE_ID, + messageId.incrementAndGet()); + span.addEvent("message", attributes); + delegate().onMessage(message); + } + + @Override + public void onHalfClose() { + try { + delegate().onHalfClose(); + } catch (Throwable e) { + tracer.endExceptionally(span, e); + throw e; + } + } + + @Override + public void onCancel() { + try { + delegate().onCancel(); + span.setAttribute("canceled", true); + } catch (Throwable e) { + tracer.endExceptionally(span, e); + throw e; + } + tracer.end(span); + } + + @Override + public void onComplete() { + try { + delegate().onComplete(); + } catch (Throwable e) { + tracer.endExceptionally(span, e); + throw e; + } + tracer.end(span); + } + + @Override + public void onReady() { + try { + delegate().onReady(); + } catch (Throwable e) { + tracer.endExceptionally(span, e); + throw e; + } + } + } +} diff --git a/instrumentation/grpc-1.5/library/src/test/groovy/io/opentelemetry/instrumentation/grpc/v1_5/GrpcStreamingTest.groovy b/instrumentation/grpc-1.5/library/src/test/groovy/io/opentelemetry/instrumentation/grpc/v1_5/GrpcStreamingTest.groovy new file mode 100644 index 000000000000..72a830760773 --- /dev/null +++ b/instrumentation/grpc-1.5/library/src/test/groovy/io/opentelemetry/instrumentation/grpc/v1_5/GrpcStreamingTest.groovy @@ -0,0 +1,24 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.instrumentation.grpc.v1_5 + +import io.grpc.ManagedChannelBuilder +import io.grpc.ServerBuilder +import io.opentelemetry.auto.test.InstrumentationTestTrait +import io.opentelemetry.instrumentation.grpc.v1_5.client.TracingClientInterceptor +import io.opentelemetry.instrumentation.grpc.v1_5.server.TracingServerInterceptor + +class GrpcStreamingTest extends AbstractGrpcStreamingTest implements InstrumentationTestTrait { + @Override + ServerBuilder configureServer(ServerBuilder server) { + return server.intercept(TracingServerInterceptor.newInterceptor()) + } + + @Override + ManagedChannelBuilder configureClient(ManagedChannelBuilder client) { + return client.intercept(TracingClientInterceptor.newInterceptor()) + } +} diff --git a/instrumentation/grpc-1.5/library/src/test/groovy/io/opentelemetry/instrumentation/grpc/v1_5/GrpcTest.groovy b/instrumentation/grpc-1.5/library/src/test/groovy/io/opentelemetry/instrumentation/grpc/v1_5/GrpcTest.groovy new file mode 100644 index 000000000000..e1317cc4904b --- /dev/null +++ b/instrumentation/grpc-1.5/library/src/test/groovy/io/opentelemetry/instrumentation/grpc/v1_5/GrpcTest.groovy @@ -0,0 +1,24 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.instrumentation.grpc.v1_5 + +import io.grpc.ManagedChannelBuilder +import io.grpc.ServerBuilder +import io.opentelemetry.auto.test.InstrumentationTestTrait +import io.opentelemetry.instrumentation.grpc.v1_5.client.TracingClientInterceptor +import io.opentelemetry.instrumentation.grpc.v1_5.server.TracingServerInterceptor + +class GrpcTest extends AbstractGrpcTest implements InstrumentationTestTrait { + @Override + ServerBuilder configureServer(ServerBuilder server) { + return server.intercept(TracingServerInterceptor.newInterceptor()) + } + + @Override + ManagedChannelBuilder configureClient(ManagedChannelBuilder client) { + return client.intercept(TracingClientInterceptor.newInterceptor()) + } +} diff --git a/instrumentation/grpc-1.5/library/src/test/groovy/io/opentelemetry/instrumentation/grpc/v1_5/common/GrpcHelperTest.groovy b/instrumentation/grpc-1.5/library/src/test/groovy/io/opentelemetry/instrumentation/grpc/v1_5/common/GrpcHelperTest.groovy new file mode 100644 index 000000000000..c130aea50c09 --- /dev/null +++ b/instrumentation/grpc-1.5/library/src/test/groovy/io/opentelemetry/instrumentation/grpc/v1_5/common/GrpcHelperTest.groovy @@ -0,0 +1,38 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.instrumentation.grpc.v1_5.common + +import io.grpc.Status +import io.opentelemetry.trace.StatusCanonicalCode +import spock.lang.Specification + +class GrpcHelperTest extends Specification { + + def "test status from #grpcStatus.code"() { + when: + def status = GrpcHelper.statusFromGrpcStatus(grpcStatus) + + then: + if (grpcStatus == Status.OK) { + status == StatusCanonicalCode.UNSET + } else { + status == StatusCanonicalCode.ERROR + } + + // Considering history of status, if we compare all values of the gRPC status by name, we will + // probably find any new mismatches with the OpenTelemetry spec. + where: + grpcStatus << Status.Code.values().collect { Status.fromCode(it) } + } + + def "test status has grpc description"() { + when: + def status = GrpcHelper.statusFromGrpcStatus(Status.INVALID_ARGUMENT.withDescription("bad argument")) + + then: + status == StatusCanonicalCode.ERROR + } +} diff --git a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/client/AbstractGrpcClientInstrumentation.java b/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/client/AbstractGrpcClientInstrumentation.java deleted file mode 100644 index dbe96fd76c35..000000000000 --- a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/client/AbstractGrpcClientInstrumentation.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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. - */ - -package io.opentelemetry.instrumentation.auto.grpc.client; - -import io.opentelemetry.javaagent.tooling.Instrumenter; -import java.net.InetSocketAddress; -import java.util.Collections; -import java.util.Map; - -abstract class AbstractGrpcClientInstrumentation extends Instrumenter.Default { - - public AbstractGrpcClientInstrumentation() { - super("grpc", "grpc-client"); - } - - @Override - public String[] helperClassNames() { - return new String[] { - packageName + ".GrpcClientTracer", - packageName + ".GrpcInjectAdapter", - packageName + ".TracingClientInterceptor", - packageName + ".TracingClientInterceptor$TracingClientCall", - packageName + ".TracingClientInterceptor$TracingClientCallListener", - "io.opentelemetry.instrumentation.auto.grpc.common.GrpcHelper", - }; - } - - @Override - public Map contextStore() { - return Collections.singletonMap( - "io.grpc.ManagedChannelBuilder", InetSocketAddress.class.getName()); - } -} diff --git a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/client/GrpcClientBuilderForAddressInstrumentation.java b/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/client/GrpcClientBuilderForAddressInstrumentation.java deleted file mode 100644 index 29792b59d7cc..000000000000 --- a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/client/GrpcClientBuilderForAddressInstrumentation.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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. - */ - -package io.opentelemetry.instrumentation.auto.grpc.client; - -import static io.opentelemetry.javaagent.tooling.bytebuddy.matcher.AgentElementMatchers.extendsClass; -import static java.util.Collections.singletonMap; -import static net.bytebuddy.matcher.ElementMatchers.isMethod; -import static net.bytebuddy.matcher.ElementMatchers.named; - -import com.google.auto.service.AutoService; -import io.grpc.ManagedChannelBuilder; -import io.opentelemetry.instrumentation.auto.api.ContextStore; -import io.opentelemetry.instrumentation.auto.api.InstrumentationContext; -import io.opentelemetry.javaagent.tooling.Instrumenter; -import java.net.InetSocketAddress; -import java.util.Map; -import net.bytebuddy.asm.Advice; -import net.bytebuddy.description.method.MethodDescription; -import net.bytebuddy.description.type.TypeDescription; -import net.bytebuddy.matcher.ElementMatcher; -import net.bytebuddy.matcher.ElementMatchers; - -@AutoService(Instrumenter.class) -public class GrpcClientBuilderForAddressInstrumentation extends AbstractGrpcClientInstrumentation { - - @Override - public ElementMatcher typeMatcher() { - return extendsClass(named("io.grpc.ManagedChannelBuilder")); - } - - @Override - public Map, String> transformers() { - return singletonMap( - isMethod().and(named("forAddress").and(ElementMatchers.takesArguments(2))), - GrpcClientBuilderForAddressInstrumentation.class.getName() + "$ForAddressAdvice"); - } - - public static class ForAddressAdvice { - @Advice.OnMethodExit(suppress = Throwable.class) - public static final void forAddress( - @Advice.Argument(0) String address, - @Advice.Argument(1) int port, - @Advice.Return ManagedChannelBuilder builder) { - ContextStore contextStore = - InstrumentationContext.get(ManagedChannelBuilder.class, InetSocketAddress.class); - contextStore.put(builder, InetSocketAddress.createUnresolved(address, port)); - } - } -} diff --git a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/common/GrpcHelper.java b/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/common/GrpcHelper.java deleted file mode 100644 index 7f99d815a03f..000000000000 --- a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/common/GrpcHelper.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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. - */ - -package io.opentelemetry.instrumentation.auto.grpc.common; - -import io.grpc.Status.Code; -import io.opentelemetry.instrumentation.api.tracer.utils.NetPeerUtils; -import io.opentelemetry.trace.Span; -import io.opentelemetry.trace.Status; -import io.opentelemetry.trace.Status.CanonicalCode; -import io.opentelemetry.trace.attributes.SemanticAttributes; -import java.net.InetSocketAddress; -import java.util.Collections; -import java.util.EnumMap; -import java.util.Map; - -public final class GrpcHelper { - private static final Map CODE_MAP; - - static { - EnumMap codeMap = new EnumMap<>(Code.class); - codeMap.put(Code.OK, CanonicalCode.OK); - codeMap.put(Code.CANCELLED, CanonicalCode.CANCELLED); - codeMap.put(Code.INVALID_ARGUMENT, CanonicalCode.INVALID_ARGUMENT); - codeMap.put(Code.DEADLINE_EXCEEDED, CanonicalCode.DEADLINE_EXCEEDED); - codeMap.put(Code.NOT_FOUND, CanonicalCode.NOT_FOUND); - codeMap.put(Code.ALREADY_EXISTS, CanonicalCode.ALREADY_EXISTS); - codeMap.put(Code.PERMISSION_DENIED, CanonicalCode.PERMISSION_DENIED); - codeMap.put(Code.RESOURCE_EXHAUSTED, CanonicalCode.RESOURCE_EXHAUSTED); - codeMap.put(Code.FAILED_PRECONDITION, CanonicalCode.FAILED_PRECONDITION); - codeMap.put(Code.ABORTED, CanonicalCode.ABORTED); - codeMap.put(Code.OUT_OF_RANGE, CanonicalCode.OUT_OF_RANGE); - codeMap.put(Code.UNIMPLEMENTED, CanonicalCode.UNIMPLEMENTED); - codeMap.put(Code.INTERNAL, CanonicalCode.INTERNAL); - codeMap.put(Code.UNAVAILABLE, CanonicalCode.UNAVAILABLE); - codeMap.put(Code.DATA_LOSS, CanonicalCode.DATA_LOSS); - codeMap.put(Code.UNAUTHENTICATED, CanonicalCode.UNAUTHENTICATED); - codeMap.put(Code.UNKNOWN, CanonicalCode.UNKNOWN); - CODE_MAP = Collections.unmodifiableMap(codeMap); - } - - public static void prepareSpan( - Span span, String fullMethodName, InetSocketAddress peerAddress, boolean server) { - - int slash = fullMethodName.indexOf('/'); - String serviceName = slash == -1 ? fullMethodName : fullMethodName.substring(0, slash); - String methodName = slash == -1 ? null : fullMethodName.substring(slash + 1); - - span.setAttribute(SemanticAttributes.RPC_SERVICE, serviceName); - span.setAttribute(SemanticAttributes.RPC_METHOD, methodName); - - if (peerAddress != null) { - span.setAttribute(SemanticAttributes.NET_PEER_PORT, (long) peerAddress.getPort()); - if (server) { - span.setAttribute( - SemanticAttributes.NET_PEER_IP, peerAddress.getAddress().getHostAddress()); - } else { - NetPeerUtils.setNetPeer(span, peerAddress.getHostName(), null); - } - } else { - // The spec says these fields must be populated, so put some values in even if we don't have - // an address recorded. - span.setAttribute(SemanticAttributes.NET_PEER_PORT, 0L); - NetPeerUtils.setNetPeer(span, "(unknown)", null); - } - } - - public static Status statusFromGrpcStatus(io.grpc.Status grpcStatus) { - Status status = codeFromGrpcCode(grpcStatus.getCode()).toStatus(); - if (grpcStatus.getDescription() != null) { - status = status.withDescription(grpcStatus.getDescription()); - } - return status; - } - - private static CanonicalCode codeFromGrpcCode(Code grpcCode) { - CanonicalCode code = CODE_MAP.get(grpcCode); - return code != null ? code : CanonicalCode.UNKNOWN; - } - - private GrpcHelper() {} -} diff --git a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/server/GrpcExtractAdapter.java b/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/server/GrpcExtractAdapter.java deleted file mode 100644 index 06938bbb05a2..000000000000 --- a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/server/GrpcExtractAdapter.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -package io.opentelemetry.instrumentation.auto.grpc.server; - -import io.grpc.Metadata; -import io.opentelemetry.context.propagation.TextMapPropagator; - -public final class GrpcExtractAdapter implements TextMapPropagator.Getter { - - public static final GrpcExtractAdapter GETTER = new GrpcExtractAdapter(); - - @Override - public String get(Metadata carrier, String key) { - return carrier.get(Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER)); - } -} diff --git a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/server/TracingServerInterceptor.java b/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/server/TracingServerInterceptor.java deleted file mode 100644 index 4e6737752e9b..000000000000 --- a/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/auto/grpc/server/TracingServerInterceptor.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * 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. - */ - -package io.opentelemetry.instrumentation.auto.grpc.server; - -import static io.opentelemetry.instrumentation.auto.grpc.server.GrpcServerTracer.TRACER; -import static io.opentelemetry.trace.TracingContextUtils.currentContextWith; - -import io.grpc.ForwardingServerCall; -import io.grpc.ForwardingServerCallListener; -import io.grpc.Grpc; -import io.grpc.Metadata; -import io.grpc.ServerCall; -import io.grpc.ServerCallHandler; -import io.grpc.ServerInterceptor; -import io.grpc.Status; -import io.opentelemetry.common.Attributes; -import io.opentelemetry.context.Scope; -import io.opentelemetry.instrumentation.auto.grpc.common.GrpcHelper; -import io.opentelemetry.trace.Span; -import io.opentelemetry.trace.attributes.SemanticAttributes; -import java.net.InetSocketAddress; -import java.net.SocketAddress; -import java.util.concurrent.atomic.AtomicLong; - -public class TracingServerInterceptor implements ServerInterceptor { - - public static final TracingServerInterceptor INSTANCE = new TracingServerInterceptor(); - - private TracingServerInterceptor() {} - - @Override - public ServerCall.Listener interceptCall( - ServerCall call, Metadata headers, ServerCallHandler next) { - - String methodName = call.getMethodDescriptor().getFullMethodName(); - Span span = TRACER.startSpan(methodName, headers); - - SocketAddress addr = call.getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR); - InetSocketAddress iAddr = addr instanceof InetSocketAddress ? (InetSocketAddress) addr : null; - GrpcHelper.prepareSpan(span, methodName, iAddr, true); - - ServerCall.Listener result; - try (Scope ignored = currentContextWith(span)) { - - try { - // Wrap the server call so that we can decorate the span - // with the resulting status - TracingServerCall tracingServerCall = new TracingServerCall<>(span, call); - - // call other interceptors - result = next.startCall(tracingServerCall, headers); - } catch (Throwable e) { - TRACER.endExceptionally(span, e); - throw e; - } - } - - // This ensures the server implementation can see the span in scope - return new TracingServerCallListener<>(span, result); - } - - static final class TracingServerCall - extends ForwardingServerCall.SimpleForwardingServerCall { - final Span span; - - TracingServerCall(Span span, ServerCall delegate) { - super(delegate); - this.span = span; - } - - @Override - public void close(Status status, Metadata trailers) { - TRACER.setStatus(span, status); - try (Scope ignored = currentContextWith(span)) { - delegate().close(status, trailers); - } catch (Throwable e) { - TRACER.endExceptionally(span, e); - throw e; - } - } - } - - static final class TracingServerCallListener - extends ForwardingServerCallListener.SimpleForwardingServerCallListener { - private final Span span; - private final AtomicLong messageId = new AtomicLong(); - - TracingServerCallListener(Span span, ServerCall.Listener delegate) { - super(delegate); - this.span = span; - } - - @Override - public void onMessage(ReqT message) { - Attributes attributes = - Attributes.of( - SemanticAttributes.GRPC_MESSAGE_TYPE, - "RECEIVED", - SemanticAttributes.GRPC_MESSAGE_ID, - messageId.incrementAndGet()); - span.addEvent("message", attributes); - try (Scope ignored = currentContextWith(span)) { - delegate().onMessage(message); - } - } - - @Override - public void onHalfClose() { - try (Scope ignored = currentContextWith(span)) { - delegate().onHalfClose(); - } catch (Throwable e) { - TRACER.endExceptionally(span, e); - throw e; - } - } - - @Override - public void onCancel() { - try (Scope ignored = currentContextWith(span)) { - delegate().onCancel(); - span.setAttribute("canceled", true); - } catch (Throwable e) { - TRACER.endExceptionally(span, e); - throw e; - } - TRACER.end(span); - } - - @Override - public void onComplete() { - try (Scope ignored = currentContextWith(span)) { - delegate().onComplete(); - } catch (Throwable e) { - TRACER.endExceptionally(span, e); - throw e; - } - TRACER.end(span); - } - - @Override - public void onReady() { - try (Scope ignored = currentContextWith(span)) { - delegate().onReady(); - } catch (Throwable e) { - TRACER.endExceptionally(span, e); - throw e; - } - } - } -} diff --git a/instrumentation/grpc-1.5/src/test/groovy/io/opentelemetry/instrumentation/auto/grpc/common/GrpcHelperTest.groovy b/instrumentation/grpc-1.5/src/test/groovy/io/opentelemetry/instrumentation/auto/grpc/common/GrpcHelperTest.groovy deleted file mode 100644 index fc64524f5348..000000000000 --- a/instrumentation/grpc-1.5/src/test/groovy/io/opentelemetry/instrumentation/auto/grpc/common/GrpcHelperTest.groovy +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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. - */ - -package io.opentelemetry.instrumentation.auto.grpc.common - -import io.grpc.Status -import spock.lang.Specification - -class GrpcHelperTest extends Specification { - - def "test status from #grpcStatus.code"() { - when: - def status = GrpcHelper.statusFromGrpcStatus(grpcStatus) - - then: - status.canonicalCode.name() == grpcStatus.code.name() - status.description == null - - // Considering history of status, if we compare all values of the gRPC status by name, we will - // probably find any new mismatches with the OpenTelemetry spec. - where: - grpcStatus << Status.Code.values().collect { Status.fromCode(it) } - } - - def "test status has grpc description"() { - when: - def status = GrpcHelper.statusFromGrpcStatus(Status.INVALID_ARGUMENT.withDescription("bad argument")) - - then: - status.canonicalCode == io.opentelemetry.trace.Status.CanonicalCode.INVALID_ARGUMENT - status.description == "bad argument" - } -} diff --git a/instrumentation/grpc-1.5/testing/grpc-1.5-testing.gradle b/instrumentation/grpc-1.5/testing/grpc-1.5-testing.gradle new file mode 100644 index 000000000000..eed5be471bc8 --- /dev/null +++ b/instrumentation/grpc-1.5/testing/grpc-1.5-testing.gradle @@ -0,0 +1,37 @@ +plugins { + id "java-library" + id "com.google.protobuf" version "0.8.13" +} + +apply from: "$rootDir/gradle/java.gradle" + +def grpcVersion = '1.5.0' + +protobuf { + protoc { + // Download compiler rather than using locally installed version: + artifact = 'com.google.protobuf:protoc:3.3.0' + } + plugins { + grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" } + } + generateProtoTasks { + all()*.plugins { grpc {} } + } +} + +dependencies { + api project(':testing-common') + + api group: 'io.grpc', name: 'grpc-core', version: grpcVersion + api group: 'io.grpc', name: 'grpc-protobuf', version: grpcVersion + api group: 'io.grpc', name: 'grpc-stub', version: grpcVersion + + implementation group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2' + + implementation deps.guava + + implementation deps.groovy + implementation deps.opentelemetryApi + implementation deps.spock +} diff --git a/instrumentation/grpc-1.5/src/test/groovy/GrpcStreamingTest.groovy b/instrumentation/grpc-1.5/testing/src/main/groovy/io/opentelemetry/instrumentation/grpc/v1_5/AbstractGrpcStreamingTest.groovy similarity index 73% rename from instrumentation/grpc-1.5/src/test/groovy/GrpcStreamingTest.groovy rename to instrumentation/grpc-1.5/testing/src/main/groovy/io/opentelemetry/instrumentation/grpc/v1_5/AbstractGrpcStreamingTest.groovy index ee909cb59b29..951e080abdac 100644 --- a/instrumentation/grpc-1.5/src/test/groovy/GrpcStreamingTest.groovy +++ b/instrumentation/grpc-1.5/testing/src/main/groovy/io/opentelemetry/instrumentation/grpc/v1_5/AbstractGrpcStreamingTest.groovy @@ -1,19 +1,10 @@ /* * 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.grpc.v1_5 + import static io.opentelemetry.trace.Span.Kind.CLIENT import static io.opentelemetry.trace.Span.Kind.SERVER @@ -25,17 +16,22 @@ import io.grpc.ManagedChannelBuilder import io.grpc.Server import io.grpc.ServerBuilder import io.grpc.stub.StreamObserver -import io.opentelemetry.auto.test.AgentTestRunner +import io.opentelemetry.auto.test.InstrumentationSpecification import io.opentelemetry.auto.test.utils.PortUtils -import io.opentelemetry.trace.Status import io.opentelemetry.trace.attributes.SemanticAttributes import java.util.concurrent.CopyOnWriteArrayList import java.util.concurrent.TimeUnit import java.util.concurrent.atomic.AtomicReference +import spock.lang.Unroll + +@Unroll +abstract class AbstractGrpcStreamingTest extends InstrumentationSpecification { + + abstract ServerBuilder configureServer(ServerBuilder server) -class GrpcStreamingTest extends AgentTestRunner { + abstract ManagedChannelBuilder configureClient(ManagedChannelBuilder client) - def "test conversation #name"() { + def "test conversation #paramName"() { setup: def msgCount = serverMessageCount def serverReceived = new CopyOnWriteArrayList<>() @@ -70,8 +66,8 @@ class GrpcStreamingTest extends AgentTestRunner { } } def port = PortUtils.randomOpenPort() - Server server = ServerBuilder.forPort(port).addService(greeter).build().start() - ManagedChannelBuilder channelBuilder = ManagedChannelBuilder.forAddress("localhost", port) + Server server = configureServer(ServerBuilder.forPort(port).addService(greeter)).build().start() + ManagedChannelBuilder channelBuilder = configureClient(ManagedChannelBuilder.forAddress("localhost", port)) // Depending on the version of gRPC usePlainText may or may not take an argument. try { @@ -106,26 +102,17 @@ class GrpcStreamingTest extends AgentTestRunner { observer.onCompleted() then: - error.get() == null - TEST_WRITER.waitForTraces(1) - error.get() == null - serverReceived == clientRange.collect { "call $it" } - clientReceived == serverRange.collect { clientRange.collect { "call $it" } }.flatten().sort() - assertTraces(1) { trace(0, 2) { span(0) { - operationName "example.Greeter/Conversation" - spanKind CLIENT - parent() + name "example.Greeter/Conversation" + kind CLIENT + hasNoParent() errored false - status(Status.OK) attributes { "${SemanticAttributes.RPC_SYSTEM.key()}" "grpc" "${SemanticAttributes.RPC_SERVICE.key()}" "example.Greeter" "${SemanticAttributes.RPC_METHOD.key()}" "Conversation" - "${SemanticAttributes.NET_PEER_NAME.key()}" "localhost" - "${SemanticAttributes.NET_PEER_PORT.key()}" port } (1..(clientMessageCount * serverMessageCount)).each { def messageId = it @@ -139,11 +126,10 @@ class GrpcStreamingTest extends AgentTestRunner { } } span(1) { - operationName "example.Greeter/Conversation" - spanKind SERVER + name "example.Greeter/Conversation" + kind SERVER childOf span(0) errored false - status(Status.OK) attributes { "${SemanticAttributes.RPC_SYSTEM.key()}" "grpc" "${SemanticAttributes.RPC_SERVICE.key()}" "example.Greeter" @@ -164,18 +150,21 @@ class GrpcStreamingTest extends AgentTestRunner { } } } + error.get() == null + serverReceived == clientRange.collect { "call $it" } + clientReceived == serverRange.collect { clientRange.collect { "call $it" } }.flatten().sort() cleanup: channel?.shutdownNow()?.awaitTermination(10, TimeUnit.SECONDS) server?.shutdownNow()?.awaitTermination() where: - name | clientMessageCount | serverMessageCount - "A" | 1 | 1 - "B" | 2 | 1 - "C" | 1 | 2 - "D" | 2 | 2 - "E" | 3 | 3 + paramName | clientMessageCount | serverMessageCount + "A" | 1 | 1 + "B" | 2 | 1 + "C" | 1 | 2 + "D" | 2 | 2 + "E" | 3 | 3 clientRange = 1..clientMessageCount serverRange = 1..serverMessageCount diff --git a/instrumentation/grpc-1.5/src/test/groovy/GrpcTest.groovy b/instrumentation/grpc-1.5/testing/src/main/groovy/io/opentelemetry/instrumentation/grpc/v1_5/AbstractGrpcTest.groovy similarity index 52% rename from instrumentation/grpc-1.5/src/test/groovy/GrpcTest.groovy rename to instrumentation/grpc-1.5/testing/src/main/groovy/io/opentelemetry/instrumentation/grpc/v1_5/AbstractGrpcTest.groovy index b0b113c6d219..26e7cd9cdd38 100644 --- a/instrumentation/grpc-1.5/src/test/groovy/GrpcTest.groovy +++ b/instrumentation/grpc-1.5/testing/src/main/groovy/io/opentelemetry/instrumentation/grpc/v1_5/AbstractGrpcTest.groovy @@ -1,19 +1,10 @@ /* * 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.grpc.v1_5 + import static io.opentelemetry.auto.test.utils.TraceUtils.basicSpan import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -22,22 +13,41 @@ import static io.opentelemetry.trace.Span.Kind.SERVER import example.GreeterGrpc import example.Helloworld import io.grpc.BindableService +import io.grpc.CallOptions +import io.grpc.Channel +import io.grpc.ClientCall +import io.grpc.ClientInterceptor +import io.grpc.Context import io.grpc.ManagedChannel import io.grpc.ManagedChannelBuilder +import io.grpc.Metadata +import io.grpc.MethodDescriptor import io.grpc.Server import io.grpc.ServerBuilder +import io.grpc.ServerCall +import io.grpc.ServerCallHandler +import io.grpc.ServerInterceptor import io.grpc.Status import io.grpc.StatusRuntimeException import io.grpc.stub.StreamObserver -import io.opentelemetry.auto.test.AgentTestRunner +import io.opentelemetry.auto.test.InstrumentationSpecification import io.opentelemetry.auto.test.utils.PortUtils -import io.opentelemetry.instrumentation.auto.grpc.common.GrpcHelper +import io.opentelemetry.trace.StatusCanonicalCode +import io.opentelemetry.trace.TracingContextUtils import io.opentelemetry.trace.attributes.SemanticAttributes +import java.util.concurrent.CountDownLatch import java.util.concurrent.TimeUnit +import java.util.concurrent.atomic.AtomicReference +import spock.lang.Unroll + +@Unroll +abstract class AbstractGrpcTest extends InstrumentationSpecification { + + abstract ServerBuilder configureServer(ServerBuilder server) -class GrpcTest extends AgentTestRunner { + abstract ManagedChannelBuilder configureClient(ManagedChannelBuilder client) - def "test request-response"() { + def "test request-response #paramName"() { setup: BindableService greeter = new GreeterGrpc.GreeterImplBase() { @Override @@ -49,8 +59,8 @@ class GrpcTest extends AgentTestRunner { } } def port = PortUtils.randomOpenPort() - Server server = ServerBuilder.forPort(port).addService(greeter).build().start() - ManagedChannelBuilder channelBuilder = ManagedChannelBuilder.forAddress("localhost", port) + Server server = configureServer(ServerBuilder.forPort(port).addService(greeter)).build().start() + ManagedChannelBuilder channelBuilder = configureClient(ManagedChannelBuilder.forAddress("localhost", port)) // Depending on the version of gRPC usePlainText may or may not take an argument. try { @@ -63,21 +73,20 @@ class GrpcTest extends AgentTestRunner { when: def response = runUnderTrace("parent") { - client.sayHello(Helloworld.Request.newBuilder().setName(name).build()) + client.sayHello(Helloworld.Request.newBuilder().setName(paramName).build()) } then: - response.message == "Hello $name" + response.message == "Hello $paramName" assertTraces(1) { trace(0, 3) { basicSpan(it, 0, "parent") span(1) { - operationName "example.Greeter/SayHello" - spanKind CLIENT + name "example.Greeter/SayHello" + kind CLIENT childOf span(0) errored false - status(io.opentelemetry.trace.Status.OK) event(0) { eventName "message" attributes { @@ -89,16 +98,13 @@ class GrpcTest extends AgentTestRunner { "${SemanticAttributes.RPC_SYSTEM.key()}" "grpc" "${SemanticAttributes.RPC_SERVICE.key()}" "example.Greeter" "${SemanticAttributes.RPC_METHOD.key()}" "SayHello" - "${SemanticAttributes.NET_PEER_NAME.key()}" "localhost" - "${SemanticAttributes.NET_PEER_PORT.key()}" port } } span(2) { - operationName "example.Greeter/SayHello" - spanKind SERVER + name "example.Greeter/SayHello" + kind SERVER childOf span(1) errored false - status(io.opentelemetry.trace.Status.OK) event(0) { eventName "message" attributes { @@ -122,10 +128,10 @@ class GrpcTest extends AgentTestRunner { server?.shutdownNow()?.awaitTermination() where: - name << ["some name", "some other name"] + paramName << ["some name", "some other name"] } - def "test error - #name"() { + def "test error - #paramName"() { setup: def error = grpcStatus.asException() BindableService greeter = new GreeterGrpc.GreeterImplBase() { @@ -136,8 +142,8 @@ class GrpcTest extends AgentTestRunner { } } def port = PortUtils.randomOpenPort() - Server server = ServerBuilder.forPort(port).addService(greeter).build().start() - ManagedChannelBuilder channelBuilder = ManagedChannelBuilder.forAddress("localhost", port) + Server server = configureServer(ServerBuilder.forPort(port).addService(greeter)).build().start() + ManagedChannelBuilder channelBuilder = configureClient(ManagedChannelBuilder.forAddress("localhost", port)) // Depending on the version of gRPC usePlainText may or may not take an argument. try { @@ -149,7 +155,7 @@ class GrpcTest extends AgentTestRunner { GreeterGrpc.GreeterBlockingStub client = GreeterGrpc.newBlockingStub(channel) when: - client.sayHello(Helloworld.Request.newBuilder().setName(name).build()) + client.sayHello(Helloworld.Request.newBuilder().setName(paramName).build()) then: thrown StatusRuntimeException @@ -157,25 +163,23 @@ class GrpcTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "example.Greeter/SayHello" - spanKind CLIENT - parent() + name "example.Greeter/SayHello" + kind CLIENT + hasNoParent() errored true - status(GrpcHelper.statusFromGrpcStatus(grpcStatus)) + status(StatusCanonicalCode.ERROR) attributes { "${SemanticAttributes.RPC_SYSTEM.key()}" "grpc" "${SemanticAttributes.RPC_SERVICE.key()}" "example.Greeter" "${SemanticAttributes.RPC_METHOD.key()}" "SayHello" - "${SemanticAttributes.NET_PEER_NAME.key()}" "localhost" - "${SemanticAttributes.NET_PEER_PORT.key()}" port } } span(1) { - operationName "example.Greeter/SayHello" - spanKind SERVER + name "example.Greeter/SayHello" + kind SERVER childOf span(0) errored true - status(GrpcHelper.statusFromGrpcStatus(grpcStatus)) + status(StatusCanonicalCode.ERROR) event(0) { eventName "message" attributes { @@ -202,7 +206,7 @@ class GrpcTest extends AgentTestRunner { server?.shutdownNow()?.awaitTermination() where: - name | grpcStatus + paramName | grpcStatus "Runtime - cause" | Status.UNKNOWN.withCause(new RuntimeException("some error")) "Status - cause" | Status.PERMISSION_DENIED.withCause(new RuntimeException("some error")) "StatusRuntime - cause" | Status.UNIMPLEMENTED.withCause(new RuntimeException("some error")) @@ -211,7 +215,7 @@ class GrpcTest extends AgentTestRunner { "StatusRuntime - description" | Status.UNIMPLEMENTED.withDescription("some description") } - def "test error thrown - #name"() { + def "test error thrown - #paramName"() { setup: def error = grpcStatus.asRuntimeException() BindableService greeter = new GreeterGrpc.GreeterImplBase() { @@ -222,8 +226,8 @@ class GrpcTest extends AgentTestRunner { } } def port = PortUtils.randomOpenPort() - Server server = ServerBuilder.forPort(port).addService(greeter).build().start() - ManagedChannelBuilder channelBuilder = ManagedChannelBuilder.forAddress("localhost", port) + Server server = configureServer(ServerBuilder.forPort(port).addService(greeter)).build().start() + ManagedChannelBuilder channelBuilder = configureClient(ManagedChannelBuilder.forAddress("localhost", port)) // Depending on the version of gRPC usePlainText may or may not take an argument. try { @@ -235,7 +239,7 @@ class GrpcTest extends AgentTestRunner { GreeterGrpc.GreeterBlockingStub client = GreeterGrpc.newBlockingStub(channel) when: - client.sayHello(Helloworld.Request.newBuilder().setName(name).build()) + client.sayHello(Helloworld.Request.newBuilder().setName(paramName).build()) then: thrown StatusRuntimeException @@ -243,27 +247,24 @@ class GrpcTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "example.Greeter/SayHello" - spanKind CLIENT - parent() + name "example.Greeter/SayHello" + kind CLIENT + hasNoParent() errored true // NB: Exceptions thrown on the server don't appear to be propagated to the client, at // least for the version we test against. - status(io.opentelemetry.trace.Status.UNKNOWN) attributes { "${SemanticAttributes.RPC_SYSTEM.key()}" "grpc" "${SemanticAttributes.RPC_SERVICE.key()}" "example.Greeter" "${SemanticAttributes.RPC_METHOD.key()}" "SayHello" - "${SemanticAttributes.NET_PEER_NAME.key()}" "localhost" - "${SemanticAttributes.NET_PEER_PORT.key()}" Long } } span(1) { - operationName "example.Greeter/SayHello" - spanKind SERVER + name "example.Greeter/SayHello" + kind SERVER childOf span(0) errored true - status(GrpcHelper.statusFromGrpcStatus(grpcStatus)) + status(StatusCanonicalCode.ERROR) event(0) { eventName "message" attributes { @@ -290,7 +291,7 @@ class GrpcTest extends AgentTestRunner { server?.shutdownNow()?.awaitTermination() where: - name | grpcStatus + paramName | grpcStatus "Runtime - cause" | Status.UNKNOWN.withCause(new RuntimeException("some error")) "Status - cause" | Status.PERMISSION_DENIED.withCause(new RuntimeException("some error")) "StatusRuntime - cause" | Status.UNIMPLEMENTED.withCause(new RuntimeException("some error")) @@ -298,4 +299,153 @@ class GrpcTest extends AgentTestRunner { "Status - description" | Status.PERMISSION_DENIED.withDescription("some description") "StatusRuntime - description" | Status.UNIMPLEMENTED.withDescription("some description") } + + def "test user context preserved"() { + setup: + Context.Key key = Context.key("cat") + BindableService greeter = new GreeterGrpc.GreeterImplBase() { + @Override + void sayHello( + final Helloworld.Request req, final StreamObserver responseObserver) { + if (key.get() != "meow") { + responseObserver.onError(new AssertionError((Object) "context not preserved")) + return + } + if (!TracingContextUtils.getSpan(Context.current()).getContext().isValid()) { + responseObserver.onError(new AssertionError((Object) "span not attached")) + return + } + final Helloworld.Response reply = Helloworld.Response.newBuilder().setMessage("Hello $req.name").build() + responseObserver.onNext(reply) + responseObserver.onCompleted() + } + } + def port = PortUtils.randomOpenPort() + Server server + server = configureServer(ServerBuilder.forPort(port) + .addService(greeter)) + .intercept(new ServerInterceptor() { + @Override + ServerCall.Listener interceptCall(ServerCall call, Metadata headers, ServerCallHandler next) { + def ctx = Context.current().withValue(key, "meow") + def oldCtx = ctx.attach() + try { + return next.startCall(call, headers) + } finally { + ctx.detach(oldCtx) + } + } + }) + .build().start() + ManagedChannelBuilder channelBuilder + channelBuilder = configureClient(ManagedChannelBuilder.forAddress("localhost", port)) + .intercept(new ClientInterceptor() { + @Override + ClientCall interceptCall(MethodDescriptor method, CallOptions callOptions, Channel next) { + def ctx = Context.current().withValue(key, "meow") + def oldCtx = ctx.attach() + try { + return next.newCall(method, callOptions) + } finally { + ctx.detach(oldCtx) + } + } + }) + + // Depending on the version of gRPC usePlainText may or may not take an argument. + try { + channelBuilder.usePlaintext() + } catch (MissingMethodException e) { + channelBuilder.usePlaintext(true) + } + ManagedChannel channel = channelBuilder.build() + def client = GreeterGrpc.newStub(channel) + + when: + AtomicReference response = new AtomicReference<>() + AtomicReference error = new AtomicReference<>() + CountDownLatch latch = new CountDownLatch(1) + runUnderTrace("parent") { + client.sayHello( + Helloworld.Request.newBuilder().setName("test").build(), + new StreamObserver() { + @Override + void onNext(Helloworld.Response r) { + if (key.get() != "meow") { + error.set(new AssertionError((Object) "context not preserved")) + return + } + if (!TracingContextUtils.getSpan(Context.current()).getContext().isValid()) { + error.set(new AssertionError((Object) "span not attached")) + return + } + response.set(r) + } + + @Override + void onError(Throwable throwable) { + error.set(throwable) + } + + @Override + void onCompleted() { + latch.countDown() + } + }) + } + + latch.await(10, TimeUnit.SECONDS) + + then: + error.get() == null + response.get().message == "Hello test" + + assertTraces(1) { + trace(0, 3) { + basicSpan(it, 0, "parent") + span(1) { + name "example.Greeter/SayHello" + kind CLIENT + childOf span(0) + errored false + event(0) { + eventName "message" + attributes { + "message.type" "SENT" + "message.id" 1 + } + } + attributes { + "${SemanticAttributes.RPC_SYSTEM.key()}" "grpc" + "${SemanticAttributes.RPC_SERVICE.key()}" "example.Greeter" + "${SemanticAttributes.RPC_METHOD.key()}" "SayHello" + } + } + span(2) { + name "example.Greeter/SayHello" + kind SERVER + childOf span(1) + errored false + event(0) { + eventName "message" + attributes { + "message.type" "RECEIVED" + "message.id" 1 + } + } + attributes { + "${SemanticAttributes.RPC_SYSTEM.key()}" "grpc" + "${SemanticAttributes.RPC_SERVICE.key()}" "example.Greeter" + "${SemanticAttributes.RPC_METHOD.key()}" "SayHello" + "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" + "${SemanticAttributes.NET_PEER_PORT.key()}" Long + } + } + } + } + + cleanup: + channel?.shutdownNow()?.awaitTermination(10, TimeUnit.SECONDS) + server?.shutdownNow()?.awaitTermination() + } } diff --git a/instrumentation/grpc-1.5/src/test/proto/helloworld.proto b/instrumentation/grpc-1.5/testing/src/main/proto/helloworld.proto similarity index 100% rename from instrumentation/grpc-1.5/src/test/proto/helloworld.proto rename to instrumentation/grpc-1.5/testing/src/main/proto/helloworld.proto diff --git a/instrumentation/guava-10.0/src/main/java/io/opentelemetry/instrumentation/auto/guava/ListenableFutureInstrumentation.java b/instrumentation/guava-10.0/src/main/java/io/opentelemetry/instrumentation/auto/guava/ListenableFutureInstrumentation.java index 68e7eddfb5b1..75605d8729ba 100644 --- a/instrumentation/guava-10.0/src/main/java/io/opentelemetry/instrumentation/auto/guava/ListenableFutureInstrumentation.java +++ b/instrumentation/guava-10.0/src/main/java/io/opentelemetry/instrumentation/auto/guava/ListenableFutureInstrumentation.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.guava; diff --git a/instrumentation/guava-10.0/src/test/groovy/ListenableFutureTest.groovy b/instrumentation/guava-10.0/src/test/groovy/ListenableFutureTest.groovy index 29aa8aa5e4da..af71db6ae64d 100644 --- a/instrumentation/guava-10.0/src/test/groovy/ListenableFutureTest.groovy +++ b/instrumentation/guava-10.0/src/test/groovy/ListenableFutureTest.groovy @@ -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 */ import com.google.common.util.concurrent.Futures diff --git a/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/AbstractHibernateInstrumentation.java b/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/AbstractHibernateInstrumentation.java index b68b70cc6ecb..5e8f19dcaff5 100644 --- a/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/AbstractHibernateInstrumentation.java +++ b/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/AbstractHibernateInstrumentation.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.hibernate.v3_3; diff --git a/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/CriteriaInstrumentation.java b/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/CriteriaInstrumentation.java index 318d321d1304..d14a18eccc91 100644 --- a/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/CriteriaInstrumentation.java +++ b/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/CriteriaInstrumentation.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.hibernate.v3_3; diff --git a/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/QueryInstrumentation.java b/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/QueryInstrumentation.java index dbe3e45cfedf..0872a70ed01c 100644 --- a/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/QueryInstrumentation.java +++ b/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/QueryInstrumentation.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.hibernate.v3_3; diff --git a/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/SessionFactoryInstrumentation.java b/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/SessionFactoryInstrumentation.java index e53c7095bfbd..b5f946b697d3 100644 --- a/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/SessionFactoryInstrumentation.java +++ b/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/SessionFactoryInstrumentation.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.hibernate.v3_3; diff --git a/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/SessionInstrumentation.java b/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/SessionInstrumentation.java index d4f977743e8e..a91e2982c683 100644 --- a/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/SessionInstrumentation.java +++ b/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/SessionInstrumentation.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.hibernate.v3_3; diff --git a/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/TransactionInstrumentation.java b/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/TransactionInstrumentation.java index 279374b26f7d..7bd1e46a63bc 100644 --- a/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/TransactionInstrumentation.java +++ b/instrumentation/hibernate/hibernate-3.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v3_3/TransactionInstrumentation.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.hibernate.v3_3; diff --git a/instrumentation/hibernate/hibernate-3.3/src/test/groovy/AbstractHibernateTest.groovy b/instrumentation/hibernate/hibernate-3.3/src/test/groovy/AbstractHibernateTest.groovy index a8e0db2c5d7b..72fd9e7ecf0d 100644 --- a/instrumentation/hibernate/hibernate-3.3/src/test/groovy/AbstractHibernateTest.groovy +++ b/instrumentation/hibernate/hibernate-3.3/src/test/groovy/AbstractHibernateTest.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestRunner diff --git a/instrumentation/hibernate/hibernate-3.3/src/test/groovy/CriteriaTest.groovy b/instrumentation/hibernate/hibernate-3.3/src/test/groovy/CriteriaTest.groovy index e87caf237be8..483583f441b4 100644 --- a/instrumentation/hibernate/hibernate-3.3/src/test/groovy/CriteriaTest.groovy +++ b/instrumentation/hibernate/hibernate-3.3/src/test/groovy/CriteriaTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -40,22 +29,22 @@ class CriteriaTest extends AbstractHibernateTest { assertTraces(1) { trace(0, 4) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName "Criteria.$methodName" - spanKind INTERNAL + name "Criteria.$methodName" + kind INTERNAL childOf span(0) attributes { } } span(2) { - operationName ~/^select / - spanKind CLIENT + name ~/^select / + kind CLIENT childOf span(1) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -66,8 +55,8 @@ class CriteriaTest extends AbstractHibernateTest { } } span(3) { - operationName "Transaction.commit" - spanKind INTERNAL + name "Transaction.commit" + kind INTERNAL childOf span(0) attributes { } diff --git a/instrumentation/hibernate/hibernate-3.3/src/test/groovy/QueryTest.groovy b/instrumentation/hibernate/hibernate-3.3/src/test/groovy/QueryTest.groovy index 81d126a7a3b7..12ab6ce64824 100644 --- a/instrumentation/hibernate/hibernate-3.3/src/test/groovy/QueryTest.groovy +++ b/instrumentation/hibernate/hibernate-3.3/src/test/groovy/QueryTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -45,21 +34,21 @@ class QueryTest extends AbstractHibernateTest { // With Transaction trace(0, 4) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName expectedSpanName - spanKind INTERNAL + name expectedSpanName + kind INTERNAL childOf span(0) attributes { } } span(2) { - spanKind CLIENT + kind CLIENT childOf span(1) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -70,8 +59,8 @@ class QueryTest extends AbstractHibernateTest { } } span(3) { - operationName "Transaction.commit" - spanKind INTERNAL + name "Transaction.commit" + kind INTERNAL childOf span(0) attributes { } @@ -81,22 +70,22 @@ class QueryTest extends AbstractHibernateTest { // Without Transaction trace(1, 3) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName expectedSpanName - spanKind INTERNAL + name expectedSpanName + kind INTERNAL childOf span(0) attributes { } } span(2) { - operationName ~/^select / - spanKind CLIENT + name ~/^select / + kind CLIENT childOf span(1) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -153,22 +142,22 @@ class QueryTest extends AbstractHibernateTest { assertTraces(1) { trace(0, 4) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName "from Value" - spanKind INTERNAL + name "from Value" + kind INTERNAL childOf span(0) attributes { } } span(2) { - operationName ~/^select / - spanKind CLIENT + name ~/^select / + kind CLIENT childOf span(1) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -179,8 +168,8 @@ class QueryTest extends AbstractHibernateTest { } } span(3) { - operationName "Transaction.commit" - spanKind INTERNAL + name "Transaction.commit" + kind INTERNAL childOf span(0) attributes { } diff --git a/instrumentation/hibernate/hibernate-3.3/src/test/groovy/SessionTest.groovy b/instrumentation/hibernate/hibernate-3.3/src/test/groovy/SessionTest.groovy index 13f0dce2c0c5..2cf2059deb2c 100644 --- a/instrumentation/hibernate/hibernate-3.3/src/test/groovy/SessionTest.groovy +++ b/instrumentation/hibernate/hibernate-3.3/src/test/groovy/SessionTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace @@ -57,22 +46,22 @@ class SessionTest extends AbstractHibernateTest { for (int i = 0; i < sessionImplementations.size(); i++) { trace(i, 4) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName "Session.$methodName $resource" - spanKind INTERNAL + name "Session.$methodName $resource" + kind INTERNAL childOf span(0) attributes { } } span(2) { - operationName ~/^select / - spanKind CLIENT + name ~/^select / + kind CLIENT childOf span(1) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -83,8 +72,8 @@ class SessionTest extends AbstractHibernateTest { } } span(3) { - operationName "Transaction.commit" - spanKind INTERNAL + name "Transaction.commit" + kind INTERNAL childOf span(0) attributes { } @@ -126,28 +115,28 @@ class SessionTest extends AbstractHibernateTest { assertTraces(1) { trace(0, 4) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName "Session.$methodName $resource" - spanKind INTERNAL + name "Session.$methodName $resource" + kind INTERNAL childOf span(0) attributes { } } span(2) { - operationName "Transaction.commit" - spanKind INTERNAL + name "Transaction.commit" + kind INTERNAL childOf span(0) attributes { } } span(3) { - spanKind CLIENT + kind CLIENT childOf span(2) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -198,22 +187,22 @@ class SessionTest extends AbstractHibernateTest { assertTraces(1) { trace(0, 5) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName "Session.$methodName $resource" - spanKind INTERNAL + name "Session.$methodName $resource" + kind INTERNAL childOf span(0) attributes { } } span(2) { - operationName ~/^select / - spanKind CLIENT + name ~/^select / + kind CLIENT childOf span(1) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -224,14 +213,14 @@ class SessionTest extends AbstractHibernateTest { } } span(3) { - operationName "Transaction.commit" - spanKind INTERNAL + name "Transaction.commit" + kind INTERNAL childOf span(0) attributes { } } span(4) { - spanKind CLIENT + kind CLIENT childOf span(3) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -279,22 +268,22 @@ class SessionTest extends AbstractHibernateTest { assertTraces(1) { trace(0, 3) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName "Session.replicate" - spanKind INTERNAL + name "Session.replicate" + kind INTERNAL childOf span(0) errored(true) errorEvent(MappingException, "Unknown entity: java.lang.Long") } span(2) { - operationName "Transaction.commit" - spanKind INTERNAL + name "Transaction.commit" + kind INTERNAL childOf span(0) attributes { } @@ -324,28 +313,28 @@ class SessionTest extends AbstractHibernateTest { assertTraces(1) { trace(0, 4) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName "Session.$methodName $resource" - spanKind INTERNAL + name "Session.$methodName $resource" + kind INTERNAL childOf span(0) attributes { } } span(2) { - operationName "Transaction.commit" - spanKind INTERNAL + name "Transaction.commit" + kind INTERNAL childOf span(0) attributes { } } span(3) { - spanKind CLIENT + kind CLIENT childOf span(2) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -403,21 +392,21 @@ class SessionTest extends AbstractHibernateTest { assertTraces(1) { trace(0, 4) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName expectedSpanName - spanKind INTERNAL + name expectedSpanName + kind INTERNAL childOf span(0) attributes { } } span(2) { - spanKind CLIENT + kind CLIENT childOf span(1) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -428,8 +417,8 @@ class SessionTest extends AbstractHibernateTest { } } span(3) { - operationName "Transaction.commit" - spanKind INTERNAL + name "Transaction.commit" + kind INTERNAL childOf span(0) attributes { } @@ -470,41 +459,41 @@ class SessionTest extends AbstractHibernateTest { assertTraces(1) { trace(0, 11) { span(0) { - operationName "overlapping Sessions" + name "overlapping Sessions" attributes { } } span(1) { - operationName "Session" - spanKind INTERNAL + name "Session" + kind INTERNAL childOf span(0) attributes { } } span(2) { - operationName "Session.save Value" - spanKind INTERNAL + name "Session.save Value" + kind INTERNAL childOf span(1) attributes { } } span(3) { - operationName "Session.delete Value" - spanKind INTERNAL + name "Session.delete Value" + kind INTERNAL childOf span(1) attributes { } } span(4) { - operationName "Transaction.commit" - spanKind INTERNAL + name "Transaction.commit" + kind INTERNAL childOf span(1) attributes { } } span(5) { - operationName ~/^insert / - spanKind CLIENT + name ~/^insert / + kind CLIENT childOf span(4) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -515,8 +504,8 @@ class SessionTest extends AbstractHibernateTest { } } span(6) { - operationName ~/^delete / - spanKind CLIENT + name ~/^delete / + kind CLIENT childOf span(4) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -527,29 +516,29 @@ class SessionTest extends AbstractHibernateTest { } } span(7) { - operationName "Session" - spanKind INTERNAL + name "Session" + kind INTERNAL childOf span(0) attributes { } } span(8) { - operationName "Session.insert Value" - spanKind INTERNAL + name "Session.insert Value" + kind INTERNAL childOf span(7) attributes { } } span(9) { - operationName "Session" - spanKind INTERNAL + name "Session" + kind INTERNAL childOf span(0) attributes { } } span(10) { - operationName "Session.save Value" - spanKind INTERNAL + name "Session.save Value" + kind INTERNAL childOf span(9) attributes { } diff --git a/instrumentation/hibernate/hibernate-3.3/src/test/java/Value.java b/instrumentation/hibernate/hibernate-3.3/src/test/java/Value.java index 6b94fbad6bf7..d72b8d8a035e 100644 --- a/instrumentation/hibernate/hibernate-3.3/src/test/java/Value.java +++ b/instrumentation/hibernate/hibernate-3.3/src/test/java/Value.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 */ import javax.persistence.Entity; diff --git a/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/AbstractHibernateInstrumentation.java b/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/AbstractHibernateInstrumentation.java index 08b3170af094..502da56a596d 100644 --- a/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/AbstractHibernateInstrumentation.java +++ b/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/AbstractHibernateInstrumentation.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.hibernate.v4_0; diff --git a/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/CriteriaInstrumentation.java b/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/CriteriaInstrumentation.java index 0fde40cf010d..bc3e34c084a8 100644 --- a/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/CriteriaInstrumentation.java +++ b/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/CriteriaInstrumentation.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.hibernate.v4_0; diff --git a/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/QueryInstrumentation.java b/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/QueryInstrumentation.java index 8671156f7abf..c3cea3668d6c 100644 --- a/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/QueryInstrumentation.java +++ b/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/QueryInstrumentation.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.hibernate.v4_0; diff --git a/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/SessionFactoryInstrumentation.java b/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/SessionFactoryInstrumentation.java index 36751f60096b..917b3a718c66 100644 --- a/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/SessionFactoryInstrumentation.java +++ b/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/SessionFactoryInstrumentation.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.hibernate.v4_0; diff --git a/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/SessionInstrumentation.java b/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/SessionInstrumentation.java index 7e69ae862361..f92f7f495ba9 100644 --- a/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/SessionInstrumentation.java +++ b/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/SessionInstrumentation.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.hibernate.v4_0; diff --git a/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/TransactionInstrumentation.java b/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/TransactionInstrumentation.java index d8b1780bce3e..1b6fdf57cd6d 100644 --- a/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/TransactionInstrumentation.java +++ b/instrumentation/hibernate/hibernate-4.0/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_0/TransactionInstrumentation.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.hibernate.v4_0; diff --git a/instrumentation/hibernate/hibernate-4.0/src/test/groovy/AbstractHibernateTest.groovy b/instrumentation/hibernate/hibernate-4.0/src/test/groovy/AbstractHibernateTest.groovy index d2e05180f2c1..ee88644ba38f 100644 --- a/instrumentation/hibernate/hibernate-4.0/src/test/groovy/AbstractHibernateTest.groovy +++ b/instrumentation/hibernate/hibernate-4.0/src/test/groovy/AbstractHibernateTest.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestRunner diff --git a/instrumentation/hibernate/hibernate-4.0/src/test/groovy/CriteriaTest.groovy b/instrumentation/hibernate/hibernate-4.0/src/test/groovy/CriteriaTest.groovy index e87caf237be8..483583f441b4 100644 --- a/instrumentation/hibernate/hibernate-4.0/src/test/groovy/CriteriaTest.groovy +++ b/instrumentation/hibernate/hibernate-4.0/src/test/groovy/CriteriaTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -40,22 +29,22 @@ class CriteriaTest extends AbstractHibernateTest { assertTraces(1) { trace(0, 4) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName "Criteria.$methodName" - spanKind INTERNAL + name "Criteria.$methodName" + kind INTERNAL childOf span(0) attributes { } } span(2) { - operationName ~/^select / - spanKind CLIENT + name ~/^select / + kind CLIENT childOf span(1) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -66,8 +55,8 @@ class CriteriaTest extends AbstractHibernateTest { } } span(3) { - operationName "Transaction.commit" - spanKind INTERNAL + name "Transaction.commit" + kind INTERNAL childOf span(0) attributes { } diff --git a/instrumentation/hibernate/hibernate-4.0/src/test/groovy/QueryTest.groovy b/instrumentation/hibernate/hibernate-4.0/src/test/groovy/QueryTest.groovy index cf12185c939a..4259ddce690f 100644 --- a/instrumentation/hibernate/hibernate-4.0/src/test/groovy/QueryTest.groovy +++ b/instrumentation/hibernate/hibernate-4.0/src/test/groovy/QueryTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -45,21 +34,21 @@ class QueryTest extends AbstractHibernateTest { // With Transaction trace(0, 4) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName expectedSpanName - spanKind INTERNAL + name expectedSpanName + kind INTERNAL childOf span(0) attributes { } } span(2) { - spanKind CLIENT + kind CLIENT childOf span(1) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -70,8 +59,8 @@ class QueryTest extends AbstractHibernateTest { } } span(3) { - operationName "Transaction.commit" - spanKind INTERNAL + name "Transaction.commit" + kind INTERNAL childOf span(0) attributes { } @@ -81,22 +70,22 @@ class QueryTest extends AbstractHibernateTest { // Without Transaction trace(1, 3) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName expectedSpanName - spanKind INTERNAL + name expectedSpanName + kind INTERNAL childOf span(0) attributes { } } span(2) { - operationName ~/^select / - spanKind CLIENT + name ~/^select / + kind CLIENT childOf span(1) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -153,22 +142,22 @@ class QueryTest extends AbstractHibernateTest { assertTraces(1) { trace(0, 4) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName "from Value" - spanKind INTERNAL + name "from Value" + kind INTERNAL childOf span(0) attributes { } } span(2) { - operationName ~/^select / - spanKind CLIENT + name ~/^select / + kind CLIENT childOf span(1) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -179,8 +168,8 @@ class QueryTest extends AbstractHibernateTest { } } span(3) { - operationName "Transaction.commit" - spanKind INTERNAL + name "Transaction.commit" + kind INTERNAL childOf span(0) attributes { } diff --git a/instrumentation/hibernate/hibernate-4.0/src/test/groovy/SessionTest.groovy b/instrumentation/hibernate/hibernate-4.0/src/test/groovy/SessionTest.groovy index 28ec0dfdfb04..e4c8c760abcd 100644 --- a/instrumentation/hibernate/hibernate-4.0/src/test/groovy/SessionTest.groovy +++ b/instrumentation/hibernate/hibernate-4.0/src/test/groovy/SessionTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace @@ -57,22 +46,22 @@ class SessionTest extends AbstractHibernateTest { for (int i = 0; i < sessionImplementations.size(); i++) { trace(i, 4) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName "Session.$methodName $resource" - spanKind INTERNAL + name "Session.$methodName $resource" + kind INTERNAL childOf span(0) attributes { } } span(2) { childOf span(1) - spanKind CLIENT + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" "${SemanticAttributes.DB_NAME.key()}" "db1" @@ -82,8 +71,8 @@ class SessionTest extends AbstractHibernateTest { } } span(3) { - operationName "Transaction.commit" - spanKind INTERNAL + name "Transaction.commit" + kind INTERNAL childOf span(0) attributes { } @@ -139,22 +128,22 @@ class SessionTest extends AbstractHibernateTest { assertTraces(1) { trace(0, 5) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName "Session.$methodName $resource" - spanKind INTERNAL + name "Session.$methodName $resource" + kind INTERNAL childOf span(0) attributes { } } span(2) { - operationName ~/^select / - spanKind CLIENT + name ~/^select / + kind CLIENT childOf span(1) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -165,14 +154,14 @@ class SessionTest extends AbstractHibernateTest { } } span(3) { - operationName "Transaction.commit" - spanKind INTERNAL + name "Transaction.commit" + kind INTERNAL childOf span(0) attributes { } } span(4) { - spanKind CLIENT + kind CLIENT childOf span(3) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -220,22 +209,22 @@ class SessionTest extends AbstractHibernateTest { assertTraces(1) { trace(0, 3) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName "Session.replicate" - spanKind INTERNAL + name "Session.replicate" + kind INTERNAL childOf span(0) errored(true) errorEvent(MappingException, "Unknown entity: java.lang.Long") } span(2) { - operationName "Transaction.commit" - spanKind INTERNAL + name "Transaction.commit" + kind INTERNAL childOf span(0) attributes { } @@ -265,28 +254,28 @@ class SessionTest extends AbstractHibernateTest { assertTraces(1) { trace(0, 4) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName "Session.$methodName $resource" - spanKind INTERNAL + name "Session.$methodName $resource" + kind INTERNAL childOf span(0) attributes { } } span(2) { - operationName "Transaction.commit" - spanKind INTERNAL + name "Transaction.commit" + kind INTERNAL childOf span(0) attributes { } } span(3) { - spanKind CLIENT + kind CLIENT childOf span(2) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -344,21 +333,21 @@ class SessionTest extends AbstractHibernateTest { assertTraces(1) { trace(0, 4) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName resource - spanKind INTERNAL + name resource + kind INTERNAL childOf span(0) attributes { } } span(2) { - spanKind CLIENT + kind CLIENT childOf span(1) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -369,8 +358,8 @@ class SessionTest extends AbstractHibernateTest { } } span(3) { - operationName "Transaction.commit" - spanKind INTERNAL + name "Transaction.commit" + kind INTERNAL childOf span(0) attributes { } @@ -411,41 +400,41 @@ class SessionTest extends AbstractHibernateTest { assertTraces(1) { trace(0, 12) { span(0) { - operationName "overlapping Sessions" + name "overlapping Sessions" attributes { } } span(1) { - operationName "Session" - spanKind INTERNAL + name "Session" + kind INTERNAL childOf span(0) attributes { } } span(2) { - operationName "Session.save Value" - spanKind INTERNAL + name "Session.save Value" + kind INTERNAL childOf span(1) attributes { } } span(3) { - operationName "Session.delete Value" - spanKind INTERNAL + name "Session.delete Value" + kind INTERNAL childOf span(1) attributes { } } span(4) { - operationName "Transaction.commit" - spanKind INTERNAL + name "Transaction.commit" + kind INTERNAL childOf span(1) attributes { } } span(5) { - operationName ~/^insert / - spanKind CLIENT + name ~/^insert / + kind CLIENT childOf span(4) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -456,8 +445,8 @@ class SessionTest extends AbstractHibernateTest { } } span(6) { - operationName ~/^delete / - spanKind CLIENT + name ~/^delete / + kind CLIENT childOf span(4) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -468,22 +457,22 @@ class SessionTest extends AbstractHibernateTest { } } span(7) { - operationName "Session" - spanKind INTERNAL + name "Session" + kind INTERNAL childOf span(0) attributes { } } span(8) { - operationName "Session.insert Value" - spanKind INTERNAL + name "Session.insert Value" + kind INTERNAL childOf span(7) attributes { } } span(9) { - operationName ~/^insert / - spanKind CLIENT + name ~/^insert / + kind CLIENT childOf span(8) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "h2" @@ -494,15 +483,15 @@ class SessionTest extends AbstractHibernateTest { } } span(10) { - operationName "Session" - spanKind INTERNAL + name "Session" + kind INTERNAL childOf span(0) attributes { } } span(11) { - operationName "Session.save Value" - spanKind INTERNAL + name "Session.save Value" + kind INTERNAL childOf span(10) attributes { } diff --git a/instrumentation/hibernate/hibernate-4.0/src/test/java/Value.java b/instrumentation/hibernate/hibernate-4.0/src/test/java/Value.java index 6b94fbad6bf7..d72b8d8a035e 100644 --- a/instrumentation/hibernate/hibernate-4.0/src/test/java/Value.java +++ b/instrumentation/hibernate/hibernate-4.0/src/test/java/Value.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 */ import javax.persistence.Entity; diff --git a/instrumentation/hibernate/hibernate-4.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_3/ProcedureCallInstrumentation.java b/instrumentation/hibernate/hibernate-4.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_3/ProcedureCallInstrumentation.java index 38a4ecfc7e6a..b6bca1f7d7c4 100644 --- a/instrumentation/hibernate/hibernate-4.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_3/ProcedureCallInstrumentation.java +++ b/instrumentation/hibernate/hibernate-4.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_3/ProcedureCallInstrumentation.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.hibernate.v4_3; diff --git a/instrumentation/hibernate/hibernate-4.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_3/SessionInstrumentation.java b/instrumentation/hibernate/hibernate-4.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_3/SessionInstrumentation.java index d2970f1ac061..d9291a660ae0 100644 --- a/instrumentation/hibernate/hibernate-4.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_3/SessionInstrumentation.java +++ b/instrumentation/hibernate/hibernate-4.3/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/v4_3/SessionInstrumentation.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.hibernate.v4_3; diff --git a/instrumentation/hibernate/hibernate-4.3/src/test/groovy/ProcedureCallTest.groovy b/instrumentation/hibernate/hibernate-4.3/src/test/groovy/ProcedureCallTest.groovy index 44d855e36772..7a8b6414a87e 100644 --- a/instrumentation/hibernate/hibernate-4.3/src/test/groovy/ProcedureCallTest.groovy +++ b/instrumentation/hibernate/hibernate-4.3/src/test/groovy/ProcedureCallTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -82,22 +71,22 @@ class ProcedureCallTest extends AgentTestRunner { assertTraces(1) { trace(0, 4) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName "ProcedureCall.getOutputs TEST_PROC" - spanKind INTERNAL + name "ProcedureCall.getOutputs TEST_PROC" + kind INTERNAL childOf span(0) attributes { } } span(2) { - operationName "{call TEST_PROC()}" - spanKind CLIENT + name "{call TEST_PROC()}" + kind CLIENT childOf span(1) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "hsqldb" @@ -108,8 +97,8 @@ class ProcedureCallTest extends AgentTestRunner { } } span(3) { - spanKind INTERNAL - operationName "Transaction.commit" + kind INTERNAL + name "Transaction.commit" childOf span(0) attributes { } @@ -140,22 +129,22 @@ class ProcedureCallTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName "Session" - spanKind INTERNAL - parent() + name "Session" + kind INTERNAL + hasNoParent() attributes { } } span(1) { - operationName "ProcedureCall.getOutputs TEST_PROC" - spanKind INTERNAL + name "ProcedureCall.getOutputs TEST_PROC" + kind INTERNAL childOf span(0) errored(true) errorEvent(SQLGrammarException, "could not prepare statement") } span(2) { - operationName "Transaction.commit" - spanKind INTERNAL + name "Transaction.commit" + kind INTERNAL childOf span(0) attributes { } diff --git a/instrumentation/hibernate/hibernate-4.3/src/test/groovy/SpringJpaTest.groovy b/instrumentation/hibernate/hibernate-4.3/src/test/groovy/SpringJpaTest.groovy index 8b3162f83424..2dfe3dc1509f 100644 --- a/instrumentation/hibernate/hibernate-4.3/src/test/groovy/SpringJpaTest.groovy +++ b/instrumentation/hibernate/hibernate-4.3/src/test/groovy/SpringJpaTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -46,8 +35,8 @@ class SpringJpaTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "select customer0_.id as id1_0_, customer0_.firstName as firstNam2_0_, customer0_.lastName as lastName3_0_ from Customer customer0_" - spanKind CLIENT + name "select customer0_.id as id1_0_, customer0_.firstName as firstNam2_0_, customer0_.lastName as lastName3_0_ from Customer customer0_" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "hsqldb" "${SemanticAttributes.DB_NAME.key()}" "test" @@ -72,8 +61,8 @@ class SpringJpaTest extends AgentTestRunner { if (extraTrace) { trace(0, 1) { span(0) { - operationName "call next value for hibernate_sequence" - spanKind CLIENT + name "call next value for hibernate_sequence" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "hsqldb" "${SemanticAttributes.DB_NAME.key()}" "test" @@ -86,8 +75,8 @@ class SpringJpaTest extends AgentTestRunner { } trace(extraTrace ? 1 : 0, 1) { span(0) { - operationName ~/insert into Customer \(.*\) values \(.*, \?, \?\)/ - spanKind CLIENT + name ~/insert into Customer \(.*\) values \(.*, \?, \?\)/ + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "hsqldb" "${SemanticAttributes.DB_NAME.key()}" "test" @@ -109,8 +98,8 @@ class SpringJpaTest extends AgentTestRunner { assertTraces(2) { trace(0, 1) { span(0) { - operationName "select customer0_.id as id1_0_0_, customer0_.firstName as firstNam2_0_0_, customer0_.lastName as lastName3_0_0_ from Customer customer0_ where customer0_.id=?" - spanKind CLIENT + name "select customer0_.id as id1_0_0_, customer0_.firstName as firstNam2_0_0_, customer0_.lastName as lastName3_0_0_ from Customer customer0_ where customer0_.id=?" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "hsqldb" "${SemanticAttributes.DB_NAME.key()}" "test" @@ -122,8 +111,8 @@ class SpringJpaTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "update Customer set firstName=?, lastName=? where id=?" - spanKind CLIENT + name "update Customer set firstName=?, lastName=? where id=?" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "hsqldb" "${SemanticAttributes.DB_NAME.key()}" "test" @@ -145,8 +134,8 @@ class SpringJpaTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "select customer0_.id as id1_0_, customer0_.firstName as firstNam2_0_, customer0_.lastName as lastName3_0_ from Customer customer0_ where customer0_.lastName=?" - spanKind CLIENT + name "select customer0_.id as id1_0_, customer0_.firstName as firstNam2_0_, customer0_.lastName as lastName3_0_ from Customer customer0_ where customer0_.lastName=?" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "hsqldb" "${SemanticAttributes.DB_NAME.key()}" "test" @@ -166,8 +155,8 @@ class SpringJpaTest extends AgentTestRunner { assertTraces(2) { trace(0, 1) { span(0) { - operationName "select customer0_.id as id1_0_0_, customer0_.firstName as firstNam2_0_0_, customer0_.lastName as lastName3_0_0_ from Customer customer0_ where customer0_.id=?" - spanKind CLIENT + name "select customer0_.id as id1_0_0_, customer0_.firstName as firstNam2_0_0_, customer0_.lastName as lastName3_0_0_ from Customer customer0_ where customer0_.id=?" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "hsqldb" "${SemanticAttributes.DB_NAME.key()}" "test" @@ -179,8 +168,8 @@ class SpringJpaTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "delete from Customer where id=?" - spanKind CLIENT + name "delete from Customer where id=?" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "hsqldb" "${SemanticAttributes.DB_NAME.key()}" "test" diff --git a/instrumentation/hibernate/hibernate-4.3/src/test/java/Value.java b/instrumentation/hibernate/hibernate-4.3/src/test/java/Value.java index 6b94fbad6bf7..d72b8d8a035e 100644 --- a/instrumentation/hibernate/hibernate-4.3/src/test/java/Value.java +++ b/instrumentation/hibernate/hibernate-4.3/src/test/java/Value.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 */ import javax.persistence.Entity; diff --git a/instrumentation/hibernate/hibernate-4.3/src/test/java/spring/jpa/Customer.java b/instrumentation/hibernate/hibernate-4.3/src/test/java/spring/jpa/Customer.java index 56c0420ad483..c55f240b89a3 100644 --- a/instrumentation/hibernate/hibernate-4.3/src/test/java/spring/jpa/Customer.java +++ b/instrumentation/hibernate/hibernate-4.3/src/test/java/spring/jpa/Customer.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 spring.jpa; diff --git a/instrumentation/hibernate/hibernate-4.3/src/test/java/spring/jpa/CustomerRepository.java b/instrumentation/hibernate/hibernate-4.3/src/test/java/spring/jpa/CustomerRepository.java index 11552783948f..9662f2a4b59c 100644 --- a/instrumentation/hibernate/hibernate-4.3/src/test/java/spring/jpa/CustomerRepository.java +++ b/instrumentation/hibernate/hibernate-4.3/src/test/java/spring/jpa/CustomerRepository.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 spring.jpa; diff --git a/instrumentation/hibernate/hibernate-4.3/src/test/java/spring/jpa/PersistenceConfig.java b/instrumentation/hibernate/hibernate-4.3/src/test/java/spring/jpa/PersistenceConfig.java index ef9e7efeb3a7..98afef6b75d7 100644 --- a/instrumentation/hibernate/hibernate-4.3/src/test/java/spring/jpa/PersistenceConfig.java +++ b/instrumentation/hibernate/hibernate-4.3/src/test/java/spring/jpa/PersistenceConfig.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 spring.jpa; diff --git a/instrumentation/hibernate/hibernate-common/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/HibernateDecorator.java b/instrumentation/hibernate/hibernate-common/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/HibernateDecorator.java index 7f5e263c7b26..17ebbbb61d8d 100644 --- a/instrumentation/hibernate/hibernate-common/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/HibernateDecorator.java +++ b/instrumentation/hibernate/hibernate-common/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/HibernateDecorator.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.hibernate; diff --git a/instrumentation/hibernate/hibernate-common/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/SessionMethodUtils.java b/instrumentation/hibernate/hibernate-common/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/SessionMethodUtils.java index 573f6d7b4b46..fad1556ec39f 100644 --- a/instrumentation/hibernate/hibernate-common/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/SessionMethodUtils.java +++ b/instrumentation/hibernate/hibernate-common/src/main/java/io/opentelemetry/instrumentation/auto/hibernate/SessionMethodUtils.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.hibernate; diff --git a/instrumentation/http-url-connection/src/main/java/io/opentelemetry/instrumentation/auto/httpurlconnection/HeadersInjectAdapter.java b/instrumentation/http-url-connection/src/main/java/io/opentelemetry/instrumentation/auto/httpurlconnection/HeadersInjectAdapter.java index c271ac646528..7d10d561511e 100644 --- a/instrumentation/http-url-connection/src/main/java/io/opentelemetry/instrumentation/auto/httpurlconnection/HeadersInjectAdapter.java +++ b/instrumentation/http-url-connection/src/main/java/io/opentelemetry/instrumentation/auto/httpurlconnection/HeadersInjectAdapter.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.httpurlconnection; diff --git a/instrumentation/http-url-connection/src/main/java/io/opentelemetry/instrumentation/auto/httpurlconnection/HttpUrlConnectionInstrumentation.java b/instrumentation/http-url-connection/src/main/java/io/opentelemetry/instrumentation/auto/httpurlconnection/HttpUrlConnectionInstrumentation.java index b181b732a50a..13c870ec4591 100644 --- a/instrumentation/http-url-connection/src/main/java/io/opentelemetry/instrumentation/auto/httpurlconnection/HttpUrlConnectionInstrumentation.java +++ b/instrumentation/http-url-connection/src/main/java/io/opentelemetry/instrumentation/auto/httpurlconnection/HttpUrlConnectionInstrumentation.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.httpurlconnection; diff --git a/instrumentation/http-url-connection/src/main/java/io/opentelemetry/instrumentation/auto/httpurlconnection/HttpUrlConnectionTracer.java b/instrumentation/http-url-connection/src/main/java/io/opentelemetry/instrumentation/auto/httpurlconnection/HttpUrlConnectionTracer.java index 8fefa097d0a0..9411a7238583 100644 --- a/instrumentation/http-url-connection/src/main/java/io/opentelemetry/instrumentation/auto/httpurlconnection/HttpUrlConnectionTracer.java +++ b/instrumentation/http-url-connection/src/main/java/io/opentelemetry/instrumentation/auto/httpurlconnection/HttpUrlConnectionTracer.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.httpurlconnection; diff --git a/instrumentation/http-url-connection/src/test/groovy/HttpUrlConnectionResponseCodeOnlyTest.groovy b/instrumentation/http-url-connection/src/test/groovy/HttpUrlConnectionResponseCodeOnlyTest.groovy index 0fd494d56eab..394b2420d08e 100644 --- a/instrumentation/http-url-connection/src/test/groovy/HttpUrlConnectionResponseCodeOnlyTest.groovy +++ b/instrumentation/http-url-connection/src/test/groovy/HttpUrlConnectionResponseCodeOnlyTest.groovy @@ -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 */ import io.opentelemetry.auto.test.base.HttpClientTest diff --git a/instrumentation/http-url-connection/src/test/groovy/HttpUrlConnectionTest.groovy b/instrumentation/http-url-connection/src/test/groovy/HttpUrlConnectionTest.groovy index 7f52a590c3dc..33aa834b2b08 100644 --- a/instrumentation/http-url-connection/src/test/groovy/HttpUrlConnectionTest.groovy +++ b/instrumentation/http-url-connection/src/test/groovy/HttpUrlConnectionTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace @@ -89,15 +78,15 @@ class HttpUrlConnectionTest extends HttpClientTest { server.distributedRequestTrace(it, 1, traces[2][1]) trace(2, 3) { span(0) { - operationName "someTrace" - parent() + name "someTrace" + hasNoParent() errored false attributes { } } span(1) { - operationName expectedOperationName("GET") - spanKind CLIENT + name expectedOperationName("GET") + kind CLIENT childOf span(0) errored false attributes { @@ -110,8 +99,8 @@ class HttpUrlConnectionTest extends HttpClientTest { } } span(2) { - operationName expectedOperationName("GET") - spanKind CLIENT + name expectedOperationName("GET") + kind CLIENT childOf span(0) errored false attributes { @@ -163,15 +152,15 @@ class HttpUrlConnectionTest extends HttpClientTest { assertTraces(1) { trace(0, 3) { span(0) { - operationName "someTrace" - parent() + name "someTrace" + hasNoParent() errored false attributes { } } span(1) { - operationName expectedOperationName("GET") - spanKind CLIENT + name expectedOperationName("GET") + kind CLIENT childOf span(0) errored false attributes { @@ -184,8 +173,8 @@ class HttpUrlConnectionTest extends HttpClientTest { } } span(2) { - operationName expectedOperationName("GET") - spanKind CLIENT + name expectedOperationName("GET") + kind CLIENT childOf span(0) errored false attributes { @@ -221,15 +210,15 @@ class HttpUrlConnectionTest extends HttpClientTest { assertTraces(1) { trace(0, 2) { span(0) { - operationName "someTrace" - parent() + name "someTrace" + hasNoParent() errored false attributes { } } span(1) { - operationName expectedOperationName("GET") - spanKind CLIENT + name expectedOperationName("GET") + kind CLIENT childOf span(0) errored false attributes { @@ -280,15 +269,15 @@ class HttpUrlConnectionTest extends HttpClientTest { server.distributedRequestTrace(it, 0, traces[1][1]) trace(1, 2) { span(0) { - operationName "someTrace" - parent() + name "someTrace" + hasNoParent() errored false attributes { } } span(1) { - operationName expectedOperationName("POST") - spanKind CLIENT + name expectedOperationName("POST") + kind CLIENT childOf span(0) errored false attributes { diff --git a/instrumentation/http-url-connection/src/test/groovy/HttpUrlConnectionUseCachesFalseTest.groovy b/instrumentation/http-url-connection/src/test/groovy/HttpUrlConnectionUseCachesFalseTest.groovy index 4f66036850fd..2de8c48d025d 100644 --- a/instrumentation/http-url-connection/src/test/groovy/HttpUrlConnectionUseCachesFalseTest.groovy +++ b/instrumentation/http-url-connection/src/test/groovy/HttpUrlConnectionUseCachesFalseTest.groovy @@ -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 */ import io.opentelemetry.auto.test.base.HttpClientTest diff --git a/instrumentation/http-url-connection/src/test/groovy/SpringRestTemplateTest.groovy b/instrumentation/http-url-connection/src/test/groovy/SpringRestTemplateTest.groovy index 786d77ab2f76..ccb876a276d1 100644 --- a/instrumentation/http-url-connection/src/test/groovy/SpringRestTemplateTest.groovy +++ b/instrumentation/http-url-connection/src/test/groovy/SpringRestTemplateTest.groovy @@ -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 */ import io.opentelemetry.auto.test.base.HttpClientTest diff --git a/instrumentation/http-url-connection/src/test/groovy/UrlConnectionTest.groovy b/instrumentation/http-url-connection/src/test/groovy/UrlConnectionTest.groovy index edd2b7fe22be..813e8dd722fa 100644 --- a/instrumentation/http-url-connection/src/test/groovy/UrlConnectionTest.groovy +++ b/instrumentation/http-url-connection/src/test/groovy/UrlConnectionTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.PortUtils.UNUSABLE_PORT @@ -41,14 +30,14 @@ class UrlConnectionTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "someTrace" - parent() + name "someTrace" + hasNoParent() errored true errorEvent ConnectException, String } span(1) { - operationName expectedOperationName("GET") - spanKind CLIENT + name expectedOperationName("GET") + kind CLIENT childOf span(0) errored true errorEvent ConnectException, String diff --git a/instrumentation/hystrix-1.4/src/main/java/io/opentelemetry/instrumentation/auto/hystrix/HystrixInstrumentation.java b/instrumentation/hystrix-1.4/src/main/java/io/opentelemetry/instrumentation/auto/hystrix/HystrixInstrumentation.java index eef37e3b6eeb..7f1c4777f71d 100644 --- a/instrumentation/hystrix-1.4/src/main/java/io/opentelemetry/instrumentation/auto/hystrix/HystrixInstrumentation.java +++ b/instrumentation/hystrix-1.4/src/main/java/io/opentelemetry/instrumentation/auto/hystrix/HystrixInstrumentation.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.hystrix; diff --git a/instrumentation/hystrix-1.4/src/main/java/io/opentelemetry/instrumentation/auto/hystrix/HystrixTracer.java b/instrumentation/hystrix-1.4/src/main/java/io/opentelemetry/instrumentation/auto/hystrix/HystrixTracer.java index 71c33f22f3c3..5ffa88eb0967 100644 --- a/instrumentation/hystrix-1.4/src/main/java/io/opentelemetry/instrumentation/auto/hystrix/HystrixTracer.java +++ b/instrumentation/hystrix-1.4/src/main/java/io/opentelemetry/instrumentation/auto/hystrix/HystrixTracer.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.hystrix; diff --git a/instrumentation/hystrix-1.4/src/test/groovy/HystrixObservableChainTest.groovy b/instrumentation/hystrix-1.4/src/test/groovy/HystrixObservableChainTest.groovy index 00d18f4b26f6..09c9315ba979 100644 --- a/instrumentation/hystrix-1.4/src/test/groovy/HystrixObservableChainTest.groovy +++ b/instrumentation/hystrix-1.4/src/test/groovy/HystrixObservableChainTest.groovy @@ -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 */ import static com.netflix.hystrix.HystrixCommandGroupKey.Factory.asKey @@ -27,14 +16,19 @@ class HystrixObservableChainTest extends AgentTestRunner { static { // Disable so failure testing below doesn't inadvertently change the behavior. System.setProperty("hystrix.command.default.circuitBreaker.enabled", "false") - ConfigUtils.updateConfig { - System.setProperty("otel.hystrix.tags.enabled", "true") - } // Uncomment for debugging: // System.setProperty("hystrix.command.default.execution.timeout.enabled", "false") } + static final PREVIOUS_CONFIG = ConfigUtils.updateConfig { + it.setProperty("otel.hystrix.tags.enabled", "true") + } + + def cleanupSpec() { + ConfigUtils.setConfig(PREVIOUS_CONFIG) + } + def "test command #action"() { setup: @@ -82,14 +76,14 @@ class HystrixObservableChainTest extends AgentTestRunner { assertTraces(1) { trace(0, 5) { span(0) { - operationName "parent" - parent() + name "parent" + hasNoParent() errored false attributes { } } span(1) { - operationName "ExampleGroup.HystrixObservableChainTest\$1.execute" + name "ExampleGroup.HystrixObservableChainTest\$1.execute" childOf span(0) errored false attributes { @@ -99,14 +93,14 @@ class HystrixObservableChainTest extends AgentTestRunner { } } span(2) { - operationName "tracedMethod" + name "tracedMethod" childOf span(1) errored false attributes { } } span(3) { - operationName "OtherGroup.HystrixObservableChainTest\$2.execute" + name "OtherGroup.HystrixObservableChainTest\$2.execute" childOf span(1) errored false attributes { @@ -116,7 +110,7 @@ class HystrixObservableChainTest extends AgentTestRunner { } } span(4) { - operationName "anotherTracedMethod" + name "anotherTracedMethod" childOf span(3) errored false attributes { diff --git a/instrumentation/hystrix-1.4/src/test/groovy/HystrixObservableTest.groovy b/instrumentation/hystrix-1.4/src/test/groovy/HystrixObservableTest.groovy index 7c5969ac8c28..45da7c6023c9 100644 --- a/instrumentation/hystrix-1.4/src/test/groovy/HystrixObservableTest.groovy +++ b/instrumentation/hystrix-1.4/src/test/groovy/HystrixObservableTest.groovy @@ -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 */ import static com.netflix.hystrix.HystrixCommandGroupKey.Factory.asKey @@ -31,14 +20,19 @@ class HystrixObservableTest extends AgentTestRunner { static { // Disable so failure testing below doesn't inadvertently change the behavior. System.setProperty("hystrix.command.default.circuitBreaker.enabled", "false") - ConfigUtils.updateConfig { - System.setProperty("otel.hystrix.tags.enabled", "true") - } // Uncomment for debugging: // System.setProperty("hystrix.command.default.execution.timeout.enabled", "false") } + static final PREVIOUS_CONFIG = ConfigUtils.updateConfig { + it.setProperty("otel.hystrix.tags.enabled", "true") + } + + def cleanupSpec() { + ConfigUtils.setConfig(PREVIOUS_CONFIG) + } + def "test command #action"() { setup: def observeOnFn = observeOn @@ -74,14 +68,14 @@ class HystrixObservableTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName "parent" - parent() + name "parent" + hasNoParent() errored false attributes { } } span(1) { - operationName "ExampleGroup.HystrixObservableTest\$1.execute" + name "ExampleGroup.HystrixObservableTest\$1.execute" childOf span(0) errored false attributes { @@ -91,7 +85,7 @@ class HystrixObservableTest extends AgentTestRunner { } } span(2) { - operationName "tracedMethod" + name "tracedMethod" childOf span(1) errored false attributes { @@ -169,14 +163,14 @@ class HystrixObservableTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName "parent" - parent() + name "parent" + hasNoParent() errored false attributes { } } span(1) { - operationName "ExampleGroup.HystrixObservableTest\$2.execute" + name "ExampleGroup.HystrixObservableTest\$2.execute" childOf span(0) errored true errorEvent(IllegalArgumentException) @@ -187,7 +181,7 @@ class HystrixObservableTest extends AgentTestRunner { } } span(2) { - operationName "ExampleGroup.HystrixObservableTest\$2.fallback" + name "ExampleGroup.HystrixObservableTest\$2.fallback" childOf span(1) errored false attributes { @@ -267,13 +261,13 @@ class HystrixObservableTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName "parent" - parent() + name "parent" + hasNoParent() errored true errorEvent(HystrixRuntimeException, "HystrixObservableTest\$3 failed and no fallback available.") } span(1) { - operationName "FailingGroup.HystrixObservableTest\$3.execute" + name "FailingGroup.HystrixObservableTest\$3.execute" childOf span(0) errored true errorEvent(IllegalArgumentException) @@ -284,7 +278,7 @@ class HystrixObservableTest extends AgentTestRunner { } } span(2) { - operationName "FailingGroup.HystrixObservableTest\$3.fallback" + name "FailingGroup.HystrixObservableTest\$3.fallback" childOf span(1) errored true errorEvent(UnsupportedOperationException, "No fallback available.") diff --git a/instrumentation/hystrix-1.4/src/test/groovy/HystrixTest.groovy b/instrumentation/hystrix-1.4/src/test/groovy/HystrixTest.groovy index a74029bcc7a9..efd99a462e89 100644 --- a/instrumentation/hystrix-1.4/src/test/groovy/HystrixTest.groovy +++ b/instrumentation/hystrix-1.4/src/test/groovy/HystrixTest.groovy @@ -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 */ import static com.netflix.hystrix.HystrixCommandGroupKey.Factory.asKey @@ -29,14 +18,19 @@ class HystrixTest extends AgentTestRunner { static { // Disable so failure testing below doesn't inadvertently change the behavior. System.setProperty("hystrix.command.default.circuitBreaker.enabled", "false") - ConfigUtils.updateConfig { - System.setProperty("otel.hystrix.tags.enabled", "true") - } // Uncomment for debugging: // System.setProperty("hystrix.command.default.execution.timeout.enabled", "false") } + static final PREVIOUS_CONFIG = ConfigUtils.updateConfig { + it.setProperty("otel.hystrix.tags.enabled", "true") + } + + def cleanupSpec() { + ConfigUtils.setConfig(PREVIOUS_CONFIG) + } + def "test command #action"() { setup: def command = new HystrixCommand(asKey("ExampleGroup")) { @@ -60,14 +54,14 @@ class HystrixTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName "parent" - parent() + name "parent" + hasNoParent() errored false attributes { } } span(1) { - operationName "ExampleGroup.HystrixTest\$1.execute" + name "ExampleGroup.HystrixTest\$1.execute" childOf span(0) errored false attributes { @@ -77,7 +71,7 @@ class HystrixTest extends AgentTestRunner { } } span(2) { - operationName "tracedMethod" + name "tracedMethod" childOf span(1) errored false attributes { @@ -123,14 +117,14 @@ class HystrixTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName "parent" - parent() + name "parent" + hasNoParent() errored false attributes { } } span(1) { - operationName "ExampleGroup.HystrixTest\$2.execute" + name "ExampleGroup.HystrixTest\$2.execute" childOf span(0) errored true errorEvent(IllegalArgumentException) @@ -141,7 +135,7 @@ class HystrixTest extends AgentTestRunner { } } span(2) { - operationName "ExampleGroup.HystrixTest\$2.fallback" + name "ExampleGroup.HystrixTest\$2.fallback" childOf span(1) errored false attributes { diff --git a/instrumentation/instrumentation.gradle b/instrumentation/instrumentation.gradle index 0e158a9616e6..7fde3349e484 100644 --- a/instrumentation/instrumentation.gradle +++ b/instrumentation/instrumentation.gradle @@ -77,8 +77,8 @@ shadowJar { // relocate OpenTelemetry API usage relocate "io.opentelemetry.OpenTelemetry", "io.opentelemetry.javaagent.shaded.io.opentelemetry.OpenTelemetry" relocate "io.opentelemetry.common", "io.opentelemetry.javaagent.shaded.io.opentelemetry.common" + relocate "io.opentelemetry.baggage", "io.opentelemetry.javaagent.shaded.io.opentelemetry.baggage" relocate "io.opentelemetry.context", "io.opentelemetry.javaagent.shaded.io.opentelemetry.context" - relocate "io.opentelemetry.correlationcontext", "io.opentelemetry.javaagent.shaded.io.opentelemetry.correlationcontext" relocate "io.opentelemetry.internal", "io.opentelemetry.javaagent.shaded.io.opentelemetry.internal" relocate "io.opentelemetry.metrics", "io.opentelemetry.javaagent.shaded.io.opentelemetry.metrics" relocate "io.opentelemetry.trace", "io.opentelemetry.javaagent.shaded.io.opentelemetry.trace" @@ -90,3 +90,14 @@ shadowJar { relocate "application.io.opentelemetry", "io.opentelemetry" relocate "application.io.grpc", "io.grpc" } + +tasks.register("listInstrumentations") { + group = "Help" + description = "List all available instrumentation modules" + doFirst { + subprojects + .findAll {it.plugins.hasPlugin("muzzle")} + .collect {it.path} + .each { println it} + } +} \ No newline at end of file diff --git a/instrumentation/java-classloader/jboss-testing/src/test/groovy/JBossClassloadingTest.groovy b/instrumentation/java-classloader/jboss-testing/src/test/groovy/JBossClassloadingTest.groovy index 0900effae44b..d680502485ad 100644 --- a/instrumentation/java-classloader/jboss-testing/src/test/groovy/JBossClassloadingTest.groovy +++ b/instrumentation/java-classloader/jboss-testing/src/test/groovy/JBossClassloadingTest.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestRunner diff --git a/instrumentation/java-classloader/osgi-testing/src/test/groovy/OSGIClassloadingTest.groovy b/instrumentation/java-classloader/osgi-testing/src/test/groovy/OSGIClassloadingTest.groovy index 6326b8e30800..3fc0ee4e8438 100644 --- a/instrumentation/java-classloader/osgi-testing/src/test/groovy/OSGIClassloadingTest.groovy +++ b/instrumentation/java-classloader/osgi-testing/src/test/groovy/OSGIClassloadingTest.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestRunner diff --git a/instrumentation/java-classloader/src/main/java/io/opentelemetry/instrumentation/auto/javaclassloader/ClassLoaderInstrumentation.java b/instrumentation/java-classloader/src/main/java/io/opentelemetry/instrumentation/auto/javaclassloader/ClassLoaderInstrumentation.java index 89a9b3d4b9d1..dfde70f0a5b6 100644 --- a/instrumentation/java-classloader/src/main/java/io/opentelemetry/instrumentation/auto/javaclassloader/ClassLoaderInstrumentation.java +++ b/instrumentation/java-classloader/src/main/java/io/opentelemetry/instrumentation/auto/javaclassloader/ClassLoaderInstrumentation.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.javaclassloader; diff --git a/instrumentation/java-classloader/src/main/java/io/opentelemetry/instrumentation/auto/javaclassloader/ResourceInjectionInstrumentation.java b/instrumentation/java-classloader/src/main/java/io/opentelemetry/instrumentation/auto/javaclassloader/ResourceInjectionInstrumentation.java index 73036b46ba9e..20717ef6f84c 100644 --- a/instrumentation/java-classloader/src/main/java/io/opentelemetry/instrumentation/auto/javaclassloader/ResourceInjectionInstrumentation.java +++ b/instrumentation/java-classloader/src/main/java/io/opentelemetry/instrumentation/auto/javaclassloader/ResourceInjectionInstrumentation.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.javaclassloader; diff --git a/instrumentation/java-classloader/src/test/groovy/ClassLoadingTest.groovy b/instrumentation/java-classloader/src/test/groovy/ClassLoadingTest.groovy index cba7a8d5a496..cd102372459d 100644 --- a/instrumentation/java-classloader/src/test/groovy/ClassLoadingTest.groovy +++ b/instrumentation/java-classloader/src/test/groovy/ClassLoadingTest.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestRunner diff --git a/instrumentation/java-classloader/src/test/groovy/ResourceInjectionTest.groovy b/instrumentation/java-classloader/src/test/groovy/ResourceInjectionTest.groovy index ff9b81888b62..967f132cc893 100644 --- a/instrumentation/java-classloader/src/test/groovy/ResourceInjectionTest.groovy +++ b/instrumentation/java-classloader/src/test/groovy/ResourceInjectionTest.groovy @@ -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 */ import static io.opentelemetry.auto.util.gc.GCUtils.awaitGC diff --git a/instrumentation/java-classloader/tomcat-testing/src/test/groovy/TomcatClassloadingTest.groovy b/instrumentation/java-classloader/tomcat-testing/src/test/groovy/TomcatClassloadingTest.groovy index 9abff2aad478..c95cf2b45f3e 100644 --- a/instrumentation/java-classloader/tomcat-testing/src/test/groovy/TomcatClassloadingTest.groovy +++ b/instrumentation/java-classloader/tomcat-testing/src/test/groovy/TomcatClassloadingTest.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestRunner diff --git a/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/AbstractExecutorInstrumentation.java b/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/AbstractExecutorInstrumentation.java index 7cb18d61ec57..e15a728ffad0 100644 --- a/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/AbstractExecutorInstrumentation.java +++ b/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/AbstractExecutorInstrumentation.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.javaconcurrent; diff --git a/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/CallableInstrumentation.java b/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/CallableInstrumentation.java index bec40a8b5bbf..ad0a6ea603cb 100644 --- a/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/CallableInstrumentation.java +++ b/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/CallableInstrumentation.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.javaconcurrent; diff --git a/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/FutureInstrumentation.java b/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/FutureInstrumentation.java index e1351d60e698..f6234c7fc64b 100644 --- a/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/FutureInstrumentation.java +++ b/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/FutureInstrumentation.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.javaconcurrent; diff --git a/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/JavaExecutorInstrumentation.java b/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/JavaExecutorInstrumentation.java index efb2ad76d4c1..0245ccf302bb 100644 --- a/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/JavaExecutorInstrumentation.java +++ b/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/JavaExecutorInstrumentation.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.javaconcurrent; @@ -61,6 +50,11 @@ public Map, String> transfor transformers.put( named("execute").and(takesArgument(0, Runnable.class)).and(takesArguments(1)), JavaExecutorInstrumentation.class.getName() + "$SetExecuteRunnableStateAdvice"); + // Netty uses addTask as the acutal core of their submission; there are non-standard variations + // like execute(Runnable,boolean) that aren't caught by standard instrumentation + transformers.put( + named("addTask").and(takesArgument(0, Runnable.class)).and(takesArguments(1)), + JavaExecutorInstrumentation.class.getName() + "$SetExecuteRunnableStateAdvice"); transformers.put( named("execute").and(takesArgument(0, ForkJoinTask.class)), JavaExecutorInstrumentation.class.getName() + "$SetJavaForkJoinStateAdvice"); diff --git a/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/JavaForkJoinTaskInstrumentation.java b/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/JavaForkJoinTaskInstrumentation.java index 14888b3ae996..6bff76b426a3 100644 --- a/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/JavaForkJoinTaskInstrumentation.java +++ b/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/JavaForkJoinTaskInstrumentation.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.javaconcurrent; diff --git a/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/NonStandardExecutorInstrumentation.java b/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/NonStandardExecutorInstrumentation.java index 86b9fdc05f35..983a49a286af 100644 --- a/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/NonStandardExecutorInstrumentation.java +++ b/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/NonStandardExecutorInstrumentation.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.javaconcurrent; diff --git a/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/RunnableInstrumentation.java b/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/RunnableInstrumentation.java index 50970c9096b0..1a4735ecce22 100644 --- a/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/RunnableInstrumentation.java +++ b/instrumentation/java-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/javaconcurrent/RunnableInstrumentation.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.javaconcurrent; diff --git a/instrumentation/java-concurrent/src/test/groovy/CompletableFutureTest.groovy b/instrumentation/java-concurrent/src/test/groovy/CompletableFutureTest.groovy index a2a68ebd64d8..2f0febedbf17 100644 --- a/instrumentation/java-concurrent/src/test/groovy/CompletableFutureTest.groovy +++ b/instrumentation/java-concurrent/src/test/groovy/CompletableFutureTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.basicSpan diff --git a/instrumentation/java-concurrent/src/test/groovy/ExecutorInstrumentationTest.groovy b/instrumentation/java-concurrent/src/test/groovy/ExecutorInstrumentationTest.groovy index aaee73b041a9..6d6ae7aca0f6 100644 --- a/instrumentation/java-concurrent/src/test/groovy/ExecutorInstrumentationTest.groovy +++ b/instrumentation/java-concurrent/src/test/groovy/ExecutorInstrumentationTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace @@ -39,11 +28,12 @@ import java.util.concurrent.TimeoutException import spock.lang.Shared class ExecutorInstrumentationTest extends AgentTestRunner { + static final PREVIOUS_CONFIG = ConfigUtils.updateConfigAndResetInstrumentation { + it.setProperty("otel.trace.executors", "ExecutorInstrumentationTest\$CustomThreadPoolExecutor") + } - static { - ConfigUtils.updateConfig { - System.setProperty("otel.trace.executors", "ExecutorInstrumentationTest\$CustomThreadPoolExecutor") - } + def cleanupSpec() { + ConfigUtils.setConfig(PREVIOUS_CONFIG) } @Shared diff --git a/instrumentation/java-concurrent/src/test/groovy/ModuleInjectionTest.groovy b/instrumentation/java-concurrent/src/test/groovy/ModuleInjectionTest.groovy index b8fc5f09d939..eb3b2fb0f111 100644 --- a/instrumentation/java-concurrent/src/test/groovy/ModuleInjectionTest.groovy +++ b/instrumentation/java-concurrent/src/test/groovy/ModuleInjectionTest.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestRunner diff --git a/instrumentation/java-concurrent/src/test/java/JavaAsyncChild.java b/instrumentation/java-concurrent/src/test/java/JavaAsyncChild.java index e1e4b3f8b9e4..e898b656e192 100644 --- a/instrumentation/java-concurrent/src/test/java/JavaAsyncChild.java +++ b/instrumentation/java-concurrent/src/test/java/JavaAsyncChild.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 */ import io.opentelemetry.OpenTelemetry; diff --git a/instrumentation/java-concurrent/src/test/java/LambdaGen.java b/instrumentation/java-concurrent/src/test/java/LambdaGen.java index 65a5af8cd2ac..d715d8a09ebb 100644 --- a/instrumentation/java-concurrent/src/test/java/LambdaGen.java +++ b/instrumentation/java-concurrent/src/test/java/LambdaGen.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 */ import java.util.concurrent.Callable; diff --git a/instrumentation/java-httpclient/src/main/java/io/opentelemetry/instrumentation/auto/httpclient/HttpClientInstrumentation.java b/instrumentation/java-httpclient/src/main/java/io/opentelemetry/instrumentation/auto/httpclient/HttpClientInstrumentation.java index e7298c32a12b..6b849321ffea 100644 --- a/instrumentation/java-httpclient/src/main/java/io/opentelemetry/instrumentation/auto/httpclient/HttpClientInstrumentation.java +++ b/instrumentation/java-httpclient/src/main/java/io/opentelemetry/instrumentation/auto/httpclient/HttpClientInstrumentation.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.httpclient; diff --git a/instrumentation/java-httpclient/src/main/java/io/opentelemetry/instrumentation/auto/httpclient/HttpHeadersInjectAdapter.java b/instrumentation/java-httpclient/src/main/java/io/opentelemetry/instrumentation/auto/httpclient/HttpHeadersInjectAdapter.java index 34ef2ab7eeb7..a997a33e1333 100644 --- a/instrumentation/java-httpclient/src/main/java/io/opentelemetry/instrumentation/auto/httpclient/HttpHeadersInjectAdapter.java +++ b/instrumentation/java-httpclient/src/main/java/io/opentelemetry/instrumentation/auto/httpclient/HttpHeadersInjectAdapter.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.httpclient; diff --git a/instrumentation/java-httpclient/src/main/java/io/opentelemetry/instrumentation/auto/httpclient/HttpHeadersInstrumentation.java b/instrumentation/java-httpclient/src/main/java/io/opentelemetry/instrumentation/auto/httpclient/HttpHeadersInstrumentation.java index 750203b51b17..28e1b7c818a7 100644 --- a/instrumentation/java-httpclient/src/main/java/io/opentelemetry/instrumentation/auto/httpclient/HttpHeadersInstrumentation.java +++ b/instrumentation/java-httpclient/src/main/java/io/opentelemetry/instrumentation/auto/httpclient/HttpHeadersInstrumentation.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.httpclient; diff --git a/instrumentation/java-httpclient/src/main/java/io/opentelemetry/instrumentation/auto/httpclient/JdkHttpClientTracer.java b/instrumentation/java-httpclient/src/main/java/io/opentelemetry/instrumentation/auto/httpclient/JdkHttpClientTracer.java index e3d95c126584..8dec7efd925f 100644 --- a/instrumentation/java-httpclient/src/main/java/io/opentelemetry/instrumentation/auto/httpclient/JdkHttpClientTracer.java +++ b/instrumentation/java-httpclient/src/main/java/io/opentelemetry/instrumentation/auto/httpclient/JdkHttpClientTracer.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.httpclient; diff --git a/instrumentation/java-httpclient/src/main/java/io/opentelemetry/instrumentation/auto/httpclient/ResponseConsumer.java b/instrumentation/java-httpclient/src/main/java/io/opentelemetry/instrumentation/auto/httpclient/ResponseConsumer.java index d700e3759e92..f26584c46cf5 100644 --- a/instrumentation/java-httpclient/src/main/java/io/opentelemetry/instrumentation/auto/httpclient/ResponseConsumer.java +++ b/instrumentation/java-httpclient/src/main/java/io/opentelemetry/instrumentation/auto/httpclient/ResponseConsumer.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.httpclient; diff --git a/instrumentation/java-httpclient/src/test/groovy/JdkHttpClientAsyncTest.groovy b/instrumentation/java-httpclient/src/test/groovy/JdkHttpClientAsyncTest.groovy index 2cd8f04acfac..fd560d2b445a 100644 --- a/instrumentation/java-httpclient/src/test/groovy/JdkHttpClientAsyncTest.groovy +++ b/instrumentation/java-httpclient/src/test/groovy/JdkHttpClientAsyncTest.groovy @@ -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 */ import java.net.http.HttpRequest diff --git a/instrumentation/java-httpclient/src/test/groovy/JdkHttpClientSyncTest.groovy b/instrumentation/java-httpclient/src/test/groovy/JdkHttpClientSyncTest.groovy index 606bfd46af60..7ea91a918fe0 100644 --- a/instrumentation/java-httpclient/src/test/groovy/JdkHttpClientSyncTest.groovy +++ b/instrumentation/java-httpclient/src/test/groovy/JdkHttpClientSyncTest.groovy @@ -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 */ import java.net.http.HttpRequest diff --git a/instrumentation/java-httpclient/src/test/groovy/JdkHttpClientTest.groovy b/instrumentation/java-httpclient/src/test/groovy/JdkHttpClientTest.groovy index 3f639ebd99d6..a9003869bddc 100644 --- a/instrumentation/java-httpclient/src/test/groovy/JdkHttpClientTest.groovy +++ b/instrumentation/java-httpclient/src/test/groovy/JdkHttpClientTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -75,9 +64,9 @@ abstract class JdkHttpClientTest extends HttpClientTest { assertTraces(1) { trace(0, 1 + extraClientSpans()) { span(0) { - parent() - operationName expectedOperationName(method) - spanKind CLIENT + hasNoParent() + name expectedOperationName(method) + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" diff --git a/instrumentation/jaxrs-client/jaxrs-client-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v1_1/InjectAdapter.java b/instrumentation/jaxrs-client/jaxrs-client-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v1_1/InjectAdapter.java index 3d52d87bcd12..77aaab246919 100644 --- a/instrumentation/jaxrs-client/jaxrs-client-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v1_1/InjectAdapter.java +++ b/instrumentation/jaxrs-client/jaxrs-client-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v1_1/InjectAdapter.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.jaxrsclient.v1_1; diff --git a/instrumentation/jaxrs-client/jaxrs-client-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v1_1/JaxRsClientV1Instrumentation.java b/instrumentation/jaxrs-client/jaxrs-client-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v1_1/JaxRsClientV1Instrumentation.java index 10606d6d1eca..0f318d746cd0 100644 --- a/instrumentation/jaxrs-client/jaxrs-client-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v1_1/JaxRsClientV1Instrumentation.java +++ b/instrumentation/jaxrs-client/jaxrs-client-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v1_1/JaxRsClientV1Instrumentation.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.jaxrsclient.v1_1; diff --git a/instrumentation/jaxrs-client/jaxrs-client-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v1_1/JaxRsClientV1Tracer.java b/instrumentation/jaxrs-client/jaxrs-client-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v1_1/JaxRsClientV1Tracer.java index e6182cc0d89f..b6199e16420f 100644 --- a/instrumentation/jaxrs-client/jaxrs-client-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v1_1/JaxRsClientV1Tracer.java +++ b/instrumentation/jaxrs-client/jaxrs-client-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v1_1/JaxRsClientV1Tracer.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.jaxrsclient.v1_1; diff --git a/instrumentation/jaxrs-client/jaxrs-client-1.1/src/test/groovy/JaxRsClientV1Test.groovy b/instrumentation/jaxrs-client/jaxrs-client-1.1/src/test/groovy/JaxRsClientV1Test.groovy index 81673ff81af5..182f8900324f 100644 --- a/instrumentation/jaxrs-client/jaxrs-client-1.1/src/test/groovy/JaxRsClientV1Test.groovy +++ b/instrumentation/jaxrs-client/jaxrs-client-1.1/src/test/groovy/JaxRsClientV1Test.groovy @@ -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 */ import com.sun.jersey.api.client.Client diff --git a/instrumentation/jaxrs-client/jaxrs-client-2.0/jaxrs-client-2.0-jersey-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/JerseyClientConnectionErrorInstrumentation.java b/instrumentation/jaxrs-client/jaxrs-client-2.0/jaxrs-client-2.0-jersey-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/JerseyClientConnectionErrorInstrumentation.java index bb3ec0be339e..384acd3de424 100644 --- a/instrumentation/jaxrs-client/jaxrs-client-2.0/jaxrs-client-2.0-jersey-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/JerseyClientConnectionErrorInstrumentation.java +++ b/instrumentation/jaxrs-client/jaxrs-client-2.0/jaxrs-client-2.0-jersey-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/JerseyClientConnectionErrorInstrumentation.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.jaxrsclient.v2_0; diff --git a/instrumentation/jaxrs-client/jaxrs-client-2.0/jaxrs-client-2.0-resteasy-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/ResteasyClientConnectionErrorInstrumentation.java b/instrumentation/jaxrs-client/jaxrs-client-2.0/jaxrs-client-2.0-resteasy-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/ResteasyClientConnectionErrorInstrumentation.java index 4cf9141e878f..189bf7ea41af 100644 --- a/instrumentation/jaxrs-client/jaxrs-client-2.0/jaxrs-client-2.0-resteasy-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/ResteasyClientConnectionErrorInstrumentation.java +++ b/instrumentation/jaxrs-client/jaxrs-client-2.0/jaxrs-client-2.0-resteasy-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/ResteasyClientConnectionErrorInstrumentation.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.jaxrsclient.v2_0; diff --git a/instrumentation/jaxrs-client/jaxrs-client-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/ClientTracingFeature.java b/instrumentation/jaxrs-client/jaxrs-client-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/ClientTracingFeature.java index d30682aa8d23..d05076b2cb29 100644 --- a/instrumentation/jaxrs-client/jaxrs-client-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/ClientTracingFeature.java +++ b/instrumentation/jaxrs-client/jaxrs-client-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/ClientTracingFeature.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.jaxrsclient.v2_0; diff --git a/instrumentation/jaxrs-client/jaxrs-client-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/ClientTracingFilter.java b/instrumentation/jaxrs-client/jaxrs-client-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/ClientTracingFilter.java index 798e675391c0..9aadd5e76a81 100644 --- a/instrumentation/jaxrs-client/jaxrs-client-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/ClientTracingFilter.java +++ b/instrumentation/jaxrs-client/jaxrs-client-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/ClientTracingFilter.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.jaxrsclient.v2_0; diff --git a/instrumentation/jaxrs-client/jaxrs-client-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/InjectAdapter.java b/instrumentation/jaxrs-client/jaxrs-client-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/InjectAdapter.java index 4111eec2069d..4c7a35bc9b7a 100644 --- a/instrumentation/jaxrs-client/jaxrs-client-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/InjectAdapter.java +++ b/instrumentation/jaxrs-client/jaxrs-client-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/InjectAdapter.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.jaxrsclient.v2_0; diff --git a/instrumentation/jaxrs-client/jaxrs-client-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/JaxRsClientInstrumentation.java b/instrumentation/jaxrs-client/jaxrs-client-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/JaxRsClientInstrumentation.java index 66f954398ff2..c053a58767f8 100644 --- a/instrumentation/jaxrs-client/jaxrs-client-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/JaxRsClientInstrumentation.java +++ b/instrumentation/jaxrs-client/jaxrs-client-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/JaxRsClientInstrumentation.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.jaxrsclient.v2_0; diff --git a/instrumentation/jaxrs-client/jaxrs-client-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/JaxRsClientTracer.java b/instrumentation/jaxrs-client/jaxrs-client-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/JaxRsClientTracer.java index b2f546469362..7be016bce153 100644 --- a/instrumentation/jaxrs-client/jaxrs-client-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/JaxRsClientTracer.java +++ b/instrumentation/jaxrs-client/jaxrs-client-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrsclient/v2_0/JaxRsClientTracer.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.jaxrsclient.v2_0; diff --git a/instrumentation/jaxrs-client/jaxrs-client-2.0/src/test/groovy/JaxMultithreadedClientTest.groovy b/instrumentation/jaxrs-client/jaxrs-client-2.0/src/test/groovy/JaxMultithreadedClientTest.groovy index e4d9ef61629a..5e85a893675b 100644 --- a/instrumentation/jaxrs-client/jaxrs-client-2.0/src/test/groovy/JaxMultithreadedClientTest.groovy +++ b/instrumentation/jaxrs-client/jaxrs-client-2.0/src/test/groovy/JaxMultithreadedClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.server.http.TestHttpServer.httpServer diff --git a/instrumentation/jaxrs-client/jaxrs-client-2.0/src/test/groovy/JaxRsClientAsyncTest.groovy b/instrumentation/jaxrs-client/jaxrs-client-2.0/src/test/groovy/JaxRsClientAsyncTest.groovy index 0f844d1b6b4e..0e7666297cc8 100644 --- a/instrumentation/jaxrs-client/jaxrs-client-2.0/src/test/groovy/JaxRsClientAsyncTest.groovy +++ b/instrumentation/jaxrs-client/jaxrs-client-2.0/src/test/groovy/JaxRsClientAsyncTest.groovy @@ -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 */ import io.opentelemetry.auto.test.base.HttpClientTest diff --git a/instrumentation/jaxrs-client/jaxrs-client-2.0/src/test/groovy/JaxRsClientTest.groovy b/instrumentation/jaxrs-client/jaxrs-client-2.0/src/test/groovy/JaxRsClientTest.groovy index a23320f289bd..59c5151c7c09 100644 --- a/instrumentation/jaxrs-client/jaxrs-client-2.0/src/test/groovy/JaxRsClientTest.groovy +++ b/instrumentation/jaxrs-client/jaxrs-client-2.0/src/test/groovy/JaxRsClientTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -67,9 +56,9 @@ abstract class JaxRsClientTest extends HttpClientTest { assertTraces(1) { trace(0, 2) { span(0) { - parent() - operationName expectedOperationName(method) - spanKind CLIENT + hasNoParent() + name expectedOperationName(method) + kind CLIENT errored true attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" diff --git a/instrumentation/jaxrs-client/jaxrs-client-2.0/src/test/groovy/ResteasyProxyClientTest.groovy b/instrumentation/jaxrs-client/jaxrs-client-2.0/src/test/groovy/ResteasyProxyClientTest.groovy index 2d90293a35ad..bb48da702507 100644 --- a/instrumentation/jaxrs-client/jaxrs-client-2.0/src/test/groovy/ResteasyProxyClientTest.groovy +++ b/instrumentation/jaxrs-client/jaxrs-client-2.0/src/test/groovy/ResteasyProxyClientTest.groovy @@ -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 */ import io.opentelemetry.auto.test.base.HttpClientTest diff --git a/instrumentation/jaxrs/jaxrs-1.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v1_0/JaxRsAnnotationsInstrumentation.java b/instrumentation/jaxrs/jaxrs-1.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v1_0/JaxRsAnnotationsInstrumentation.java index 5f2afe0b5cd7..c2437ee635c2 100644 --- a/instrumentation/jaxrs/jaxrs-1.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v1_0/JaxRsAnnotationsInstrumentation.java +++ b/instrumentation/jaxrs/jaxrs-1.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v1_0/JaxRsAnnotationsInstrumentation.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.jaxrs.v1_0; diff --git a/instrumentation/jaxrs/jaxrs-1.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v1_0/JaxRsAnnotationsTracer.java b/instrumentation/jaxrs/jaxrs-1.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v1_0/JaxRsAnnotationsTracer.java index 005049f0bd74..fbb45ac2fc5c 100644 --- a/instrumentation/jaxrs/jaxrs-1.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v1_0/JaxRsAnnotationsTracer.java +++ b/instrumentation/jaxrs/jaxrs-1.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v1_0/JaxRsAnnotationsTracer.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.jaxrs.v1_0; diff --git a/instrumentation/jaxrs/jaxrs-1.0/src/test/groovy/JavaInterfaces.java b/instrumentation/jaxrs/jaxrs-1.0/src/test/groovy/JavaInterfaces.java index 15888b787806..891d2b5f5d07 100644 --- a/instrumentation/jaxrs/jaxrs-1.0/src/test/groovy/JavaInterfaces.java +++ b/instrumentation/jaxrs/jaxrs-1.0/src/test/groovy/JavaInterfaces.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 */ import javax.ws.rs.GET; diff --git a/instrumentation/jaxrs/jaxrs-1.0/src/test/groovy/JaxRsAnnotations1InstrumentationTest.groovy b/instrumentation/jaxrs/jaxrs-1.0/src/test/groovy/JaxRsAnnotations1InstrumentationTest.groovy index 4660a0bf5894..d04cab93597a 100644 --- a/instrumentation/jaxrs/jaxrs-1.0/src/test/groovy/JaxRsAnnotations1InstrumentationTest.groovy +++ b/instrumentation/jaxrs/jaxrs-1.0/src/test/groovy/JaxRsAnnotations1InstrumentationTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderServerTrace @@ -43,7 +32,7 @@ class JaxRsAnnotations1InstrumentationTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "POST /a" + name "POST /a" attributes { } } @@ -62,13 +51,13 @@ class JaxRsAnnotations1InstrumentationTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName name - parent() + name paramName + hasNoParent() attributes { } } span(1) { - operationName "${className}.call" + name "${className}.call" childOf span(0) attributes { } @@ -89,7 +78,7 @@ class JaxRsAnnotations1InstrumentationTest extends AgentTestRunner { spanNames.get(obj.class).size() == 1 where: - name | obj + paramName | obj "/a" | new Jax() { @Path("/a") void call() { @@ -156,7 +145,7 @@ class JaxRsAnnotations1InstrumentationTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "test" + name "test" attributes { } } diff --git a/instrumentation/jaxrs/jaxrs-1.0/src/test/groovy/JerseyTest.groovy b/instrumentation/jaxrs/jaxrs-1.0/src/test/groovy/JerseyTest.groovy index 270e899ccb6c..c4dbfe9e9612 100644 --- a/instrumentation/jaxrs/jaxrs-1.0/src/test/groovy/JerseyTest.groovy +++ b/instrumentation/jaxrs/jaxrs-1.0/src/test/groovy/JerseyTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderServerTrace @@ -45,14 +34,14 @@ class JerseyTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName expectedSpanName + name expectedSpanName attributes { } } span(1) { childOf span(0) - operationName controllerName + name controllerName attributes { } } @@ -80,14 +69,14 @@ class JerseyTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName expectedSpanName + name expectedSpanName attributes { } } span(1) { childOf span(0) - operationName controller1Name - spanKind INTERNAL + name controller1Name + kind INTERNAL attributes { } } diff --git a/instrumentation/jaxrs/jaxrs-1.0/src/test/java/Resource.java b/instrumentation/jaxrs/jaxrs-1.0/src/test/java/Resource.java index 06049230ce4f..d962f172ca63 100644 --- a/instrumentation/jaxrs/jaxrs-1.0/src/test/java/Resource.java +++ b/instrumentation/jaxrs/jaxrs-1.0/src/test/java/Resource.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 */ import javax.ws.rs.POST; diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/AbstractRequestContextInstrumentation.java b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/AbstractRequestContextInstrumentation.java index 534419f24bc8..6e486c95b94b 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/AbstractRequestContextInstrumentation.java +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/AbstractRequestContextInstrumentation.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.jaxrs.v2_0; diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/CompletionStageFinishCallback.java b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/CompletionStageFinishCallback.java index 091da1151a30..e78372c6bc9a 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/CompletionStageFinishCallback.java +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/CompletionStageFinishCallback.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.jaxrs.v2_0; diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/ContainerRequestFilterInstrumentation.java b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/ContainerRequestFilterInstrumentation.java index 1adfa737fa43..4819033b28bf 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/ContainerRequestFilterInstrumentation.java +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/ContainerRequestFilterInstrumentation.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.jaxrs.v2_0; diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/DefaultRequestContextInstrumentation.java b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/DefaultRequestContextInstrumentation.java index 051d545abb4e..72dbe4292e45 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/DefaultRequestContextInstrumentation.java +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/DefaultRequestContextInstrumentation.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.jaxrs.v2_0; diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/JaxRsAnnotationsInstrumentation.java b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/JaxRsAnnotationsInstrumentation.java index b25e86255b59..124a11a48ccf 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/JaxRsAnnotationsInstrumentation.java +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/JaxRsAnnotationsInstrumentation.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.jaxrs.v2_0; diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/JaxRsAnnotationsTracer.java b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/JaxRsAnnotationsTracer.java index 16d0bc7686dc..6d09559ea1ba 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/JaxRsAnnotationsTracer.java +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/JaxRsAnnotationsTracer.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.jaxrs.v2_0; diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/JaxRsAsyncResponseInstrumentation.java b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/JaxRsAsyncResponseInstrumentation.java index 27681fbb7e4f..d8ba68ce0580 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/JaxRsAsyncResponseInstrumentation.java +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/JaxRsAsyncResponseInstrumentation.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.jaxrs.v2_0; diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-jersey-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/JerseyRequestContextInstrumentation.java b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-jersey-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/JerseyRequestContextInstrumentation.java index 4f7c17081fc5..c1207375ae0c 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-jersey-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/JerseyRequestContextInstrumentation.java +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-jersey-2.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/JerseyRequestContextInstrumentation.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.jaxrs.v2_0; diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-jersey-2.0/src/test/groovy/JerseyAnnotationInstrumentationTest.groovy b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-jersey-2.0/src/test/groovy/JerseyAnnotationInstrumentationTest.groovy index a43f8601d7bd..a171d38b7adf 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-jersey-2.0/src/test/groovy/JerseyAnnotationInstrumentationTest.groovy +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-jersey-2.0/src/test/groovy/JerseyAnnotationInstrumentationTest.groovy @@ -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 */ class JerseyAnnotationInstrumentationTest extends JaxRsAnnotationsInstrumentationTest { diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-jersey-2.0/src/test/groovy/JerseyFilterTest.groovy b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-jersey-2.0/src/test/groovy/JerseyFilterTest.groovy index b2045de633a7..11da7ff1991a 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-jersey-2.0/src/test/groovy/JerseyFilterTest.groovy +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-jersey-2.0/src/test/groovy/JerseyFilterTest.groovy @@ -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 */ import static Resource.Test1 diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-jersey-2.0/src/test/groovy/JerseyHttpServerTest.groovy b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-jersey-2.0/src/test/groovy/JerseyHttpServerTest.groovy index 3d6080abf066..79898e8cca06 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-jersey-2.0/src/test/groovy/JerseyHttpServerTest.groovy +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-jersey-2.0/src/test/groovy/JerseyHttpServerTest.groovy @@ -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 */ import io.dropwizard.jetty.NonblockingServletHolder diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/Resteasy30RequestContextInstrumentation.java b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/Resteasy30RequestContextInstrumentation.java index 75c2478d88f6..92392ccb0400 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/Resteasy30RequestContextInstrumentation.java +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.0/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/Resteasy30RequestContextInstrumentation.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.jaxrs.v2_0; diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.0/src/test/groovy/ResteasyAnnotationInstrumentationTest.groovy b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.0/src/test/groovy/ResteasyAnnotationInstrumentationTest.groovy index c6eed10edce6..f86d3473d457 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.0/src/test/groovy/ResteasyAnnotationInstrumentationTest.groovy +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.0/src/test/groovy/ResteasyAnnotationInstrumentationTest.groovy @@ -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 */ class ResteasyAnnotationInstrumentationTest extends JaxRsAnnotationsInstrumentationTest { diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.0/src/test/groovy/ResteasyFilterTest.groovy b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.0/src/test/groovy/ResteasyFilterTest.groovy index 740917653224..9b00879b2938 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.0/src/test/groovy/ResteasyFilterTest.groovy +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.0/src/test/groovy/ResteasyFilterTest.groovy @@ -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 */ import static Resource.Test1 diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.0/src/test/groovy/ResteasyHttpServerTest.groovy b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.0/src/test/groovy/ResteasyHttpServerTest.groovy index b445811af41a..164a4b4eec94 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.0/src/test/groovy/ResteasyHttpServerTest.groovy +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.0/src/test/groovy/ResteasyHttpServerTest.groovy @@ -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 */ import io.undertow.Undertow diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.1/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/Resteasy31RequestContextInstrumentation.java b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.1/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/Resteasy31RequestContextInstrumentation.java index deb2e816bb49..cf35e051f0f0 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.1/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/Resteasy31RequestContextInstrumentation.java +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.1/src/main/java/io/opentelemetry/instrumentation/auto/jaxrs/v2_0/Resteasy31RequestContextInstrumentation.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.jaxrs.v2_0; diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.1/src/test/groovy/ResteasyAnnotationInstrumentationTest.groovy b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.1/src/test/groovy/ResteasyAnnotationInstrumentationTest.groovy index c6eed10edce6..f86d3473d457 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.1/src/test/groovy/ResteasyAnnotationInstrumentationTest.groovy +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.1/src/test/groovy/ResteasyAnnotationInstrumentationTest.groovy @@ -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 */ class ResteasyAnnotationInstrumentationTest extends JaxRsAnnotationsInstrumentationTest { diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.1/src/test/groovy/ResteasyFilterTest.groovy b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.1/src/test/groovy/ResteasyFilterTest.groovy index 740917653224..9b00879b2938 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.1/src/test/groovy/ResteasyFilterTest.groovy +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.1/src/test/groovy/ResteasyFilterTest.groovy @@ -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 */ import static Resource.Test1 diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.1/src/test/groovy/ResteasyHttpServerTest.groovy b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.1/src/test/groovy/ResteasyHttpServerTest.groovy index b445811af41a..164a4b4eec94 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.1/src/test/groovy/ResteasyHttpServerTest.groovy +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-resteasy-3.1/src/test/groovy/ResteasyHttpServerTest.groovy @@ -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 */ import io.undertow.Undertow diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/groovy/JaxRsAnnotationsInstrumentationTest.groovy b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/groovy/JaxRsAnnotationsInstrumentationTest.groovy index bc283b2b41e3..568c43b8d563 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/groovy/JaxRsAnnotationsInstrumentationTest.groovy +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/groovy/JaxRsAnnotationsInstrumentationTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderServerTrace @@ -43,7 +32,7 @@ abstract class JaxRsAnnotationsInstrumentationTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "POST /a" + name "POST /a" attributes { } } @@ -62,13 +51,13 @@ abstract class JaxRsAnnotationsInstrumentationTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName name - parent() + name paramName + hasNoParent() attributes { } } span(1) { - operationName "${className}.call" + name "${className}.call" childOf span(0) attributes { } @@ -89,7 +78,7 @@ abstract class JaxRsAnnotationsInstrumentationTest extends AgentTestRunner { spanNames.get(obj.class).size() == 1 where: - name | obj + paramName | obj "/a" | new Jax() { @Path("/a") void call() { @@ -156,7 +145,7 @@ abstract class JaxRsAnnotationsInstrumentationTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "test" + name "test" attributes { } } diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/groovy/JaxRsFilterTest.groovy b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/groovy/JaxRsFilterTest.groovy index 5703d389571d..1a6b5a6b13ca 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/groovy/JaxRsFilterTest.groovy +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/groovy/JaxRsFilterTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderServerTrace @@ -62,13 +51,13 @@ abstract class JaxRsFilterTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName parentSpanName != null ? parentSpanName : "test.span" + name parentSpanName != null ? parentSpanName : "test.span" attributes { } } span(1) { childOf span(0) - operationName controllerName + name controllerName attributes { } } @@ -111,14 +100,14 @@ abstract class JaxRsFilterTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName parentResourceName + name parentResourceName attributes { } } span(1) { childOf span(0) - operationName controller1Name - spanKind INTERNAL + name controller1Name + kind INTERNAL attributes { } } diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/groovy/JaxRsHttpServerTest.groovy b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/groovy/JaxRsHttpServerTest.groovy index 03481cbfacf1..e05122d4046a 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/groovy/JaxRsHttpServerTest.groovy +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/groovy/JaxRsHttpServerTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.EXCEPTION @@ -172,14 +161,14 @@ abstract class JaxRsHttpServerTest extends HttpServerTest { int statusCode, String query) { trace.span(index) { - operationName method + " /" + path - spanKind SERVER + name method + " /" + path + kind SERVER errored isError if (parentID != null) { traceId traceID - parentId parentID + parentSpanId parentID } else { - parent() + hasNoParent() } attributes { "${SemanticAttributes.NET_PEER_IP.key()}" { it == null || it == "127.0.0.1" } // Optional @@ -215,8 +204,8 @@ abstract class JaxRsHttpServerTest extends HttpServerTest { boolean isError, String exceptionMessage = null) { trace.span(index) { - operationName "JaxRsTestResource.${methodName}" - spanKind INTERNAL + name "JaxRsTestResource.${methodName}" + kind INTERNAL errored isError if (isError) { errorEvent(Exception, exceptionMessage) diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/groovy/JaxRsTestResource.groovy b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/groovy/JaxRsTestResource.groovy index a832fbcc6420..579a17db235d 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/groovy/JaxRsTestResource.groovy +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/groovy/JaxRsTestResource.groovy @@ -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 */ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.ERROR diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/java/JavaInterfaces.java b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/java/JavaInterfaces.java index 15888b787806..891d2b5f5d07 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/java/JavaInterfaces.java +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/java/JavaInterfaces.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 */ import javax.ws.rs.GET; diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/java/Resource.java b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/java/Resource.java index 06049230ce4f..d962f172ca63 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/java/Resource.java +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/java/Resource.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 */ import javax.ws.rs.POST; diff --git a/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/ConnectionInstrumentation.java b/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/ConnectionInstrumentation.java index 10a39799bd5a..1e9260f1787a 100644 --- a/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/ConnectionInstrumentation.java +++ b/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/ConnectionInstrumentation.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.jdbc; diff --git a/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/DataSourceInstrumentation.java b/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/DataSourceInstrumentation.java index f63203a83707..412ecaa4bc08 100644 --- a/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/DataSourceInstrumentation.java +++ b/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/DataSourceInstrumentation.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.jdbc; diff --git a/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/DataSourceTracer.java b/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/DataSourceTracer.java index c094d76c84ee..a47fecf5c5f8 100644 --- a/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/DataSourceTracer.java +++ b/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/DataSourceTracer.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.jdbc; diff --git a/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/DriverInstrumentation.java b/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/DriverInstrumentation.java index 86c48aad2163..17fe308ab41c 100644 --- a/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/DriverInstrumentation.java +++ b/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/DriverInstrumentation.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.jdbc; diff --git a/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/JDBCMaps.java b/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/JDBCMaps.java index 052e49d50034..ddeb3bb87a54 100644 --- a/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/JDBCMaps.java +++ b/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/JDBCMaps.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.jdbc; diff --git a/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/JDBCUtils.java b/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/JDBCUtils.java index 4ef92c5ab987..a7713b8efb9f 100644 --- a/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/JDBCUtils.java +++ b/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/JDBCUtils.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.jdbc; diff --git a/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/JdbcTracer.java b/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/JdbcTracer.java index f335e43aaee0..165b858d7170 100644 --- a/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/JdbcTracer.java +++ b/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/JdbcTracer.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.jdbc; diff --git a/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/PreparedStatementInstrumentation.java b/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/PreparedStatementInstrumentation.java index a762beb1833b..45ed85b24823 100644 --- a/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/PreparedStatementInstrumentation.java +++ b/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/PreparedStatementInstrumentation.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.jdbc; diff --git a/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/StatementInstrumentation.java b/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/StatementInstrumentation.java index f4db678cb84b..b6c11f73b6c4 100644 --- a/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/StatementInstrumentation.java +++ b/instrumentation/jdbc/src/main/java/io/opentelemetry/instrumentation/auto/jdbc/StatementInstrumentation.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.jdbc; diff --git a/instrumentation/jdbc/src/test/groovy/JDBCConnectionUrlParserTest.groovy b/instrumentation/jdbc/src/test/groovy/JDBCConnectionUrlParserTest.groovy index 09294d88730d..c15fb133c98c 100644 --- a/instrumentation/jdbc/src/test/groovy/JDBCConnectionUrlParserTest.groovy +++ b/instrumentation/jdbc/src/test/groovy/JDBCConnectionUrlParserTest.groovy @@ -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 */ import static io.opentelemetry.instrumentation.auto.api.jdbc.JDBCConnectionUrlParser.parse diff --git a/instrumentation/jdbc/src/test/groovy/JDBCInstrumentationTest.groovy b/instrumentation/jdbc/src/test/groovy/JDBCInstrumentationTest.groovy index d34a0a7e02c0..da7bffbcb06d 100644 --- a/instrumentation/jdbc/src/test/groovy/JDBCInstrumentationTest.groovy +++ b/instrumentation/jdbc/src/test/groovy/JDBCInstrumentationTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.basicSpan @@ -41,19 +30,14 @@ import spock.lang.Unroll import test.TestConnection class JDBCInstrumentationTest extends AgentTestRunner { - static { - ConfigUtils.updateConfig { - System.setProperty("otel.integration.jdbc-datasource.enabled", "true") - } + static final PREVIOUS_CONFIG = ConfigUtils.updateConfigAndResetInstrumentation { + it.setProperty("otel.integration.jdbc-datasource.enabled", "true") } def specCleanup() { - ConfigUtils.updateConfig { - System.clearProperty("otel.integration.jdbc-datasource.enabled") - } + ConfigUtils.setConfig(PREVIOUS_CONFIG) } - @Shared def dbName = "jdbcUnitTest" @@ -197,8 +181,8 @@ class JDBCInstrumentationTest extends AgentTestRunner { trace(0, 2) { basicSpan(it, 0, "parent") span(1) { - operationName JDBCUtils.normalizeSql(query) - spanKind CLIENT + name JDBCUtils.normalizeSql(query) + kind CLIENT childOf span(0) errored false attributes { @@ -253,8 +237,8 @@ class JDBCInstrumentationTest extends AgentTestRunner { trace(0, 2) { basicSpan(it, 0, "parent") span(1) { - operationName JDBCUtils.normalizeSql(query) - spanKind CLIENT + name JDBCUtils.normalizeSql(query) + kind CLIENT childOf span(0) errored false attributes { @@ -301,8 +285,8 @@ class JDBCInstrumentationTest extends AgentTestRunner { trace(0, 2) { basicSpan(it, 0, "parent") span(1) { - operationName JDBCUtils.normalizeSql(query) - spanKind CLIENT + name JDBCUtils.normalizeSql(query) + kind CLIENT childOf span(0) errored false attributes { @@ -350,8 +334,8 @@ class JDBCInstrumentationTest extends AgentTestRunner { trace(0, 2) { basicSpan(it, 0, "parent") span(1) { - operationName JDBCUtils.normalizeSql(query) - spanKind CLIENT + name JDBCUtils.normalizeSql(query) + kind CLIENT childOf span(0) errored false attributes { @@ -399,8 +383,8 @@ class JDBCInstrumentationTest extends AgentTestRunner { trace(0, 2) { basicSpan(it, 0, "parent") span(1) { - operationName JDBCUtils.normalizeSql(query) - spanKind CLIENT + name JDBCUtils.normalizeSql(query) + kind CLIENT childOf span(0) errored false attributes { @@ -451,8 +435,8 @@ class JDBCInstrumentationTest extends AgentTestRunner { trace(0, 2) { basicSpan(it, 0, "parent") span(1) { - operationName JDBCUtils.normalizeSql(query) - spanKind CLIENT + name JDBCUtils.normalizeSql(query) + kind CLIENT childOf span(0) errored false attributes { @@ -515,8 +499,8 @@ class JDBCInstrumentationTest extends AgentTestRunner { trace(0, 2) { basicSpan(it, 0, "parent") span(1) { - operationName JDBCUtils.normalizeSql(query) - spanKind CLIENT + name JDBCUtils.normalizeSql(query) + kind CLIENT childOf span(0) errored false attributes { @@ -575,14 +559,14 @@ class JDBCInstrumentationTest extends AgentTestRunner { basicSpan(it, 0, "parent") span(1) { - operationName "${datasource.class.simpleName}.getConnection" + name "${datasource.class.simpleName}.getConnection" childOf span(0) attributes { } } if (recursive) { span(2) { - operationName "${datasource.class.simpleName}.getConnection" + name "${datasource.class.simpleName}.getConnection" childOf span(1) attributes { } @@ -622,8 +606,8 @@ class JDBCInstrumentationTest extends AgentTestRunner { trace(0, 2) { basicSpan(it, 0, "parent") span(1) { - operationName JDBCUtils.normalizeSql(query) - spanKind CLIENT + name JDBCUtils.normalizeSql(query) + kind CLIENT childOf span(0) errored false attributes { @@ -683,8 +667,8 @@ class JDBCInstrumentationTest extends AgentTestRunner { assertTraces(5) { trace(0, 1) { span(0) { - operationName JDBCUtils.normalizeSql(query) - spanKind CLIENT + name JDBCUtils.normalizeSql(query) + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "hsqldb" @@ -699,8 +683,8 @@ class JDBCInstrumentationTest extends AgentTestRunner { for (int i = 1; i < numQueries; ++i) { trace(i, 1) { span(0) { - operationName JDBCUtils.normalizeSql(query) - spanKind CLIENT + name JDBCUtils.normalizeSql(query) + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "hsqldb" diff --git a/instrumentation/jdbc/src/test/groovy/SqlNormalizerTest.groovy b/instrumentation/jdbc/src/test/groovy/SqlNormalizerTest.groovy index 741eb0b64440..3560d3e9a0bb 100644 --- a/instrumentation/jdbc/src/test/groovy/SqlNormalizerTest.groovy +++ b/instrumentation/jdbc/src/test/groovy/SqlNormalizerTest.groovy @@ -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 */ import io.opentelemetry.instrumentation.auto.jdbc.JDBCUtils diff --git a/instrumentation/jdbc/src/test/groovy/test/TestConnection.groovy b/instrumentation/jdbc/src/test/groovy/test/TestConnection.groovy index 2279db0617f7..edfe44c7465a 100644 --- a/instrumentation/jdbc/src/test/groovy/test/TestConnection.groovy +++ b/instrumentation/jdbc/src/test/groovy/test/TestConnection.groovy @@ -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 test diff --git a/instrumentation/jdbc/src/test/groovy/test/TestDatabaseMetaData.groovy b/instrumentation/jdbc/src/test/groovy/test/TestDatabaseMetaData.groovy index f75b52ac1a1a..757b43a2dff5 100644 --- a/instrumentation/jdbc/src/test/groovy/test/TestDatabaseMetaData.groovy +++ b/instrumentation/jdbc/src/test/groovy/test/TestDatabaseMetaData.groovy @@ -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 test diff --git a/instrumentation/jdbc/src/test/groovy/test/TestDriver.groovy b/instrumentation/jdbc/src/test/groovy/test/TestDriver.groovy index c608b16ffc48..60b2368bac57 100644 --- a/instrumentation/jdbc/src/test/groovy/test/TestDriver.groovy +++ b/instrumentation/jdbc/src/test/groovy/test/TestDriver.groovy @@ -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 test diff --git a/instrumentation/jdbc/src/test/groovy/test/TestStatement.groovy b/instrumentation/jdbc/src/test/groovy/test/TestStatement.groovy index 348a113bdac1..3a2605c353e7 100644 --- a/instrumentation/jdbc/src/test/groovy/test/TestStatement.groovy +++ b/instrumentation/jdbc/src/test/groovy/test/TestStatement.groovy @@ -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 test diff --git a/instrumentation/jedis/jedis-1.4/src/main/java/io/opentelemetry/instrumentation/auto/jedis/v1_4/JedisClientTracer.java b/instrumentation/jedis/jedis-1.4/src/main/java/io/opentelemetry/instrumentation/auto/jedis/v1_4/JedisClientTracer.java index c67e518915cf..2a117b5f1f45 100644 --- a/instrumentation/jedis/jedis-1.4/src/main/java/io/opentelemetry/instrumentation/auto/jedis/v1_4/JedisClientTracer.java +++ b/instrumentation/jedis/jedis-1.4/src/main/java/io/opentelemetry/instrumentation/auto/jedis/v1_4/JedisClientTracer.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.jedis.v1_4; diff --git a/instrumentation/jedis/jedis-1.4/src/main/java/io/opentelemetry/instrumentation/auto/jedis/v1_4/JedisInstrumentation.java b/instrumentation/jedis/jedis-1.4/src/main/java/io/opentelemetry/instrumentation/auto/jedis/v1_4/JedisInstrumentation.java index befdb9883859..57c70b75e34c 100644 --- a/instrumentation/jedis/jedis-1.4/src/main/java/io/opentelemetry/instrumentation/auto/jedis/v1_4/JedisInstrumentation.java +++ b/instrumentation/jedis/jedis-1.4/src/main/java/io/opentelemetry/instrumentation/auto/jedis/v1_4/JedisInstrumentation.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.jedis.v1_4; diff --git a/instrumentation/jedis/jedis-1.4/src/test/groovy/JedisClientTest.groovy b/instrumentation/jedis/jedis-1.4/src/test/groovy/JedisClientTest.groovy index 62ec9c43f128..ab4b313dda41 100644 --- a/instrumentation/jedis/jedis-1.4/src/test/groovy/JedisClientTest.groovy +++ b/instrumentation/jedis/jedis-1.4/src/test/groovy/JedisClientTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -61,8 +50,8 @@ class JedisClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.DB_CONNECTION_STRING.key()}" "localhost:$port" @@ -87,8 +76,8 @@ class JedisClientTest extends AgentTestRunner { assertTraces(2) { trace(0, 1) { span(0) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.DB_CONNECTION_STRING.key()}" "localhost:$port" @@ -101,8 +90,8 @@ class JedisClientTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.DB_CONNECTION_STRING.key()}" "localhost:$port" @@ -127,8 +116,8 @@ class JedisClientTest extends AgentTestRunner { assertTraces(2) { trace(0, 1) { span(0) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.DB_CONNECTION_STRING.key()}" "localhost:$port" @@ -141,8 +130,8 @@ class JedisClientTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "RANDOMKEY" - spanKind CLIENT + name "RANDOMKEY" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.DB_CONNECTION_STRING.key()}" "localhost:$port" diff --git a/instrumentation/jedis/jedis-3.0/src/main/java/io/opentelemetry/instrumentation/auto/jedis/v3_0/JedisClientTracer.java b/instrumentation/jedis/jedis-3.0/src/main/java/io/opentelemetry/instrumentation/auto/jedis/v3_0/JedisClientTracer.java index 376772fd0e6d..b67b6ff25cf7 100644 --- a/instrumentation/jedis/jedis-3.0/src/main/java/io/opentelemetry/instrumentation/auto/jedis/v3_0/JedisClientTracer.java +++ b/instrumentation/jedis/jedis-3.0/src/main/java/io/opentelemetry/instrumentation/auto/jedis/v3_0/JedisClientTracer.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.jedis.v3_0; diff --git a/instrumentation/jedis/jedis-3.0/src/main/java/io/opentelemetry/instrumentation/auto/jedis/v3_0/JedisInstrumentation.java b/instrumentation/jedis/jedis-3.0/src/main/java/io/opentelemetry/instrumentation/auto/jedis/v3_0/JedisInstrumentation.java index 5f09c647d812..f46c13572860 100644 --- a/instrumentation/jedis/jedis-3.0/src/main/java/io/opentelemetry/instrumentation/auto/jedis/v3_0/JedisInstrumentation.java +++ b/instrumentation/jedis/jedis-3.0/src/main/java/io/opentelemetry/instrumentation/auto/jedis/v3_0/JedisInstrumentation.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.jedis.v3_0; diff --git a/instrumentation/jedis/jedis-3.0/src/test/groovy/Jedis30ClientTest.groovy b/instrumentation/jedis/jedis-3.0/src/test/groovy/Jedis30ClientTest.groovy index a1d013f55d64..69b11a7f801b 100644 --- a/instrumentation/jedis/jedis-3.0/src/test/groovy/Jedis30ClientTest.groovy +++ b/instrumentation/jedis/jedis-3.0/src/test/groovy/Jedis30ClientTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -61,8 +50,8 @@ class Jedis30ClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.DB_CONNECTION_STRING.key()}" "localhost:$port" @@ -87,8 +76,8 @@ class Jedis30ClientTest extends AgentTestRunner { assertTraces(2) { trace(0, 1) { span(0) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.DB_CONNECTION_STRING.key()}" "localhost:$port" @@ -101,8 +90,8 @@ class Jedis30ClientTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.DB_CONNECTION_STRING.key()}" "localhost:$port" @@ -127,8 +116,8 @@ class Jedis30ClientTest extends AgentTestRunner { assertTraces(2) { trace(0, 1) { span(0) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.DB_CONNECTION_STRING.key()}" "localhost:$port" @@ -141,8 +130,8 @@ class Jedis30ClientTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "RANDOMKEY" - spanKind CLIENT + name "RANDOMKEY" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.DB_CONNECTION_STRING.key()}" "localhost:$port" diff --git a/instrumentation/jetty-8.0/src/main/java/io/opentelemetry/instrumentation/auto/jetty/JettyHandlerAdvice.java b/instrumentation/jetty-8.0/src/main/java/io/opentelemetry/instrumentation/auto/jetty/JettyHandlerAdvice.java index 489464309c12..f55c9d673d32 100644 --- a/instrumentation/jetty-8.0/src/main/java/io/opentelemetry/instrumentation/auto/jetty/JettyHandlerAdvice.java +++ b/instrumentation/jetty-8.0/src/main/java/io/opentelemetry/instrumentation/auto/jetty/JettyHandlerAdvice.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.jetty; diff --git a/instrumentation/jetty-8.0/src/main/java/io/opentelemetry/instrumentation/auto/jetty/JettyHandlerInstrumentation.java b/instrumentation/jetty-8.0/src/main/java/io/opentelemetry/instrumentation/auto/jetty/JettyHandlerInstrumentation.java index fe117a60ab1d..6454e52e14c2 100644 --- a/instrumentation/jetty-8.0/src/main/java/io/opentelemetry/instrumentation/auto/jetty/JettyHandlerInstrumentation.java +++ b/instrumentation/jetty-8.0/src/main/java/io/opentelemetry/instrumentation/auto/jetty/JettyHandlerInstrumentation.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.jetty; diff --git a/instrumentation/jetty-8.0/src/main/java/io/opentelemetry/instrumentation/auto/jetty/JettyHttpServerTracer.java b/instrumentation/jetty-8.0/src/main/java/io/opentelemetry/instrumentation/auto/jetty/JettyHttpServerTracer.java index 88fe0c461dc1..e4ff166b55fe 100644 --- a/instrumentation/jetty-8.0/src/main/java/io/opentelemetry/instrumentation/auto/jetty/JettyHttpServerTracer.java +++ b/instrumentation/jetty-8.0/src/main/java/io/opentelemetry/instrumentation/auto/jetty/JettyHttpServerTracer.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.jetty; diff --git a/instrumentation/jetty-8.0/src/test/groovy/JettyContinuationHandlerTest.groovy b/instrumentation/jetty-8.0/src/test/groovy/JettyContinuationHandlerTest.groovy index 9efd8e71bc11..eb2e13a8d6c3 100644 --- a/instrumentation/jetty-8.0/src/test/groovy/JettyContinuationHandlerTest.groovy +++ b/instrumentation/jetty-8.0/src/test/groovy/JettyContinuationHandlerTest.groovy @@ -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 */ import java.util.concurrent.ExecutorService diff --git a/instrumentation/jetty-8.0/src/test/groovy/JettyHandlerTest.groovy b/instrumentation/jetty-8.0/src/test/groovy/JettyHandlerTest.groovy index 534252422d0c..91ad5b76f57c 100644 --- a/instrumentation/jetty-8.0/src/test/groovy/JettyHandlerTest.groovy +++ b/instrumentation/jetty-8.0/src/test/groovy/JettyHandlerTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.ERROR @@ -123,17 +112,17 @@ class JettyHandlerTest extends HttpServerTest { @Override void serverSpan(TraceAssert trace, int index, String traceID = null, String parentID = null, String method = "GET", Long responseContentLength = null, ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName "TestHandler.handle" - spanKind SERVER + name "TestHandler.handle" + kind SERVER errored endpoint.errored if (endpoint == EXCEPTION) { errorEvent(Exception, EXCEPTION.body) } if (parentID != null) { traceId traceID - parentId parentID + parentSpanId parentID } else { - parent() + hasNoParent() } attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" diff --git a/instrumentation/jms-1.1/jms-1.1.gradle b/instrumentation/jms-1.1/jms-1.1.gradle index 9aa949b90b15..f4b0be83e23e 100644 --- a/instrumentation/jms-1.1/jms-1.1.gradle +++ b/instrumentation/jms-1.1/jms-1.1.gradle @@ -31,14 +31,12 @@ test.dependsOn jms2Test dependencies { compileOnly group: 'javax.jms', name: 'jms-api', version: '1.1-rev-1' - testImplementation group: 'org.apache.activemq.tooling', name: 'activemq-junit', version: '5.14.5' - testImplementation group: 'org.apache.activemq', name: 'activemq-pool', version: '5.14.5' - testImplementation group: 'org.apache.activemq', name: 'activemq-broker', version: '5.14.5' - // required for Java 11+ . Latest version that runs on Java 7 testImplementation group: 'javax.annotation', name: 'javax.annotation-api', version: '1.2' - // 4.x required for Java 7 - testImplementation group: 'org.springframework', name: 'spring-jms', version: '4.3.21.RELEASE' + testImplementation("org.springframework.boot:spring-boot-starter-activemq:${versions.springboot}") + testImplementation(group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: versions.springboot) { + exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' + } jms2TestImplementation group: 'org.hornetq', name: 'hornetq-jms-client', version: '2.4.7.Final' jms2TestImplementation group: 'org.hornetq', name: 'hornetq-jms-server', version: '2.4.7.Final' diff --git a/instrumentation/jms-1.1/src/jms2Test/groovy/JMS2Test.groovy b/instrumentation/jms-1.1/src/jms2Test/groovy/JMS2Test.groovy index 1612acc4df70..61920fa55037 100644 --- a/instrumentation/jms-1.1/src/jms2Test/groovy/JMS2Test.groovy +++ b/instrumentation/jms-1.1/src/jms2Test/groovy/JMS2Test.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CONSUMER @@ -40,21 +29,12 @@ import org.hornetq.core.config.CoreQueueConfiguration import org.hornetq.core.config.impl.ConfigurationImpl import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory -import org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory import org.hornetq.core.server.HornetQServer import org.hornetq.core.server.HornetQServers import org.hornetq.jms.client.HornetQTextMessage import spock.lang.Shared class JMS2Test extends AgentTestRunner { - - static { - ConfigUtils.updateConfig { - System.setProperty("otel.trace.classes.exclude", "org.springframework.jms.config.JmsListenerEndpointRegistry\$AggregatingCallback,org.springframework.context.support.DefaultLifecycleProcessor\$1") - } - } - - @Shared HornetQServer server @Shared @@ -76,8 +56,7 @@ class JMS2Test extends AgentTestRunner { config.securityEnabled = false config.persistenceEnabled = false config.setQueueConfigurations([new CoreQueueConfiguration("someQueue", "someQueue", null, true)]) - config.setAcceptorConfigurations([new TransportConfiguration(NettyAcceptorFactory.name), - new TransportConfiguration(InVMAcceptorFactory.name)].toSet()) + config.setAcceptorConfigurations([new TransportConfiguration(InVMAcceptorFactory.name)].toSet()) server = HornetQServers.newHornetQServer(config) server.start() @@ -102,12 +81,9 @@ class JMS2Test extends AgentTestRunner { def cleanupSpec() { server.stop() - ConfigUtils.updateConfig { - System.clearProperty("otel.trace.classes.exclude") - } } - def "sending a message to #destinationName generates spans"() { + def "sending a message to #destinationName #destinationType generates spans"() { setup: def producer = session.createProducer(destination) def consumer = session.createConsumer(destination) @@ -138,7 +114,7 @@ class JMS2Test extends AgentTestRunner { session.createTemporaryTopic() | "topic" | JMSTracer.TEMP_DESTINATION_NAME } - def "sending to a MessageListener on #destinationName generates a span"() { + def "sending to a MessageListener on #destinationName #destinationType generates a span"() { setup: def lock = new CountDownLatch(1) def messageRef = new AtomicReference() @@ -177,7 +153,7 @@ class JMS2Test extends AgentTestRunner { session.createTemporaryTopic() | "topic" | JMSTracer.TEMP_DESTINATION_NAME } - def "failing to receive message with receiveNoWait on #destinationName works"() { + def "failing to receive message with receiveNoWait on #destinationName #destinationType works"() { setup: def consumer = session.createConsumer(destination) @@ -189,9 +165,9 @@ class JMS2Test extends AgentTestRunner { assertTraces(1) { trace(0, 1) { // Consumer trace span(0) { - parent() - operationName destinationName + " receive" - spanKind CONSUMER + hasNoParent() + name destinationName + " receive" + kind CONSUMER errored false attributes { "${SemanticAttributes.MESSAGING_SYSTEM.key}" "jms" @@ -212,7 +188,7 @@ class JMS2Test extends AgentTestRunner { session.createTopic("someTopic") | "topic" | "someTopic" } - def "failing to receive message with wait(timeout) on #destinationName works"() { + def "failing to receive message with wait(timeout) on #destinationName #destinationType works"() { setup: def consumer = session.createConsumer(destination) @@ -224,9 +200,9 @@ class JMS2Test extends AgentTestRunner { assertTraces(1) { trace(0, 1) { // Consumer trace span(0) { - parent() - operationName destinationName + " receive" - spanKind CONSUMER + hasNoParent() + name destinationName + " receive" + kind CONSUMER errored false attributes { "${SemanticAttributes.MESSAGING_SYSTEM.key}" "jms" @@ -250,10 +226,10 @@ class JMS2Test extends AgentTestRunner { static producerSpan(TraceAssert trace, int index, String destinationType, String destinationName) { trace.span(index) { - operationName destinationName + " send" - spanKind PRODUCER + name destinationName + " send" + kind PRODUCER errored false - parent() + hasNoParent() attributes { "${SemanticAttributes.MESSAGING_SYSTEM.key}" "jms" "${SemanticAttributes.MESSAGING_DESTINATION.key}" destinationName @@ -270,12 +246,12 @@ class JMS2Test extends AgentTestRunner { // any other value for messageId will verify that message.id is captured and has that same value static consumerSpan(TraceAssert trace, int index, String destinationType, String destinationName, String messageId, Object parentOrLinkedSpan, Operation operation) { trace.span(index) { - operationName destinationName + " " + operation.name() - spanKind CONSUMER + name destinationName + " " + operation.name() + kind CONSUMER if (parentOrLinkedSpan != null) { childOf((SpanData) parentOrLinkedSpan) } else { - parent() + hasNoParent() } errored false attributes { diff --git a/instrumentation/jms-1.1/src/jms2Test/groovy/SpringListenerJMS2Test.groovy b/instrumentation/jms-1.1/src/jms2Test/groovy/SpringListenerJMS2Test.groovy index c1fbe688cd85..fd748feba05b 100644 --- a/instrumentation/jms-1.1/src/jms2Test/groovy/SpringListenerJMS2Test.groovy +++ b/instrumentation/jms-1.1/src/jms2Test/groovy/SpringListenerJMS2Test.groovy @@ -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 */ import static JMS2Test.consumerSpan @@ -26,19 +15,6 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext import org.springframework.jms.core.JmsTemplate class SpringListenerJMS2Test extends AgentTestRunner { - - static { - ConfigUtils.updateConfig { - System.setProperty("otel.trace.classes.exclude", "org.springframework.jms.config.JmsListenerEndpointRegistry\$AggregatingCallback,org.springframework.context.support.DefaultLifecycleProcessor\$1") - } - } - - def cleanupSpec() { - ConfigUtils.updateConfig { - System.clearProperty("otel.trace.classes.exclude") - } - } - def "receiving message in spring listener generates spans"() { setup: def context = new AnnotationConfigApplicationContext(Config) diff --git a/instrumentation/jms-1.1/src/jms2Test/groovy/SpringTemplateJMS2Test.groovy b/instrumentation/jms-1.1/src/jms2Test/groovy/SpringTemplateJMS2Test.groovy index ead0e0af30fc..26ff446cd171 100644 --- a/instrumentation/jms-1.1/src/jms2Test/groovy/SpringTemplateJMS2Test.groovy +++ b/instrumentation/jms-1.1/src/jms2Test/groovy/SpringTemplateJMS2Test.groovy @@ -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 */ import static JMS2Test.consumerSpan @@ -34,20 +23,12 @@ import org.hornetq.core.config.CoreQueueConfiguration import org.hornetq.core.config.impl.ConfigurationImpl import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory -import org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory import org.hornetq.core.server.HornetQServer import org.hornetq.core.server.HornetQServers import org.springframework.jms.core.JmsTemplate import spock.lang.Shared class SpringTemplateJMS2Test extends AgentTestRunner { - - static { - ConfigUtils.updateConfig { - System.setProperty("otel.trace.classes.exclude", "org.springframework.jms.config.JmsListenerEndpointRegistry\$AggregatingCallback,org.springframework.context.support.DefaultLifecycleProcessor\$1") - } - } - @Shared HornetQServer server @Shared @@ -69,8 +50,7 @@ class SpringTemplateJMS2Test extends AgentTestRunner { config.securityEnabled = false config.persistenceEnabled = false config.setQueueConfigurations([new CoreQueueConfiguration("someQueue", "someQueue", null, true)]) - config.setAcceptorConfigurations([new TransportConfiguration(NettyAcceptorFactory.name), - new TransportConfiguration(InVMAcceptorFactory.name)].toSet()) + config.setAcceptorConfigurations([new TransportConfiguration(InVMAcceptorFactory.name)].toSet()) server = HornetQServers.newHornetQServer(config) server.start() @@ -97,9 +77,6 @@ class SpringTemplateJMS2Test extends AgentTestRunner { def cleanupSpec() { server.stop() - ConfigUtils.updateConfig { - System.clearProperty("otel.trace.classes.exclude") - } } def "sending a message to #destinationName generates spans"() { diff --git a/instrumentation/jms-1.1/src/jms2Test/groovy/listener/Config.groovy b/instrumentation/jms-1.1/src/jms2Test/groovy/listener/Config.groovy index d3103285f73a..eabe780b601d 100644 --- a/instrumentation/jms-1.1/src/jms2Test/groovy/listener/Config.groovy +++ b/instrumentation/jms-1.1/src/jms2Test/groovy/listener/Config.groovy @@ -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 listener @@ -27,7 +16,6 @@ import org.hornetq.core.config.CoreQueueConfiguration import org.hornetq.core.config.impl.ConfigurationImpl import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory -import org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory import org.hornetq.core.server.HornetQServer import org.hornetq.core.server.HornetQServers import org.springframework.context.annotation.Bean @@ -57,8 +45,7 @@ class Config { config.securityEnabled = false config.persistenceEnabled = false config.setQueueConfigurations([new CoreQueueConfiguration("someQueue", "someQueue", null, true)]) - config.setAcceptorConfigurations([new TransportConfiguration(NettyAcceptorFactory.name), - new TransportConfiguration(InVMAcceptorFactory.name)].toSet()) + config.setAcceptorConfigurations([new TransportConfiguration(InVMAcceptorFactory.name)].toSet()) server = HornetQServers.newHornetQServer(config) server.start() diff --git a/instrumentation/jms-1.1/src/jms2Test/groovy/listener/TestListener.groovy b/instrumentation/jms-1.1/src/jms2Test/groovy/listener/TestListener.groovy index f75dbcc2ef20..878ffc3e3a7e 100644 --- a/instrumentation/jms-1.1/src/jms2Test/groovy/listener/TestListener.groovy +++ b/instrumentation/jms-1.1/src/jms2Test/groovy/listener/TestListener.groovy @@ -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 listener diff --git a/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/JMSMessageConsumerInstrumentation.java b/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/JMSMessageConsumerInstrumentation.java index 0b02d46890e7..dda09ddb32a3 100644 --- a/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/JMSMessageConsumerInstrumentation.java +++ b/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/JMSMessageConsumerInstrumentation.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.jms; diff --git a/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/JMSMessageListenerInstrumentation.java b/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/JMSMessageListenerInstrumentation.java index 8bf39446f693..87c6f7ddcb96 100644 --- a/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/JMSMessageListenerInstrumentation.java +++ b/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/JMSMessageListenerInstrumentation.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.jms; diff --git a/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/JMSMessageProducerInstrumentation.java b/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/JMSMessageProducerInstrumentation.java index 97c9a87838ac..675e45c56c6b 100644 --- a/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/JMSMessageProducerInstrumentation.java +++ b/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/JMSMessageProducerInstrumentation.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.jms; diff --git a/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/JMSSessionInstrumentation.java b/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/JMSSessionInstrumentation.java index 64eb459621a4..3131a9128eac 100644 --- a/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/JMSSessionInstrumentation.java +++ b/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/JMSSessionInstrumentation.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.jms; diff --git a/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/JMSTracer.java b/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/JMSTracer.java index b7e95199df2c..629194a382b1 100644 --- a/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/JMSTracer.java +++ b/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/JMSTracer.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.jms; diff --git a/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/MessageDestination.java b/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/MessageDestination.java index 1ed75b1d10fa..df915f2a5e61 100644 --- a/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/MessageDestination.java +++ b/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/MessageDestination.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.jms; diff --git a/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/MessageExtractAdapter.java b/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/MessageExtractAdapter.java index 7a7f84d13dbe..8c43e8d9362a 100644 --- a/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/MessageExtractAdapter.java +++ b/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/MessageExtractAdapter.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.jms; diff --git a/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/MessageInjectAdapter.java b/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/MessageInjectAdapter.java index d06c7250854c..7d055c088f9f 100644 --- a/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/MessageInjectAdapter.java +++ b/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/MessageInjectAdapter.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.jms; diff --git a/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/Operation.java b/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/Operation.java index 6d5dd9b9b0f2..54d99bbfaa2d 100644 --- a/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/Operation.java +++ b/instrumentation/jms-1.1/src/main/java/io/opentelemetry/instrumentation/auto/jms/Operation.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.jms; diff --git a/instrumentation/jms-1.1/src/test/groovy/JMS1Test.groovy b/instrumentation/jms-1.1/src/test/groovy/JMS1Test.groovy index 0f0690ff79ad..3de4d55311eb 100644 --- a/instrumentation/jms-1.1/src/test/groovy/JMS1Test.groovy +++ b/instrumentation/jms-1.1/src/test/groovy/JMS1Test.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CONSUMER @@ -32,12 +21,22 @@ import javax.jms.Session import javax.jms.TextMessage import org.apache.activemq.ActiveMQConnectionFactory import org.apache.activemq.command.ActiveMQTextMessage -import org.apache.activemq.junit.EmbeddedActiveMQBroker +import org.slf4j.Logger +import org.slf4j.LoggerFactory +import org.testcontainers.containers.GenericContainer +import org.testcontainers.containers.output.Slf4jLogConsumer +import spock.lang.Requires import spock.lang.Shared +@Requires({"true" != System.getenv("CIRCLECI")}) class JMS1Test extends AgentTestRunner { - @Shared - EmbeddedActiveMQBroker broker = new EmbeddedActiveMQBroker() + + private static final Logger logger = LoggerFactory.getLogger(JMS1Test) + + private static final GenericContainer broker = new GenericContainer("rmohr/activemq") + .withExposedPorts(61616, 8161) + .withLogConsumer(new Slf4jLogConsumer(logger)) + @Shared String messageText = "a message" @Shared @@ -47,7 +46,7 @@ class JMS1Test extends AgentTestRunner { def setupSpec() { broker.start() - ActiveMQConnectionFactory connectionFactory = broker.createConnectionFactory() + ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:" + broker.getMappedPort(61616)) Connection connection = connectionFactory.createConnection() connection.start() @@ -58,7 +57,7 @@ class JMS1Test extends AgentTestRunner { broker.stop() } - def "sending a message to #expectedSpanName generates spans"() { + def "sending a message to #destinationName #destinationType generates spans"() { setup: def producer = session.createProducer(destination) def consumer = session.createConsumer(destination) @@ -89,7 +88,7 @@ class JMS1Test extends AgentTestRunner { session.createTemporaryTopic() | "topic" | JMSTracer.TEMP_DESTINATION_NAME } - def "sending to a MessageListener on #expectedSpanName generates a span"() { + def "sending to a MessageListener on #destinationName #destinationType generates a span"() { setup: def lock = new CountDownLatch(1) def messageRef = new AtomicReference() @@ -128,7 +127,7 @@ class JMS1Test extends AgentTestRunner { session.createTemporaryTopic() | "topic" | JMSTracer.TEMP_DESTINATION_NAME } - def "failing to receive message with receiveNoWait on #expectedSpanName works"() { + def "failing to receive message with receiveNoWait on #destinationName #destinationType works"() { setup: def consumer = session.createConsumer(destination) @@ -140,9 +139,9 @@ class JMS1Test extends AgentTestRunner { assertTraces(1) { trace(0, 1) { // Consumer trace span(0) { - parent() - operationName destinationName + " receive" - spanKind CONSUMER + hasNoParent() + name destinationName + " receive" + kind CONSUMER errored false attributes { "${SemanticAttributes.MESSAGING_SYSTEM.key}" "jms" @@ -163,7 +162,7 @@ class JMS1Test extends AgentTestRunner { session.createTopic("someTopic") | "topic" | "someTopic" } - def "failing to receive message with wait(timeout) on #expectedSpanName works"() { + def "failing to receive message with wait(timeout) on #destinationName #destinationType works"() { setup: def consumer = session.createConsumer(destination) @@ -175,9 +174,9 @@ class JMS1Test extends AgentTestRunner { assertTraces(1) { trace(0, 1) { // Consumer trace span(0) { - parent() - operationName destinationName + " receive" - spanKind CONSUMER + hasNoParent() + name destinationName + " receive" + kind CONSUMER errored false attributes { "${SemanticAttributes.MESSAGING_SYSTEM.key}" "jms" @@ -198,7 +197,7 @@ class JMS1Test extends AgentTestRunner { session.createTopic("someTopic") | "topic" | "someTopic" } - def "sending a read-only message to #expectedSpanName fails"() { + def "sending a read-only message to #destinationName #destinationType fails"() { setup: def producer = session.createProducer(destination) def consumer = session.createConsumer(destination) @@ -225,9 +224,9 @@ class JMS1Test extends AgentTestRunner { } trace(1, 1) { span(0) { - parent() - operationName destinationName + " receive" - spanKind CONSUMER + hasNoParent() + name destinationName + " receive" + kind CONSUMER errored false attributes { "${SemanticAttributes.MESSAGING_SYSTEM.key}" "jms" @@ -257,10 +256,10 @@ class JMS1Test extends AgentTestRunner { static producerSpan(TraceAssert trace, int index, String destinationType, String destinationName) { trace.span(index) { - operationName destinationName + " send" - spanKind PRODUCER + name destinationName + " send" + kind PRODUCER errored false - parent() + hasNoParent() attributes { "${SemanticAttributes.MESSAGING_SYSTEM.key}" "jms" "${SemanticAttributes.MESSAGING_DESTINATION.key}" destinationName @@ -277,12 +276,12 @@ class JMS1Test extends AgentTestRunner { // any other value for messageId will verify that message.id is captured and has that same value static consumerSpan(TraceAssert trace, int index, String destinationType, String destinationName, String messageId, Object parentOrLinkedSpan, Operation operation) { trace.span(index) { - operationName destinationName + " " + operation.name() - spanKind CONSUMER + name destinationName + " " + operation.name() + kind CONSUMER if (parentOrLinkedSpan != null) { childOf((SpanData) parentOrLinkedSpan) } else { - parent() + hasNoParent() } errored false attributes { diff --git a/instrumentation/jms-1.1/src/test/groovy/SpringListenerJMS1Test.groovy b/instrumentation/jms-1.1/src/test/groovy/SpringListenerJMS1Test.groovy index 7eb7fc31d3b6..6c6b5d07f0b8 100644 --- a/instrumentation/jms-1.1/src/test/groovy/SpringListenerJMS1Test.groovy +++ b/instrumentation/jms-1.1/src/test/groovy/SpringListenerJMS1Test.groovy @@ -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 */ import static JMS1Test.consumerSpan @@ -21,10 +10,11 @@ import io.opentelemetry.auto.test.AgentTestRunner import io.opentelemetry.instrumentation.auto.jms.Operation import javax.jms.ConnectionFactory import listener.Config -import org.apache.activemq.junit.EmbeddedActiveMQBroker import org.springframework.context.annotation.AnnotationConfigApplicationContext import org.springframework.jms.core.JmsTemplate +import spock.lang.Requires +@Requires({ "true" != System.getenv("CIRCLECI") }) class SpringListenerJMS1Test extends AgentTestRunner { def "receiving message in spring listener generates spans"() { @@ -47,6 +37,6 @@ class SpringListenerJMS1Test extends AgentTestRunner { } cleanup: - context.getBean(EmbeddedActiveMQBroker).stop() + context.stop() } } diff --git a/instrumentation/jms-1.1/src/test/groovy/SpringTemplateJMS1Test.groovy b/instrumentation/jms-1.1/src/test/groovy/SpringTemplateJMS1Test.groovy index 6bdedf375629..d37e9ca29908 100644 --- a/instrumentation/jms-1.1/src/test/groovy/SpringTemplateJMS1Test.groovy +++ b/instrumentation/jms-1.1/src/test/groovy/SpringTemplateJMS1Test.groovy @@ -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 */ import static JMS1Test.consumerSpan @@ -27,13 +16,22 @@ import javax.jms.Connection import javax.jms.Session import javax.jms.TextMessage import org.apache.activemq.ActiveMQConnectionFactory -import org.apache.activemq.junit.EmbeddedActiveMQBroker +import org.slf4j.Logger +import org.slf4j.LoggerFactory import org.springframework.jms.core.JmsTemplate +import org.testcontainers.containers.GenericContainer +import org.testcontainers.containers.output.Slf4jLogConsumer +import spock.lang.Requires import spock.lang.Shared +@Requires({"true" != System.getenv("CIRCLECI")}) class SpringTemplateJMS1Test extends AgentTestRunner { - @Shared - EmbeddedActiveMQBroker broker = new EmbeddedActiveMQBroker() + private static final Logger logger = LoggerFactory.getLogger(SpringTemplateJMS1Test) + + private static final GenericContainer broker = new GenericContainer("rmohr/activemq") + .withExposedPorts(61616, 8161) + .withLogConsumer(new Slf4jLogConsumer(logger)) + @Shared String messageText = "a message" @Shared @@ -43,7 +41,7 @@ class SpringTemplateJMS1Test extends AgentTestRunner { def setupSpec() { broker.start() - ActiveMQConnectionFactory connectionFactory = broker.createConnectionFactory() + ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:" + broker.getMappedPort(61616)) Connection connection = connectionFactory.createConnection() connection.start() session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE) diff --git a/instrumentation/jms-1.1/src/test/groovy/listener/Config.groovy b/instrumentation/jms-1.1/src/test/groovy/listener/Config.groovy index 7338a83ad6e2..7c092c5fbf44 100644 --- a/instrumentation/jms-1.1/src/test/groovy/listener/Config.groovy +++ b/instrumentation/jms-1.1/src/test/groovy/listener/Config.groovy @@ -1,46 +1,36 @@ /* * 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 listener import javax.annotation.PreDestroy import javax.jms.ConnectionFactory -import org.apache.activemq.junit.EmbeddedActiveMQBroker +import org.apache.activemq.ActiveMQConnectionFactory import org.springframework.context.annotation.Bean import org.springframework.context.annotation.ComponentScan import org.springframework.context.annotation.Configuration import org.springframework.jms.annotation.EnableJms import org.springframework.jms.config.DefaultJmsListenerContainerFactory import org.springframework.jms.config.JmsListenerContainerFactory +import org.testcontainers.containers.GenericContainer @Configuration @ComponentScan @EnableJms class Config { - @Bean - EmbeddedActiveMQBroker broker() { - def broker = new EmbeddedActiveMQBroker() + private static GenericContainer broker = new GenericContainer("rmohr/activemq") + .withExposedPorts(61616, 8161) + + static { broker.start() - return broker } @Bean - ConnectionFactory connectionFactory(EmbeddedActiveMQBroker broker) { - return broker.createConnectionFactory() + ConnectionFactory connectionFactory() { + return new ActiveMQConnectionFactory("tcp://localhost:" + broker.getMappedPort(61616)) } @Bean @@ -52,6 +42,6 @@ class Config { @PreDestroy void destroy() { - broker().stop() + broker.stop() } } diff --git a/instrumentation/jms-1.1/src/test/groovy/listener/TestListener.groovy b/instrumentation/jms-1.1/src/test/groovy/listener/TestListener.groovy index 7acde2bcadd0..3969cd964f80 100644 --- a/instrumentation/jms-1.1/src/test/groovy/listener/TestListener.groovy +++ b/instrumentation/jms-1.1/src/test/groovy/listener/TestListener.groovy @@ -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 listener diff --git a/instrumentation/jsp-2.3/src/main/java/io/opentelemetry/instrumentation/auto/jsp/JSPInstrumentation.java b/instrumentation/jsp-2.3/src/main/java/io/opentelemetry/instrumentation/auto/jsp/JSPInstrumentation.java index b37f897385fc..e9107e7ee2ee 100644 --- a/instrumentation/jsp-2.3/src/main/java/io/opentelemetry/instrumentation/auto/jsp/JSPInstrumentation.java +++ b/instrumentation/jsp-2.3/src/main/java/io/opentelemetry/instrumentation/auto/jsp/JSPInstrumentation.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.jsp; diff --git a/instrumentation/jsp-2.3/src/main/java/io/opentelemetry/instrumentation/auto/jsp/JSPTracer.java b/instrumentation/jsp-2.3/src/main/java/io/opentelemetry/instrumentation/auto/jsp/JSPTracer.java index 45df62078477..c8a6fa62a89d 100644 --- a/instrumentation/jsp-2.3/src/main/java/io/opentelemetry/instrumentation/auto/jsp/JSPTracer.java +++ b/instrumentation/jsp-2.3/src/main/java/io/opentelemetry/instrumentation/auto/jsp/JSPTracer.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.jsp; diff --git a/instrumentation/jsp-2.3/src/main/java/io/opentelemetry/instrumentation/auto/jsp/JasperJSPCompilationContextInstrumentation.java b/instrumentation/jsp-2.3/src/main/java/io/opentelemetry/instrumentation/auto/jsp/JasperJSPCompilationContextInstrumentation.java index 8272aec876c1..eccccab6d808 100644 --- a/instrumentation/jsp-2.3/src/main/java/io/opentelemetry/instrumentation/auto/jsp/JasperJSPCompilationContextInstrumentation.java +++ b/instrumentation/jsp-2.3/src/main/java/io/opentelemetry/instrumentation/auto/jsp/JasperJSPCompilationContextInstrumentation.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.jsp; diff --git a/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationBasicTests.groovy b/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationBasicTests.groovy index 2d0d24e52a54..85f3a1349f8f 100644 --- a/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationBasicTests.groovy +++ b/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationBasicTests.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.SERVER @@ -104,9 +93,9 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - parent() - operationName expectedOperationName() - spanKind SERVER + hasNoParent() + name expectedOperationName() + kind SERVER errored false attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -121,7 +110,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { } span(1) { childOf span(0) - operationName "Compile /$jspFileName" + name "Compile /$jspFileName" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -131,7 +120,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { } span(2) { childOf span(0) - operationName "Render /$jspFileName" + name "Render /$jspFileName" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -165,9 +154,9 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - parent() - operationName expectedOperationName() - spanKind SERVER + hasNoParent() + name expectedOperationName() + kind SERVER errored false attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -182,7 +171,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { } span(1) { childOf span(0) - operationName "Compile /getQuery.jsp" + name "Compile /getQuery.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -192,7 +181,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { } span(2) { childOf span(0) - operationName "Render /getQuery.jsp" + name "Render /getQuery.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -223,9 +212,9 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - parent() - operationName expectedOperationName() - spanKind SERVER + hasNoParent() + name expectedOperationName() + kind SERVER errored false attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -240,7 +229,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { } span(1) { childOf span(0) - operationName "Compile /post.jsp" + name "Compile /post.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -250,7 +239,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { } span(2) { childOf span(0) - operationName "Render /post.jsp" + name "Render /post.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -278,9 +267,9 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - parent() - operationName expectedOperationName() - spanKind SERVER + hasNoParent() + name expectedOperationName() + kind SERVER errored true event(0) { eventName(SemanticAttributes.EXCEPTION_EVENT_NAME) @@ -307,7 +296,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { } span(1) { childOf span(0) - operationName "Compile /$jspFileName" + name "Compile /$jspFileName" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -317,7 +306,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { } span(2) { childOf span(0) - operationName "Render /$jspFileName" + name "Render /$jspFileName" errored true event(0) { eventName(SemanticAttributes.EXCEPTION_EVENT_NAME) @@ -362,9 +351,9 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - parent() - operationName expectedOperationName() - spanKind SERVER + hasNoParent() + name expectedOperationName() + kind SERVER errored false attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -379,7 +368,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { } span(1) { childOf span(0) - operationName "Compile /includes/includeHtml.jsp" + name "Compile /includes/includeHtml.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -389,7 +378,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { } span(2) { childOf span(0) - operationName "Render /includes/includeHtml.jsp" + name "Render /includes/includeHtml.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -416,9 +405,9 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { assertTraces(1) { trace(0, 7) { span(0) { - parent() - operationName expectedOperationName() - spanKind SERVER + hasNoParent() + name expectedOperationName() + kind SERVER errored false attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -433,7 +422,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { } span(1) { childOf span(0) - operationName "Compile /includes/includeMulti.jsp" + name "Compile /includes/includeMulti.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -443,7 +432,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { } span(2) { childOf span(0) - operationName "Render /includes/includeMulti.jsp" + name "Render /includes/includeMulti.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -452,7 +441,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { } span(3) { childOf span(2) - operationName "Compile /common/javaLoopH2.jsp" + name "Compile /common/javaLoopH2.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -462,7 +451,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { } span(4) { childOf span(2) - operationName "Render /common/javaLoopH2.jsp" + name "Render /common/javaLoopH2.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -471,7 +460,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { } span(5) { childOf span(2) - operationName "Compile /common/javaLoopH2.jsp" + name "Compile /common/javaLoopH2.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -481,7 +470,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { } span(6) { childOf span(2) - operationName "Render /common/javaLoopH2.jsp" + name "Render /common/javaLoopH2.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -508,9 +497,9 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - parent() - operationName expectedOperationName() - spanKind SERVER + hasNoParent() + name expectedOperationName() + kind SERVER errored true errorEvent(JasperException, String) attributes { @@ -526,7 +515,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { } span(1) { childOf span(0) - operationName "Compile /$jspFileName" + name "Compile /$jspFileName" errored true errorEvent(JasperException, String) attributes { @@ -561,10 +550,10 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - parent() + hasNoParent() // serviceName jspWebappContext - operationName expectedOperationName() - spanKind SERVER + name expectedOperationName() + kind SERVER // FIXME: this is not a great span name for serving static content. // spanName "GET /$jspWebappContext/$staticFile" errored false diff --git a/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationForwardTests.groovy b/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationForwardTests.groovy index 0879c1057892..d7b62ec1664d 100644 --- a/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationForwardTests.groovy +++ b/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationForwardTests.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.SERVER @@ -102,9 +91,9 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { assertTraces(1) { trace(0, 5) { span(0) { - parent() - operationName expectedOperationName() - spanKind SERVER + hasNoParent() + name expectedOperationName() + kind SERVER errored false attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -119,7 +108,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(1) { childOf span(0) - operationName "Compile /$forwardFromFileName" + name "Compile /$forwardFromFileName" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -129,7 +118,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(2) { childOf span(0) - operationName "Render /$forwardFromFileName" + name "Render /$forwardFromFileName" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -138,7 +127,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(3) { childOf span(2) - operationName "Compile /$forwardDestFileName" + name "Compile /$forwardDestFileName" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -148,7 +137,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(4) { childOf span(2) - operationName "Render /$forwardDestFileName" + name "Render /$forwardDestFileName" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -181,9 +170,9 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - parent() - operationName expectedOperationName() - spanKind SERVER + hasNoParent() + name expectedOperationName() + kind SERVER errored false attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -198,7 +187,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(1) { childOf span(0) - operationName "Compile /forwards/forwardToHtml.jsp" + name "Compile /forwards/forwardToHtml.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -208,7 +197,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(2) { childOf span(0) - operationName "Render /forwards/forwardToHtml.jsp" + name "Render /forwards/forwardToHtml.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -235,9 +224,9 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { assertTraces(1) { trace(0, 9) { span(0) { - parent() - operationName expectedOperationName() - spanKind SERVER + hasNoParent() + name expectedOperationName() + kind SERVER errored false attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -252,7 +241,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(1) { childOf span(0) - operationName "Compile /forwards/forwardToIncludeMulti.jsp" + name "Compile /forwards/forwardToIncludeMulti.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -262,7 +251,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(2) { childOf span(0) - operationName "Render /forwards/forwardToIncludeMulti.jsp" + name "Render /forwards/forwardToIncludeMulti.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -271,7 +260,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(3) { childOf span(2) - operationName "Compile /includes/includeMulti.jsp" + name "Compile /includes/includeMulti.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -281,7 +270,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(4) { childOf span(2) - operationName "Render /includes/includeMulti.jsp" + name "Render /includes/includeMulti.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -291,7 +280,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(5) { childOf span(4) - operationName "Compile /common/javaLoopH2.jsp" + name "Compile /common/javaLoopH2.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -301,7 +290,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(6) { childOf span(4) - operationName "Render /common/javaLoopH2.jsp" + name "Render /common/javaLoopH2.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -311,7 +300,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(7) { childOf span(4) - operationName "Compile /common/javaLoopH2.jsp" + name "Compile /common/javaLoopH2.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -321,7 +310,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(8) { childOf span(4) - operationName "Render /common/javaLoopH2.jsp" + name "Render /common/javaLoopH2.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -349,9 +338,9 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { assertTraces(1) { trace(0, 7) { span(0) { - parent() - operationName expectedOperationName() - spanKind SERVER + hasNoParent() + name expectedOperationName() + kind SERVER errored false attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -366,7 +355,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(1) { childOf span(0) - operationName "Compile /forwards/forwardToJspForward.jsp" + name "Compile /forwards/forwardToJspForward.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -376,7 +365,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(2) { childOf span(0) - operationName "Render /forwards/forwardToJspForward.jsp" + name "Render /forwards/forwardToJspForward.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -385,7 +374,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(3) { childOf span(2) - operationName "Compile /forwards/forwardToSimpleJava.jsp" + name "Compile /forwards/forwardToSimpleJava.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -395,7 +384,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(4) { childOf span(2) - operationName "Render /forwards/forwardToSimpleJava.jsp" + name "Render /forwards/forwardToSimpleJava.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -405,7 +394,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(5) { childOf span(4) - operationName "Compile /common/loop.jsp" + name "Compile /common/loop.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -415,7 +404,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(6) { childOf span(4) - operationName "Render /common/loop.jsp" + name "Render /common/loop.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -443,9 +432,9 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { assertTraces(1) { trace(0, 4) { span(0) { - parent() - operationName expectedOperationName() - spanKind SERVER + hasNoParent() + name expectedOperationName() + kind SERVER errored true errorEvent(JasperException, String) attributes { @@ -461,7 +450,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(1) { childOf span(0) - operationName "Compile /forwards/forwardToCompileError.jsp" + name "Compile /forwards/forwardToCompileError.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -471,7 +460,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(2) { childOf span(0) - operationName "Render /forwards/forwardToCompileError.jsp" + name "Render /forwards/forwardToCompileError.jsp" errored true errorEvent(JasperException, String) attributes { @@ -481,7 +470,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(3) { childOf span(2) - operationName "Compile /compileError.jsp" + name "Compile /compileError.jsp" errored true errorEvent(JasperException, String) attributes { @@ -510,9 +499,9 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - parent() - operationName expectedOperationName() - spanKind SERVER + hasNoParent() + name expectedOperationName() + kind SERVER errored true attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -527,7 +516,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(1) { childOf span(0) - operationName "Compile /forwards/forwardToNonExistent.jsp" + name "Compile /forwards/forwardToNonExistent.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" @@ -537,7 +526,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner { } span(2) { childOf span(0) - operationName "Render /forwards/forwardToNonExistent.jsp" + name "Render /forwards/forwardToNonExistent.jsp" errored false attributes { "servlet.context" "/$jspWebappContext" diff --git a/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/KafkaClientConfiguration.java b/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/KafkaClientConfiguration.java index 9a7922e92835..5d6028178f14 100644 --- a/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/KafkaClientConfiguration.java +++ b/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/KafkaClientConfiguration.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.kafkaclients; diff --git a/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/KafkaConsumerInstrumentation.java b/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/KafkaConsumerInstrumentation.java index b5a7123e3fe8..1d2266c5380a 100644 --- a/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/KafkaConsumerInstrumentation.java +++ b/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/KafkaConsumerInstrumentation.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.kafkaclients; diff --git a/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/KafkaConsumerTracer.java b/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/KafkaConsumerTracer.java index a7b639c73ae4..e1c6454349a1 100644 --- a/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/KafkaConsumerTracer.java +++ b/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/KafkaConsumerTracer.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.kafkaclients; diff --git a/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/KafkaProducerInstrumentation.java b/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/KafkaProducerInstrumentation.java index 2f22a7b229d9..39feb014731a 100644 --- a/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/KafkaProducerInstrumentation.java +++ b/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/KafkaProducerInstrumentation.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.kafkaclients; diff --git a/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/KafkaProducerTracer.java b/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/KafkaProducerTracer.java index 4940d47de63f..b02406f82119 100644 --- a/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/KafkaProducerTracer.java +++ b/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/KafkaProducerTracer.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.kafkaclients; diff --git a/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/TextMapExtractAdapter.java b/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/TextMapExtractAdapter.java index 4c628d5c3e7e..fb52aff15548 100644 --- a/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/TextMapExtractAdapter.java +++ b/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/TextMapExtractAdapter.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.kafkaclients; diff --git a/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/TextMapInjectAdapter.java b/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/TextMapInjectAdapter.java index 2ca83e3d0db4..eb786aa0ef08 100644 --- a/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/TextMapInjectAdapter.java +++ b/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/TextMapInjectAdapter.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.kafkaclients; diff --git a/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/TracingIterable.java b/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/TracingIterable.java index a7ee6cb71d44..52737e35d795 100644 --- a/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/TracingIterable.java +++ b/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/TracingIterable.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.kafkaclients; diff --git a/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/TracingIterator.java b/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/TracingIterator.java index 72037cb26ad0..3e1ef74adeeb 100644 --- a/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/TracingIterator.java +++ b/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/TracingIterator.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.kafkaclients; diff --git a/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/TracingList.java b/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/TracingList.java index 5a5d1155f0db..e9a99b463cb1 100644 --- a/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/TracingList.java +++ b/instrumentation/kafka-clients-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkaclients/TracingList.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.kafkaclients; diff --git a/instrumentation/kafka-clients-0.11/src/test/groovy/KafkaClientTest.groovy b/instrumentation/kafka-clients-0.11/src/test/groovy/KafkaClientTest.groovy index 9900e3b5eea5..95fd2b1c38a7 100644 --- a/instrumentation/kafka-clients-0.11/src/test/groovy/KafkaClientTest.groovy +++ b/instrumentation/kafka-clients-0.11/src/test/groovy/KafkaClientTest.groovy @@ -1,19 +1,9 @@ /* * 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 */ +import static io.opentelemetry.auto.test.utils.ConfigUtils.setConfig import static io.opentelemetry.auto.test.utils.ConfigUtils.updateConfig import static io.opentelemetry.auto.test.utils.TraceUtils.basicSpan import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace @@ -22,6 +12,7 @@ import static io.opentelemetry.trace.Span.Kind.PRODUCER import io.opentelemetry.auto.test.AgentTestRunner import io.opentelemetry.trace.attributes.SemanticAttributes +import io.opentelemetry.instrumentation.api.config.Config import java.util.concurrent.LinkedBlockingQueue import java.util.concurrent.TimeUnit import org.apache.kafka.clients.consumer.ConsumerConfig @@ -106,8 +97,8 @@ class KafkaClientTest extends AgentTestRunner { trace(0, 4) { basicSpan(it, 0, "parent") span(1) { - operationName SHARED_TOPIC + " send" - spanKind PRODUCER + name SHARED_TOPIC + " send" + kind PRODUCER errored false childOf span(0) attributes { @@ -117,8 +108,8 @@ class KafkaClientTest extends AgentTestRunner { } } span(2) { - operationName SHARED_TOPIC + " process" - spanKind CONSUMER + name SHARED_TOPIC + " process" + kind CONSUMER errored false childOf span(1) attributes { @@ -196,8 +187,8 @@ class KafkaClientTest extends AgentTestRunner { trace(0, 4) { basicSpan(it, 0, "parent") span(1) { - operationName SHARED_TOPIC + " send" - spanKind PRODUCER + name SHARED_TOPIC + " send" + kind PRODUCER errored false childOf span(0) attributes { @@ -207,8 +198,8 @@ class KafkaClientTest extends AgentTestRunner { } } span(2) { - operationName SHARED_TOPIC + " process" - spanKind CONSUMER + name SHARED_TOPIC + " process" + kind CONSUMER errored false childOf span(1) attributes { @@ -279,10 +270,10 @@ class KafkaClientTest extends AgentTestRunner { trace(0, 2) { // PRODUCER span 0 span(0) { - operationName SHARED_TOPIC + " send" - spanKind PRODUCER + name SHARED_TOPIC + " send" + kind PRODUCER errored false - parent() + hasNoParent() attributes { "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_DESTINATION.key}" SHARED_TOPIC @@ -292,8 +283,8 @@ class KafkaClientTest extends AgentTestRunner { } // CONSUMER span 0 span(1) { - operationName SHARED_TOPIC + " process" - spanKind CONSUMER + name SHARED_TOPIC + " process" + kind CONSUMER errored false childOf span(0) attributes { @@ -354,10 +345,10 @@ class KafkaClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName SHARED_TOPIC + " send" - spanKind PRODUCER + name SHARED_TOPIC + " send" + kind PRODUCER errored false - parent() + hasNoParent() attributes { "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_DESTINATION.key}" SHARED_TOPIC @@ -366,8 +357,8 @@ class KafkaClientTest extends AgentTestRunner { } } span(1) { - operationName SHARED_TOPIC + " process" - spanKind CONSUMER + name SHARED_TOPIC + " process" + kind CONSUMER errored false childOf span(0) attributes { @@ -427,9 +418,9 @@ class KafkaClientTest extends AgentTestRunner { when: String message = "Testing without headers" - setPropagation(propagationEnabled) + def previousConfig = setPropagation(propagationEnabled) kafkaTemplate.send(SHARED_TOPIC, message) - setPropagation(true) + setConfig(previousConfig) then: // check that the message was received @@ -459,10 +450,10 @@ class KafkaClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName SHARED_TOPIC + " send" - spanKind PRODUCER + name SHARED_TOPIC + " send" + kind PRODUCER errored false - parent() + hasNoParent() attributes { "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_DESTINATION.key}" SHARED_TOPIC @@ -484,10 +475,10 @@ class KafkaClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName SHARED_TOPIC + " send" - spanKind PRODUCER + name SHARED_TOPIC + " send" + kind PRODUCER errored false - parent() + hasNoParent() attributes { "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_DESTINATION.key}" SHARED_TOPIC @@ -495,8 +486,8 @@ class KafkaClientTest extends AgentTestRunner { } } span(1) { - operationName SHARED_TOPIC + " process" - spanKind CONSUMER + name SHARED_TOPIC + " process" + kind CONSUMER errored false childOf span(0) attributes { @@ -515,7 +506,7 @@ class KafkaClientTest extends AgentTestRunner { container.stop() when: "read message without context propagation" - setPropagation(false) + def previousConfig = setPropagation(false) records.clear() container = startConsumer("consumer-without-propagation", records) @@ -526,10 +517,10 @@ class KafkaClientTest extends AgentTestRunner { assertTraces(2) { trace(0, 2) { span(0) { - operationName SHARED_TOPIC + " send" - spanKind PRODUCER + name SHARED_TOPIC + " send" + kind PRODUCER errored false - parent() + hasNoParent() attributes { "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_DESTINATION.key}" SHARED_TOPIC @@ -537,8 +528,8 @@ class KafkaClientTest extends AgentTestRunner { } } span(1) { - operationName SHARED_TOPIC + " process" - spanKind CONSUMER + name SHARED_TOPIC + " process" + kind CONSUMER errored false childOf span(0) attributes { @@ -555,10 +546,10 @@ class KafkaClientTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName SHARED_TOPIC + " process" - spanKind CONSUMER + name SHARED_TOPIC + " process" + kind CONSUMER errored false - parent() + hasNoParent() attributes { "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_DESTINATION.key}" SHARED_TOPIC @@ -577,7 +568,7 @@ class KafkaClientTest extends AgentTestRunner { cleanup: producerFactory.stop() container?.stop() - setPropagation(true) + setConfig(previousConfig) } protected KafkaMessageListenerContainer startConsumer(String groupId, records) { @@ -620,9 +611,9 @@ class KafkaClientTest extends AgentTestRunner { } } - private static setPropagation(boolean propagationEnabled) { - updateConfig { - System.setProperty("otel.kafka.client.propagation.enabled", Boolean.toString(propagationEnabled)) + private static Config setPropagation(boolean propagationEnabled) { + return updateConfig { + it.setProperty("otel.kafka.client.propagation.enabled", Boolean.toString(propagationEnabled)) } } } diff --git a/instrumentation/kafka-streams-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkastreams/KafkaStreamsProcessorInstrumentation.java b/instrumentation/kafka-streams-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkastreams/KafkaStreamsProcessorInstrumentation.java index 79dd7980dd02..010671f54707 100644 --- a/instrumentation/kafka-streams-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkastreams/KafkaStreamsProcessorInstrumentation.java +++ b/instrumentation/kafka-streams-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkastreams/KafkaStreamsProcessorInstrumentation.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.kafkastreams; diff --git a/instrumentation/kafka-streams-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkastreams/KafkaStreamsSourceNodeRecordDeserializerInstrumentation.java b/instrumentation/kafka-streams-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkastreams/KafkaStreamsSourceNodeRecordDeserializerInstrumentation.java index 3a02736a5947..1539c7791e23 100644 --- a/instrumentation/kafka-streams-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkastreams/KafkaStreamsSourceNodeRecordDeserializerInstrumentation.java +++ b/instrumentation/kafka-streams-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkastreams/KafkaStreamsSourceNodeRecordDeserializerInstrumentation.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.kafkastreams; diff --git a/instrumentation/kafka-streams-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkastreams/KafkaStreamsTracer.java b/instrumentation/kafka-streams-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkastreams/KafkaStreamsTracer.java index aedc60295c96..32ae873233fa 100644 --- a/instrumentation/kafka-streams-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkastreams/KafkaStreamsTracer.java +++ b/instrumentation/kafka-streams-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkastreams/KafkaStreamsTracer.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.kafkastreams; diff --git a/instrumentation/kafka-streams-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkastreams/TextMapExtractAdapter.java b/instrumentation/kafka-streams-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkastreams/TextMapExtractAdapter.java index 7d6f010a77bb..1c196f1f7b19 100644 --- a/instrumentation/kafka-streams-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkastreams/TextMapExtractAdapter.java +++ b/instrumentation/kafka-streams-0.11/src/main/java/io/opentelemetry/instrumentation/auto/kafkastreams/TextMapExtractAdapter.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.kafkastreams; diff --git a/instrumentation/kafka-streams-0.11/src/test/groovy/KafkaStreamsTest.groovy b/instrumentation/kafka-streams-0.11/src/test/groovy/KafkaStreamsTest.groovy index 3139da17265a..dbd4d5cd13a7 100644 --- a/instrumentation/kafka-streams-0.11/src/test/groovy/KafkaStreamsTest.groovy +++ b/instrumentation/kafka-streams-0.11/src/test/groovy/KafkaStreamsTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CONSUMER @@ -138,10 +127,10 @@ class KafkaStreamsTest extends AgentTestRunner { trace(0, 5) { // PRODUCER span 0 span(0) { - operationName STREAM_PENDING + " send" - spanKind PRODUCER + name STREAM_PENDING + " send" + kind PRODUCER errored false - parent() + hasNoParent() attributes { "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_DESTINATION.key}" STREAM_PENDING @@ -150,8 +139,8 @@ class KafkaStreamsTest extends AgentTestRunner { } // CONSUMER span 0 span(1) { - operationName STREAM_PENDING + " process" - spanKind CONSUMER + name STREAM_PENDING + " process" + kind CONSUMER errored false childOf span(0) attributes { @@ -167,8 +156,8 @@ class KafkaStreamsTest extends AgentTestRunner { } // STREAMING span 1 span(2) { - operationName STREAM_PENDING + " process" - spanKind CONSUMER + name STREAM_PENDING + " process" + kind CONSUMER errored false childOf span(0) attributes { @@ -183,8 +172,8 @@ class KafkaStreamsTest extends AgentTestRunner { } // STREAMING span 0 span(3) { - operationName STREAM_PROCESSED + " send" - spanKind PRODUCER + name STREAM_PROCESSED + " send" + kind PRODUCER errored false childOf span(2) attributes { @@ -195,8 +184,8 @@ class KafkaStreamsTest extends AgentTestRunner { } // CONSUMER span 0 span(4) { - operationName STREAM_PROCESSED + " process" - spanKind CONSUMER + name STREAM_PROCESSED + " process" + kind CONSUMER errored false childOf span(3) attributes { diff --git a/instrumentation/khttp-0.1/src/main/java/io/opentelemetry/instrumentation/auto/khttp/KHttpAdvice.java b/instrumentation/khttp-0.1/src/main/java/io/opentelemetry/instrumentation/auto/khttp/KHttpAdvice.java index 5b914782aa9a..017be4d56521 100644 --- a/instrumentation/khttp-0.1/src/main/java/io/opentelemetry/instrumentation/auto/khttp/KHttpAdvice.java +++ b/instrumentation/khttp-0.1/src/main/java/io/opentelemetry/instrumentation/auto/khttp/KHttpAdvice.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.khttp; diff --git a/instrumentation/khttp-0.1/src/main/java/io/opentelemetry/instrumentation/auto/khttp/KHttpHeadersInjectAdapter.java b/instrumentation/khttp-0.1/src/main/java/io/opentelemetry/instrumentation/auto/khttp/KHttpHeadersInjectAdapter.java index 2f83a337989a..43c8ffc2bda1 100644 --- a/instrumentation/khttp-0.1/src/main/java/io/opentelemetry/instrumentation/auto/khttp/KHttpHeadersInjectAdapter.java +++ b/instrumentation/khttp-0.1/src/main/java/io/opentelemetry/instrumentation/auto/khttp/KHttpHeadersInjectAdapter.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.khttp; diff --git a/instrumentation/khttp-0.1/src/main/java/io/opentelemetry/instrumentation/auto/khttp/KHttpInstrumentation.java b/instrumentation/khttp-0.1/src/main/java/io/opentelemetry/instrumentation/auto/khttp/KHttpInstrumentation.java index eaef92ce05e7..5142edee6caf 100644 --- a/instrumentation/khttp-0.1/src/main/java/io/opentelemetry/instrumentation/auto/khttp/KHttpInstrumentation.java +++ b/instrumentation/khttp-0.1/src/main/java/io/opentelemetry/instrumentation/auto/khttp/KHttpInstrumentation.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.khttp; diff --git a/instrumentation/khttp-0.1/src/main/java/io/opentelemetry/instrumentation/auto/khttp/KHttpTracer.java b/instrumentation/khttp-0.1/src/main/java/io/opentelemetry/instrumentation/auto/khttp/KHttpTracer.java index 803f3470bd35..8a9df3dfa785 100644 --- a/instrumentation/khttp-0.1/src/main/java/io/opentelemetry/instrumentation/auto/khttp/KHttpTracer.java +++ b/instrumentation/khttp-0.1/src/main/java/io/opentelemetry/instrumentation/auto/khttp/KHttpTracer.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.khttp; diff --git a/instrumentation/khttp-0.1/src/main/java/io/opentelemetry/instrumentation/auto/khttp/RequestWrapper.java b/instrumentation/khttp-0.1/src/main/java/io/opentelemetry/instrumentation/auto/khttp/RequestWrapper.java index d7bde4dc5de1..ec6f6ca5428f 100644 --- a/instrumentation/khttp-0.1/src/main/java/io/opentelemetry/instrumentation/auto/khttp/RequestWrapper.java +++ b/instrumentation/khttp-0.1/src/main/java/io/opentelemetry/instrumentation/auto/khttp/RequestWrapper.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.khttp; diff --git a/instrumentation/khttp-0.1/src/test/groovy/KHttpClientTest.groovy b/instrumentation/khttp-0.1/src/test/groovy/KHttpClientTest.groovy index 3510cf0dd07f..a2d37ee15c4f 100644 --- a/instrumentation/khttp-0.1/src/test/groovy/KHttpClientTest.groovy +++ b/instrumentation/khttp-0.1/src/test/groovy/KHttpClientTest.groovy @@ -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 */ import io.opentelemetry.auto.test.base.HttpClientTest diff --git a/instrumentation/kotlin-coroutines/src/main/java/io/opentelemetry/instrumentation/auto/kotlincoroutines/KotlinProbeInstrumentation.java b/instrumentation/kotlin-coroutines/src/main/java/io/opentelemetry/instrumentation/auto/kotlincoroutines/KotlinProbeInstrumentation.java index 1c7247fb03da..e42a015d1272 100644 --- a/instrumentation/kotlin-coroutines/src/main/java/io/opentelemetry/instrumentation/auto/kotlincoroutines/KotlinProbeInstrumentation.java +++ b/instrumentation/kotlin-coroutines/src/main/java/io/opentelemetry/instrumentation/auto/kotlincoroutines/KotlinProbeInstrumentation.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.kotlincoroutines; diff --git a/instrumentation/kotlin-coroutines/src/test/groovy/KotlinCoroutineInstrumentationTest.groovy b/instrumentation/kotlin-coroutines/src/test/groovy/KotlinCoroutineInstrumentationTest.groovy index 8dbd106e2e08..d82b81885bfe 100644 --- a/instrumentation/kotlin-coroutines/src/test/groovy/KotlinCoroutineInstrumentationTest.groovy +++ b/instrumentation/kotlin-coroutines/src/test/groovy/KotlinCoroutineInstrumentationTest.groovy @@ -1,21 +1,10 @@ /* * 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 */ import io.opentelemetry.auto.test.AgentTestRunner -import io.opentelemetry.common.AttributesKeys +import io.opentelemetry.common.AttributeKey import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.ThreadPoolDispatcherKt @@ -40,7 +29,7 @@ class KotlinCoroutineInstrumentationTest extends AgentTestRunner { assertTraces(1) { trace(0, 7) { span(0) { - operationName "parent" + name "parent" attributes { } } @@ -74,7 +63,7 @@ class KotlinCoroutineInstrumentationTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "parent" + name "parent" attributes { } } @@ -101,7 +90,7 @@ class KotlinCoroutineInstrumentationTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "parent" + name "parent" attributes { } } @@ -128,7 +117,7 @@ class KotlinCoroutineInstrumentationTest extends AgentTestRunner { assertTraces(1) { trace(0, 5) { span(0) { - operationName "parent" + name "parent" attributes { } } @@ -170,7 +159,7 @@ class KotlinCoroutineInstrumentationTest extends AgentTestRunner { assertTraces(1) { trace(0, 4) { span(0) { - operationName "parent" + name "parent" attributes { } } @@ -220,14 +209,14 @@ class KotlinCoroutineInstrumentationTest extends AgentTestRunner { long iter = -1 span(0) { a = span.name.matches("a") - iter = span.getAttributes().get(AttributesKeys.longKey("iter")) + iter = span.getAttributes().get(AttributeKey.longKey("iter")) (a ? seenItersA : seenItersB).add(iter) - operationName(a ? "a" : "b") + name(a ? "a" : "b") } span(1) { - operationName(a ? "a2" : "b2") + name(a ? "a2" : "b2") childOf(span(0)) - assert span.getAttributes().get(AttributesKeys.longKey("iter")) == iter + assert span.getAttributes().get(AttributeKey.longKey("iter")) == iter } } diff --git a/instrumentation/kotlin-coroutines/src/test/kotlin/KotlinCoroutineTests.kt b/instrumentation/kotlin-coroutines/src/test/kotlin/KotlinCoroutineTests.kt index dd0391cac7a9..66ee6e9a1eb0 100644 --- a/instrumentation/kotlin-coroutines/src/test/kotlin/KotlinCoroutineTests.kt +++ b/instrumentation/kotlin-coroutines/src/test/kotlin/KotlinCoroutineTests.kt @@ -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 */ import io.opentelemetry.OpenTelemetry diff --git a/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/KubernetesClientInstrumentation.java b/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/KubernetesClientInstrumentation.java index 0818f645111b..1e5584d50634 100644 --- a/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/KubernetesClientInstrumentation.java +++ b/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/KubernetesClientInstrumentation.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.kubernetesclient; diff --git a/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/KubernetesClientTracer.java b/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/KubernetesClientTracer.java index 8d3a5024f8b9..c2fd4a13f25e 100644 --- a/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/KubernetesClientTracer.java +++ b/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/KubernetesClientTracer.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.kubernetesclient; diff --git a/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/KubernetesRequestDigest.java b/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/KubernetesRequestDigest.java index d9488dfe070f..52f0e57bacea 100644 --- a/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/KubernetesRequestDigest.java +++ b/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/KubernetesRequestDigest.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.kubernetesclient; diff --git a/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/KubernetesResource.java b/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/KubernetesResource.java index 7fc96281248d..c12200d085c8 100644 --- a/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/KubernetesResource.java +++ b/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/KubernetesResource.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.kubernetesclient; diff --git a/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/KubernetesVerb.java b/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/KubernetesVerb.java index 43ad1c7e0046..4e9d3ffc08b9 100644 --- a/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/KubernetesVerb.java +++ b/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/KubernetesVerb.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.kubernetesclient; diff --git a/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/ParseKubernetesResourceException.java b/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/ParseKubernetesResourceException.java index 130ee0781b47..7783427a87f0 100644 --- a/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/ParseKubernetesResourceException.java +++ b/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/ParseKubernetesResourceException.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.kubernetesclient; diff --git a/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/TracingInterceptor.java b/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/TracingInterceptor.java index 3a7a2be4e56f..5151ce706212 100644 --- a/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/TracingInterceptor.java +++ b/instrumentation/kubernetes-client-7.0/src/main/java/io/opentelemetry/instrumentation/auto/kubernetesclient/TracingInterceptor.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.kubernetesclient; diff --git a/instrumentation/kubernetes-client-7.0/src/test/groovy/KubernetesRequestUtilsTest.groovy b/instrumentation/kubernetes-client-7.0/src/test/groovy/KubernetesRequestUtilsTest.groovy index 1f3a52dbd81d..69e5dfad0574 100644 --- a/instrumentation/kubernetes-client-7.0/src/test/groovy/KubernetesRequestUtilsTest.groovy +++ b/instrumentation/kubernetes-client-7.0/src/test/groovy/KubernetesRequestUtilsTest.groovy @@ -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 */ import io.opentelemetry.instrumentation.auto.kubernetesclient.KubernetesRequestDigest diff --git a/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/InstrumentationPoints.java b/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/InstrumentationPoints.java index dc45d9149afe..8c657c3a2969 100644 --- a/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/InstrumentationPoints.java +++ b/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/InstrumentationPoints.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.lettuce.v4_0; diff --git a/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceAbstractDatabaseClientTracer.java b/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceAbstractDatabaseClientTracer.java index 4b7bdb630f9c..ea8e7aa85a69 100644 --- a/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceAbstractDatabaseClientTracer.java +++ b/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceAbstractDatabaseClientTracer.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.lettuce.v4_0; @@ -39,8 +28,7 @@ protected InetSocketAddress peerAddress(RedisURI redisURI) { @Override public Span onConnection(Span span, RedisURI connection) { if (connection != null && connection.getDatabase() != 0) { - span.setAttribute( - SemanticAttributes.REDIS_DATABASE_INDEX, String.valueOf(connection.getDatabase())); + span.setAttribute(SemanticAttributes.REDIS_DATABASE_INDEX, connection.getDatabase()); } return super.onConnection(span, connection); } diff --git a/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceAsyncCommandsAdvice.java b/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceAsyncCommandsAdvice.java index abe8dbd0c551..47d5a1e04c09 100644 --- a/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceAsyncCommandsAdvice.java +++ b/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceAsyncCommandsAdvice.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.lettuce.v4_0; diff --git a/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceAsyncCommandsInstrumentation.java b/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceAsyncCommandsInstrumentation.java index 4696a33a5751..67c0905b4b65 100644 --- a/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceAsyncCommandsInstrumentation.java +++ b/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceAsyncCommandsInstrumentation.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.lettuce.v4_0; diff --git a/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceClientInstrumentation.java b/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceClientInstrumentation.java index 99795ea53fab..ad099deac234 100644 --- a/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceClientInstrumentation.java +++ b/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceClientInstrumentation.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.lettuce.v4_0; diff --git a/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceConnectionDatabaseClientTracer.java b/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceConnectionDatabaseClientTracer.java index f256349bdc0e..b7a753f90c2d 100644 --- a/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceConnectionDatabaseClientTracer.java +++ b/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceConnectionDatabaseClientTracer.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.lettuce.v4_0; diff --git a/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceDatabaseClientTracer.java b/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceDatabaseClientTracer.java index f1fb27e7af1e..edafe4573a91 100644 --- a/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceDatabaseClientTracer.java +++ b/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/LettuceDatabaseClientTracer.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.lettuce.v4_0; diff --git a/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/RedisConnectionAdvice.java b/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/RedisConnectionAdvice.java index e5a185efab4f..6fe294725af5 100644 --- a/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/RedisConnectionAdvice.java +++ b/instrumentation/lettuce/lettuce-4.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v4_0/RedisConnectionAdvice.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.lettuce.v4_0; diff --git a/instrumentation/lettuce/lettuce-4.0/src/test/groovy/LettuceAsyncClientTest.groovy b/instrumentation/lettuce/lettuce-4.0/src/test/groovy/LettuceAsyncClientTest.groovy index 9a7433cd8bb5..ac86d465612a 100644 --- a/instrumentation/lettuce/lettuce-4.0/src/test/groovy/LettuceAsyncClientTest.groovy +++ b/instrumentation/lettuce/lettuce-4.0/src/test/groovy/LettuceAsyncClientTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -126,8 +115,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "CONNECT" - spanKind CLIENT + name "CONNECT" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" HOST @@ -159,8 +148,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "CONNECT" - spanKind CLIENT + name "CONNECT" + kind CLIENT errored true errorEvent RedisConnectionException, String attributes { @@ -185,8 +174,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -218,8 +207,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -265,8 +254,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -298,8 +287,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "RANDOMKEY" - spanKind CLIENT + name "RANDOMKEY" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -350,8 +339,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(2) { trace(0, 1) { span(0) { - operationName "HMSET" - spanKind CLIENT + name "HMSET" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -361,8 +350,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "HGETALL" - spanKind CLIENT + name "HGETALL" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -402,8 +391,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "DEL" - spanKind CLIENT + name "DEL" + kind CLIENT errored true errorEvent(IllegalStateException, "TestException") attributes { @@ -438,8 +427,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SADD" - spanKind CLIENT + name "SADD" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -459,8 +448,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "DEBUG" - spanKind CLIENT + name "DEBUG" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -480,8 +469,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SHUTDOWN" - spanKind CLIENT + name "SHUTDOWN" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" diff --git a/instrumentation/lettuce/lettuce-4.0/src/test/groovy/LettuceSyncClientTest.groovy b/instrumentation/lettuce/lettuce-4.0/src/test/groovy/LettuceSyncClientTest.groovy index 2befa5a685ea..5e3a34480a77 100644 --- a/instrumentation/lettuce/lettuce-4.0/src/test/groovy/LettuceSyncClientTest.groovy +++ b/instrumentation/lettuce/lettuce-4.0/src/test/groovy/LettuceSyncClientTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -108,8 +97,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "CONNECT" - spanKind CLIENT + name "CONNECT" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" HOST @@ -139,8 +128,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "CONNECT" - spanKind CLIENT + name "CONNECT" + kind CLIENT errored true errorEvent RedisConnectionException, String attributes { @@ -164,8 +153,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -185,8 +174,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -206,8 +195,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -227,8 +216,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "RANDOMKEY" - spanKind CLIENT + name "RANDOMKEY" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -248,8 +237,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "LPUSH" - spanKind CLIENT + name "LPUSH" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -269,8 +258,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "HMSET" - spanKind CLIENT + name "HMSET" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -290,8 +279,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "HGETALL" - spanKind CLIENT + name "HGETALL" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -310,8 +299,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "DEBUG" - spanKind CLIENT + name "DEBUG" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -330,8 +319,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SHUTDOWN" - spanKind CLIENT + name "SHUTDOWN" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" diff --git a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/ConnectionFutureAdvice.java b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/ConnectionFutureAdvice.java index 0d4adacc8f12..967925fe1a16 100644 --- a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/ConnectionFutureAdvice.java +++ b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/ConnectionFutureAdvice.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.lettuce.v5_0; diff --git a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceAbstractDatabaseClientTracer.java b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceAbstractDatabaseClientTracer.java index 72be5c2e032b..090aaf4a2d2c 100644 --- a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceAbstractDatabaseClientTracer.java +++ b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceAbstractDatabaseClientTracer.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.lettuce.v5_0; @@ -43,8 +32,7 @@ protected InetSocketAddress peerAddress(RedisURI redisURI) { @Override public Span onConnection(Span span, RedisURI connection) { if (connection != null && connection.getDatabase() != 0) { - span.setAttribute( - SemanticAttributes.REDIS_DATABASE_INDEX, String.valueOf(connection.getDatabase())); + span.setAttribute(SemanticAttributes.REDIS_DATABASE_INDEX, connection.getDatabase()); } return super.onConnection(span, connection); } diff --git a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceAsyncBiFunction.java b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceAsyncBiFunction.java index 41aad919ef3d..caf1bf24a493 100644 --- a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceAsyncBiFunction.java +++ b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceAsyncBiFunction.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.lettuce.v5_0; diff --git a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceAsyncCommandsAdvice.java b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceAsyncCommandsAdvice.java index 8e54b933d74d..23d39a8cf534 100644 --- a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceAsyncCommandsAdvice.java +++ b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceAsyncCommandsAdvice.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.lettuce.v5_0; diff --git a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceAsyncCommandsInstrumentation.java b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceAsyncCommandsInstrumentation.java index a04c74a39dce..c79a7a300224 100644 --- a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceAsyncCommandsInstrumentation.java +++ b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceAsyncCommandsInstrumentation.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.lettuce.v5_0; diff --git a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceClientInstrumentation.java b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceClientInstrumentation.java index c160b448484a..f012923d598a 100644 --- a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceClientInstrumentation.java +++ b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceClientInstrumentation.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.lettuce.v5_0; diff --git a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceConnectionDatabaseClientTracer.java b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceConnectionDatabaseClientTracer.java index c44e285ad4c7..39a9f1796df6 100644 --- a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceConnectionDatabaseClientTracer.java +++ b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceConnectionDatabaseClientTracer.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.lettuce.v5_0; diff --git a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceDatabaseClientTracer.java b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceDatabaseClientTracer.java index 53b223971061..9a6388cfb55c 100644 --- a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceDatabaseClientTracer.java +++ b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceDatabaseClientTracer.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.lettuce.v5_0; diff --git a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceInstrumentationUtil.java b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceInstrumentationUtil.java index 87455e32d567..de020878ddcd 100644 --- a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceInstrumentationUtil.java +++ b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceInstrumentationUtil.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.lettuce.v5_0; diff --git a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceReactiveCommandsInstrumentation.java b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceReactiveCommandsInstrumentation.java index 36ace9465415..9152dcc09b31 100644 --- a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceReactiveCommandsInstrumentation.java +++ b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/LettuceReactiveCommandsInstrumentation.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.lettuce.v5_0; diff --git a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/rx/LettuceFluxCreationAdvice.java b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/rx/LettuceFluxCreationAdvice.java index 67accaf789ea..450c25ffd763 100644 --- a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/rx/LettuceFluxCreationAdvice.java +++ b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/rx/LettuceFluxCreationAdvice.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.lettuce.v5_0.rx; diff --git a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/rx/LettuceFluxTerminationRunnable.java b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/rx/LettuceFluxTerminationRunnable.java index 5ddc4f89ad36..0856fb42d48f 100644 --- a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/rx/LettuceFluxTerminationRunnable.java +++ b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/rx/LettuceFluxTerminationRunnable.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.lettuce.v5_0.rx; diff --git a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/rx/LettuceMonoCreationAdvice.java b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/rx/LettuceMonoCreationAdvice.java index f0cc904923c6..3bf2bda9b331 100644 --- a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/rx/LettuceMonoCreationAdvice.java +++ b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/rx/LettuceMonoCreationAdvice.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.lettuce.v5_0.rx; diff --git a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/rx/LettuceMonoDualConsumer.java b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/rx/LettuceMonoDualConsumer.java index 607ff5da29fb..324d01b25e65 100644 --- a/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/rx/LettuceMonoDualConsumer.java +++ b/instrumentation/lettuce/lettuce-5.0/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_0/rx/LettuceMonoDualConsumer.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.lettuce.v5_0.rx; diff --git a/instrumentation/lettuce/lettuce-5.0/src/test/groovy/LettuceAsyncClientTest.groovy b/instrumentation/lettuce/lettuce-5.0/src/test/groovy/LettuceAsyncClientTest.groovy index a66a0709f7c6..43d973f8c004 100644 --- a/instrumentation/lettuce/lettuce-5.0/src/test/groovy/LettuceAsyncClientTest.groovy +++ b/instrumentation/lettuce/lettuce-5.0/src/test/groovy/LettuceAsyncClientTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -130,8 +119,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "CONNECT" - spanKind CLIENT + name "CONNECT" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" PEER_NAME @@ -164,8 +153,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "CONNECT" - spanKind CLIENT + name "CONNECT" + kind CLIENT errored true errorEvent CompletionException, String attributes { @@ -190,8 +179,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -223,8 +212,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -270,8 +259,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -303,8 +292,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "RANDOMKEY" - spanKind CLIENT + name "RANDOMKEY" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -354,8 +343,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(2) { trace(0, 1) { span(0) { - operationName "HMSET" - spanKind CLIENT + name "HMSET" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -365,8 +354,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "HGETALL" - spanKind CLIENT + name "HGETALL" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -406,8 +395,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "DEL" - spanKind CLIENT + name "DEL" + kind CLIENT errored true errorEvent(IllegalStateException, "TestException") attributes { @@ -442,8 +431,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SADD" - spanKind CLIENT + name "SADD" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -463,8 +452,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "DEBUG" - spanKind CLIENT + name "DEBUG" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -484,8 +473,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SHUTDOWN" - spanKind CLIENT + name "SHUTDOWN" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" diff --git a/instrumentation/lettuce/lettuce-5.0/src/test/groovy/LettuceReactiveClientTest.groovy b/instrumentation/lettuce/lettuce-5.0/src/test/groovy/LettuceReactiveClientTest.groovy index 8741fabdec17..18c5ca7ae7ce 100644 --- a/instrumentation/lettuce/lettuce-5.0/src/test/groovy/LettuceReactiveClientTest.groovy +++ b/instrumentation/lettuce/lettuce-5.0/src/test/groovy/LettuceReactiveClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace @@ -106,8 +95,8 @@ class LettuceReactiveClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -130,8 +119,8 @@ class LettuceReactiveClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -162,8 +151,8 @@ class LettuceReactiveClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -192,8 +181,8 @@ class LettuceReactiveClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "RANDOMKEY" - spanKind CLIENT + name "RANDOMKEY" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -212,8 +201,8 @@ class LettuceReactiveClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "COMMAND" - spanKind CLIENT + name "COMMAND" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -233,8 +222,8 @@ class LettuceReactiveClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "COMMAND" - spanKind CLIENT + name "COMMAND" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -267,8 +256,8 @@ class LettuceReactiveClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "DEBUG" - spanKind CLIENT + name "DEBUG" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -287,8 +276,8 @@ class LettuceReactiveClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SHUTDOWN" - spanKind CLIENT + name "SHUTDOWN" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -311,14 +300,14 @@ class LettuceReactiveClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName "test-parent" + name "test-parent" errored false attributes { } } span(1) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT errored false childOf span(0) attributes { @@ -327,8 +316,8 @@ class LettuceReactiveClientTest extends AgentTestRunner { } } span(2) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false childOf span(0) attributes { @@ -352,14 +341,14 @@ class LettuceReactiveClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName "test-parent" + name "test-parent" errored false attributes { } } span(1) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT errored false childOf span(0) attributes { @@ -368,8 +357,8 @@ class LettuceReactiveClientTest extends AgentTestRunner { } } span(2) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false childOf span(0) attributes { @@ -394,14 +383,14 @@ class LettuceReactiveClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName "test-parent" + name "test-parent" errored false attributes { } } span(1) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT errored false childOf span(0) attributes { @@ -410,8 +399,8 @@ class LettuceReactiveClientTest extends AgentTestRunner { } } span(2) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false childOf span(0) attributes { diff --git a/instrumentation/lettuce/lettuce-5.0/src/test/groovy/LettuceSyncClientTest.groovy b/instrumentation/lettuce/lettuce-5.0/src/test/groovy/LettuceSyncClientTest.groovy index 8d0b1f3343d5..1deb5269f43c 100644 --- a/instrumentation/lettuce/lettuce-5.0/src/test/groovy/LettuceSyncClientTest.groovy +++ b/instrumentation/lettuce/lettuce-5.0/src/test/groovy/LettuceSyncClientTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -110,8 +99,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "CONNECT" - spanKind CLIENT + name "CONNECT" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_PEER_NAME.key()}" PEER_NAME @@ -141,8 +130,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "CONNECT" - spanKind CLIENT + name "CONNECT" + kind CLIENT errored true errorEvent CompletionException, String attributes { @@ -166,8 +155,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -187,8 +176,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -208,8 +197,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -229,8 +218,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "RANDOMKEY" - spanKind CLIENT + name "RANDOMKEY" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -250,8 +239,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "LPUSH" - spanKind CLIENT + name "LPUSH" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -271,8 +260,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "HMSET" - spanKind CLIENT + name "HMSET" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -292,8 +281,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "HGETALL" - spanKind CLIENT + name "HGETALL" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -312,8 +301,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "DEBUG" - spanKind CLIENT + name "DEBUG" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" @@ -332,8 +321,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SHUTDOWN" - spanKind CLIENT + name "SHUTDOWN" + kind CLIENT errored false attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" diff --git a/instrumentation/lettuce/lettuce-5.1/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_1/LettuceClientResourcesInstrumentation.java b/instrumentation/lettuce/lettuce-5.1/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_1/LettuceClientResourcesInstrumentation.java index fbbc5f29defc..350b4705a7ac 100644 --- a/instrumentation/lettuce/lettuce-5.1/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_1/LettuceClientResourcesInstrumentation.java +++ b/instrumentation/lettuce/lettuce-5.1/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_1/LettuceClientResourcesInstrumentation.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.lettuce.v5_1; diff --git a/instrumentation/lettuce/lettuce-5.1/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_1/OpenTelemetryTracing.java b/instrumentation/lettuce/lettuce-5.1/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_1/OpenTelemetryTracing.java index a07483073df9..efb515f766ae 100644 --- a/instrumentation/lettuce/lettuce-5.1/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_1/OpenTelemetryTracing.java +++ b/instrumentation/lettuce/lettuce-5.1/src/main/java/io/opentelemetry/instrumentation/auto/lettuce/v5_1/OpenTelemetryTracing.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.lettuce.v5_1; @@ -26,7 +15,7 @@ import io.opentelemetry.instrumentation.auto.api.jdbc.DbSystem; import io.opentelemetry.trace.Span; import io.opentelemetry.trace.Span.Kind; -import io.opentelemetry.trace.Status; +import io.opentelemetry.trace.StatusCanonicalCode; import io.opentelemetry.trace.attributes.SemanticAttributes; import java.net.InetSocketAddress; import java.net.SocketAddress; @@ -154,7 +143,7 @@ private static class OpenTelemetrySpan extends Tracer.Span { @Nullable private List events; - @Nullable private Status status; + @Nullable private Throwable error; @Nullable private Span span; @@ -208,9 +197,10 @@ public synchronized Tracer.Span start() { events = null; } - if (status != null) { - span.setStatus(status); - status = null; + if (error != null) { + span.setStatus(StatusCanonicalCode.ERROR); + span.recordException(error); + error = null; } return this; @@ -247,13 +237,10 @@ public synchronized Tracer.Span tag(String key, String value) { @Override public synchronized Tracer.Span error(Throwable throwable) { - // TODO(anuraaga): Check if any lettuce exceptions map well to a Status and try mapping. - Status status = - Status.UNKNOWN.withDescription(throwable.getClass() + ": " + throwable.getMessage()); if (span != null) { - span.setStatus(status); + span.recordException(throwable); } else { - this.status = status; + this.error = throwable; } return this; } diff --git a/instrumentation/lettuce/lettuce-5.1/src/test/groovy/io/opentelemetry/instrumentation/auto/lettuce/v5_1/LettuceAsyncClientTest.groovy b/instrumentation/lettuce/lettuce-5.1/src/test/groovy/io/opentelemetry/instrumentation/auto/lettuce/v5_1/LettuceAsyncClientTest.groovy index d83bd2d5451c..d5eda73c4c33 100644 --- a/instrumentation/lettuce/lettuce-5.1/src/test/groovy/io/opentelemetry/instrumentation/auto/lettuce/v5_1/LettuceAsyncClientTest.groovy +++ b/instrumentation/lettuce/lettuce-5.1/src/test/groovy/io/opentelemetry/instrumentation/auto/lettuce/v5_1/LettuceAsyncClientTest.groovy @@ -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.lettuce.v5_1 @@ -159,8 +148,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" @@ -202,8 +191,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" @@ -259,8 +248,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" @@ -302,8 +291,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "RANDOMKEY" - spanKind CLIENT + name "RANDOMKEY" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" @@ -363,8 +352,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { assertTraces(2) { trace(0, 1) { span(0) { - operationName "HMSET" - spanKind CLIENT + name "HMSET" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" @@ -384,8 +373,8 @@ class LettuceAsyncClientTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "HGETALL" - spanKind CLIENT + name "HGETALL" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" diff --git a/instrumentation/lettuce/lettuce-5.1/src/test/groovy/io/opentelemetry/instrumentation/auto/lettuce/v5_1/LettuceReactiveClientTest.groovy b/instrumentation/lettuce/lettuce-5.1/src/test/groovy/io/opentelemetry/instrumentation/auto/lettuce/v5_1/LettuceReactiveClientTest.groovy index b303c39a7275..3f47a4832f73 100644 --- a/instrumentation/lettuce/lettuce-5.1/src/test/groovy/io/opentelemetry/instrumentation/auto/lettuce/v5_1/LettuceReactiveClientTest.groovy +++ b/instrumentation/lettuce/lettuce-5.1/src/test/groovy/io/opentelemetry/instrumentation/auto/lettuce/v5_1/LettuceReactiveClientTest.groovy @@ -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.lettuce.v5_1 @@ -109,8 +98,8 @@ class LettuceReactiveClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" @@ -143,8 +132,8 @@ class LettuceReactiveClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" @@ -185,8 +174,8 @@ class LettuceReactiveClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" @@ -225,8 +214,8 @@ class LettuceReactiveClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "RANDOMKEY" - spanKind CLIENT + name "RANDOMKEY" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" @@ -255,8 +244,8 @@ class LettuceReactiveClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "COMMAND" - spanKind CLIENT + name "COMMAND" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" @@ -301,14 +290,14 @@ class LettuceReactiveClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName "test-parent" + name "test-parent" errored false attributes { } } span(1) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT errored false childOf span(0) attributes { @@ -327,8 +316,8 @@ class LettuceReactiveClientTest extends AgentTestRunner { } } span(2) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false childOf span(0) attributes { @@ -362,14 +351,14 @@ class LettuceReactiveClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName "test-parent" + name "test-parent" errored false attributes { } } span(1) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT errored false childOf span(0) attributes { @@ -388,8 +377,8 @@ class LettuceReactiveClientTest extends AgentTestRunner { } } span(2) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false childOf span(0) attributes { @@ -424,14 +413,14 @@ class LettuceReactiveClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName "test-parent" + name "test-parent" errored false attributes { } } span(1) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT errored false childOf span(0) attributes { @@ -450,8 +439,8 @@ class LettuceReactiveClientTest extends AgentTestRunner { } } span(2) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false childOf span(0) attributes { diff --git a/instrumentation/lettuce/lettuce-5.1/src/test/groovy/io/opentelemetry/instrumentation/auto/lettuce/v5_1/LettuceSyncClientAuthTest.groovy b/instrumentation/lettuce/lettuce-5.1/src/test/groovy/io/opentelemetry/instrumentation/auto/lettuce/v5_1/LettuceSyncClientAuthTest.groovy index 1bfad6cd9a7b..5172bf09d224 100644 --- a/instrumentation/lettuce/lettuce-5.1/src/test/groovy/io/opentelemetry/instrumentation/auto/lettuce/v5_1/LettuceSyncClientAuthTest.groovy +++ b/instrumentation/lettuce/lettuce-5.1/src/test/groovy/io/opentelemetry/instrumentation/auto/lettuce/v5_1/LettuceSyncClientAuthTest.groovy @@ -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.lettuce.v5_1 @@ -81,8 +70,8 @@ class LettuceSyncClientAuthTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "AUTH" - spanKind CLIENT + name "AUTH" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" diff --git a/instrumentation/lettuce/lettuce-5.1/src/test/groovy/io/opentelemetry/instrumentation/auto/lettuce/v5_1/LettuceSyncClientTest.groovy b/instrumentation/lettuce/lettuce-5.1/src/test/groovy/io/opentelemetry/instrumentation/auto/lettuce/v5_1/LettuceSyncClientTest.groovy index 4cac41b4f84e..682eacc73890 100644 --- a/instrumentation/lettuce/lettuce-5.1/src/test/groovy/io/opentelemetry/instrumentation/auto/lettuce/v5_1/LettuceSyncClientTest.groovy +++ b/instrumentation/lettuce/lettuce-5.1/src/test/groovy/io/opentelemetry/instrumentation/auto/lettuce/v5_1/LettuceSyncClientTest.groovy @@ -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.lettuce.v5_1 @@ -140,8 +129,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" @@ -174,8 +163,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" @@ -206,8 +195,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" @@ -237,8 +226,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" @@ -268,8 +257,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "RANDOMKEY" - spanKind CLIENT + name "RANDOMKEY" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" @@ -299,8 +288,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "LPUSH" - spanKind CLIENT + name "LPUSH" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" @@ -330,8 +319,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "HMSET" - spanKind CLIENT + name "HMSET" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" @@ -361,8 +350,8 @@ class LettuceSyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "HGETALL" - spanKind CLIENT + name "HGETALL" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" diff --git a/instrumentation/log4j/log4j-1.2/src/main/java/io/opentelemetry/instrumentation/auto/log4j/v1_2/Log4j1Instrumentation.java b/instrumentation/log4j/log4j-1.2/src/main/java/io/opentelemetry/instrumentation/auto/log4j/v1_2/Log4j1Instrumentation.java index 46d214e945af..ca142bc3687a 100644 --- a/instrumentation/log4j/log4j-1.2/src/main/java/io/opentelemetry/instrumentation/auto/log4j/v1_2/Log4j1Instrumentation.java +++ b/instrumentation/log4j/log4j-1.2/src/main/java/io/opentelemetry/instrumentation/auto/log4j/v1_2/Log4j1Instrumentation.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.log4j.v1_2; diff --git a/instrumentation/log4j/log4j-1.2/src/main/java/io/opentelemetry/instrumentation/auto/log4j/v1_2/Log4j1LoggingEventInstrumentation.java b/instrumentation/log4j/log4j-1.2/src/main/java/io/opentelemetry/instrumentation/auto/log4j/v1_2/Log4j1LoggingEventInstrumentation.java index f3659c84e085..81eab365e6ab 100644 --- a/instrumentation/log4j/log4j-1.2/src/main/java/io/opentelemetry/instrumentation/auto/log4j/v1_2/Log4j1LoggingEventInstrumentation.java +++ b/instrumentation/log4j/log4j-1.2/src/main/java/io/opentelemetry/instrumentation/auto/log4j/v1_2/Log4j1LoggingEventInstrumentation.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.log4j.v1_2; @@ -102,9 +91,7 @@ public static void onExit( value = spanContext.getSpanIdAsHexString(); break; case SAMPLED: - if (spanContext.isSampled()) { - value = "true"; - } + value = Boolean.toString(spanContext.isSampled()); break; } } @@ -137,9 +124,7 @@ public static void onEnter( SpanContext spanContext = span.getContext(); mdc.put(TRACE_ID, spanContext.getTraceIdAsHexString()); mdc.put(SPAN_ID, spanContext.getSpanIdAsHexString()); - if (spanContext.isSampled()) { - mdc.put(SAMPLED, "true"); - } + mdc.put(SAMPLED, Boolean.toString(spanContext.isSampled())); } } diff --git a/instrumentation/log4j/log4j-1.2/src/test/groovy/ListAppender.groovy b/instrumentation/log4j/log4j-1.2/src/test/groovy/ListAppender.groovy index 5fb2acbd3787..6960ee0c7467 100644 --- a/instrumentation/log4j/log4j-1.2/src/test/groovy/ListAppender.groovy +++ b/instrumentation/log4j/log4j-1.2/src/test/groovy/ListAppender.groovy @@ -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 */ import org.apache.log4j.AppenderSkeleton diff --git a/instrumentation/log4j/log4j-1.2/src/test/groovy/Log4j1MdcTest.groovy b/instrumentation/log4j/log4j-1.2/src/test/groovy/Log4j1MdcTest.groovy index 0a7d035c03d4..13299879ea62 100644 --- a/instrumentation/log4j/log4j-1.2/src/test/groovy/Log4j1MdcTest.groovy +++ b/instrumentation/log4j/log4j-1.2/src/test/groovy/Log4j1MdcTest.groovy @@ -1,19 +1,12 @@ /* * 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 */ +import static io.opentelemetry.instrumentation.api.log.LoggingContextConstants.SAMPLED +import static io.opentelemetry.instrumentation.api.log.LoggingContextConstants.SPAN_ID +import static io.opentelemetry.instrumentation.api.log.LoggingContextConstants.TRACE_ID + import io.opentelemetry.auto.test.AgentTestRunner import io.opentelemetry.auto.test.utils.TraceUtils import io.opentelemetry.trace.TracingContextUtils @@ -37,14 +30,14 @@ class Log4j1MdcTest extends AgentTestRunner { events.size() == 2 events[0].message == "log message 1" - events[0].getMDC("traceId") == null - events[0].getMDC("spanId") == null - events[0].getMDC("traceFlags") == null + events[0].getMDC(TRACE_ID) == null + events[0].getMDC(SPAN_ID) == null + events[0].getMDC(SAMPLED) == null events[1].message == "log message 2" - events[1].getMDC("traceId") == null - events[1].getMDC("spanId") == null - events[1].getMDC("traceFlags") == null + events[1].getMDC(TRACE_ID) == null + events[1].getMDC(SPAN_ID) == null + events[1].getMDC(SAMPLED) == null } def "ids when span"() { @@ -69,20 +62,20 @@ class Log4j1MdcTest extends AgentTestRunner { events.size() == 3 events[0].message == "log message 1" - events[0].getMDC("traceId") == span1.context.traceIdAsHexString - events[0].getMDC("spanId") == span1.context.spanIdAsHexString - events[0].getMDC("sampled") == "true" + events[0].getMDC(TRACE_ID) == span1.context.traceIdAsHexString + events[0].getMDC(SPAN_ID) == span1.context.spanIdAsHexString + events[0].getMDC(SAMPLED) == "true" events[1].message == "log message 2" - events[1].getMDC("traceId") == null - events[1].getMDC("spanId") == null - events[1].getMDC("sampled") == null + events[1].getMDC(TRACE_ID) == null + events[1].getMDC(SPAN_ID) == null + events[1].getMDC(SAMPLED) == null events[2].message == "log message 3" // this explicit getMDCCopy() call here is to make sure that whole instrumentation is tested events[2].getMDCCopy() - events[2].getMDC("traceId") == span2.context.traceIdAsHexString - events[2].getMDC("spanId") == span2.context.spanIdAsHexString - events[2].getMDC("sampled") == "true" + events[2].getMDC(TRACE_ID) == span2.context.traceIdAsHexString + events[2].getMDC(SPAN_ID) == span2.context.spanIdAsHexString + events[2].getMDC(SAMPLED) == "true" } } diff --git a/instrumentation/log4j/log4j-1.2/src/test/resources/log4j.properties b/instrumentation/log4j/log4j-1.2/src/test/resources/log4j.properties index e3a930a0b877..e7104aab698c 100644 --- a/instrumentation/log4j/log4j-1.2/src/test/resources/log4j.properties +++ b/instrumentation/log4j/log4j-1.2/src/test/resources/log4j.properties @@ -1,2 +1,2 @@ log4j.rootLogger=INFO, LIST -log4j.appender.LIST=ListAppender \ No newline at end of file +log4j.appender.LIST=ListAppender diff --git a/instrumentation/log4j/log4j-2-testing/log4j-2-testing.gradle b/instrumentation/log4j/log4j-2-testing/log4j-2-testing.gradle index cb1c03ca2dd8..0e6a1f14b6cb 100644 --- a/instrumentation/log4j/log4j-2-testing/log4j-2-testing.gradle +++ b/instrumentation/log4j/log4j-2-testing/log4j-2-testing.gradle @@ -10,6 +10,7 @@ dependencies { implementation deps.groovy implementation deps.opentelemetryApi implementation deps.spock + implementation project(':instrumentation-api') annotationProcessor group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.7' } diff --git a/instrumentation/log4j/log4j-2-testing/src/main/groovy/Log4j2Test.groovy b/instrumentation/log4j/log4j-2-testing/src/main/groovy/Log4j2Test.groovy index c98415b0bb3c..38c364c8539f 100644 --- a/instrumentation/log4j/log4j-2-testing/src/main/groovy/Log4j2Test.groovy +++ b/instrumentation/log4j/log4j-2-testing/src/main/groovy/Log4j2Test.groovy @@ -1,19 +1,12 @@ /* * 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 */ +import static io.opentelemetry.instrumentation.api.log.LoggingContextConstants.SAMPLED +import static io.opentelemetry.instrumentation.api.log.LoggingContextConstants.SPAN_ID +import static io.opentelemetry.instrumentation.api.log.LoggingContextConstants.TRACE_ID + import io.opentelemetry.auto.test.InstrumentationSpecification import io.opentelemetry.auto.test.utils.TraceUtils import io.opentelemetry.instrumentation.log4j.v2_13_2.ListAppender @@ -39,14 +32,14 @@ abstract class Log4j2Test extends InstrumentationSpecification { then: events.size() == 2 events[0].message.formattedMessage == "log message 1" - events[0].getContextData().getValue("traceId") == null - events[0].getContextData().getValue("spanId") == null - events[0].getContextData().getValue("traceFlags") == null + events[0].getContextData().getValue(TRACE_ID) == null + events[0].getContextData().getValue(SPAN_ID) == null + events[0].getContextData().getValue(SAMPLED) == null events[1].message.formattedMessage == "log message 2" - events[1].getContextData().getValue("traceId") == null - events[1].getContextData().getValue("spanId") == null - events[1].getContextData().getValue("traceFlags") == null + events[1].getContextData().getValue(TRACE_ID) == null + events[1].getContextData().getValue(SPAN_ID) == null + events[1].getContextData().getValue(SAMPLED) == null } def "ids when span"() { @@ -54,18 +47,16 @@ abstract class Log4j2Test extends InstrumentationSpecification { def logger = LogManager.getLogger("TestLogger") when: - Span span1 - TraceUtils.runUnderTrace("test") { - span1 = TracingContextUtils.currentSpan + Span span1 = TraceUtils.runUnderTrace("test") { logger.info("log message 1") + TracingContextUtils.currentSpan } logger.info("log message 2") - Span span2 - TraceUtils.runUnderTrace("test 2") { - span2 = TracingContextUtils.currentSpan + Span span2 = TraceUtils.runUnderTrace("test 2") { logger.info("log message 3") + TracingContextUtils.currentSpan } def events = ListAppender.get().getEvents() @@ -73,18 +64,18 @@ abstract class Log4j2Test extends InstrumentationSpecification { then: events.size() == 3 events[0].message.formattedMessage == "log message 1" - events[0].getContextData().getValue("traceId") == span1.context.traceIdAsHexString - events[0].getContextData().getValue("spanId") == span1.context.spanIdAsHexString - events[0].getContextData().getValue("sampled") == "true" + events[0].getContextData().getValue(TRACE_ID) == span1.context.traceIdAsHexString + events[0].getContextData().getValue(SPAN_ID) == span1.context.spanIdAsHexString + events[0].getContextData().getValue(SAMPLED) == "true" events[1].message.formattedMessage == "log message 2" - events[1].getContextData().getValue("traceId") == null - events[1].getContextData().getValue("spanId") == null - events[1].getContextData().getValue("sampled") == null + events[1].getContextData().getValue(TRACE_ID) == null + events[1].getContextData().getValue(SPAN_ID) == null + events[1].getContextData().getValue(SAMPLED) == null events[2].message.formattedMessage == "log message 3" - events[2].getContextData().getValue("traceId") == span2.context.traceIdAsHexString - events[2].getContextData().getValue("spanId") == span2.context.spanIdAsHexString - events[2].getContextData().getValue("sampled") == "true" + events[2].getContextData().getValue(TRACE_ID) == span2.context.traceIdAsHexString + events[2].getContextData().getValue(SPAN_ID) == span2.context.spanIdAsHexString + events[2].getContextData().getValue(SAMPLED) == "true" } } diff --git a/instrumentation/log4j/log4j-2-testing/src/main/java/io/opentelemetry/instrumentation/log4j/v2_13_2/ListAppender.java b/instrumentation/log4j/log4j-2-testing/src/main/java/io/opentelemetry/instrumentation/log4j/v2_13_2/ListAppender.java index a5b8b65e60e9..84b83e36ad8f 100644 --- a/instrumentation/log4j/log4j-2-testing/src/main/java/io/opentelemetry/instrumentation/log4j/v2_13_2/ListAppender.java +++ b/instrumentation/log4j/log4j-2-testing/src/main/java/io/opentelemetry/instrumentation/log4j/v2_13_2/ListAppender.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.log4j.v2_13_2; diff --git a/instrumentation/log4j/log4j-2.13.2/auto/src/main/java/io/opentelemetry/instrumentation/auto/log4j/v2_13_2/Log4j2MdcInstrumentation.java b/instrumentation/log4j/log4j-2.13.2/auto/src/main/java/io/opentelemetry/instrumentation/auto/log4j/v2_13_2/Log4j2MdcInstrumentation.java index ddfd88e27a0a..aae198df5bd8 100644 --- a/instrumentation/log4j/log4j-2.13.2/auto/src/main/java/io/opentelemetry/instrumentation/auto/log4j/v2_13_2/Log4j2MdcInstrumentation.java +++ b/instrumentation/log4j/log4j-2.13.2/auto/src/main/java/io/opentelemetry/instrumentation/auto/log4j/v2_13_2/Log4j2MdcInstrumentation.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.log4j.v2_13_2; diff --git a/instrumentation/log4j/log4j-2.13.2/auto/src/test/groovy/AutoLog4j2Test.groovy b/instrumentation/log4j/log4j-2.13.2/auto/src/test/groovy/AutoLog4j2Test.groovy index 47da4221f5f3..ee65af76a738 100644 --- a/instrumentation/log4j/log4j-2.13.2/auto/src/test/groovy/AutoLog4j2Test.groovy +++ b/instrumentation/log4j/log4j-2.13.2/auto/src/test/groovy/AutoLog4j2Test.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestTrait diff --git a/instrumentation/log4j/log4j-2.13.2/library/src/main/java/io/opentelemetry/instrumentation/log4j/v2_13_2/OpenTelemetryContextDataProvider.java b/instrumentation/log4j/log4j-2.13.2/library/src/main/java/io/opentelemetry/instrumentation/log4j/v2_13_2/OpenTelemetryContextDataProvider.java index 8853880eb236..48feb37c8a65 100644 --- a/instrumentation/log4j/log4j-2.13.2/library/src/main/java/io/opentelemetry/instrumentation/log4j/v2_13_2/OpenTelemetryContextDataProvider.java +++ b/instrumentation/log4j/log4j-2.13.2/library/src/main/java/io/opentelemetry/instrumentation/log4j/v2_13_2/OpenTelemetryContextDataProvider.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.log4j.v2_13_2; @@ -51,9 +40,7 @@ public Map supplyContextData() { SpanContext spanContext = currentSpan.getContext(); contextData.put(TRACE_ID, spanContext.getTraceIdAsHexString()); contextData.put(SPAN_ID, spanContext.getSpanIdAsHexString()); - if (spanContext.isSampled()) { - contextData.put(SAMPLED, "true"); - } + contextData.put(SAMPLED, Boolean.toString(spanContext.isSampled())); return contextData; } } diff --git a/instrumentation/log4j/log4j-2.13.2/library/src/test/groovy/LibraryLog4j2Test.groovy b/instrumentation/log4j/log4j-2.13.2/library/src/test/groovy/LibraryLog4j2Test.groovy index cf65e081fb9f..234e4b5270cb 100644 --- a/instrumentation/log4j/log4j-2.13.2/library/src/test/groovy/LibraryLog4j2Test.groovy +++ b/instrumentation/log4j/log4j-2.13.2/library/src/test/groovy/LibraryLog4j2Test.groovy @@ -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 */ import io.opentelemetry.auto.test.InstrumentationTestTrait diff --git a/instrumentation/log4j/log4j-2.7/src/main/java/io/opentelemetry/instrumentation/auto/log4j/v2_7/Log4j27MdcInstrumentation.java b/instrumentation/log4j/log4j-2.7/src/main/java/io/opentelemetry/instrumentation/auto/log4j/v2_7/Log4j27MdcInstrumentation.java index e630fde23235..c58e88118fb4 100644 --- a/instrumentation/log4j/log4j-2.7/src/main/java/io/opentelemetry/instrumentation/auto/log4j/v2_7/Log4j27MdcInstrumentation.java +++ b/instrumentation/log4j/log4j-2.7/src/main/java/io/opentelemetry/instrumentation/auto/log4j/v2_7/Log4j27MdcInstrumentation.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.log4j.v2_7; diff --git a/instrumentation/log4j/log4j-2.7/src/main/java/io/opentelemetry/instrumentation/auto/log4j/v2_7/SpanDecoratingContextDataInjector.java b/instrumentation/log4j/log4j-2.7/src/main/java/io/opentelemetry/instrumentation/auto/log4j/v2_7/SpanDecoratingContextDataInjector.java index 8f14488830db..4abc5113de56 100644 --- a/instrumentation/log4j/log4j-2.7/src/main/java/io/opentelemetry/instrumentation/auto/log4j/v2_7/SpanDecoratingContextDataInjector.java +++ b/instrumentation/log4j/log4j-2.7/src/main/java/io/opentelemetry/instrumentation/auto/log4j/v2_7/SpanDecoratingContextDataInjector.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.log4j.v2_7; @@ -53,9 +42,7 @@ public StringMap injectContextData(List list, StringMap stringMap) { StringMap newContextData = new SortedArrayStringMap(contextData); newContextData.putValue(TRACE_ID, currentContext.getTraceIdAsHexString()); newContextData.putValue(SPAN_ID, currentContext.getSpanIdAsHexString()); - if (currentContext.isSampled()) { - newContextData.putValue(SAMPLED, "true"); - } + newContextData.putValue(SAMPLED, Boolean.toString(currentContext.isSampled())); return newContextData; } diff --git a/instrumentation/log4j/log4j-2.7/src/test/groovy/Log4j27Test.groovy b/instrumentation/log4j/log4j-2.7/src/test/groovy/Log4j27Test.groovy index 71ee2f8db73f..fa355d95bbae 100644 --- a/instrumentation/log4j/log4j-2.7/src/test/groovy/Log4j27Test.groovy +++ b/instrumentation/log4j/log4j-2.7/src/test/groovy/Log4j27Test.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestTrait diff --git a/instrumentation/logback/logback-1.0.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/logback/v1_0_0/LogbackInstrumentation.java b/instrumentation/logback/logback-1.0.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/logback/v1_0_0/LogbackInstrumentation.java index 05476bf5c8f2..9ca98ea7ee9d 100644 --- a/instrumentation/logback/logback-1.0.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/logback/v1_0_0/LogbackInstrumentation.java +++ b/instrumentation/logback/logback-1.0.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/logback/v1_0_0/LogbackInstrumentation.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.logback.v1_0_0; diff --git a/instrumentation/logback/logback-1.0.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/logback/v1_0_0/LoggingEventInstrumentation.java b/instrumentation/logback/logback-1.0.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/logback/v1_0_0/LoggingEventInstrumentation.java index a9bfd905abca..c1d848fe082b 100644 --- a/instrumentation/logback/logback-1.0.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/logback/v1_0_0/LoggingEventInstrumentation.java +++ b/instrumentation/logback/logback-1.0.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/logback/v1_0_0/LoggingEventInstrumentation.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.logback.v1_0_0; @@ -95,9 +84,7 @@ public static void onExit( SpanContext spanContext = currentSpan.getContext(); spanContextData.put(TRACE_ID, spanContext.getTraceIdAsHexString()); spanContextData.put(SPAN_ID, spanContext.getSpanIdAsHexString()); - if (spanContext.isSampled()) { - spanContextData.put(SAMPLED, "true"); - } + spanContextData.put(SAMPLED, Boolean.toString(spanContext.isSampled())); if (contextData == null) { contextData = spanContextData; diff --git a/instrumentation/logback/logback-1.0.0/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/logback/v1_0_0/LogbackTest.groovy b/instrumentation/logback/logback-1.0.0/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/logback/v1_0_0/LogbackTest.groovy index 9e2ddf60b3b5..737fc4f52742 100644 --- a/instrumentation/logback/logback-1.0.0/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/logback/v1_0_0/LogbackTest.groovy +++ b/instrumentation/logback/logback-1.0.0/auto/src/test/groovy/io/opentelemetry/instrumentation/auto/logback/v1_0_0/LogbackTest.groovy @@ -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.logback.v1_0_0 diff --git a/instrumentation/logback/logback-1.0.0/library/src/main/java/io/opentelemetry/instrumentation/logback/v1_0_0/LoggingEventWrapper.java b/instrumentation/logback/logback-1.0.0/library/src/main/java/io/opentelemetry/instrumentation/logback/v1_0_0/LoggingEventWrapper.java index 2e06d31c232c..a9d7819cd1a1 100644 --- a/instrumentation/logback/logback-1.0.0/library/src/main/java/io/opentelemetry/instrumentation/logback/v1_0_0/LoggingEventWrapper.java +++ b/instrumentation/logback/logback-1.0.0/library/src/main/java/io/opentelemetry/instrumentation/logback/v1_0_0/LoggingEventWrapper.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.logback.v1_0_0; diff --git a/instrumentation/logback/logback-1.0.0/library/src/main/java/io/opentelemetry/instrumentation/logback/v1_0_0/OpenTelemetryAppender.java b/instrumentation/logback/logback-1.0.0/library/src/main/java/io/opentelemetry/instrumentation/logback/v1_0_0/OpenTelemetryAppender.java index a2064a1f5a59..2ebc16087c61 100644 --- a/instrumentation/logback/logback-1.0.0/library/src/main/java/io/opentelemetry/instrumentation/logback/v1_0_0/OpenTelemetryAppender.java +++ b/instrumentation/logback/logback-1.0.0/library/src/main/java/io/opentelemetry/instrumentation/logback/v1_0_0/OpenTelemetryAppender.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.logback.v1_0_0; @@ -54,9 +43,7 @@ public static ILoggingEvent wrapEvent(ILoggingEvent event) { SpanContext spanContext = currentSpan.getContext(); contextData.put(TRACE_ID, spanContext.getTraceIdAsHexString()); contextData.put(SPAN_ID, spanContext.getSpanIdAsHexString()); - if (spanContext.isSampled()) { - contextData.put(SAMPLED, "true"); - } + contextData.put(SAMPLED, Boolean.toString(spanContext.isSampled())); if (eventContext == null) { eventContext = contextData; diff --git a/instrumentation/logback/logback-1.0.0/library/src/main/java/io/opentelemetry/instrumentation/logback/v1_0_0/internal/UnionMap.java b/instrumentation/logback/logback-1.0.0/library/src/main/java/io/opentelemetry/instrumentation/logback/v1_0_0/internal/UnionMap.java index 0a9885dd4743..51990ae902e6 100644 --- a/instrumentation/logback/logback-1.0.0/library/src/main/java/io/opentelemetry/instrumentation/logback/v1_0_0/internal/UnionMap.java +++ b/instrumentation/logback/logback-1.0.0/library/src/main/java/io/opentelemetry/instrumentation/logback/v1_0_0/internal/UnionMap.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.logback.v1_0_0.internal; diff --git a/instrumentation/logback/logback-1.0.0/library/src/test/groovy/io/opentelemetry/instrumentation/logback/v1_0_0/LogbackTest.groovy b/instrumentation/logback/logback-1.0.0/library/src/test/groovy/io/opentelemetry/instrumentation/logback/v1_0_0/LogbackTest.groovy index 23b85ea7fdf3..b1f8b7bfb3c2 100644 --- a/instrumentation/logback/logback-1.0.0/library/src/test/groovy/io/opentelemetry/instrumentation/logback/v1_0_0/LogbackTest.groovy +++ b/instrumentation/logback/logback-1.0.0/library/src/test/groovy/io/opentelemetry/instrumentation/logback/v1_0_0/LogbackTest.groovy @@ -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.logback.v1_0_0 diff --git a/instrumentation/logback/logback-1.0.0/library/src/test/groovy/io/opentelemetry/instrumentation/logback/v1_0_0/internal/UnionMapTest.groovy b/instrumentation/logback/logback-1.0.0/library/src/test/groovy/io/opentelemetry/instrumentation/logback/v1_0_0/internal/UnionMapTest.groovy index 43245193841f..2dc8ed7758ff 100644 --- a/instrumentation/logback/logback-1.0.0/library/src/test/groovy/io/opentelemetry/instrumentation/logback/v1_0_0/internal/UnionMapTest.groovy +++ b/instrumentation/logback/logback-1.0.0/library/src/test/groovy/io/opentelemetry/instrumentation/logback/v1_0_0/internal/UnionMapTest.groovy @@ -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.logback.v1_0_0.internal diff --git a/instrumentation/logback/logback-1.0.0/testing/src/main/groovy/io/opentelemetry/instrumentation/logback/v1_0_0/AbstractLogbackTest.groovy b/instrumentation/logback/logback-1.0.0/testing/src/main/groovy/io/opentelemetry/instrumentation/logback/v1_0_0/AbstractLogbackTest.groovy index 2c9488151932..943ce83ef3f3 100644 --- a/instrumentation/logback/logback-1.0.0/testing/src/main/groovy/io/opentelemetry/instrumentation/logback/v1_0_0/AbstractLogbackTest.groovy +++ b/instrumentation/logback/logback-1.0.0/testing/src/main/groovy/io/opentelemetry/instrumentation/logback/v1_0_0/AbstractLogbackTest.groovy @@ -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.logback.v1_0_0 diff --git a/instrumentation/mongo/mongo-3.1/src/main/java/io/opentelemetry/instrumentation/auto/mongo/v3_1/MongoClientInstrumentation.java b/instrumentation/mongo/mongo-3.1/src/main/java/io/opentelemetry/instrumentation/auto/mongo/v3_1/MongoClientInstrumentation.java index ca2595c401d3..e6b55d93d552 100644 --- a/instrumentation/mongo/mongo-3.1/src/main/java/io/opentelemetry/instrumentation/auto/mongo/v3_1/MongoClientInstrumentation.java +++ b/instrumentation/mongo/mongo-3.1/src/main/java/io/opentelemetry/instrumentation/auto/mongo/v3_1/MongoClientInstrumentation.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.mongo.v3_1; diff --git a/instrumentation/mongo/mongo-3.1/src/test/groovy/MongoClientTest.groovy b/instrumentation/mongo/mongo-3.1/src/test/groovy/MongoClientTest.groovy index ea3df072d841..a5339d5fdcc8 100644 --- a/instrumentation/mongo/mongo-3.1/src/test/groovy/MongoClientTest.groovy +++ b/instrumentation/mongo/mongo-3.1/src/test/groovy/MongoClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.PortUtils.UNUSABLE_PORT @@ -270,10 +259,10 @@ class MongoClientTest extends MongoBaseTest { def mongoSpan(TraceAssert trace, int index, String statement, String instance = "some-description", Object parentSpan = null, Throwable exception = null) { trace.span(index) { - operationName { it.replace(" ", "") == statement } - spanKind CLIENT + name { it.replace(" ", "") == statement } + kind CLIENT if (parentSpan == null) { - parent() + hasNoParent() } else { childOf((SpanData) parentSpan) } diff --git a/instrumentation/mongo/mongo-3.7/src/main/java/io/opentelemetry/instrumentation/auto/mongo/v3_7/MongoClientInstrumentation.java b/instrumentation/mongo/mongo-3.7/src/main/java/io/opentelemetry/instrumentation/auto/mongo/v3_7/MongoClientInstrumentation.java index 6da6a404b7fa..6c464f508b95 100644 --- a/instrumentation/mongo/mongo-3.7/src/main/java/io/opentelemetry/instrumentation/auto/mongo/v3_7/MongoClientInstrumentation.java +++ b/instrumentation/mongo/mongo-3.7/src/main/java/io/opentelemetry/instrumentation/auto/mongo/v3_7/MongoClientInstrumentation.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.mongo.v3_7; diff --git a/instrumentation/mongo/mongo-3.7/src/test/groovy/MongoClientTest.groovy b/instrumentation/mongo/mongo-3.7/src/test/groovy/MongoClientTest.groovy index c43e5cdc6af4..18507130e702 100644 --- a/instrumentation/mongo/mongo-3.7/src/test/groovy/MongoClientTest.groovy +++ b/instrumentation/mongo/mongo-3.7/src/test/groovy/MongoClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.PortUtils.UNUSABLE_PORT @@ -279,10 +268,10 @@ class MongoClientTest extends MongoBaseTest { def mongoSpan(TraceAssert trace, int index, String statement, String instance = "some-description", Object parentSpan = null, Throwable exception = null) { trace.span(index) { - operationName { it.replace(" ", "") == statement } - spanKind CLIENT + name { it.replace(" ", "") == statement } + kind CLIENT if (parentSpan == null) { - parent() + hasNoParent() } else { childOf((SpanData) parentSpan) } diff --git a/instrumentation/mongo/mongo-async-3.3/src/main/java/io/opentelemetry/instrumentation/auto/mongoasync/v3_3/MongoAsyncClientInstrumentation.java b/instrumentation/mongo/mongo-async-3.3/src/main/java/io/opentelemetry/instrumentation/auto/mongoasync/v3_3/MongoAsyncClientInstrumentation.java index 7b2bf3b1930d..bc07c162ad80 100644 --- a/instrumentation/mongo/mongo-async-3.3/src/main/java/io/opentelemetry/instrumentation/auto/mongoasync/v3_3/MongoAsyncClientInstrumentation.java +++ b/instrumentation/mongo/mongo-async-3.3/src/main/java/io/opentelemetry/instrumentation/auto/mongoasync/v3_3/MongoAsyncClientInstrumentation.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.mongoasync.v3_3; diff --git a/instrumentation/mongo/mongo-async-3.3/src/test/groovy/MongoAsyncClientTest.groovy b/instrumentation/mongo/mongo-async-3.3/src/test/groovy/MongoAsyncClientTest.groovy index 302d8a0c96b2..6b54e4da3c4e 100644 --- a/instrumentation/mongo/mongo-async-3.3/src/test/groovy/MongoAsyncClientTest.groovy +++ b/instrumentation/mongo/mongo-async-3.3/src/test/groovy/MongoAsyncClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace @@ -316,10 +305,10 @@ class MongoAsyncClientTest extends MongoBaseTest { def mongoSpan(TraceAssert trace, int index, Closure statementEval, String instance = "some-description", Object parentSpan = null, Throwable exception = null) { trace.span(index) { - operationName statementEval - spanKind CLIENT + name statementEval + kind CLIENT if (parentSpan == null) { - parent() + hasNoParent() } else { childOf((SpanData) parentSpan) } diff --git a/instrumentation/mongo/mongo-common/src/main/java/io/opentelemetry/instrumentation/auto/mongo/MongoClientTracer.java b/instrumentation/mongo/mongo-common/src/main/java/io/opentelemetry/instrumentation/auto/mongo/MongoClientTracer.java index f73ee4c74b7c..93636ee97c95 100644 --- a/instrumentation/mongo/mongo-common/src/main/java/io/opentelemetry/instrumentation/auto/mongo/MongoClientTracer.java +++ b/instrumentation/mongo/mongo-common/src/main/java/io/opentelemetry/instrumentation/auto/mongo/MongoClientTracer.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.mongo; diff --git a/instrumentation/mongo/mongo-common/src/main/java/io/opentelemetry/instrumentation/auto/mongo/TracingCommandListener.java b/instrumentation/mongo/mongo-common/src/main/java/io/opentelemetry/instrumentation/auto/mongo/TracingCommandListener.java index b39f8909c728..5191752abb8c 100644 --- a/instrumentation/mongo/mongo-common/src/main/java/io/opentelemetry/instrumentation/auto/mongo/TracingCommandListener.java +++ b/instrumentation/mongo/mongo-common/src/main/java/io/opentelemetry/instrumentation/auto/mongo/TracingCommandListener.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.mongo; diff --git a/instrumentation/mongo/mongo-testing/src/main/groovy/MongoBaseTest.groovy b/instrumentation/mongo/mongo-testing/src/main/groovy/MongoBaseTest.groovy index 15fad1ab7544..7c5ece1f7fd4 100644 --- a/instrumentation/mongo/mongo-testing/src/main/groovy/MongoBaseTest.groovy +++ b/instrumentation/mongo/mongo-testing/src/main/groovy/MongoBaseTest.groovy @@ -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 */ import de.flapdoodle.embed.mongo.MongodExecutable diff --git a/instrumentation/netty/netty-3.8/src/latestDepTest/groovy/Netty38ClientTest.groovy b/instrumentation/netty/netty-3.8/src/latestDepTest/groovy/Netty38ClientTest.groovy index 4fa90d112c42..6f78797abfc3 100644 --- a/instrumentation/netty/netty-3.8/src/latestDepTest/groovy/Netty38ClientTest.groovy +++ b/instrumentation/netty/netty-3.8/src/latestDepTest/groovy/Netty38ClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.PortUtils.UNUSABLE_PORT @@ -93,7 +82,7 @@ class Netty38ClientTest extends HttpClientTest { basicSpan(it, 0, "parent", null, thrownException) span(1) { - operationName "CONNECT" + name "CONNECT" childOf span(0) errored true Class errorClass = ConnectException diff --git a/instrumentation/netty/netty-3.8/src/latestDepTest/groovy/Netty38ServerTest.groovy b/instrumentation/netty/netty-3.8/src/latestDepTest/groovy/Netty38ServerTest.groovy index d95ef94342cb..302027fe95a4 100644 --- a/instrumentation/netty/netty-3.8/src/latestDepTest/groovy/Netty38ServerTest.groovy +++ b/instrumentation/netty/netty-3.8/src/latestDepTest/groovy/Netty38ServerTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.ERROR diff --git a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/AbstractNettyAdvice.java b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/AbstractNettyAdvice.java index 90f5407311da..a74e3dba12b2 100644 --- a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/AbstractNettyAdvice.java +++ b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/AbstractNettyAdvice.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.netty.v3_8; diff --git a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/ChannelFutureListenerInstrumentation.java b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/ChannelFutureListenerInstrumentation.java index 82b6bd17d9d8..bec6001d1d89 100644 --- a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/ChannelFutureListenerInstrumentation.java +++ b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/ChannelFutureListenerInstrumentation.java @@ -1,30 +1,20 @@ /* * 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.netty.v3_8; +import static io.opentelemetry.context.ContextUtils.withScopedContext; import static io.opentelemetry.javaagent.tooling.ClassLoaderMatcher.hasClassesNamed; import static io.opentelemetry.javaagent.tooling.bytebuddy.matcher.AgentElementMatchers.implementsInterface; -import static io.opentelemetry.trace.TracingContextUtils.currentContextWith; import static java.util.Collections.singletonMap; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import static net.bytebuddy.matcher.ElementMatchers.named; import static net.bytebuddy.matcher.ElementMatchers.takesArgument; import com.google.auto.service.AutoService; +import io.grpc.Context; import io.opentelemetry.context.Scope; import io.opentelemetry.instrumentation.auto.api.ContextStore; import io.opentelemetry.instrumentation.auto.api.InstrumentationContext; @@ -105,15 +95,16 @@ public static Scope activateScope(@Advice.Argument(0) ChannelFuture future) { ContextStore contextStore = InstrumentationContext.get(Channel.class, ChannelTraceContext.class); - Span continuation = + Context parentContext = contextStore .putIfAbsent(future.getChannel(), ChannelTraceContext.Factory.INSTANCE) - .getConnectionContinuation(); - contextStore.get(future.getChannel()).setConnectionContinuation(null); - if (continuation == null) { + .getConnectionContext(); + contextStore.get(future.getChannel()).setConnectionContext(null); + if (parentContext == null) { return null; } - Scope parentScope = currentContextWith(continuation); + // TODO pass Context into Tracer.startSpan() and then don't need this scoping + Scope parentScope = withScopedContext(parentContext); Span errorSpan = NettyHttpClientTracer.TRACER.startSpan("CONNECT", Kind.CLIENT); NettyHttpClientTracer.TRACER.endExceptionally(errorSpan, cause); return parentScope; diff --git a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/ChannelTraceContext.java b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/ChannelTraceContext.java index f304428c2fd5..f7104f9db5c9 100644 --- a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/ChannelTraceContext.java +++ b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/ChannelTraceContext.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.netty.v3_8; @@ -31,26 +20,17 @@ public ChannelTraceContext create() { } } - private Span connectionContinuation; - private Span serverSpan; + private Context connectionContext; private Span clientSpan; - private Span clientParentSpan; + private Context clientParentContext; private Context context; - public Span getConnectionContinuation() { - return connectionContinuation; + public Context getConnectionContext() { + return connectionContext; } - public void setConnectionContinuation(Span connectionContinuation) { - this.connectionContinuation = connectionContinuation; - } - - public Span getServerSpan() { - return serverSpan; - } - - public void setServerSpan(Span serverSpan) { - this.serverSpan = serverSpan; + public void setConnectionContext(Context connectionContinuation) { + this.connectionContext = connectionContinuation; } public Span getClientSpan() { @@ -61,12 +41,12 @@ public void setClientSpan(Span clientSpan) { this.clientSpan = clientSpan; } - public Span getClientParentSpan() { - return clientParentSpan; + public Context getClientParentContext() { + return clientParentContext; } - public void setClientParentSpan(Span clientParentSpan) { - this.clientParentSpan = clientParentSpan; + public void setClientParentContext(Context clientParentContext) { + this.clientParentContext = clientParentContext; } public Context getContext() { @@ -86,15 +66,14 @@ public boolean equals(Object o) { return false; } ChannelTraceContext that = (ChannelTraceContext) o; - return Objects.equals(connectionContinuation, that.connectionContinuation) - && Objects.equals(serverSpan, that.serverSpan) + return Objects.equals(connectionContext, that.connectionContext) && Objects.equals(clientSpan, that.clientSpan) - && Objects.equals(clientParentSpan, that.clientParentSpan) + && Objects.equals(clientParentContext, that.clientParentContext) && Objects.equals(context, that.context); } @Override public int hashCode() { - return Objects.hash(connectionContinuation, serverSpan, clientSpan, clientParentSpan, context); + return Objects.hash(connectionContext, clientSpan, clientParentContext, context); } } diff --git a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/NettyChannelInstrumentation.java b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/NettyChannelInstrumentation.java index 95c31bce0740..a0d9be6b6af6 100644 --- a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/NettyChannelInstrumentation.java +++ b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/NettyChannelInstrumentation.java @@ -1,31 +1,21 @@ /* * 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.netty.v3_8; import static io.opentelemetry.javaagent.tooling.ClassLoaderMatcher.hasClassesNamed; import static io.opentelemetry.javaagent.tooling.bytebuddy.matcher.AgentElementMatchers.implementsInterface; +import static io.opentelemetry.trace.TracingContextUtils.getSpan; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import static net.bytebuddy.matcher.ElementMatchers.named; import static net.bytebuddy.matcher.ElementMatchers.returns; import com.google.auto.service.AutoService; +import io.grpc.Context; import io.opentelemetry.instrumentation.auto.api.ContextStore; import io.opentelemetry.instrumentation.auto.api.InstrumentationContext; -import io.opentelemetry.instrumentation.auto.netty.v3_8.server.NettyHttpServerTracer; import io.opentelemetry.javaagent.tooling.Instrumenter; import io.opentelemetry.trace.Span; import java.util.Collections; @@ -87,16 +77,17 @@ public Map contextStore() { public static class ChannelConnectAdvice extends AbstractNettyAdvice { @Advice.OnMethodEnter public static void addConnectContinuation(@Advice.This Channel channel) { - Span span = NettyHttpServerTracer.TRACER.getCurrentSpan(); + Context context = Context.current(); + Span span = getSpan(context); if (span.getContext().isValid()) { ContextStore contextStore = InstrumentationContext.get(Channel.class, ChannelTraceContext.class); if (contextStore .putIfAbsent(channel, ChannelTraceContext.Factory.INSTANCE) - .getConnectionContinuation() + .getConnectionContext() == null) { - contextStore.get(channel).setConnectionContinuation(span); + contextStore.get(channel).setConnectionContext(context); } } } diff --git a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/NettyChannelPipelineInstrumentation.java b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/NettyChannelPipelineInstrumentation.java index 66141203d378..3160cb41334c 100644 --- a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/NettyChannelPipelineInstrumentation.java +++ b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/NettyChannelPipelineInstrumentation.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.netty.v3_8; diff --git a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/client/HttpClientRequestTracingHandler.java b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/client/HttpClientRequestTracingHandler.java index e7f66eb149fe..8b3a744ead44 100644 --- a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/client/HttpClientRequestTracingHandler.java +++ b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/client/HttpClientRequestTracingHandler.java @@ -1,24 +1,14 @@ /* * 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.netty.v3_8.client; +import static io.opentelemetry.context.ContextUtils.withScopedContext; import static io.opentelemetry.instrumentation.auto.netty.v3_8.client.NettyHttpClientTracer.TRACER; -import static io.opentelemetry.trace.TracingContextUtils.currentContextWith; +import io.grpc.Context; import io.opentelemetry.context.Scope; import io.opentelemetry.instrumentation.api.tracer.utils.NetPeerUtils; import io.opentelemetry.instrumentation.auto.api.ContextStore; @@ -49,13 +39,14 @@ public void writeRequested(ChannelHandlerContext ctx, MessageEvent msg) { ChannelTraceContext channelTraceContext = contextStore.putIfAbsent(ctx.getChannel(), ChannelTraceContext.Factory.INSTANCE); + // TODO pass Context into Tracer.startSpan() and then don't need this scoping Scope parentScope = null; - Span continuation = channelTraceContext.getConnectionContinuation(); - if (continuation != null) { - parentScope = currentContextWith(continuation); - channelTraceContext.setConnectionContinuation(null); + Context parentContext = channelTraceContext.getConnectionContext(); + if (parentContext != null) { + parentScope = withScopedContext(parentContext); + channelTraceContext.setConnectionContext(null); } - channelTraceContext.setClientParentSpan(TRACER.getCurrentSpan()); + channelTraceContext.setClientParentContext(Context.current()); HttpRequest request = (HttpRequest) msg.getMessage(); diff --git a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/client/HttpClientResponseTracingHandler.java b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/client/HttpClientResponseTracingHandler.java index df7b307401db..0cf0d5316980 100644 --- a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/client/HttpClientResponseTracingHandler.java +++ b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/client/HttpClientResponseTracingHandler.java @@ -1,29 +1,18 @@ /* * 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.netty.v3_8.client; +import static io.opentelemetry.context.ContextUtils.withScopedContext; import static io.opentelemetry.instrumentation.auto.netty.v3_8.client.NettyHttpClientTracer.TRACER; +import io.grpc.Context; import io.opentelemetry.context.Scope; import io.opentelemetry.instrumentation.auto.api.ContextStore; import io.opentelemetry.instrumentation.auto.netty.v3_8.ChannelTraceContext; -import io.opentelemetry.trace.DefaultSpan; import io.opentelemetry.trace.Span; -import io.opentelemetry.trace.TracingContextUtils; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.jboss.netty.channel.MessageEvent; @@ -43,11 +32,7 @@ public void messageReceived(ChannelHandlerContext ctx, MessageEvent msg) { ChannelTraceContext channelTraceContext = contextStore.putIfAbsent(ctx.getChannel(), ChannelTraceContext.Factory.INSTANCE); - Span parent = channelTraceContext.getClientParentSpan(); - if (parent == null) { - parent = DefaultSpan.getInvalid(); - channelTraceContext.setClientParentSpan(DefaultSpan.getInvalid()); - } + Context parentContext = channelTraceContext.getClientParentContext(); Span span = channelTraceContext.getClientSpan(); boolean finishSpan = msg.getMessage() instanceof HttpResponse; @@ -57,7 +42,11 @@ public void messageReceived(ChannelHandlerContext ctx, MessageEvent msg) { } // We want the callback in the scope of the parent, not the client span - try (Scope scope = TracingContextUtils.currentContextWith(parent)) { + if (parentContext != null) { + try (Scope ignored = withScopedContext(parentContext)) { + ctx.sendUpstream(msg); + } + } else { ctx.sendUpstream(msg); } } diff --git a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/client/HttpClientTracingHandler.java b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/client/HttpClientTracingHandler.java index 0d30c8de2566..92a079b3f225 100644 --- a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/client/HttpClientTracingHandler.java +++ b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/client/HttpClientTracingHandler.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.netty.v3_8.client; diff --git a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/client/NettyHttpClientTracer.java b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/client/NettyHttpClientTracer.java index 6f74cecb5ef4..ba4e1b830bcb 100644 --- a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/client/NettyHttpClientTracer.java +++ b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/client/NettyHttpClientTracer.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.netty.v3_8.client; diff --git a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/client/NettyResponseInjectAdapter.java b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/client/NettyResponseInjectAdapter.java index f244ad7176a4..d476ae858ad5 100644 --- a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/client/NettyResponseInjectAdapter.java +++ b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/client/NettyResponseInjectAdapter.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.netty.v3_8.client; diff --git a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/server/HttpServerRequestTracingHandler.java b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/server/HttpServerRequestTracingHandler.java index c5583d1a68c3..9f9769a19cae 100644 --- a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/server/HttpServerRequestTracingHandler.java +++ b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/server/HttpServerRequestTracingHandler.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.netty.v3_8.server; @@ -44,11 +33,11 @@ public void messageReceived(ChannelHandlerContext ctx, MessageEvent msg) { contextStore.putIfAbsent(ctx.getChannel(), ChannelTraceContext.Factory.INSTANCE); if (!(msg.getMessage() instanceof HttpRequest)) { - Context serverSpanContext = TRACER.getServerContext(channelTraceContext); - if (serverSpanContext == null) { + Context serverContext = TRACER.getServerContext(channelTraceContext); + if (serverContext == null) { ctx.sendUpstream(msg); } else { - try (Scope ignored = ContextUtils.withScopedContext(serverSpanContext)) { + try (Scope ignored = ContextUtils.withScopedContext(serverContext)) { ctx.sendUpstream(msg); } } diff --git a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/server/HttpServerResponseTracingHandler.java b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/server/HttpServerResponseTracingHandler.java index 06ccbc949c59..f0d74ef59fe1 100644 --- a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/server/HttpServerResponseTracingHandler.java +++ b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/server/HttpServerResponseTracingHandler.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.netty.v3_8.server; diff --git a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/server/HttpServerTracingHandler.java b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/server/HttpServerTracingHandler.java index 49ff9f667629..f00871e983ad 100644 --- a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/server/HttpServerTracingHandler.java +++ b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/server/HttpServerTracingHandler.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.netty.v3_8.server; diff --git a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/server/NettyHttpServerTracer.java b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/server/NettyHttpServerTracer.java index 1209e73ec2f3..9bb1a2a71666 100644 --- a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/server/NettyHttpServerTracer.java +++ b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/server/NettyHttpServerTracer.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.netty.v3_8.server; diff --git a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/server/NettyRequestExtractAdapter.java b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/server/NettyRequestExtractAdapter.java index fa687502b6ec..421cb9912d71 100644 --- a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/server/NettyRequestExtractAdapter.java +++ b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/server/NettyRequestExtractAdapter.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.netty.v3_8.server; diff --git a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/util/CombinedSimpleChannelHandler.java b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/util/CombinedSimpleChannelHandler.java index cea7cf593520..ef156f1b48ef 100644 --- a/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/util/CombinedSimpleChannelHandler.java +++ b/instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/instrumentation/auto/netty/v3_8/util/CombinedSimpleChannelHandler.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.netty.v3_8.util; diff --git a/instrumentation/netty/netty-3.8/src/test/groovy/Netty38ClientTest.groovy b/instrumentation/netty/netty-3.8/src/test/groovy/Netty38ClientTest.groovy index 506954b79aad..14c1655c5a72 100644 --- a/instrumentation/netty/netty-3.8/src/test/groovy/Netty38ClientTest.groovy +++ b/instrumentation/netty/netty-3.8/src/test/groovy/Netty38ClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.PortUtils.UNUSABLE_PORT @@ -93,7 +82,7 @@ class Netty38ClientTest extends HttpClientTest { basicSpan(it, 0, "parent", null, thrownException) span(1) { - operationName "CONNECT" + name "CONNECT" childOf span(0) errored true Class errorClass = ConnectException diff --git a/instrumentation/netty/netty-3.8/src/test/groovy/Netty38ServerTest.groovy b/instrumentation/netty/netty-3.8/src/test/groovy/Netty38ServerTest.groovy index 3a4f1a279eb0..caa0d784acf7 100644 --- a/instrumentation/netty/netty-3.8/src/test/groovy/Netty38ServerTest.groovy +++ b/instrumentation/netty/netty-3.8/src/test/groovy/Netty38ServerTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.ERROR diff --git a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/AttributeKeys.java b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/AttributeKeys.java index 5d00fa9a4d57..e3da07d978c9 100644 --- a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/AttributeKeys.java +++ b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/AttributeKeys.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.netty.v4_0; @@ -37,8 +26,8 @@ public ConcurrentMap> get(ClassLoader ignore) { } }; - public static final AttributeKey PARENT_CONNECT_SPAN_ATTRIBUTE_KEY = - attributeKey("io.opentelemetry.instrumentation.auto.netty.v4_0.parent.connect.span"); + public static final AttributeKey PARENT_CONNECT_CONTEXT_ATTRIBUTE_KEY = + attributeKey("io.opentelemetry.instrumentation.auto.netty.v4_0.parent.connect.context"); public static final AttributeKey SERVER_ATTRIBUTE_KEY = attributeKey(HttpServerTracingHandler.class.getName() + ".context"); @@ -46,7 +35,7 @@ public ConcurrentMap> get(ClassLoader ignore) { public static final AttributeKey CLIENT_ATTRIBUTE_KEY = attributeKey(HttpClientTracingHandler.class.getName() + ".span"); - public static final AttributeKey CLIENT_PARENT_ATTRIBUTE_KEY = + public static final AttributeKey CLIENT_PARENT_ATTRIBUTE_KEY = attributeKey(HttpClientTracingHandler.class.getName() + ".parent"); /** diff --git a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/ChannelFutureListenerInstrumentation.java b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/ChannelFutureListenerInstrumentation.java index 236b172dac86..d0159538755a 100644 --- a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/ChannelFutureListenerInstrumentation.java +++ b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/ChannelFutureListenerInstrumentation.java @@ -1,30 +1,20 @@ /* * 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.netty.v4_0; +import static io.opentelemetry.context.ContextUtils.withScopedContext; import static io.opentelemetry.javaagent.tooling.ClassLoaderMatcher.hasClassesNamed; import static io.opentelemetry.javaagent.tooling.bytebuddy.matcher.AgentElementMatchers.implementsInterface; -import static io.opentelemetry.trace.TracingContextUtils.currentContextWith; import static java.util.Collections.singletonMap; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import static net.bytebuddy.matcher.ElementMatchers.named; import static net.bytebuddy.matcher.ElementMatchers.takesArgument; import com.google.auto.service.AutoService; +import io.grpc.Context; import io.netty.channel.ChannelFuture; import io.opentelemetry.context.Scope; import io.opentelemetry.instrumentation.auto.netty.v4_0.client.NettyHttpClientTracer; @@ -98,12 +88,12 @@ public static Scope activateScope(@Advice.Argument(0) ChannelFuture future) { if (cause == null) { return null; } - Span parentSpan = - future.channel().attr(AttributeKeys.PARENT_CONNECT_SPAN_ATTRIBUTE_KEY).getAndRemove(); - if (parentSpan == null) { + Context parentContext = + future.channel().attr(AttributeKeys.PARENT_CONNECT_CONTEXT_ATTRIBUTE_KEY).getAndRemove(); + if (parentContext == null) { return null; } - Scope parentScope = currentContextWith(parentSpan); + Scope parentScope = withScopedContext(parentContext); Span span = NettyHttpClientTracer.TRACER.startSpan("CONNECT", Kind.CLIENT); NettyHttpClientTracer.TRACER.endExceptionally(span, cause); return parentScope; diff --git a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/NettyChannelPipelineInstrumentation.java b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/NettyChannelPipelineInstrumentation.java index 77218bf0dd6f..2c396d9a5edf 100644 --- a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/NettyChannelPipelineInstrumentation.java +++ b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/NettyChannelPipelineInstrumentation.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.netty.v4_0; @@ -25,6 +14,7 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArgument; import com.google.auto.service.AutoService; +import io.grpc.Context; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelPipeline; import io.netty.handler.codec.http.HttpClientCodec; @@ -41,9 +31,7 @@ import io.opentelemetry.instrumentation.auto.netty.v4_0.server.HttpServerRequestTracingHandler; import io.opentelemetry.instrumentation.auto.netty.v4_0.server.HttpServerResponseTracingHandler; import io.opentelemetry.instrumentation.auto.netty.v4_0.server.HttpServerTracingHandler; -import io.opentelemetry.instrumentation.auto.netty.v4_0.server.NettyHttpServerTracer; import io.opentelemetry.javaagent.tooling.Instrumenter; -import io.opentelemetry.trace.Span; import java.util.HashMap; import java.util.Map; import net.bytebuddy.asm.Advice; @@ -163,12 +151,10 @@ public static void addHandler( public static class ChannelPipelineConnectAdvice { @Advice.OnMethodEnter public static void addParentSpan(@Advice.This ChannelPipeline pipeline) { - Span span = NettyHttpServerTracer.TRACER.getCurrentSpan(); - if (span.getContext().isValid()) { - Attribute attribute = - pipeline.channel().attr(AttributeKeys.PARENT_CONNECT_SPAN_ATTRIBUTE_KEY); - attribute.compareAndSet(null, span); - } + Context context = Context.current(); + Attribute attribute = + pipeline.channel().attr(AttributeKeys.PARENT_CONNECT_CONTEXT_ATTRIBUTE_KEY); + attribute.compareAndSet(null, context); } } } diff --git a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/client/HttpClientRequestTracingHandler.java b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/client/HttpClientRequestTracingHandler.java index ea1107fc1de2..73ad2258be00 100644 --- a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/client/HttpClientRequestTracingHandler.java +++ b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/client/HttpClientRequestTracingHandler.java @@ -1,24 +1,14 @@ /* * 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.netty.v4_0.client; +import static io.opentelemetry.context.ContextUtils.withScopedContext; import static io.opentelemetry.instrumentation.auto.netty.v4_0.client.NettyHttpClientTracer.TRACER; -import static io.opentelemetry.trace.TracingContextUtils.currentContextWith; +import io.grpc.Context; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelOutboundHandlerAdapter; import io.netty.channel.ChannelPromise; @@ -38,21 +28,17 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise prm) { return; } + // TODO pass Context into Tracer.startSpan() and then don't need this scoping Scope parentScope = null; - Span parentSpan = - ctx.channel().attr(AttributeKeys.PARENT_CONNECT_SPAN_ATTRIBUTE_KEY).getAndRemove(); - if (parentSpan != null) { - parentScope = currentContextWith(parentSpan); + Context parentContext = + ctx.channel().attr(AttributeKeys.PARENT_CONNECT_CONTEXT_ATTRIBUTE_KEY).getAndRemove(); + if (parentContext != null) { + parentScope = withScopedContext(parentContext); } HttpRequest request = (HttpRequest) msg; - Span currentSpan = TRACER.getCurrentSpan(); - if (currentSpan.getContext().isValid()) { - ctx.channel().attr(AttributeKeys.CLIENT_PARENT_ATTRIBUTE_KEY).set(currentSpan); - } else { - ctx.channel().attr(AttributeKeys.CLIENT_PARENT_ATTRIBUTE_KEY).set(null); - } + ctx.channel().attr(AttributeKeys.CLIENT_PARENT_ATTRIBUTE_KEY).set(Context.current()); Span span = TRACER.startSpan(request); NetPeerUtils.setNetPeer(span, (InetSocketAddress) ctx.channel().remoteAddress()); diff --git a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/client/HttpClientResponseTracingHandler.java b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/client/HttpClientResponseTracingHandler.java index a14234a75406..0b80eb08534b 100644 --- a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/client/HttpClientResponseTracingHandler.java +++ b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/client/HttpClientResponseTracingHandler.java @@ -1,40 +1,29 @@ /* * 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.netty.v4_0.client; +import static io.opentelemetry.context.ContextUtils.withScopedContext; import static io.opentelemetry.instrumentation.auto.netty.v4_0.client.NettyHttpClientTracer.TRACER; import static io.opentelemetry.trace.TracingContextUtils.currentContextWith; +import io.grpc.Context; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.http.HttpResponse; import io.netty.util.Attribute; import io.opentelemetry.context.Scope; import io.opentelemetry.instrumentation.auto.netty.v4_0.AttributeKeys; -import io.opentelemetry.trace.DefaultSpan; import io.opentelemetry.trace.Span; public class HttpClientResponseTracingHandler extends ChannelInboundHandlerAdapter { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { - Attribute parentAttr = ctx.channel().attr(AttributeKeys.CLIENT_PARENT_ATTRIBUTE_KEY); - parentAttr.setIfAbsent(DefaultSpan.getInvalid()); - Span parent = parentAttr.get(); + Attribute parentAttr = ctx.channel().attr(AttributeKeys.CLIENT_PARENT_ATTRIBUTE_KEY); + Context parentContext = parentAttr.get(); Span span = ctx.channel().attr(AttributeKeys.CLIENT_ATTRIBUTE_KEY).get(); boolean finishSpan = msg instanceof HttpResponse; @@ -46,7 +35,11 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) { } // We want the callback in the scope of the parent, not the client span - try (Scope scope = currentContextWith(parent)) { + if (parentContext != null) { + try (Scope ignored = withScopedContext(parentContext)) { + ctx.fireChannelRead(msg); + } + } else { ctx.fireChannelRead(msg); } } diff --git a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/client/HttpClientTracingHandler.java b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/client/HttpClientTracingHandler.java index fda7bfc667a2..c37e8cc00e76 100644 --- a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/client/HttpClientTracingHandler.java +++ b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/client/HttpClientTracingHandler.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.netty.v4_0.client; diff --git a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/client/NettyHttpClientTracer.java b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/client/NettyHttpClientTracer.java index 2832774a3d5f..d37076ad16e7 100644 --- a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/client/NettyHttpClientTracer.java +++ b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/client/NettyHttpClientTracer.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.netty.v4_0.client; diff --git a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/client/NettyResponseInjectAdapter.java b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/client/NettyResponseInjectAdapter.java index 0a47f732cbd4..eb219ca8dc2c 100644 --- a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/client/NettyResponseInjectAdapter.java +++ b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/client/NettyResponseInjectAdapter.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.netty.v4_0.client; diff --git a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/server/HttpServerRequestTracingHandler.java b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/server/HttpServerRequestTracingHandler.java index 4bfd38292130..872b61a9888e 100644 --- a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/server/HttpServerRequestTracingHandler.java +++ b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/server/HttpServerRequestTracingHandler.java @@ -1,24 +1,14 @@ /* * 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.netty.v4_0.server; +import static io.opentelemetry.context.ContextUtils.withScopedContext; import static io.opentelemetry.instrumentation.auto.netty.v4_0.server.NettyHttpServerTracer.TRACER; -import static io.opentelemetry.trace.TracingContextUtils.currentContextWith; +import io.grpc.Context; import io.netty.channel.Channel; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; @@ -33,11 +23,11 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) { Channel channel = ctx.channel(); if (!(msg instanceof HttpRequest)) { - Span serverSpan = TRACER.getServerSpan(channel); - if (serverSpan == null) { + Context serverContext = TRACER.getServerContext(channel); + if (serverContext == null) { ctx.fireChannelRead(msg); } else { - try (Scope ignored = currentContextWith(serverSpan)) { + try (Scope ignored = withScopedContext(serverContext)) { ctx.fireChannelRead(msg); } } diff --git a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/server/HttpServerResponseTracingHandler.java b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/server/HttpServerResponseTracingHandler.java index 7890f65c9474..87075fe59669 100644 --- a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/server/HttpServerResponseTracingHandler.java +++ b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/server/HttpServerResponseTracingHandler.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.netty.v4_0.server; diff --git a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/server/HttpServerTracingHandler.java b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/server/HttpServerTracingHandler.java index 157a76d371d6..bdc6e86adbf7 100644 --- a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/server/HttpServerTracingHandler.java +++ b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/server/HttpServerTracingHandler.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.netty.v4_0.server; diff --git a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/server/NettyHttpServerTracer.java b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/server/NettyHttpServerTracer.java index c98c03ee83bf..ce6d6e7cee8e 100644 --- a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/server/NettyHttpServerTracer.java +++ b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/server/NettyHttpServerTracer.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.netty.v4_0.server; diff --git a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/server/NettyRequestExtractAdapter.java b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/server/NettyRequestExtractAdapter.java index 4a2c52f69f1e..10ea95af25bb 100644 --- a/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/server/NettyRequestExtractAdapter.java +++ b/instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_0/server/NettyRequestExtractAdapter.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.netty.v4_0.server; diff --git a/instrumentation/netty/netty-4.0/src/test/groovy/Netty40ClientTest.groovy b/instrumentation/netty/netty-4.0/src/test/groovy/Netty40ClientTest.groovy index 2ecfe7db504e..087a84f5492e 100644 --- a/instrumentation/netty/netty-4.0/src/test/groovy/Netty40ClientTest.groovy +++ b/instrumentation/netty/netty-4.0/src/test/groovy/Netty40ClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.PortUtils.UNUSABLE_PORT @@ -97,7 +86,7 @@ class Netty40ClientTest extends HttpClientTest { // for up to a total of 10 seconds (default connection time limit) for (def i = 1; i < size; i++) { span(i) { - operationName "CONNECT" + name "CONNECT" childOf span(0) errored true Class errorClass = ConnectException diff --git a/instrumentation/netty/netty-4.0/src/test/groovy/Netty40ServerTest.groovy b/instrumentation/netty/netty-4.0/src/test/groovy/Netty40ServerTest.groovy index 5549b0e87bb3..5f991d2d33ed 100644 --- a/instrumentation/netty/netty-4.0/src/test/groovy/Netty40ServerTest.groovy +++ b/instrumentation/netty/netty-4.0/src/test/groovy/Netty40ServerTest.groovy @@ -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 */ import static io.netty.handler.codec.http.HttpHeaders.Names.CONTENT_LENGTH diff --git a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/AttributeKeys.java b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/AttributeKeys.java index 26361f48252c..6d2c87ec4ab7 100644 --- a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/AttributeKeys.java +++ b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/AttributeKeys.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.netty.v4_1; @@ -52,7 +41,7 @@ public ConcurrentMap> get(ClassLoader ignore) { public static final AttributeKey CLIENT_ATTRIBUTE_KEY = attributeKey(HttpClientTracingHandler.class.getName() + ".span"); - public static final AttributeKey CLIENT_PARENT_ATTRIBUTE_KEY = + public static final AttributeKey CLIENT_PARENT_ATTRIBUTE_KEY = attributeKey(HttpClientTracingHandler.class.getName() + ".parent"); /** diff --git a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/ChannelFutureListenerInstrumentation.java b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/ChannelFutureListenerInstrumentation.java index f424758aa589..1eba34a953ca 100644 --- a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/ChannelFutureListenerInstrumentation.java +++ b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/ChannelFutureListenerInstrumentation.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.netty.v4_1; diff --git a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/NettyChannelPipelineInstrumentation.java b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/NettyChannelPipelineInstrumentation.java index 73980f2a8848..4a587fe96c06 100644 --- a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/NettyChannelPipelineInstrumentation.java +++ b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/NettyChannelPipelineInstrumentation.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.netty.v4_1; diff --git a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/client/HttpClientRequestTracingHandler.java b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/client/HttpClientRequestTracingHandler.java index 51da5edee32a..34d6db66257b 100644 --- a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/client/HttpClientRequestTracingHandler.java +++ b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/client/HttpClientRequestTracingHandler.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.netty.v4_1.client; @@ -39,22 +28,17 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise prm) { return; } + // TODO pass Context into Tracer.startSpan() and then don't need this scoping Scope parentScope = null; Context parentContext = ctx.channel().attr(AttributeKeys.PARENT_CONNECT_CONTEXT_ATTRIBUTE_KEY).getAndRemove(); if (parentContext != null) { - // TODO (trask) if null then do with ROOT scope? parentScope = withScopedContext(parentContext); } HttpRequest request = (HttpRequest) msg; - Span currentSpan = TRACER.getCurrentSpan(); - if (currentSpan.getContext().isValid()) { - ctx.channel().attr(AttributeKeys.CLIENT_PARENT_ATTRIBUTE_KEY).set(currentSpan); - } else { - ctx.channel().attr(AttributeKeys.CLIENT_PARENT_ATTRIBUTE_KEY).set(null); - } + ctx.channel().attr(AttributeKeys.CLIENT_PARENT_ATTRIBUTE_KEY).set(Context.current()); Span span = TRACER.startSpan(request); NetPeerUtils.setNetPeer(span, (InetSocketAddress) ctx.channel().remoteAddress()); diff --git a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/client/HttpClientResponseTracingHandler.java b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/client/HttpClientResponseTracingHandler.java index 87b58d10a7a7..db8ff3d16398 100644 --- a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/client/HttpClientResponseTracingHandler.java +++ b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/client/HttpClientResponseTracingHandler.java @@ -1,40 +1,29 @@ /* * 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.netty.v4_1.client; +import static io.opentelemetry.context.ContextUtils.withScopedContext; import static io.opentelemetry.instrumentation.auto.netty.v4_1.client.NettyHttpClientTracer.TRACER; import static io.opentelemetry.trace.TracingContextUtils.currentContextWith; +import io.grpc.Context; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.http.HttpResponse; import io.netty.util.Attribute; import io.opentelemetry.context.Scope; import io.opentelemetry.instrumentation.auto.netty.v4_1.AttributeKeys; -import io.opentelemetry.trace.DefaultSpan; import io.opentelemetry.trace.Span; public class HttpClientResponseTracingHandler extends ChannelInboundHandlerAdapter { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { - Attribute parentAttr = ctx.channel().attr(AttributeKeys.CLIENT_PARENT_ATTRIBUTE_KEY); - parentAttr.setIfAbsent(DefaultSpan.getInvalid()); - Span parent = parentAttr.get(); + Attribute parentAttr = ctx.channel().attr(AttributeKeys.CLIENT_PARENT_ATTRIBUTE_KEY); + Context parentContext = parentAttr.get(); Span span = ctx.channel().attr(AttributeKeys.CLIENT_ATTRIBUTE_KEY).get(); boolean finishSpan = msg instanceof HttpResponse; @@ -46,7 +35,11 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) { } // We want the callback in the scope of the parent, not the client span - try (Scope scope = currentContextWith(parent)) { + if (parentContext != null) { + try (Scope ignored = withScopedContext(parentContext)) { + ctx.fireChannelRead(msg); + } + } else { ctx.fireChannelRead(msg); } } diff --git a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/client/HttpClientTracingHandler.java b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/client/HttpClientTracingHandler.java index a63a47c5f1ac..f9de167a630a 100644 --- a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/client/HttpClientTracingHandler.java +++ b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/client/HttpClientTracingHandler.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.netty.v4_1.client; diff --git a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/client/NettyHttpClientTracer.java b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/client/NettyHttpClientTracer.java index 4d18293d939b..e7591a9dca6f 100644 --- a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/client/NettyHttpClientTracer.java +++ b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/client/NettyHttpClientTracer.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.netty.v4_1.client; diff --git a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/client/NettyResponseInjectAdapter.java b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/client/NettyResponseInjectAdapter.java index 012362706fa6..7bfc49216b1f 100644 --- a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/client/NettyResponseInjectAdapter.java +++ b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/client/NettyResponseInjectAdapter.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.netty.v4_1.client; diff --git a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/server/HttpServerRequestTracingHandler.java b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/server/HttpServerRequestTracingHandler.java index b7a84f3cd8c7..749595cecabb 100644 --- a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/server/HttpServerRequestTracingHandler.java +++ b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/server/HttpServerRequestTracingHandler.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.netty.v4_1.server; diff --git a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/server/HttpServerResponseTracingHandler.java b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/server/HttpServerResponseTracingHandler.java index e6628eec33f1..ca20bec903bb 100644 --- a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/server/HttpServerResponseTracingHandler.java +++ b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/server/HttpServerResponseTracingHandler.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.netty.v4_1.server; diff --git a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/server/HttpServerTracingHandler.java b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/server/HttpServerTracingHandler.java index 3b03f624a20b..9213fcdfb0b7 100644 --- a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/server/HttpServerTracingHandler.java +++ b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/server/HttpServerTracingHandler.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.netty.v4_1.server; diff --git a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/server/NettyHttpServerTracer.java b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/server/NettyHttpServerTracer.java index dc1f14a21b2f..bf16889e2ba8 100644 --- a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/server/NettyHttpServerTracer.java +++ b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/server/NettyHttpServerTracer.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.netty.v4_1.server; diff --git a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/server/NettyRequestExtractAdapter.java b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/server/NettyRequestExtractAdapter.java index 2d0e74300697..20b4376bfe39 100644 --- a/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/server/NettyRequestExtractAdapter.java +++ b/instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/instrumentation/auto/netty/v4_1/server/NettyRequestExtractAdapter.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.netty.v4_1.server; diff --git a/instrumentation/netty/netty-4.1/src/test/groovy/Netty41ClientTest.groovy b/instrumentation/netty/netty-4.1/src/test/groovy/Netty41ClientTest.groovy index c0bbeef67169..88b314bcd0d3 100644 --- a/instrumentation/netty/netty-4.1/src/test/groovy/Netty41ClientTest.groovy +++ b/instrumentation/netty/netty-4.1/src/test/groovy/Netty41ClientTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.PortUtils.UNUSABLE_PORT @@ -19,13 +8,24 @@ import static io.opentelemetry.auto.test.utils.TraceUtils.basicSpan import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace import static org.asynchttpclient.Dsl.asyncHttpClient +import io.netty.bootstrap.Bootstrap +import io.netty.buffer.Unpooled import io.netty.channel.AbstractChannel import io.netty.channel.Channel import io.netty.channel.ChannelHandler import io.netty.channel.ChannelHandlerContext import io.netty.channel.ChannelInitializer +import io.netty.channel.ChannelPipeline +import io.netty.channel.EventLoopGroup import io.netty.channel.embedded.EmbeddedChannel +import io.netty.channel.nio.NioEventLoopGroup +import io.netty.channel.socket.SocketChannel +import io.netty.channel.socket.nio.NioSocketChannel +import io.netty.handler.codec.http.DefaultFullHttpRequest import io.netty.handler.codec.http.HttpClientCodec +import io.netty.handler.codec.http.HttpHeaderNames +import io.netty.handler.codec.http.HttpMethod +import io.netty.handler.codec.http.HttpVersion import io.opentelemetry.auto.test.base.HttpClientTest import io.opentelemetry.instrumentation.auto.netty.v4_1.client.HttpClientTracingHandler import java.util.concurrent.ExecutionException @@ -81,6 +81,68 @@ class Netty41ClientTest extends HttpClientTest { return false } + def "test connection reuse and second request with lazy execute"() { + setup: + //Create a simple Netty pipeline + EventLoopGroup group = new NioEventLoopGroup() + Bootstrap b = new Bootstrap() + b.group(group) + .channel(NioSocketChannel) + .handler(new ChannelInitializer() { + @Override + protected void initChannel(SocketChannel socketChannel) throws Exception { + ChannelPipeline pipeline = socketChannel.pipeline() + pipeline.addLast(new HttpClientCodec()) + } + }) + def request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, server.address.resolve("/success").toString(), Unpooled.EMPTY_BUFFER) + request.headers().set(HttpHeaderNames.HOST, server.address.host) + request.headers().set(HttpHeaderNames.USER_AGENT, userAgent()) + Channel ch = null + + when: + // note that this is a purely asynchronous request + runUnderTrace("parent1") { + ch = b.connect(server.address.host, server.address.port).sync().channel() + ch.write(request) + ch.flush() + } + // This is a cheap/easy way to block/ensure that the first request has finished and check reported spans midway through + // the complex sequence of events + assertTraces(1) { + trace(0, 3) { + basicSpan(it, 0, "parent1") + clientSpan(it, 1, span(0)) + serverSpan(it, 2, span(1)) + } + } + + then: + // now run a second request through the same channel + runUnderTrace("parent2") { + ch.write(request) + ch.flush() + } + + assertTraces(2) { + trace(0, 3) { + basicSpan(it, 0, "parent1") + clientSpan(it, 1, span(0)) + serverSpan(it, 2, span(1)) + } + trace(1, 3) { + basicSpan(it, 0, "parent2") + clientSpan(it, 1, span(0)) + serverSpan(it, 2, span(1)) + } + } + + + cleanup: + group.shutdownGracefully() + } + + def "connection error (unopened port)"() { given: def uri = new URI("http://localhost:$UNUSABLE_PORT/") @@ -105,7 +167,7 @@ class Netty41ClientTest extends HttpClientTest { // for up to a total of 10 seconds (default connection time limit) for (def i = 1; i < size; i++) { span(i) { - operationName "CONNECT" + name "CONNECT" childOf span(0) errored true errorEvent(AbstractChannel.AnnotatedConnectException, ~/Connection refused:( no further information:)? localhost\/\[?[0-9.:]+\]?:$UNUSABLE_PORT/) @@ -206,7 +268,7 @@ class Netty41ClientTest extends HttpClientTest { basicSpan(it, 0, "parent") span(1) { childOf span(0) - operationName "tracedMethod" + name "tracedMethod" errored false attributes { } diff --git a/instrumentation/netty/netty-4.1/src/test/groovy/Netty41ServerTest.groovy b/instrumentation/netty/netty-4.1/src/test/groovy/Netty41ServerTest.groovy index e66161a3e573..7ef02da81843 100644 --- a/instrumentation/netty/netty-4.1/src/test/groovy/Netty41ServerTest.groovy +++ b/instrumentation/netty/netty-4.1/src/test/groovy/Netty41ServerTest.groovy @@ -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 */ import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_LENGTH diff --git a/instrumentation/netty/netty-4.1/src/test/groovy/ReactorNettyTest.groovy b/instrumentation/netty/netty-4.1/src/test/groovy/ReactorNettyTest.groovy index e05eee24a5d1..8384bec87246 100644 --- a/instrumentation/netty/netty-4.1/src/test/groovy/ReactorNettyTest.groovy +++ b/instrumentation/netty/netty-4.1/src/test/groovy/ReactorNettyTest.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestRunner @@ -75,12 +64,12 @@ class ReactorNettyTest extends AgentTestRunner { def userAgent = "ReactorNetty/" trace.span(index) { if (parentSpan == null) { - parent() + hasNoParent() } else { childOf((SpanData) parentSpan) } - operationName "HTTP GET" - spanKind CLIENT + name "HTTP GET" + kind CLIENT errored false attributes { "${SemanticAttributes.NET_TRANSPORT.key()}" "IP.TCP" diff --git a/instrumentation/okhttp/okhttp-2.2/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v2_2/OkHttp2Instrumentation.java b/instrumentation/okhttp/okhttp-2.2/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v2_2/OkHttp2Instrumentation.java index 71b616772c7c..37aabc0643a4 100644 --- a/instrumentation/okhttp/okhttp-2.2/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v2_2/OkHttp2Instrumentation.java +++ b/instrumentation/okhttp/okhttp-2.2/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v2_2/OkHttp2Instrumentation.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.okhttp.v2_2; diff --git a/instrumentation/okhttp/okhttp-2.2/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v2_2/OkHttpClientTracer.java b/instrumentation/okhttp/okhttp-2.2/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v2_2/OkHttpClientTracer.java index 2aef9d664b44..c526b45ce5a5 100644 --- a/instrumentation/okhttp/okhttp-2.2/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v2_2/OkHttpClientTracer.java +++ b/instrumentation/okhttp/okhttp-2.2/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v2_2/OkHttpClientTracer.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.okhttp.v2_2; diff --git a/instrumentation/okhttp/okhttp-2.2/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v2_2/RequestBuilderInjectAdapter.java b/instrumentation/okhttp/okhttp-2.2/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v2_2/RequestBuilderInjectAdapter.java index e4ec349df4d7..296872594873 100644 --- a/instrumentation/okhttp/okhttp-2.2/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v2_2/RequestBuilderInjectAdapter.java +++ b/instrumentation/okhttp/okhttp-2.2/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v2_2/RequestBuilderInjectAdapter.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.okhttp.v2_2; diff --git a/instrumentation/okhttp/okhttp-2.2/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v2_2/TracingInterceptor.java b/instrumentation/okhttp/okhttp-2.2/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v2_2/TracingInterceptor.java index 5671f43eaec9..49ff5c911a30 100644 --- a/instrumentation/okhttp/okhttp-2.2/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v2_2/TracingInterceptor.java +++ b/instrumentation/okhttp/okhttp-2.2/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v2_2/TracingInterceptor.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.okhttp.v2_2; diff --git a/instrumentation/okhttp/okhttp-2.2/src/test/groovy/HeadersUtil.groovy b/instrumentation/okhttp/okhttp-2.2/src/test/groovy/HeadersUtil.groovy index 8cdfd1dfcfca..79c87450152b 100644 --- a/instrumentation/okhttp/okhttp-2.2/src/test/groovy/HeadersUtil.groovy +++ b/instrumentation/okhttp/okhttp-2.2/src/test/groovy/HeadersUtil.groovy @@ -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 */ class HeadersUtil { diff --git a/instrumentation/okhttp/okhttp-2.2/src/test/groovy/OkHttp2AsyncTest.groovy b/instrumentation/okhttp/okhttp-2.2/src/test/groovy/OkHttp2AsyncTest.groovy index 44e19c9b00a1..2336b74c8df8 100644 --- a/instrumentation/okhttp/okhttp-2.2/src/test/groovy/OkHttp2AsyncTest.groovy +++ b/instrumentation/okhttp/okhttp-2.2/src/test/groovy/OkHttp2AsyncTest.groovy @@ -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 */ import static java.util.concurrent.TimeUnit.SECONDS diff --git a/instrumentation/okhttp/okhttp-2.2/src/test/groovy/OkHttp2Test.groovy b/instrumentation/okhttp/okhttp-2.2/src/test/groovy/OkHttp2Test.groovy index caff29791a73..c1337429b58d 100644 --- a/instrumentation/okhttp/okhttp-2.2/src/test/groovy/OkHttp2Test.groovy +++ b/instrumentation/okhttp/okhttp-2.2/src/test/groovy/OkHttp2Test.groovy @@ -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 */ import com.squareup.okhttp.Headers diff --git a/instrumentation/okhttp/okhttp-3.0/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v3_0/OkHttp3Instrumentation.java b/instrumentation/okhttp/okhttp-3.0/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v3_0/OkHttp3Instrumentation.java index 37f08bedb17d..1ee3f6f0b14b 100644 --- a/instrumentation/okhttp/okhttp-3.0/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v3_0/OkHttp3Instrumentation.java +++ b/instrumentation/okhttp/okhttp-3.0/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v3_0/OkHttp3Instrumentation.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.okhttp.v3_0; diff --git a/instrumentation/okhttp/okhttp-3.0/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v3_0/OkHttpClientTracer.java b/instrumentation/okhttp/okhttp-3.0/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v3_0/OkHttpClientTracer.java index a645ba1934c6..b43a4404588e 100644 --- a/instrumentation/okhttp/okhttp-3.0/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v3_0/OkHttpClientTracer.java +++ b/instrumentation/okhttp/okhttp-3.0/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v3_0/OkHttpClientTracer.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.okhttp.v3_0; diff --git a/instrumentation/okhttp/okhttp-3.0/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v3_0/RequestBuilderInjectAdapter.java b/instrumentation/okhttp/okhttp-3.0/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v3_0/RequestBuilderInjectAdapter.java index f8afaa1557db..ca355f82e1e5 100644 --- a/instrumentation/okhttp/okhttp-3.0/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v3_0/RequestBuilderInjectAdapter.java +++ b/instrumentation/okhttp/okhttp-3.0/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v3_0/RequestBuilderInjectAdapter.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.okhttp.v3_0; diff --git a/instrumentation/okhttp/okhttp-3.0/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v3_0/TracingInterceptor.java b/instrumentation/okhttp/okhttp-3.0/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v3_0/TracingInterceptor.java index aef4e5b70d00..d92494f3bc8f 100644 --- a/instrumentation/okhttp/okhttp-3.0/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v3_0/TracingInterceptor.java +++ b/instrumentation/okhttp/okhttp-3.0/src/main/java/io/opentelemetry/instrumentation/auto/okhttp/v3_0/TracingInterceptor.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.okhttp.v3_0; diff --git a/instrumentation/okhttp/okhttp-3.0/src/test/groovy/OkHttp3AsyncTest.groovy b/instrumentation/okhttp/okhttp-3.0/src/test/groovy/OkHttp3AsyncTest.groovy index 3e85a9e636fe..9612f8dd9e80 100644 --- a/instrumentation/okhttp/okhttp-3.0/src/test/groovy/OkHttp3AsyncTest.groovy +++ b/instrumentation/okhttp/okhttp-3.0/src/test/groovy/OkHttp3AsyncTest.groovy @@ -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 */ import static java.util.concurrent.TimeUnit.SECONDS diff --git a/instrumentation/okhttp/okhttp-3.0/src/test/groovy/OkHttp3Test.groovy b/instrumentation/okhttp/okhttp-3.0/src/test/groovy/OkHttp3Test.groovy index 52e78f67ee7f..b58fb8ff0cef 100644 --- a/instrumentation/okhttp/okhttp-3.0/src/test/groovy/OkHttp3Test.groovy +++ b/instrumentation/okhttp/okhttp-3.0/src/test/groovy/OkHttp3Test.groovy @@ -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 */ import io.opentelemetry.auto.test.base.HttpClientTest diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/AbstractInstrumentation.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/AbstractInstrumentation.java index 69e7de613229..87e7f70337c8 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/AbstractInstrumentation.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/AbstractInstrumentation.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.opentelemetryapi; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/CorrelationsContextUtilsInstrumentation.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/BaggageUtilsInstrumentation.java similarity index 59% rename from instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/CorrelationsContextUtilsInstrumentation.java rename to instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/BaggageUtilsInstrumentation.java index baa1257ec0c6..289897b7b650 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/CorrelationsContextUtilsInstrumentation.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/BaggageUtilsInstrumentation.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.opentelemetryapi; @@ -23,8 +12,8 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArguments; import application.io.grpc.Context; -import application.io.opentelemetry.correlationcontext.CorrelationContext; import com.google.auto.service.AutoService; +import io.opentelemetry.baggage.Baggage; import io.opentelemetry.javaagent.tooling.Instrumenter; import java.util.HashMap; import java.util.Map; @@ -33,30 +22,26 @@ import net.bytebuddy.description.type.TypeDescription; import net.bytebuddy.matcher.ElementMatcher; -// TODO: Actually bridge correlation context. We currently just stub out withCorrelationContext +// TODO: Actually bridge correlation context. We currently just stub out withBaggage // to have minimum functionality with SDK shim implementations. // https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/973 @AutoService(Instrumenter.class) -public class CorrelationsContextUtilsInstrumentation extends AbstractInstrumentation { +public class BaggageUtilsInstrumentation extends AbstractInstrumentation { @Override public ElementMatcher typeMatcher() { - return named("application.io.opentelemetry.correlationcontext.CorrelationsContextUtils"); + return named("application.io.opentelemetry.baggage.BaggageUtils"); } @Override public Map, String> transformers() { Map, String> transformers = new HashMap<>(); transformers.put( - isMethod() - .and(isPublic()) - .and(isStatic()) - .and(named("withCorrelationContext")) - .and(takesArguments(2)), - CorrelationsContextUtilsInstrumentation.class.getName() + "$WithCorrelationContextAdvice"); + isMethod().and(isPublic()).and(isStatic()).and(named("withBaggage")).and(takesArguments(2)), + BaggageUtilsInstrumentation.class.getName() + "$WithBaggageAdvice"); return transformers; } - public static class WithCorrelationContextAdvice { + public static class WithBaggageAdvice { @Advice.OnMethodEnter(skipOn = Advice.OnDefaultValue.class) public static Object onEnter() { @@ -65,7 +50,7 @@ public static Object onEnter() { @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void methodExit( - @Advice.Argument(0) CorrelationContext applicationCorrelationContext, + @Advice.Argument(0) Baggage applicationBaggage, @Advice.Argument(1) Context applicationContext, @Advice.Return(readOnly = false) Context applicationUpdatedContext) { applicationUpdatedContext = applicationContext; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/ContextUtilsInstrumentation.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/ContextUtilsInstrumentation.java index 1b23b422aaa3..0c2a73368121 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/ContextUtilsInstrumentation.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/ContextUtilsInstrumentation.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.opentelemetryapi; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/DefaultSpanInstrumentation.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/DefaultSpanInstrumentation.java index 259f6c82dd06..0784f176c85d 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/DefaultSpanInstrumentation.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/DefaultSpanInstrumentation.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.opentelemetryapi; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/GrpcContextInstrumentation.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/GrpcContextInstrumentation.java index 19162ec70aa1..1ce0d939b180 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/GrpcContextInstrumentation.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/GrpcContextInstrumentation.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.opentelemetryapi; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/LabelBridging.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/LabelBridging.java index 7755f43f508c..5c8a293675be 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/LabelBridging.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/LabelBridging.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.opentelemetryapi; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/OpenTelemetryApiInstrumentation.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/OpenTelemetryApiInstrumentation.java index d488004d68a4..0a10c265e0c9 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/OpenTelemetryApiInstrumentation.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/OpenTelemetryApiInstrumentation.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.opentelemetryapi; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/TracingContextUtilsInstrumentation.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/TracingContextUtilsInstrumentation.java index a5a8fd65ecca..63f3615dd22c 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/TracingContextUtilsInstrumentation.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/TracingContextUtilsInstrumentation.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.opentelemetryapi; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/anotations/AbstractTraceAnnotationInstrumentation.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/anotations/AbstractTraceAnnotationInstrumentation.java index a126c7a0509d..32c2bccf8e4d 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/anotations/AbstractTraceAnnotationInstrumentation.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/anotations/AbstractTraceAnnotationInstrumentation.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.opentelemetryapi.anotations; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/anotations/TraceAnnotationTracer.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/anotations/TraceAnnotationTracer.java index 858b45aa26a0..d7c74607da8b 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/anotations/TraceAnnotationTracer.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/anotations/TraceAnnotationTracer.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.opentelemetryapi.anotations; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/anotations/WithSpanAdvice.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/anotations/WithSpanAdvice.java index d84863d77eb5..87a73f4220c3 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/anotations/WithSpanAdvice.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/anotations/WithSpanAdvice.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.opentelemetryapi.anotations; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/anotations/WithSpanAnnotationInstrumentation.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/anotations/WithSpanAnnotationInstrumentation.java index 2536dee0e8b9..8b8ea928fc14 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/anotations/WithSpanAnnotationInstrumentation.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/anotations/WithSpanAnnotationInstrumentation.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.opentelemetryapi.anotations; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/context/ApplicationScope.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/context/ApplicationScope.java index 92f7eb87ff8b..117b2bcb3bfb 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/context/ApplicationScope.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/context/ApplicationScope.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.opentelemetryapi.context; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/context/ContextUtils.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/context/ContextUtils.java index 956b88022e79..38091dfaee0e 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/context/ContextUtils.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/context/ContextUtils.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.opentelemetryapi.context; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/context/NoopScope.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/context/NoopScope.java index d700c1048a7c..edad8b1bd7d5 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/context/NoopScope.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/context/NoopScope.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.opentelemetryapi.context; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/context/propagation/ApplicationContextPropagators.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/context/propagation/ApplicationContextPropagators.java index 6dab187c3c17..94bace9600f6 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/context/propagation/ApplicationContextPropagators.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/context/propagation/ApplicationContextPropagators.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.opentelemetryapi.context.propagation; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/context/propagation/ApplicationTextMapPropagator.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/context/propagation/ApplicationTextMapPropagator.java index 38214b3cf51b..6979e09a8659 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/context/propagation/ApplicationTextMapPropagator.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/context/propagation/ApplicationTextMapPropagator.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.opentelemetryapi.context.propagation; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationBatchRecorder.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationBatchRecorder.java index 03c0acffd199..972f5bdaea8c 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationBatchRecorder.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationBatchRecorder.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.opentelemetryapi.metrics; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleCounter.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleCounter.java index 7eedffc704c2..603678b504ea 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleCounter.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleCounter.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.opentelemetryapi.metrics; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleSumObserver.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleSumObserver.java index 88524a0b26f6..e789f83ae702 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleSumObserver.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleSumObserver.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.opentelemetryapi.metrics; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleUpDownCounter.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleUpDownCounter.java index cf1c97682851..943267fd5b6f 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleUpDownCounter.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleUpDownCounter.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.opentelemetryapi.metrics; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleUpDownSumObserver.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleUpDownSumObserver.java index 5810ec6c2425..032695ed2f9c 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleUpDownSumObserver.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleUpDownSumObserver.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.opentelemetryapi.metrics; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleValueObserver.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleValueObserver.java index b74005c001a0..0599ec8ccc09 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleValueObserver.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleValueObserver.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.opentelemetryapi.metrics; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleValueRecorder.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleValueRecorder.java index 4ca8790ad53c..9690edbc224f 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleValueRecorder.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationDoubleValueRecorder.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.opentelemetryapi.metrics; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongCounter.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongCounter.java index de244917dcd8..d45fd3771fd4 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongCounter.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongCounter.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.opentelemetryapi.metrics; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongSumObserver.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongSumObserver.java index 7139570409b8..ca787400fcb1 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongSumObserver.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongSumObserver.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.opentelemetryapi.metrics; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongUpDownCounter.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongUpDownCounter.java index 88e916530863..356c90e69568 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongUpDownCounter.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongUpDownCounter.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.opentelemetryapi.metrics; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongUpDownSumObserver.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongUpDownSumObserver.java index b27be5aae38d..928497934507 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongUpDownSumObserver.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongUpDownSumObserver.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.opentelemetryapi.metrics; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongValueObserver.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongValueObserver.java index 4c4b28eb20dd..56278f8986de 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongValueObserver.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongValueObserver.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.opentelemetryapi.metrics; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongValueRecorder.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongValueRecorder.java index ae49253b22cf..552eda0d2dfa 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongValueRecorder.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationLongValueRecorder.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.opentelemetryapi.metrics; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationMeter.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationMeter.java index 513003791a52..76e35a7a82df 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationMeter.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationMeter.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.opentelemetryapi.metrics; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationMeterProvider.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationMeterProvider.java index 44d46b94c8de..7cc2b7aff205 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationMeterProvider.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/metrics/ApplicationMeterProvider.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.opentelemetryapi.metrics; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/trace/ApplicationSpan.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/trace/ApplicationSpan.java index 983bf5fa0fd5..1e34ceefe70c 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/trace/ApplicationSpan.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/trace/ApplicationSpan.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.opentelemetryapi.trace; @@ -23,11 +12,9 @@ import application.io.opentelemetry.common.AttributeKey; import application.io.opentelemetry.common.Attributes; import application.io.opentelemetry.trace.EndSpanOptions; -import application.io.opentelemetry.trace.Event; -import application.io.opentelemetry.trace.Link; import application.io.opentelemetry.trace.Span; import application.io.opentelemetry.trace.SpanContext; -import application.io.opentelemetry.trace.Status; +import application.io.opentelemetry.trace.StatusCanonicalCode; import io.opentelemetry.instrumentation.auto.api.ContextStore; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -93,21 +80,13 @@ public void addEvent(String name, Attributes applicationAttributes, long timesta } @Override - public void addEvent(Event applicationEvent) { - addEvent(applicationEvent.getName(), applicationEvent.getAttributes()); + public void setStatus(StatusCanonicalCode status) { + agentSpan.setStatus(Bridging.toAgent(status)); } @Override - public void addEvent(Event applicationEvent, long timestamp) { - addEvent(applicationEvent.getName(), applicationEvent.getAttributes(), timestamp); - } - - @Override - public void setStatus(Status applicationStatus) { - io.opentelemetry.trace.Status agentStatus = Bridging.toAgentOrNull(applicationStatus); - if (agentStatus != null) { - agentSpan.setStatus(agentStatus); - } + public void setStatus(StatusCanonicalCode status, String description) { + agentSpan.setStatus(Bridging.toAgent(status), description); } @Override @@ -192,14 +171,6 @@ public Span.Builder addLink( return this; } - @Override - public Span.Builder addLink(Link applicationLink) { - agentBuilder.addLink( - Bridging.toAgent(applicationLink.getContext()), - Bridging.toAgent(applicationLink.getAttributes())); - return this; - } - @Override public Span.Builder setAttribute(String key, String value) { agentBuilder.setAttribute(key, value); diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/trace/ApplicationTracer.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/trace/ApplicationTracer.java index 1be15c0887a2..2e5e0d93b9d3 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/trace/ApplicationTracer.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/trace/ApplicationTracer.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.opentelemetryapi.trace; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/trace/ApplicationTracerProvider.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/trace/ApplicationTracerProvider.java index 1960347ba86d..4cbaa83b6768 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/trace/ApplicationTracerProvider.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/trace/ApplicationTracerProvider.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.opentelemetryapi.trace; diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/trace/Bridging.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/trace/Bridging.java index 8da6352e727f..b07dc3b2cf41 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/trace/Bridging.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/trace/Bridging.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.opentelemetryapi.trace; @@ -23,7 +12,7 @@ import application.io.opentelemetry.trace.EndSpanOptions; import application.io.opentelemetry.trace.Span; import application.io.opentelemetry.trace.SpanContext; -import application.io.opentelemetry.trace.Status; +import application.io.opentelemetry.trace.StatusCanonicalCode; import application.io.opentelemetry.trace.TraceState; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -124,46 +113,45 @@ public static io.opentelemetry.common.AttributeKey toAgent( switch (applicationKey.getType()) { case STRING: return (io.opentelemetry.common.AttributeKey) - io.opentelemetry.common.AttributesKeys.stringKey(applicationKey.getKey()); + io.opentelemetry.common.AttributeKey.stringKey(applicationKey.getKey()); case BOOLEAN: return (io.opentelemetry.common.AttributeKey) - io.opentelemetry.common.AttributesKeys.booleanKey(applicationKey.getKey()); + io.opentelemetry.common.AttributeKey.booleanKey(applicationKey.getKey()); case LONG: return (io.opentelemetry.common.AttributeKey) - io.opentelemetry.common.AttributesKeys.longKey(applicationKey.getKey()); + io.opentelemetry.common.AttributeKey.longKey(applicationKey.getKey()); case DOUBLE: return (io.opentelemetry.common.AttributeKey) - io.opentelemetry.common.AttributesKeys.doubleKey(applicationKey.getKey()); + io.opentelemetry.common.AttributeKey.doubleKey(applicationKey.getKey()); case STRING_ARRAY: return (io.opentelemetry.common.AttributeKey) - io.opentelemetry.common.AttributesKeys.stringArrayKey(applicationKey.getKey()); + io.opentelemetry.common.AttributeKey.stringArrayKey(applicationKey.getKey()); case BOOLEAN_ARRAY: return (io.opentelemetry.common.AttributeKey) - io.opentelemetry.common.AttributesKeys.booleanArrayKey(applicationKey.getKey()); + io.opentelemetry.common.AttributeKey.booleanArrayKey(applicationKey.getKey()); case LONG_ARRAY: return (io.opentelemetry.common.AttributeKey) - io.opentelemetry.common.AttributesKeys.longArrayKey(applicationKey.getKey()); + io.opentelemetry.common.AttributeKey.longArrayKey(applicationKey.getKey()); case DOUBLE_ARRAY: return (io.opentelemetry.common.AttributeKey) - io.opentelemetry.common.AttributesKeys.doubleArrayKey(applicationKey.getKey()); + io.opentelemetry.common.AttributeKey.doubleArrayKey(applicationKey.getKey()); default: log.debug("unexpected attribute key type: {}", applicationKey.getType()); return null; } } - public static io.opentelemetry.trace.Status toAgentOrNull(Status applicationStatus) { - io.opentelemetry.trace.Status.CanonicalCode agentCanonicalCode; + public static io.opentelemetry.trace.StatusCanonicalCode toAgent( + StatusCanonicalCode applicationStatus) { + io.opentelemetry.trace.StatusCanonicalCode agentCanonicalCode; try { agentCanonicalCode = - io.opentelemetry.trace.Status.CanonicalCode.valueOf( - applicationStatus.getCanonicalCode().name()); + io.opentelemetry.trace.StatusCanonicalCode.valueOf(applicationStatus.name()); } catch (IllegalArgumentException e) { - log.debug( - "unexpected status canonical code: {}", applicationStatus.getCanonicalCode().name()); - return null; + log.debug("unexpected status canonical code: {}", applicationStatus.name()); + return io.opentelemetry.trace.StatusCanonicalCode.UNSET; } - return agentCanonicalCode.toStatus().withDescription(applicationStatus.getDescription()); + return agentCanonicalCode; } public static io.opentelemetry.trace.Span.Kind toAgentOrNull(Span.Kind applicationSpanKind) { diff --git a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/trace/TracingContextUtils.java b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/trace/TracingContextUtils.java index e99ad733a532..81c8bbb5f48c 100644 --- a/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/trace/TracingContextUtils.java +++ b/instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/instrumentation/auto/opentelemetryapi/trace/TracingContextUtils.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.opentelemetryapi.trace; diff --git a/instrumentation/opentelemetry-api-beta/src/test/groovy/MeterTest.groovy b/instrumentation/opentelemetry-api-beta/src/test/groovy/MeterTest.groovy index 306a984a6a5e..edaf3de8be9b 100644 --- a/instrumentation/opentelemetry-api-beta/src/test/groovy/MeterTest.groovy +++ b/instrumentation/opentelemetry-api-beta/src/test/groovy/MeterTest.groovy @@ -1,24 +1,13 @@ /* * 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 */ -import static io.opentelemetry.sdk.metrics.data.MetricData.Descriptor.Type.MONOTONIC_DOUBLE -import static io.opentelemetry.sdk.metrics.data.MetricData.Descriptor.Type.MONOTONIC_LONG -import static io.opentelemetry.sdk.metrics.data.MetricData.Descriptor.Type.NON_MONOTONIC_DOUBLE -import static io.opentelemetry.sdk.metrics.data.MetricData.Descriptor.Type.NON_MONOTONIC_LONG -import static io.opentelemetry.sdk.metrics.data.MetricData.Descriptor.Type.SUMMARY +import static io.opentelemetry.sdk.metrics.data.MetricData.Type.MONOTONIC_DOUBLE +import static io.opentelemetry.sdk.metrics.data.MetricData.Type.MONOTONIC_LONG +import static io.opentelemetry.sdk.metrics.data.MetricData.Type.NON_MONOTONIC_DOUBLE +import static io.opentelemetry.sdk.metrics.data.MetricData.Type.NON_MONOTONIC_LONG +import static io.opentelemetry.sdk.metrics.data.MetricData.Type.SUMMARY import application.io.opentelemetry.OpenTelemetry import application.io.opentelemetry.common.Labels @@ -54,9 +43,9 @@ class MeterTest extends AgentTestRunner { then: def metricData = findMetric(OpenTelemetrySdk.getMeterProvider().getMetricProducer().collectAllMetrics(), instrumentationName, "test") metricData != null - metricData.descriptor.description == "d" - metricData.descriptor.unit == "u" - metricData.descriptor.type == expectedType + metricData.description == "d" + metricData.unit == "u" + metricData.type == expectedType metricData.instrumentationLibraryInfo.name == instrumentationName metricData.instrumentationLibraryInfo.version == "1.2.3" metricData.points.size() == 1 @@ -105,9 +94,9 @@ class MeterTest extends AgentTestRunner { then: def metricData = findMetric(OpenTelemetrySdk.getMeterProvider().getMetricProducer().collectAllMetrics(), instrumentationName, "test") metricData != null - metricData.descriptor.description == "d" - metricData.descriptor.unit == "u" - metricData.descriptor.type == SUMMARY + metricData.description == "d" + metricData.unit == "u" + metricData.type == SUMMARY metricData.instrumentationLibraryInfo.name == instrumentationName metricData.instrumentationLibraryInfo.version == "1.2.3" metricData.points.size() == 1 @@ -186,9 +175,9 @@ class MeterTest extends AgentTestRunner { then: def metricData = findMetric(OpenTelemetrySdk.getMeterProvider().getMetricProducer().collectAllMetrics(), instrumentationName, "test") metricData != null - metricData.descriptor.description == "d" - metricData.descriptor.unit == "u" - metricData.descriptor.type == expectedType + metricData.description == "d" + metricData.unit == "u" + metricData.type == expectedType metricData.instrumentationLibraryInfo.name == instrumentationName metricData.instrumentationLibraryInfo.version == "1.2.3" metricData.points.size() == 1 @@ -238,9 +227,9 @@ class MeterTest extends AgentTestRunner { then: def metricData = findMetric(allMetrics, instrumentationName, "test") metricData != null - metricData.descriptor.description == "d" - metricData.descriptor.unit == "u" - metricData.descriptor.type == MONOTONIC_LONG + metricData.description == "d" + metricData.unit == "u" + metricData.type == MONOTONIC_LONG metricData.instrumentationLibraryInfo.name == instrumentationName metricData.instrumentationLibraryInfo.version == "1.2.3" metricData.points.size() == 1 @@ -250,9 +239,9 @@ class MeterTest extends AgentTestRunner { def metricData2 = findMetric(allMetrics, instrumentationName, "test2") metricData2 != null - metricData2.descriptor.description == "d" - metricData2.descriptor.unit == "u" - metricData2.descriptor.type == SUMMARY + metricData2.description == "d" + metricData2.unit == "u" + metricData2.type == SUMMARY metricData2.instrumentationLibraryInfo.name == instrumentationName metricData2.instrumentationLibraryInfo.version == "1.2.3" metricData2.points.size() == 1 @@ -264,7 +253,7 @@ class MeterTest extends AgentTestRunner { def findMetric(Collection allMetrics, instrumentationName, metricName) { for (def metric : allMetrics) { - if (metric.instrumentationLibraryInfo.name == instrumentationName && metric.descriptor.name == metricName) { + if (metric.instrumentationLibraryInfo.name == instrumentationName && metric.name == metricName) { return metric } } diff --git a/instrumentation/opentelemetry-api-beta/src/test/groovy/TracerSdkTest.groovy b/instrumentation/opentelemetry-api-beta/src/test/groovy/TracerSdkTest.groovy index 6adfe38bf350..66268639f93d 100644 --- a/instrumentation/opentelemetry-api-beta/src/test/groovy/TracerSdkTest.groovy +++ b/instrumentation/opentelemetry-api-beta/src/test/groovy/TracerSdkTest.groovy @@ -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 */ import application.io.opentelemetry.sdk.OpenTelemetrySdk @@ -22,7 +11,7 @@ class TracerSdkTest extends AgentTestRunner { def "direct access to sdk should not fail"() { when: - def provider = OpenTelemetrySdk.getTracerProvider() + def provider = OpenTelemetrySdk.getTracerManagement() then: provider instanceof TracerSdkProvider diff --git a/instrumentation/opentelemetry-api-beta/src/test/groovy/TracerTest.groovy b/instrumentation/opentelemetry-api-beta/src/test/groovy/TracerTest.groovy index 8ff1ef57b236..ae34e48d231c 100644 --- a/instrumentation/opentelemetry-api-beta/src/test/groovy/TracerTest.groovy +++ b/instrumentation/opentelemetry-api-beta/src/test/groovy/TracerTest.groovy @@ -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 */ import static application.io.opentelemetry.context.ContextUtils.withScopedContext @@ -27,7 +16,7 @@ import application.io.opentelemetry.common.Attributes import application.io.opentelemetry.context.Scope import application.io.opentelemetry.trace.DefaultSpan import application.io.opentelemetry.trace.Span -import application.io.opentelemetry.trace.Status +import application.io.opentelemetry.trace.StatusCanonicalCode import io.opentelemetry.auto.test.AgentTestRunner import io.opentelemetry.trace.attributes.SemanticAttributes @@ -41,17 +30,17 @@ class TracerTest extends AgentTestRunner { testSpan.setAttribute("long", 2) testSpan.setAttribute("double", 3.0) testSpan.setAttribute("boolean", true) - testSpan.setStatus(Status.UNKNOWN) + testSpan.setStatus(StatusCanonicalCode.ERROR) testSpan.end() then: assertTraces(1) { trace(0, 1) { span(0) { - operationName "test" - spanKind io.opentelemetry.trace.Span.Kind.PRODUCER - parent() - status io.opentelemetry.trace.Status.UNKNOWN + name "test" + kind io.opentelemetry.trace.Span.Kind.PRODUCER + hasNoParent() + status io.opentelemetry.trace.StatusCanonicalCode.ERROR attributes { "string" "1" "long" 2 @@ -79,13 +68,13 @@ class TracerTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "parent" - parent() + name "parent" + hasNoParent() attributes { } } span(1) { - operationName "test" + name "test" childOf span(0) attributes { } @@ -110,13 +99,13 @@ class TracerTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "parent" - parent() + name "parent" + hasNoParent() attributes { } } span(1) { - operationName "test" + name "test" childOf span(0) attributes { } @@ -142,13 +131,13 @@ class TracerTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "parent" - parent() + name "parent" + hasNoParent() attributes { } } span(1) { - operationName "test" + name "test" childOf span(0) attributes { } @@ -170,13 +159,13 @@ class TracerTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "parent" - parent() + name "parent" + hasNoParent() attributes { } } span(1) { - operationName "test" + name "test" childOf span(0) attributes { } @@ -199,16 +188,16 @@ class TracerTest extends AgentTestRunner { assertTraces(2) { trace(0, 1) { span(0) { - operationName "parent" - parent() + name "parent" + hasNoParent() attributes { } } } trace(1, 1) { span(0) { - operationName "test" - parent() + name "test" + hasNoParent() attributes { } } @@ -227,8 +216,8 @@ class TracerTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "test2" - parent() + name "test2" + hasNoParent() attributes { } } @@ -247,7 +236,7 @@ class TracerTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "test" + name "test" event(0) { eventName("exception") attributes { @@ -275,7 +264,7 @@ class TracerTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "test" + name "test" event(0) { eventName("exception") attributes { @@ -304,8 +293,8 @@ class TracerTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "test2" - parent() + name "test2" + hasNoParent() attributes { } } @@ -326,8 +315,8 @@ class TracerTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "test2" - parent() + name "test2" + hasNoParent() attributes { } } diff --git a/instrumentation/opentelemetry-api-beta/src/test/groovy/TracingContextUtilsTest.groovy b/instrumentation/opentelemetry-api-beta/src/test/groovy/TracingContextUtilsTest.groovy index 4562630fb037..d0e88ec06410 100644 --- a/instrumentation/opentelemetry-api-beta/src/test/groovy/TracingContextUtilsTest.groovy +++ b/instrumentation/opentelemetry-api-beta/src/test/groovy/TracingContextUtilsTest.groovy @@ -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 */ import static application.io.opentelemetry.trace.TracingContextUtils.currentContextWith diff --git a/instrumentation/opentelemetry-api-beta/src/test/groovy/WithSpanInstrumentationTest.groovy b/instrumentation/opentelemetry-api-beta/src/test/groovy/WithSpanInstrumentationTest.groovy index d032484abbc3..6bb0a5358a12 100644 --- a/instrumentation/opentelemetry-api-beta/src/test/groovy/WithSpanInstrumentationTest.groovy +++ b/instrumentation/opentelemetry-api-beta/src/test/groovy/WithSpanInstrumentationTest.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestRunner @@ -23,19 +12,13 @@ import io.opentelemetry.trace.Span * This test verifies that auto instrumentation supports {@link io.opentelemetry.extensions.auto.annotations.WithSpan} contrib annotation. */ class WithSpanInstrumentationTest extends AgentTestRunner { - - static { - ConfigUtils.updateConfig { - System.setProperty("otel.trace.classes.exclude", WithSpanInstrumentationTest.name + "*") - System.setProperty("otel.trace.annotated.methods.exclude", "${TracedWithSpan.name}[ignored]") - } + static final PREVIOUS_CONFIG = ConfigUtils.updateConfigAndResetInstrumentation { + it.setProperty("otel.trace.classes.exclude", WithSpanInstrumentationTest.name + "*") + it.setProperty("otel.trace.annotated.methods.exclude", "${TracedWithSpan.name}[ignored]") } def cleanupSpec() { - ConfigUtils.updateConfig { - System.clearProperty("otel.trace.classes.exclude") - System.clearProperty("otel.trace.annotated.methods.exclude") - } + ConfigUtils.setConfig(PREVIOUS_CONFIG) } def "should derive automatic name"() { @@ -46,9 +29,9 @@ class WithSpanInstrumentationTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "TracedWithSpan.otel" - spanKind Span.Kind.INTERNAL - parent() + name "TracedWithSpan.otel" + kind Span.Kind.INTERNAL + hasNoParent() errored false attributes { "providerAttr" "Otel" @@ -66,8 +49,8 @@ class WithSpanInstrumentationTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "manualName" - parent() + name "manualName" + hasNoParent() errored false attributes { "providerAttr" "Otel" @@ -85,9 +68,9 @@ class WithSpanInstrumentationTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "TracedWithSpan.oneOfAKind" - spanKind Span.Kind.PRODUCER - parent() + name "TracedWithSpan.oneOfAKind" + kind Span.Kind.PRODUCER + hasNoParent() errored false attributes { "providerAttr" "Otel" diff --git a/instrumentation/opentelemetry-api-beta/src/test/java/io/opentelemetry/test/annotation/TracedWithSpan.java b/instrumentation/opentelemetry-api-beta/src/test/java/io/opentelemetry/test/annotation/TracedWithSpan.java index e050a7dc9eee..212743fe8acc 100644 --- a/instrumentation/opentelemetry-api-beta/src/test/java/io/opentelemetry/test/annotation/TracedWithSpan.java +++ b/instrumentation/opentelemetry-api-beta/src/test/java/io/opentelemetry/test/annotation/TracedWithSpan.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.test.annotation; diff --git a/instrumentation/play-ws/play-ws-1.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v1_0/AsyncHandlerWrapper.java b/instrumentation/play-ws/play-ws-1.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v1_0/AsyncHandlerWrapper.java index ebda84863285..dd4d06b348f6 100644 --- a/instrumentation/play-ws/play-ws-1.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v1_0/AsyncHandlerWrapper.java +++ b/instrumentation/play-ws/play-ws-1.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v1_0/AsyncHandlerWrapper.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.playws.v1_0; diff --git a/instrumentation/play-ws/play-ws-1.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v1_0/PlayWSClientInstrumentation.java b/instrumentation/play-ws/play-ws-1.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v1_0/PlayWSClientInstrumentation.java index bca623bfaba6..3c9ea1a8e0b4 100644 --- a/instrumentation/play-ws/play-ws-1.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v1_0/PlayWSClientInstrumentation.java +++ b/instrumentation/play-ws/play-ws-1.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v1_0/PlayWSClientInstrumentation.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.playws.v1_0; diff --git a/instrumentation/play-ws/play-ws-1.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v1_0/StreamedAsyncHandlerWrapper.java b/instrumentation/play-ws/play-ws-1.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v1_0/StreamedAsyncHandlerWrapper.java index 8d6d75a1a5b4..868629c8e590 100644 --- a/instrumentation/play-ws/play-ws-1.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v1_0/StreamedAsyncHandlerWrapper.java +++ b/instrumentation/play-ws/play-ws-1.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v1_0/StreamedAsyncHandlerWrapper.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.playws.v1_0; diff --git a/instrumentation/play-ws/play-ws-1.0/src/test/groovy/PlayWSClientTest.groovy b/instrumentation/play-ws/play-ws-1.0/src/test/groovy/PlayWSClientTest.groovy index 1eeaead62a3f..2c5a0f935b4e 100644 --- a/instrumentation/play-ws/play-ws-1.0/src/test/groovy/PlayWSClientTest.groovy +++ b/instrumentation/play-ws/play-ws-1.0/src/test/groovy/PlayWSClientTest.groovy @@ -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 */ import java.util.concurrent.TimeUnit diff --git a/instrumentation/play-ws/play-ws-2.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_0/AsyncHandlerWrapper.java b/instrumentation/play-ws/play-ws-2.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_0/AsyncHandlerWrapper.java index 7100fb373f63..8d90b9cb522a 100644 --- a/instrumentation/play-ws/play-ws-2.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_0/AsyncHandlerWrapper.java +++ b/instrumentation/play-ws/play-ws-2.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_0/AsyncHandlerWrapper.java @@ -1,24 +1,14 @@ /* * 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.playws.v2_0; +import static io.opentelemetry.context.ContextUtils.withScopedContext; import static io.opentelemetry.instrumentation.auto.playws.PlayWSClientTracer.TRACER; -import static io.opentelemetry.trace.TracingContextUtils.currentContextWith; +import io.grpc.Context; import io.opentelemetry.context.Scope; import io.opentelemetry.trace.Span; import java.net.InetSocketAddress; @@ -34,14 +24,14 @@ public class AsyncHandlerWrapper implements AsyncHandler { private final AsyncHandler delegate; private final Span span; - private final Span parentSpan; + private final Context parentContext; private final Response.ResponseBuilder builder = new Response.ResponseBuilder(); public AsyncHandlerWrapper(AsyncHandler delegate, Span span) { this.delegate = delegate; this.span = span; - parentSpan = TRACER.getCurrentSpan(); + parentContext = Context.current(); } @Override @@ -68,11 +58,7 @@ public Object onCompleted() throws Exception { Response response = builder.build(); TRACER.end(span, response); - if (parentSpan.getContext().isValid()) { - try (Scope scope = currentContextWith(parentSpan)) { - return delegate.onCompleted(); - } - } else { + try (Scope ignored = withScopedContext(parentContext)) { return delegate.onCompleted(); } } @@ -81,11 +67,7 @@ public Object onCompleted() throws Exception { public void onThrowable(Throwable throwable) { TRACER.endExceptionally(span, throwable); - if (parentSpan.getContext().isValid()) { - try (Scope scope = currentContextWith(parentSpan)) { - delegate.onThrowable(throwable); - } - } else { + try (Scope ignored = withScopedContext(parentContext)) { delegate.onThrowable(throwable); } } diff --git a/instrumentation/play-ws/play-ws-2.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_0/PlayWSClientInstrumentation.java b/instrumentation/play-ws/play-ws-2.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_0/PlayWSClientInstrumentation.java index b538912f7360..589ae5ac0348 100644 --- a/instrumentation/play-ws/play-ws-2.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_0/PlayWSClientInstrumentation.java +++ b/instrumentation/play-ws/play-ws-2.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_0/PlayWSClientInstrumentation.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.playws.v2_0; diff --git a/instrumentation/play-ws/play-ws-2.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_0/StreamedAsyncHandlerWrapper.java b/instrumentation/play-ws/play-ws-2.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_0/StreamedAsyncHandlerWrapper.java index aae75178960c..61ff57d77d57 100644 --- a/instrumentation/play-ws/play-ws-2.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_0/StreamedAsyncHandlerWrapper.java +++ b/instrumentation/play-ws/play-ws-2.0/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_0/StreamedAsyncHandlerWrapper.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.playws.v2_0; diff --git a/instrumentation/play-ws/play-ws-2.0/src/test/groovy/PlayWSClientTest.groovy b/instrumentation/play-ws/play-ws-2.0/src/test/groovy/PlayWSClientTest.groovy index 1194787fe371..f243728e4254 100644 --- a/instrumentation/play-ws/play-ws-2.0/src/test/groovy/PlayWSClientTest.groovy +++ b/instrumentation/play-ws/play-ws-2.0/src/test/groovy/PlayWSClientTest.groovy @@ -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 */ import java.util.concurrent.TimeUnit diff --git a/instrumentation/play-ws/play-ws-2.1/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_1/AsyncHandlerWrapper.java b/instrumentation/play-ws/play-ws-2.1/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_1/AsyncHandlerWrapper.java index fb3e0351815f..064caedecf5b 100644 --- a/instrumentation/play-ws/play-ws-2.1/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_1/AsyncHandlerWrapper.java +++ b/instrumentation/play-ws/play-ws-2.1/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_1/AsyncHandlerWrapper.java @@ -1,24 +1,14 @@ /* * 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.playws.v2_1; +import static io.opentelemetry.context.ContextUtils.withScopedContext; import static io.opentelemetry.instrumentation.auto.playws.PlayWSClientTracer.TRACER; -import static io.opentelemetry.trace.TracingContextUtils.currentContextWith; +import io.grpc.Context; import io.opentelemetry.context.Scope; import io.opentelemetry.trace.Span; import java.net.InetSocketAddress; @@ -35,14 +25,14 @@ public class AsyncHandlerWrapper implements AsyncHandler { private final AsyncHandler delegate; private final Span span; - private final Span parentSpan; + private final Context parentContext; private final Response.ResponseBuilder builder = new Response.ResponseBuilder(); public AsyncHandlerWrapper(AsyncHandler delegate, Span span) { this.delegate = delegate; this.span = span; - parentSpan = TRACER.getCurrentSpan(); + parentContext = Context.current(); } @Override @@ -69,11 +59,7 @@ public Object onCompleted() throws Exception { Response response = builder.build(); TRACER.end(span, response); - if (parentSpan.getContext().isValid()) { - try (Scope scope = currentContextWith(parentSpan)) { - return delegate.onCompleted(); - } - } else { + try (Scope ignored = withScopedContext(parentContext)) { return delegate.onCompleted(); } } @@ -82,11 +68,7 @@ public Object onCompleted() throws Exception { public void onThrowable(Throwable throwable) { TRACER.endExceptionally(span, throwable); - if (parentSpan.getContext().isValid()) { - try (Scope scope = currentContextWith(parentSpan)) { - delegate.onThrowable(throwable); - } - } else { + try (Scope ignored = withScopedContext(parentContext)) { delegate.onThrowable(throwable); } } diff --git a/instrumentation/play-ws/play-ws-2.1/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_1/PlayWSClientInstrumentation.java b/instrumentation/play-ws/play-ws-2.1/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_1/PlayWSClientInstrumentation.java index a50a5b1b4236..a932a96f7c91 100644 --- a/instrumentation/play-ws/play-ws-2.1/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_1/PlayWSClientInstrumentation.java +++ b/instrumentation/play-ws/play-ws-2.1/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_1/PlayWSClientInstrumentation.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.playws.v2_1; diff --git a/instrumentation/play-ws/play-ws-2.1/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_1/StreamedAsyncHandlerWrapper.java b/instrumentation/play-ws/play-ws-2.1/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_1/StreamedAsyncHandlerWrapper.java index 2b1f513bbfaa..431c128b9d16 100644 --- a/instrumentation/play-ws/play-ws-2.1/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_1/StreamedAsyncHandlerWrapper.java +++ b/instrumentation/play-ws/play-ws-2.1/src/main/java/io/opentelemetry/instrumentation/auto/playws/v2_1/StreamedAsyncHandlerWrapper.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.playws.v2_1; diff --git a/instrumentation/play-ws/play-ws-2.1/src/test/groovy/PlayWSClientTest.groovy b/instrumentation/play-ws/play-ws-2.1/src/test/groovy/PlayWSClientTest.groovy index 1eeaead62a3f..2c5a0f935b4e 100644 --- a/instrumentation/play-ws/play-ws-2.1/src/test/groovy/PlayWSClientTest.groovy +++ b/instrumentation/play-ws/play-ws-2.1/src/test/groovy/PlayWSClientTest.groovy @@ -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 */ import java.util.concurrent.TimeUnit diff --git a/instrumentation/play-ws/play-ws-common/src/main/java/io/opentelemetry/instrumentation/auto/playws/BasePlayWSClientInstrumentation.java b/instrumentation/play-ws/play-ws-common/src/main/java/io/opentelemetry/instrumentation/auto/playws/BasePlayWSClientInstrumentation.java index 9e937e3f14ce..1945fe67d971 100644 --- a/instrumentation/play-ws/play-ws-common/src/main/java/io/opentelemetry/instrumentation/auto/playws/BasePlayWSClientInstrumentation.java +++ b/instrumentation/play-ws/play-ws-common/src/main/java/io/opentelemetry/instrumentation/auto/playws/BasePlayWSClientInstrumentation.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.playws; diff --git a/instrumentation/play-ws/play-ws-common/src/main/java/io/opentelemetry/instrumentation/auto/playws/HeadersInjectAdapter.java b/instrumentation/play-ws/play-ws-common/src/main/java/io/opentelemetry/instrumentation/auto/playws/HeadersInjectAdapter.java index 8b27d4317923..4c266133b057 100644 --- a/instrumentation/play-ws/play-ws-common/src/main/java/io/opentelemetry/instrumentation/auto/playws/HeadersInjectAdapter.java +++ b/instrumentation/play-ws/play-ws-common/src/main/java/io/opentelemetry/instrumentation/auto/playws/HeadersInjectAdapter.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.playws; diff --git a/instrumentation/play-ws/play-ws-common/src/main/java/io/opentelemetry/instrumentation/auto/playws/PlayWSClientTracer.java b/instrumentation/play-ws/play-ws-common/src/main/java/io/opentelemetry/instrumentation/auto/playws/PlayWSClientTracer.java index 6cd54f1ef0fe..4bb31701417f 100644 --- a/instrumentation/play-ws/play-ws-common/src/main/java/io/opentelemetry/instrumentation/auto/playws/PlayWSClientTracer.java +++ b/instrumentation/play-ws/play-ws-common/src/main/java/io/opentelemetry/instrumentation/auto/playws/PlayWSClientTracer.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.playws; diff --git a/instrumentation/play-ws/play-ws-testing/src/main/groovy/PlayWSClientTestBase.groovy b/instrumentation/play-ws/play-ws-testing/src/main/groovy/PlayWSClientTestBase.groovy index 05aae91c2b63..116dbce28609 100644 --- a/instrumentation/play-ws/play-ws-testing/src/main/groovy/PlayWSClientTestBase.groovy +++ b/instrumentation/play-ws/play-ws-testing/src/main/groovy/PlayWSClientTestBase.groovy @@ -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 */ import akka.actor.ActorSystem diff --git a/instrumentation/play/play-2.3/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_3/PlayAdvice.java b/instrumentation/play/play-2.3/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_3/PlayAdvice.java index 82f90f416cae..538a24f7aae0 100644 --- a/instrumentation/play/play-2.3/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_3/PlayAdvice.java +++ b/instrumentation/play/play-2.3/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_3/PlayAdvice.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.play.v2_3; diff --git a/instrumentation/play/play-2.3/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_3/PlayInstrumentation.java b/instrumentation/play/play-2.3/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_3/PlayInstrumentation.java index 1e1dcb38332e..47cd93bc4aa5 100644 --- a/instrumentation/play/play-2.3/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_3/PlayInstrumentation.java +++ b/instrumentation/play/play-2.3/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_3/PlayInstrumentation.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.play.v2_3; diff --git a/instrumentation/play/play-2.3/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_3/PlayTracer.java b/instrumentation/play/play-2.3/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_3/PlayTracer.java index 02c35913b23e..8bc0f0ce1399 100644 --- a/instrumentation/play/play-2.3/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_3/PlayTracer.java +++ b/instrumentation/play/play-2.3/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_3/PlayTracer.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.play.v2_3; diff --git a/instrumentation/play/play-2.3/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_3/RequestCompleteCallback.java b/instrumentation/play/play-2.3/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_3/RequestCompleteCallback.java index 2c2aa82d6633..05ab690277e6 100644 --- a/instrumentation/play/play-2.3/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_3/RequestCompleteCallback.java +++ b/instrumentation/play/play-2.3/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_3/RequestCompleteCallback.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.play.v2_3; diff --git a/instrumentation/play/play-2.3/src/test/groovy/client/PlayWSClientTest.groovy b/instrumentation/play/play-2.3/src/test/groovy/client/PlayWSClientTest.groovy index 6dc87ae0d8c3..137b9d6224cc 100644 --- a/instrumentation/play/play-2.3/src/test/groovy/client/PlayWSClientTest.groovy +++ b/instrumentation/play/play-2.3/src/test/groovy/client/PlayWSClientTest.groovy @@ -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 client diff --git a/instrumentation/play/play-2.3/src/test/groovy/server/PlayAsyncServerTest.groovy b/instrumentation/play/play-2.3/src/test/groovy/server/PlayAsyncServerTest.groovy index fa70df59a27b..d17720db1f2b 100644 --- a/instrumentation/play/play-2.3/src/test/groovy/server/PlayAsyncServerTest.groovy +++ b/instrumentation/play/play-2.3/src/test/groovy/server/PlayAsyncServerTest.groovy @@ -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 server diff --git a/instrumentation/play/play-2.3/src/test/groovy/server/PlayServerTest.groovy b/instrumentation/play/play-2.3/src/test/groovy/server/PlayServerTest.groovy index fe854debaccb..9d785b56725a 100644 --- a/instrumentation/play/play-2.3/src/test/groovy/server/PlayServerTest.groovy +++ b/instrumentation/play/play-2.3/src/test/groovy/server/PlayServerTest.groovy @@ -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 server @@ -46,8 +35,8 @@ class PlayServerTest extends HttpServerTest { @Override void handlerSpan(TraceAssert trace, int index, Object parent, String method = "GET", ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName "play.request" - spanKind INTERNAL + name "play.request" + kind INTERNAL errored endpoint == EXCEPTION if (endpoint == EXCEPTION) { errorEvent(Exception, EXCEPTION.body) diff --git a/instrumentation/play/play-2.3/src/test/scala/server/AsyncServer.scala b/instrumentation/play/play-2.3/src/test/scala/server/AsyncServer.scala index 0b459a7f38b0..c3f73ecb5ad4 100644 --- a/instrumentation/play/play-2.3/src/test/scala/server/AsyncServer.scala +++ b/instrumentation/play/play-2.3/src/test/scala/server/AsyncServer.scala @@ -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 server diff --git a/instrumentation/play/play-2.3/src/test/scala/server/ControllerClosureAdapter.scala b/instrumentation/play/play-2.3/src/test/scala/server/ControllerClosureAdapter.scala index 1e84b4748f46..3e4f5b415560 100644 --- a/instrumentation/play/play-2.3/src/test/scala/server/ControllerClosureAdapter.scala +++ b/instrumentation/play/play-2.3/src/test/scala/server/ControllerClosureAdapter.scala @@ -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 server diff --git a/instrumentation/play/play-2.3/src/test/scala/server/Settings.scala b/instrumentation/play/play-2.3/src/test/scala/server/Settings.scala index 56fca48c2b00..16b2a477c85b 100644 --- a/instrumentation/play/play-2.3/src/test/scala/server/Settings.scala +++ b/instrumentation/play/play-2.3/src/test/scala/server/Settings.scala @@ -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 server diff --git a/instrumentation/play/play-2.3/src/test/scala/server/SyncServer.scala b/instrumentation/play/play-2.3/src/test/scala/server/SyncServer.scala index 5cf50a739bd4..31a301a70010 100644 --- a/instrumentation/play/play-2.3/src/test/scala/server/SyncServer.scala +++ b/instrumentation/play/play-2.3/src/test/scala/server/SyncServer.scala @@ -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 server diff --git a/instrumentation/play/play-2.4/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_4/PlayAdvice.java b/instrumentation/play/play-2.4/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_4/PlayAdvice.java index db38fc9617c1..43319ca01225 100644 --- a/instrumentation/play/play-2.4/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_4/PlayAdvice.java +++ b/instrumentation/play/play-2.4/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_4/PlayAdvice.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.play.v2_4; diff --git a/instrumentation/play/play-2.4/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_4/PlayInstrumentation.java b/instrumentation/play/play-2.4/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_4/PlayInstrumentation.java index d348fccdfd05..9fb47a104003 100644 --- a/instrumentation/play/play-2.4/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_4/PlayInstrumentation.java +++ b/instrumentation/play/play-2.4/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_4/PlayInstrumentation.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.play.v2_4; diff --git a/instrumentation/play/play-2.4/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_4/PlayTracer.java b/instrumentation/play/play-2.4/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_4/PlayTracer.java index 6544cb23aa3e..cfb77d46cc23 100644 --- a/instrumentation/play/play-2.4/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_4/PlayTracer.java +++ b/instrumentation/play/play-2.4/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_4/PlayTracer.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.play.v2_4; diff --git a/instrumentation/play/play-2.4/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_4/RequestCompleteCallback.java b/instrumentation/play/play-2.4/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_4/RequestCompleteCallback.java index 2264ebd15388..5a27ebbabe3b 100644 --- a/instrumentation/play/play-2.4/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_4/RequestCompleteCallback.java +++ b/instrumentation/play/play-2.4/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_4/RequestCompleteCallback.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.play.v2_4; diff --git a/instrumentation/play/play-2.4/src/test/groovy/client/PlayWSClientTest.groovy b/instrumentation/play/play-2.4/src/test/groovy/client/PlayWSClientTest.groovy index c79d1d81f9fe..3ee0e3148ec9 100644 --- a/instrumentation/play/play-2.4/src/test/groovy/client/PlayWSClientTest.groovy +++ b/instrumentation/play/play-2.4/src/test/groovy/client/PlayWSClientTest.groovy @@ -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 client diff --git a/instrumentation/play/play-2.4/src/test/groovy/server/PlayAsyncServerTest.groovy b/instrumentation/play/play-2.4/src/test/groovy/server/PlayAsyncServerTest.groovy index 993bd6aeb807..36ec1e45cfc1 100644 --- a/instrumentation/play/play-2.4/src/test/groovy/server/PlayAsyncServerTest.groovy +++ b/instrumentation/play/play-2.4/src/test/groovy/server/PlayAsyncServerTest.groovy @@ -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 server diff --git a/instrumentation/play/play-2.4/src/test/groovy/server/PlayServerTest.groovy b/instrumentation/play/play-2.4/src/test/groovy/server/PlayServerTest.groovy index 5127495ee0cb..4201aeefed73 100644 --- a/instrumentation/play/play-2.4/src/test/groovy/server/PlayServerTest.groovy +++ b/instrumentation/play/play-2.4/src/test/groovy/server/PlayServerTest.groovy @@ -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 server @@ -83,8 +72,8 @@ class PlayServerTest extends HttpServerTest { @Override void handlerSpan(TraceAssert trace, int index, Object parent, String method = "GET", ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName "play.request" - spanKind INTERNAL + name "play.request" + kind INTERNAL errored endpoint == EXCEPTION if (endpoint == EXCEPTION) { errorEvent(Exception, EXCEPTION.body) diff --git a/instrumentation/play/play-2.6/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_6/PlayAdvice.java b/instrumentation/play/play-2.6/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_6/PlayAdvice.java index cf430f29a348..afeb4051467f 100644 --- a/instrumentation/play/play-2.6/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_6/PlayAdvice.java +++ b/instrumentation/play/play-2.6/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_6/PlayAdvice.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.play.v2_6; diff --git a/instrumentation/play/play-2.6/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_6/PlayInstrumentation.java b/instrumentation/play/play-2.6/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_6/PlayInstrumentation.java index d06205c4848f..f831b215ffdd 100644 --- a/instrumentation/play/play-2.6/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_6/PlayInstrumentation.java +++ b/instrumentation/play/play-2.6/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_6/PlayInstrumentation.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.play.v2_6; diff --git a/instrumentation/play/play-2.6/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_6/PlayTracer.java b/instrumentation/play/play-2.6/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_6/PlayTracer.java index 55d19fc1f9cd..a25d15561f7b 100644 --- a/instrumentation/play/play-2.6/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_6/PlayTracer.java +++ b/instrumentation/play/play-2.6/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_6/PlayTracer.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.play.v2_6; diff --git a/instrumentation/play/play-2.6/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_6/RequestCompleteCallback.java b/instrumentation/play/play-2.6/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_6/RequestCompleteCallback.java index c12ef35d2303..264e87d8d902 100644 --- a/instrumentation/play/play-2.6/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_6/RequestCompleteCallback.java +++ b/instrumentation/play/play-2.6/src/main/java/io/opentelemetry/instrumentation/auto/play/v2_6/RequestCompleteCallback.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.play.v2_6; diff --git a/instrumentation/play/play-2.6/src/test/groovy/server/PlayAsyncServerTest.groovy b/instrumentation/play/play-2.6/src/test/groovy/server/PlayAsyncServerTest.groovy index 89788360b3b2..abf021acf8e1 100644 --- a/instrumentation/play/play-2.6/src/test/groovy/server/PlayAsyncServerTest.groovy +++ b/instrumentation/play/play-2.6/src/test/groovy/server/PlayAsyncServerTest.groovy @@ -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 server diff --git a/instrumentation/play/play-2.6/src/test/groovy/server/PlayServerTest.groovy b/instrumentation/play/play-2.6/src/test/groovy/server/PlayServerTest.groovy index 54d40ff64949..8c78806b5fff 100644 --- a/instrumentation/play/play-2.6/src/test/groovy/server/PlayServerTest.groovy +++ b/instrumentation/play/play-2.6/src/test/groovy/server/PlayServerTest.groovy @@ -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 server @@ -85,8 +74,8 @@ class PlayServerTest extends HttpServerTest { @Override void handlerSpan(TraceAssert trace, int index, Object parent, String method = "GET", ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName "play.request" - spanKind INTERNAL + name "play.request" + kind INTERNAL errored endpoint == EXCEPTION childOf((SpanData) parent) if (endpoint == EXCEPTION) { diff --git a/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/RabbitChannelInstrumentation.java b/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/RabbitChannelInstrumentation.java index 592984d23ba2..d0e22b8fa4ad 100644 --- a/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/RabbitChannelInstrumentation.java +++ b/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/RabbitChannelInstrumentation.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.rabbitmq.amqp; diff --git a/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/RabbitCommandInstrumentation.java b/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/RabbitCommandInstrumentation.java index 2aae1d4a8844..d05824a6030d 100644 --- a/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/RabbitCommandInstrumentation.java +++ b/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/RabbitCommandInstrumentation.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.rabbitmq.amqp; diff --git a/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/RabbitTracer.java b/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/RabbitTracer.java index 879af5d513a9..42ee9b206352 100644 --- a/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/RabbitTracer.java +++ b/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/RabbitTracer.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.rabbitmq.amqp; diff --git a/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/TextMapExtractAdapter.java b/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/TextMapExtractAdapter.java index b6660996c0f4..ad05332d53b1 100644 --- a/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/TextMapExtractAdapter.java +++ b/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/TextMapExtractAdapter.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.rabbitmq.amqp; diff --git a/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/TextMapInjectAdapter.java b/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/TextMapInjectAdapter.java index bb69def9aa4e..658ff2ac6af8 100644 --- a/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/TextMapInjectAdapter.java +++ b/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/TextMapInjectAdapter.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.rabbitmq.amqp; diff --git a/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/TracedDelegatingConsumer.java b/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/TracedDelegatingConsumer.java index 30bac7cb85fb..087338de146d 100644 --- a/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/TracedDelegatingConsumer.java +++ b/instrumentation/rabbitmq-2.7/src/main/java/io/opentelemetry/instrumentation/auto/rabbitmq/amqp/TracedDelegatingConsumer.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.rabbitmq.amqp; diff --git a/instrumentation/rabbitmq-2.7/src/test/groovy/RabbitMQTest.groovy b/instrumentation/rabbitmq-2.7/src/test/groovy/RabbitMQTest.groovy index 5b1f6af4965e..f91328d4a372 100644 --- a/instrumentation/rabbitmq-2.7/src/test/groovy/RabbitMQTest.groovy +++ b/instrumentation/rabbitmq-2.7/src/test/groovy/RabbitMQTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace @@ -30,7 +19,7 @@ import com.rabbitmq.client.GetResponse import com.rabbitmq.client.ShutdownSignalException import io.opentelemetry.auto.test.AgentTestRunner import io.opentelemetry.auto.test.asserts.TraceAssert -import io.opentelemetry.common.AttributesKeys +import io.opentelemetry.common.AttributeKey import io.opentelemetry.sdk.trace.data.SpanData import io.opentelemetry.trace.attributes.SemanticAttributes import java.time.Duration @@ -111,7 +100,7 @@ class RabbitMQTest extends AgentTestRunner { assertTraces(1) { trace(0, 6) { span(0) { - operationName "parent" + name "parent" attributes { } } @@ -346,26 +335,26 @@ class RabbitMQTest extends AgentTestRunner { } trace.span(index) { - operationName spanName + name spanName - switch (trace.span(index).attributes.get(AttributesKeys.stringKey("amqp.command"))) { + switch (trace.span(index).attributes.get(AttributeKey.stringKey("amqp.command"))) { case "basic.publish": - spanKind PRODUCER + kind PRODUCER break case "basic.get": - spanKind CLIENT + kind CLIENT break case "basic.deliver": - spanKind CONSUMER + kind CONSUMER break default: - spanKind CLIENT + kind CLIENT } if (parentSpan) { childOf((SpanData) parentSpan) } else { - parent() + hasNoParent() } if (linkSpan) { diff --git a/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ActionWrapper.java b/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ActionWrapper.java index 6cf0a8f0b6a8..5b2678b9ae22 100644 --- a/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ActionWrapper.java +++ b/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ActionWrapper.java @@ -1,27 +1,14 @@ /* * 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.ratpack; -import static io.opentelemetry.trace.TracingContextUtils.currentContextWith; +import static io.opentelemetry.context.ContextUtils.withScopedContext; -import io.opentelemetry.OpenTelemetry; +import io.grpc.Context; import io.opentelemetry.context.Scope; -import io.opentelemetry.trace.Span; -import io.opentelemetry.trace.Tracer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import ratpack.func.Action; @@ -30,30 +17,27 @@ public class ActionWrapper implements Action { private static final Logger log = LoggerFactory.getLogger(ActionWrapper.class); - private static final Tracer TRACER = OpenTelemetry.getTracer("io.opentelemetry.auto.ratpack-1.4"); - private final Action delegate; - private final Span span; + private final Context parentContext; - private ActionWrapper(Action delegate, Span span) { - assert span != null; + private ActionWrapper(Action delegate, Context parentContext) { + assert parentContext != null; this.delegate = delegate; - this.span = span; + this.parentContext = parentContext; } @Override public void execute(T t) throws Exception { - try (Scope scope = currentContextWith(span)) { + try (Scope ignored = withScopedContext(parentContext)) { delegate.execute(t); } } public static Action wrapIfNeeded(Action delegate) { - Span span = TRACER.getCurrentSpan(); - if (delegate instanceof ActionWrapper || !span.getContext().isValid()) { + if (delegate instanceof ActionWrapper) { return delegate; } log.debug("Wrapping action task {}", delegate); - return new ActionWrapper(delegate, span); + return new ActionWrapper(delegate, Context.current()); } } diff --git a/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/BlockWrapper.java b/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/BlockWrapper.java index be5dad855329..1d63cb870259 100644 --- a/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/BlockWrapper.java +++ b/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/BlockWrapper.java @@ -1,26 +1,15 @@ /* * 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.ratpack; -import static io.opentelemetry.trace.TracingContextUtils.currentContextWith; +import static io.opentelemetry.context.ContextUtils.withScopedContext; +import io.grpc.Context; import io.opentelemetry.OpenTelemetry; import io.opentelemetry.context.Scope; -import io.opentelemetry.trace.Span; import io.opentelemetry.trace.Tracer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -33,27 +22,26 @@ public class BlockWrapper implements Block { private static final Tracer TRACER = OpenTelemetry.getTracer("io.opentelemetry.auto.ratpack-1.4"); private final Block delegate; - private final Span span; + private final Context parentContext; - private BlockWrapper(Block delegate, Span span) { - assert span != null; + private BlockWrapper(Block delegate, Context parentContext) { + assert parentContext != null; this.delegate = delegate; - this.span = span; + this.parentContext = parentContext; } @Override public void execute() throws Exception { - try (Scope scope = currentContextWith(span)) { + try (Scope ignored = withScopedContext(parentContext)) { delegate.execute(); } } public static Block wrapIfNeeded(Block delegate) { - Span span = TRACER.getCurrentSpan(); - if (delegate instanceof BlockWrapper || !span.getContext().isValid()) { + if (delegate instanceof BlockWrapper) { return delegate; } log.debug("Wrapping block {}", delegate); - return new BlockWrapper(delegate, span); + return new BlockWrapper(delegate, Context.current()); } } diff --git a/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ContinuationInstrumentation.java b/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ContinuationInstrumentation.java index 09ce49d79697..274793090a67 100644 --- a/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ContinuationInstrumentation.java +++ b/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ContinuationInstrumentation.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.ratpack; diff --git a/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/DefaultExecutionInstrumentation.java b/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/DefaultExecutionInstrumentation.java index 9474b83a835e..3f1d026570be 100644 --- a/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/DefaultExecutionInstrumentation.java +++ b/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/DefaultExecutionInstrumentation.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.ratpack; diff --git a/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ErrorHandlerAdvice.java b/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ErrorHandlerAdvice.java index 8a120bbf9f13..6db43be1ff1e 100644 --- a/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ErrorHandlerAdvice.java +++ b/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ErrorHandlerAdvice.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.ratpack; @@ -19,7 +8,7 @@ import static io.opentelemetry.instrumentation.auto.ratpack.RatpackTracer.TRACER; import io.opentelemetry.trace.Span; -import io.opentelemetry.trace.Status; +import io.opentelemetry.trace.StatusCanonicalCode; import java.util.Optional; import net.bytebuddy.asm.Advice; import ratpack.handling.Context; @@ -31,7 +20,7 @@ public static void captureThrowable( Optional span = ctx.maybeGet(Span.class); if (span.isPresent()) { // TODO this emulates old behaviour of BaseDecorator. Has to review - span.get().setStatus(Status.UNKNOWN); + span.get().setStatus(StatusCanonicalCode.ERROR); TRACER.addThrowable(span.get(), throwable); } } diff --git a/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/RatpackTracer.java b/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/RatpackTracer.java index ccc9bf086388..b6e86ba84747 100644 --- a/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/RatpackTracer.java +++ b/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/RatpackTracer.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.ratpack; diff --git a/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ServerErrorHandlerInstrumentation.java b/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ServerErrorHandlerInstrumentation.java index 656f29dab5b9..aeb2d3099ac9 100644 --- a/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ServerErrorHandlerInstrumentation.java +++ b/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ServerErrorHandlerInstrumentation.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.ratpack; diff --git a/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ServerRegistryAdvice.java b/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ServerRegistryAdvice.java index 7374e58d8bf1..14d6e7dccace 100644 --- a/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ServerRegistryAdvice.java +++ b/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ServerRegistryAdvice.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.ratpack; diff --git a/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ServerRegistryInstrumentation.java b/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ServerRegistryInstrumentation.java index 964982428a42..505da6c366af 100644 --- a/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ServerRegistryInstrumentation.java +++ b/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/ServerRegistryInstrumentation.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.ratpack; diff --git a/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/TracingHandler.java b/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/TracingHandler.java index a57e3432b582..9ed2f8d881f9 100644 --- a/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/TracingHandler.java +++ b/instrumentation/ratpack-1.4/src/main/java/io/opentelemetry/instrumentation/auto/ratpack/TracingHandler.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.ratpack; @@ -29,7 +18,7 @@ import ratpack.handling.Handler; public final class TracingHandler implements Handler { - public static Handler INSTANCE = new TracingHandler(); + public static final Handler INSTANCE = new TracingHandler(); /** * This constant is copied over from diff --git a/instrumentation/ratpack-1.4/src/test/groovy/RatpackOtherTest.groovy b/instrumentation/ratpack-1.4/src/test/groovy/RatpackOtherTest.groovy index d4a22fef4dfe..84aefc835dbd 100644 --- a/instrumentation/ratpack-1.4/src/test/groovy/RatpackOtherTest.groovy +++ b/instrumentation/ratpack-1.4/src/test/groovy/RatpackOtherTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.INTERNAL @@ -81,9 +70,9 @@ class RatpackOtherTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "/$route" - spanKind SERVER - parent() + name "/$route" + kind SERVER + hasNoParent() errored false attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -97,8 +86,8 @@ class RatpackOtherTest extends AgentTestRunner { } } span(1) { - operationName "/$route" - spanKind INTERNAL + name "/$route" + kind INTERNAL childOf span(0) errored false attributes { diff --git a/instrumentation/ratpack-1.4/src/test/groovy/client/RatpackForkedHttpClientTest.groovy b/instrumentation/ratpack-1.4/src/test/groovy/client/RatpackForkedHttpClientTest.groovy index 72b09f318f51..c33acb7f273d 100644 --- a/instrumentation/ratpack-1.4/src/test/groovy/client/RatpackForkedHttpClientTest.groovy +++ b/instrumentation/ratpack-1.4/src/test/groovy/client/RatpackForkedHttpClientTest.groovy @@ -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 client diff --git a/instrumentation/ratpack-1.4/src/test/groovy/client/RatpackHttpClientTest.groovy b/instrumentation/ratpack-1.4/src/test/groovy/client/RatpackHttpClientTest.groovy index 2dd3d6c9abc7..274a3337a638 100644 --- a/instrumentation/ratpack-1.4/src/test/groovy/client/RatpackHttpClientTest.groovy +++ b/instrumentation/ratpack-1.4/src/test/groovy/client/RatpackHttpClientTest.groovy @@ -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 client diff --git a/instrumentation/ratpack-1.4/src/test/groovy/server/RatpackAsyncHttpServerTest.groovy b/instrumentation/ratpack-1.4/src/test/groovy/server/RatpackAsyncHttpServerTest.groovy index 77dbf2efdae6..762308f5c806 100644 --- a/instrumentation/ratpack-1.4/src/test/groovy/server/RatpackAsyncHttpServerTest.groovy +++ b/instrumentation/ratpack-1.4/src/test/groovy/server/RatpackAsyncHttpServerTest.groovy @@ -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 server diff --git a/instrumentation/ratpack-1.4/src/test/groovy/server/RatpackForkedHttpServerTest.groovy b/instrumentation/ratpack-1.4/src/test/groovy/server/RatpackForkedHttpServerTest.groovy index 96b700bb4fef..48ee9439a539 100644 --- a/instrumentation/ratpack-1.4/src/test/groovy/server/RatpackForkedHttpServerTest.groovy +++ b/instrumentation/ratpack-1.4/src/test/groovy/server/RatpackForkedHttpServerTest.groovy @@ -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 server diff --git a/instrumentation/ratpack-1.4/src/test/groovy/server/RatpackHttpServerTest.groovy b/instrumentation/ratpack-1.4/src/test/groovy/server/RatpackHttpServerTest.groovy index cbc1e43dbe73..e03a461b33e4 100644 --- a/instrumentation/ratpack-1.4/src/test/groovy/server/RatpackHttpServerTest.groovy +++ b/instrumentation/ratpack-1.4/src/test/groovy/server/RatpackHttpServerTest.groovy @@ -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 server @@ -120,8 +109,8 @@ class RatpackHttpServerTest extends HttpServerTest { @Override void handlerSpan(TraceAssert trace, int index, Object parent, String method = "GET", ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName endpoint.status == 404 ? "/" : endpoint == PATH_PARAM ? "/path/:id/param" : endpoint.path - spanKind INTERNAL + name endpoint.status == 404 ? "/" : endpoint == PATH_PARAM ? "/path/:id/param" : endpoint.path + kind INTERNAL errored endpoint == EXCEPTION childOf((SpanData) parent) if (endpoint == EXCEPTION) { diff --git a/instrumentation/reactor-3.1/src/main/java/io/opentelemetry/instrumentation/auto/reactor/ReactorHooksAdvice.java b/instrumentation/reactor-3.1/src/main/java/io/opentelemetry/instrumentation/auto/reactor/ReactorHooksAdvice.java index 1edeac7659fe..8278656131d0 100644 --- a/instrumentation/reactor-3.1/src/main/java/io/opentelemetry/instrumentation/auto/reactor/ReactorHooksAdvice.java +++ b/instrumentation/reactor-3.1/src/main/java/io/opentelemetry/instrumentation/auto/reactor/ReactorHooksAdvice.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.reactor; diff --git a/instrumentation/reactor-3.1/src/main/java/io/opentelemetry/instrumentation/auto/reactor/ReactorHooksInstrumentation.java b/instrumentation/reactor-3.1/src/main/java/io/opentelemetry/instrumentation/auto/reactor/ReactorHooksInstrumentation.java index 4993dcf738b0..dbe08da839a1 100644 --- a/instrumentation/reactor-3.1/src/main/java/io/opentelemetry/instrumentation/auto/reactor/ReactorHooksInstrumentation.java +++ b/instrumentation/reactor-3.1/src/main/java/io/opentelemetry/instrumentation/auto/reactor/ReactorHooksInstrumentation.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.reactor; diff --git a/instrumentation/reactor-3.1/src/test/groovy/ReactorCoreTest.groovy b/instrumentation/reactor-3.1/src/test/groovy/ReactorCoreTest.groovy index 4d7d042253e9..f00ba8f85d93 100644 --- a/instrumentation/reactor-3.1/src/test/groovy/ReactorCoreTest.groovy +++ b/instrumentation/reactor-3.1/src/test/groovy/ReactorCoreTest.groovy @@ -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 */ import io.opentelemetry.OpenTelemetry @@ -56,13 +45,13 @@ class ReactorCoreTest extends AgentTestRunner { assertTraces(1) { trace(0, workSpans + 2) { span(0) { - operationName "trace-parent" - parent() + name "trace-parent" + hasNoParent() attributes { } } span(1) { - operationName "publisher-parent" + name "publisher-parent" childOf span(0) attributes { } @@ -72,7 +61,7 @@ class ReactorCoreTest extends AgentTestRunner { for (int i = 0; i < workSpans; i++) { span(i + 2) { - operationName "add one" + name "add one" childOf span(1) attributes { } @@ -82,7 +71,7 @@ class ReactorCoreTest extends AgentTestRunner { } where: - name | expected | workSpans | publisherSupplier + paramName | expected | workSpans | publisherSupplier "basic mono" | 2 | 1 | { -> Mono.just(1).map(addOne) } "two operations mono" | 4 | 2 | { -> Mono.just(2).map(addOne).map(addOne) } "delayed mono" | 4 | 1 | { -> @@ -118,10 +107,10 @@ class ReactorCoreTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "trace-parent" + name "trace-parent" errored true errorEvent(RuntimeException, EXCEPTION_MESSAGE) - parent() + hasNoParent() } // It's important that we don't attach errors at the Reactor level so that we don't @@ -133,9 +122,9 @@ class ReactorCoreTest extends AgentTestRunner { } where: - name | publisherSupplier - "mono" | { -> Mono.error(new RuntimeException(EXCEPTION_MESSAGE)) } - "flux" | { -> Flux.error(new RuntimeException(EXCEPTION_MESSAGE)) } + paramName | publisherSupplier + "mono" | { -> Mono.error(new RuntimeException(EXCEPTION_MESSAGE)) } + "flux" | { -> Flux.error(new RuntimeException(EXCEPTION_MESSAGE)) } } def "Publisher step '#name' test"() { @@ -149,10 +138,10 @@ class ReactorCoreTest extends AgentTestRunner { assertTraces(1) { trace(0, workSpans + 2) { span(0) { - operationName "trace-parent" + name "trace-parent" errored true errorEvent(RuntimeException, EXCEPTION_MESSAGE) - parent() + hasNoParent() } // It's important that we don't attach errors at the Reactor level so that we don't @@ -163,7 +152,7 @@ class ReactorCoreTest extends AgentTestRunner { for (int i = 0; i < workSpans; i++) { span(i + 2) { - operationName "add one" + name "add one" childOf span(1) attributes { } @@ -173,7 +162,7 @@ class ReactorCoreTest extends AgentTestRunner { } where: - name | workSpans | publisherSupplier + paramName | workSpans | publisherSupplier "basic mono failure" | 1 | { -> Mono.just(1).map(addOne).map({ throwException() }) } "basic flux failure" | 1 | { -> Flux.fromIterable([5, 6]).map(addOne).map({ throwException() }) @@ -188,8 +177,8 @@ class ReactorCoreTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "trace-parent" - parent() + name "trace-parent" + hasNoParent() attributes { } } @@ -199,7 +188,7 @@ class ReactorCoreTest extends AgentTestRunner { } where: - name | publisherSupplier + paramName | publisherSupplier "basic mono" | { -> Mono.just(1) } "basic flux" | { -> Flux.fromIterable([5, 6]) } } @@ -212,8 +201,8 @@ class ReactorCoreTest extends AgentTestRunner { assertTraces(1) { trace(0, workSpans + 2) { span(0) { - operationName "trace-parent" - parent() + name "trace-parent" + hasNoParent() attributes { } } @@ -222,7 +211,7 @@ class ReactorCoreTest extends AgentTestRunner { for (int i = 0; i < workSpans; i++) { span(i + 2) { - operationName "add one" + name "add one" childOf span(1) attributes { } @@ -232,7 +221,7 @@ class ReactorCoreTest extends AgentTestRunner { } where: - name | workSpans | publisherSupplier + paramName | workSpans | publisherSupplier "basic mono" | 3 | { -> Mono.just(1).map(addOne).map(addOne).then(Mono.just(1).map(addOne)) } @@ -299,7 +288,7 @@ class ReactorCoreTest extends AgentTestRunner { } where: - name | workItems | publisherSupplier + paramName | workItems | publisherSupplier "basic mono" | 1 | { -> Mono.just(1).map(addOne) } "basic flux" | 2 | { -> Flux.fromIterable([1, 2]).map(addOne) } } diff --git a/instrumentation/reactor-3.1/src/test/groovy/SubscriptionTest.groovy b/instrumentation/reactor-3.1/src/test/groovy/SubscriptionTest.groovy index 9933e065e14b..82b77065bcc2 100644 --- a/instrumentation/reactor-3.1/src/test/groovy/SubscriptionTest.groovy +++ b/instrumentation/reactor-3.1/src/test/groovy/SubscriptionTest.groovy @@ -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 */ import io.opentelemetry.OpenTelemetry diff --git a/instrumentation/rediscala-1.8/src/main/java/io/opentelemetry/instrumentation/auto/rediscala/RediscalaClientTracer.java b/instrumentation/rediscala-1.8/src/main/java/io/opentelemetry/instrumentation/auto/rediscala/RediscalaClientTracer.java index 4ba1e1d2df54..d6d094b60a98 100644 --- a/instrumentation/rediscala-1.8/src/main/java/io/opentelemetry/instrumentation/auto/rediscala/RediscalaClientTracer.java +++ b/instrumentation/rediscala-1.8/src/main/java/io/opentelemetry/instrumentation/auto/rediscala/RediscalaClientTracer.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.rediscala; diff --git a/instrumentation/rediscala-1.8/src/main/java/io/opentelemetry/instrumentation/auto/rediscala/RediscalaInstrumentation.java b/instrumentation/rediscala-1.8/src/main/java/io/opentelemetry/instrumentation/auto/rediscala/RediscalaInstrumentation.java index 25dfc2b56dd1..25063b6aeead 100644 --- a/instrumentation/rediscala-1.8/src/main/java/io/opentelemetry/instrumentation/auto/rediscala/RediscalaInstrumentation.java +++ b/instrumentation/rediscala-1.8/src/main/java/io/opentelemetry/instrumentation/auto/rediscala/RediscalaInstrumentation.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.rediscala; diff --git a/instrumentation/rediscala-1.8/src/test/groovy/RediscalaClientTest.groovy b/instrumentation/rediscala-1.8/src/test/groovy/RediscalaClientTest.groovy index 514723c7d38a..3fffa544047a 100644 --- a/instrumentation/rediscala-1.8/src/test/groovy/RediscalaClientTest.groovy +++ b/instrumentation/rediscala-1.8/src/test/groovy/RediscalaClientTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -85,8 +74,8 @@ class RediscalaClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "Set" - spanKind CLIENT + name "Set" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.DB_STATEMENT.key()}" "Set" @@ -113,8 +102,8 @@ class RediscalaClientTest extends AgentTestRunner { assertTraces(2) { trace(0, 1) { span(0) { - operationName "Set" - spanKind CLIENT + name "Set" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.DB_STATEMENT.key()}" "Set" @@ -123,8 +112,8 @@ class RediscalaClientTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "Get" - spanKind CLIENT + name "Get" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.DB_STATEMENT.key()}" "Get" diff --git a/instrumentation/redisson-3.0/src/main/java/io/opentelemetry/instrumentation/auto/redisson/RedissonClientTracer.java b/instrumentation/redisson-3.0/src/main/java/io/opentelemetry/instrumentation/auto/redisson/RedissonClientTracer.java index 01591848d0f9..157e04ccaf2d 100644 --- a/instrumentation/redisson-3.0/src/main/java/io/opentelemetry/instrumentation/auto/redisson/RedissonClientTracer.java +++ b/instrumentation/redisson-3.0/src/main/java/io/opentelemetry/instrumentation/auto/redisson/RedissonClientTracer.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.redisson; diff --git a/instrumentation/redisson-3.0/src/main/java/io/opentelemetry/instrumentation/auto/redisson/RedissonInstrumentation.java b/instrumentation/redisson-3.0/src/main/java/io/opentelemetry/instrumentation/auto/redisson/RedissonInstrumentation.java index 59588a6d914d..9f24e8bd061c 100644 --- a/instrumentation/redisson-3.0/src/main/java/io/opentelemetry/instrumentation/auto/redisson/RedissonInstrumentation.java +++ b/instrumentation/redisson-3.0/src/main/java/io/opentelemetry/instrumentation/auto/redisson/RedissonInstrumentation.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.redisson; diff --git a/instrumentation/redisson-3.0/src/test/groovy/RedissonAsyncClientTest.groovy b/instrumentation/redisson-3.0/src/test/groovy/RedissonAsyncClientTest.groovy index d6c9e18af12e..662e8f27888f 100644 --- a/instrumentation/redisson-3.0/src/test/groovy/RedissonAsyncClientTest.groovy +++ b/instrumentation/redisson-3.0/src/test/groovy/RedissonAsyncClientTest.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestRunner @@ -75,8 +64,8 @@ class RedissonAsyncClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -106,8 +95,8 @@ class RedissonAsyncClientTest extends AgentTestRunner { assertTraces(2) { trace(0, 1) { span(0) { - operationName "SADD" - spanKind CLIENT + name "SADD" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -120,8 +109,8 @@ class RedissonAsyncClientTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "RPUSH" - spanKind CLIENT + name "RPUSH" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" diff --git a/instrumentation/redisson-3.0/src/test/groovy/RedissonClientTest.groovy b/instrumentation/redisson-3.0/src/test/groovy/RedissonClientTest.groovy index b9ac8ead35f5..b73f5d1d66ed 100644 --- a/instrumentation/redisson-3.0/src/test/groovy/RedissonClientTest.groovy +++ b/instrumentation/redisson-3.0/src/test/groovy/RedissonClientTest.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestRunner @@ -80,8 +69,8 @@ class RedissonClientTest extends AgentTestRunner { assertTraces(2) { trace(0, 1) { span(0) { - operationName "SET" - spanKind CLIENT + name "SET" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -94,8 +83,8 @@ class RedissonClientTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "GET" - spanKind CLIENT + name "GET" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -119,8 +108,8 @@ class RedissonClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SET;SET" - spanKind CLIENT + name "SET;SET" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -142,8 +131,8 @@ class RedissonClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "RPUSH" - spanKind CLIENT + name "RPUSH" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -166,8 +155,8 @@ class RedissonClientTest extends AgentTestRunner { assertTraces(2) { trace(0, 1) { span(0) { - operationName "EVAL" - spanKind CLIENT + name "EVAL" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -180,8 +169,8 @@ class RedissonClientTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "HGET" - spanKind CLIENT + name "HGET" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -203,8 +192,8 @@ class RedissonClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "SADD" - spanKind CLIENT + name "SADD" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -230,8 +219,8 @@ class RedissonClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "ZADD" - spanKind CLIENT + name "ZADD" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -253,8 +242,8 @@ class RedissonClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "INCR" - spanKind CLIENT + name "INCR" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -277,8 +266,8 @@ class RedissonClientTest extends AgentTestRunner { assertTraces(2) { trace(0, 1) { span(0) { - operationName "EVAL" - spanKind CLIENT + name "EVAL" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -291,8 +280,8 @@ class RedissonClientTest extends AgentTestRunner { } trace(1, 1) { span(0) { - operationName "EVAL" - spanKind CLIENT + name "EVAL" + kind CLIENT attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "redis" "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" diff --git a/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/client/RmiClientInstrumentation.java b/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/client/RmiClientInstrumentation.java index 08f5c79546bc..806e8a9f3e89 100644 --- a/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/client/RmiClientInstrumentation.java +++ b/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/client/RmiClientInstrumentation.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.rmi.client; diff --git a/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/client/RmiClientTracer.java b/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/client/RmiClientTracer.java index 9083074bbad0..63639ab819d2 100644 --- a/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/client/RmiClientTracer.java +++ b/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/client/RmiClientTracer.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.rmi.client; diff --git a/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/context/ContextPayload.java b/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/context/ContextPayload.java index 7a2c94f72750..6fb281706e5b 100644 --- a/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/context/ContextPayload.java +++ b/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/context/ContextPayload.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.rmi.context; diff --git a/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/context/ContextPropagator.java b/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/context/ContextPropagator.java index 5f1e1169dbc4..5ce59396fc95 100644 --- a/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/context/ContextPropagator.java +++ b/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/context/ContextPropagator.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.rmi.context; diff --git a/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/context/client/RmiClientContextInstrumentation.java b/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/context/client/RmiClientContextInstrumentation.java index 2ba6bb582782..4adcd8924ae8 100644 --- a/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/context/client/RmiClientContextInstrumentation.java +++ b/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/context/client/RmiClientContextInstrumentation.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.rmi.context.client; diff --git a/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/context/server/ContextDispatcher.java b/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/context/server/ContextDispatcher.java index c02fb8a048f9..5a158e2b4b4d 100644 --- a/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/context/server/ContextDispatcher.java +++ b/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/context/server/ContextDispatcher.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.rmi.context.server; diff --git a/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/context/server/RmiServerContextInstrumentation.java b/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/context/server/RmiServerContextInstrumentation.java index d641047270e9..714463c586f4 100644 --- a/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/context/server/RmiServerContextInstrumentation.java +++ b/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/context/server/RmiServerContextInstrumentation.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.rmi.context.server; diff --git a/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/server/RmiServerInstrumentation.java b/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/server/RmiServerInstrumentation.java index e55955dfc2e7..4b1a2a09bdf0 100644 --- a/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/server/RmiServerInstrumentation.java +++ b/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/server/RmiServerInstrumentation.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.rmi.server; diff --git a/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/server/RmiServerTracer.java b/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/server/RmiServerTracer.java index a38f7e596cca..f7b07a54b198 100644 --- a/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/server/RmiServerTracer.java +++ b/instrumentation/rmi/src/main/java/io/opentelemetry/instrumentation/auto/rmi/server/RmiServerTracer.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.rmi.server; diff --git a/instrumentation/rmi/src/test/groovy/RmiTest.groovy b/instrumentation/rmi/src/test/groovy/RmiTest.groovy index e52687607940..a72d7d677136 100644 --- a/instrumentation/rmi/src/test/groovy/RmiTest.groovy +++ b/instrumentation/rmi/src/test/groovy/RmiTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.basicSpan @@ -54,8 +43,8 @@ class RmiTest extends AgentTestRunner { trace(0, 3) { basicSpan(it, 0, "parent") span(1) { - operationName "rmi.app.Greeter/hello" - spanKind CLIENT + name "rmi.app.Greeter/hello" + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.RPC_SYSTEM.key()}" "java_rmi" @@ -64,8 +53,8 @@ class RmiTest extends AgentTestRunner { } } span(2) { - operationName "rmi.app.Server/hello" - spanKind SERVER + name "rmi.app.Server/hello" + kind SERVER attributes { "${SemanticAttributes.RPC_SYSTEM.key()}" "java_rmi" "${SemanticAttributes.RPC_SERVICE.key()}" "rmi.app.Server" @@ -115,8 +104,8 @@ class RmiTest extends AgentTestRunner { trace(0, 3) { basicSpan(it, 0, "parent", null, thrownException) span(1) { - operationName "rmi.app.Greeter/exceptional" - spanKind CLIENT + name "rmi.app.Greeter/exceptional" + kind CLIENT childOf span(0) errored true errorEvent(RuntimeException, String) @@ -128,8 +117,8 @@ class RmiTest extends AgentTestRunner { } } span(2) { - operationName "rmi.app.Server/exceptional" - spanKind SERVER + name "rmi.app.Server/exceptional" + kind SERVER errored true errorEvent(RuntimeException, String) attributes { @@ -162,8 +151,8 @@ class RmiTest extends AgentTestRunner { trace(0, 3) { basicSpan(it, 0, "parent") span(1) { - operationName "rmi.app.Greeter/hello" - spanKind CLIENT + name "rmi.app.Greeter/hello" + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.RPC_SYSTEM.key()}" "java_rmi" @@ -173,8 +162,8 @@ class RmiTest extends AgentTestRunner { } span(2) { childOf span(1) - operationName "rmi.app.ServerLegacy/hello" - spanKind SERVER + name "rmi.app.ServerLegacy/hello" + kind SERVER attributes { "${SemanticAttributes.RPC_SYSTEM.key()}" "java_rmi" "${SemanticAttributes.RPC_SERVICE.key()}" "rmi.app.ServerLegacy" diff --git a/instrumentation/rmi/src/test/java/rmi/app/Greeter.java b/instrumentation/rmi/src/test/java/rmi/app/Greeter.java index 6b8ffaac4144..57c715b10161 100644 --- a/instrumentation/rmi/src/test/java/rmi/app/Greeter.java +++ b/instrumentation/rmi/src/test/java/rmi/app/Greeter.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 rmi.app; diff --git a/instrumentation/rmi/src/test/java/rmi/app/Server.java b/instrumentation/rmi/src/test/java/rmi/app/Server.java index 223667cce65d..6ba5de00c97b 100644 --- a/instrumentation/rmi/src/test/java/rmi/app/Server.java +++ b/instrumentation/rmi/src/test/java/rmi/app/Server.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 rmi.app; diff --git a/instrumentation/rmi/src/test/java/rmi/app/ServerLegacy.java b/instrumentation/rmi/src/test/java/rmi/app/ServerLegacy.java index 5bca33106650..5defe9b4a253 100644 --- a/instrumentation/rmi/src/test/java/rmi/app/ServerLegacy.java +++ b/instrumentation/rmi/src/test/java/rmi/app/ServerLegacy.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 rmi.app; diff --git a/instrumentation/rxjava-1.0/src/main/java/io/opentelemetry/instrumentation/auto/rxjava/SpanFinishingSubscription.java b/instrumentation/rxjava-1.0/src/main/java/io/opentelemetry/instrumentation/auto/rxjava/SpanFinishingSubscription.java index 60b4974d110f..fc2cb67e6587 100644 --- a/instrumentation/rxjava-1.0/src/main/java/io/opentelemetry/instrumentation/auto/rxjava/SpanFinishingSubscription.java +++ b/instrumentation/rxjava-1.0/src/main/java/io/opentelemetry/instrumentation/auto/rxjava/SpanFinishingSubscription.java @@ -1,21 +1,13 @@ /* * 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.rxjava; +import static io.opentelemetry.trace.TracingContextUtils.getSpan; + +import io.grpc.Context; import io.opentelemetry.instrumentation.api.tracer.BaseTracer; import io.opentelemetry.trace.Span; import java.util.concurrent.atomic.AtomicReference; @@ -23,23 +15,26 @@ public class SpanFinishingSubscription implements Subscription { private final BaseTracer tracer; - private final AtomicReference spanRef; + private final AtomicReference contextRef; - public SpanFinishingSubscription(BaseTracer tracer, AtomicReference spanRef) { + public SpanFinishingSubscription(BaseTracer tracer, AtomicReference contextRef) { this.tracer = tracer; - this.spanRef = spanRef; + this.contextRef = contextRef; } @Override public void unsubscribe() { - Span span = spanRef.getAndSet(null); - if (span != null) { - tracer.end(span); + Context context = contextRef.getAndSet(null); + if (context != null) { + Span span = getSpan(context); + if (span.getContext().isValid()) { + tracer.end(span); + } } } @Override public boolean isUnsubscribed() { - return spanRef.get() == null; + return contextRef.get() == null; } } diff --git a/instrumentation/rxjava-1.0/src/main/java/io/opentelemetry/instrumentation/auto/rxjava/TracedOnSubscribe.java b/instrumentation/rxjava-1.0/src/main/java/io/opentelemetry/instrumentation/auto/rxjava/TracedOnSubscribe.java index 0992596f2803..e61a3cbe8b00 100644 --- a/instrumentation/rxjava-1.0/src/main/java/io/opentelemetry/instrumentation/auto/rxjava/TracedOnSubscribe.java +++ b/instrumentation/rxjava-1.0/src/main/java/io/opentelemetry/instrumentation/auto/rxjava/TracedOnSubscribe.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.rxjava; @@ -44,13 +33,12 @@ public TracedOnSubscribe( @Override public void call(Subscriber subscriber) { - // TODO too many contexts here - // Review if we can pass parentContext to startSpan + // TODO pass Context into Tracer.startSpan() and then don't need this outer scoping try (Scope ignored = ContextUtils.withScopedContext(parentContext)) { Span span = tracer.startSpan(operationName, spanKind); decorateSpan(span); try (Scope ignored1 = tracer.startScope(span)) { - delegate.call(new TracedSubscriber(span, subscriber, tracer)); + delegate.call(new TracedSubscriber(Context.current(), subscriber, tracer)); } } } diff --git a/instrumentation/rxjava-1.0/src/main/java/io/opentelemetry/instrumentation/auto/rxjava/TracedSubscriber.java b/instrumentation/rxjava-1.0/src/main/java/io/opentelemetry/instrumentation/auto/rxjava/TracedSubscriber.java index 7a2ef11a87cd..3f220bc92478 100644 --- a/instrumentation/rxjava-1.0/src/main/java/io/opentelemetry/instrumentation/auto/rxjava/TracedSubscriber.java +++ b/instrumentation/rxjava-1.0/src/main/java/io/opentelemetry/instrumentation/auto/rxjava/TracedSubscriber.java @@ -1,23 +1,14 @@ /* * 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.rxjava; -import static io.opentelemetry.trace.TracingContextUtils.currentContextWith; +import static io.opentelemetry.context.ContextUtils.withScopedContext; +import static io.opentelemetry.trace.TracingContextUtils.getSpan; +import io.grpc.Context; import io.opentelemetry.context.Scope; import io.opentelemetry.instrumentation.api.tracer.BaseTracer; import io.opentelemetry.trace.Span; @@ -26,24 +17,23 @@ public class TracedSubscriber extends Subscriber { - private final AtomicReference spanRef; + private final AtomicReference contextRef; private final Subscriber delegate; private final BaseTracer tracer; - // TODO pass the whole context here, not just span - public TracedSubscriber(Span span, Subscriber delegate, BaseTracer tracer) { - spanRef = new AtomicReference<>(span); + public TracedSubscriber(Context context, Subscriber delegate, BaseTracer tracer) { + contextRef = new AtomicReference<>(context); this.delegate = delegate; this.tracer = tracer; - SpanFinishingSubscription subscription = new SpanFinishingSubscription(tracer, spanRef); + SpanFinishingSubscription subscription = new SpanFinishingSubscription(tracer, contextRef); delegate.add(subscription); } @Override public void onStart() { - Span span = spanRef.get(); - if (span != null) { - try (Scope ignored = currentContextWith(span)) { + Context context = contextRef.get(); + if (context != null) { + try (Scope ignored = withScopedContext(context)) { delegate.onStart(); } } else { @@ -53,12 +43,10 @@ public void onStart() { @Override public void onNext(T value) { - Span span = spanRef.get(); - if (span != null) { - try (Scope ignored = currentContextWith(span)) { + Context context = contextRef.get(); + if (context != null) { + try (Scope ignored = withScopedContext(context)) { delegate.onNext(value); - } catch (Throwable e) { - onError(e); } } else { delegate.onNext(value); @@ -67,19 +55,19 @@ public void onNext(T value) { @Override public void onCompleted() { - Span span = spanRef.getAndSet(null); - if (span != null) { - boolean errored = false; - try (Scope ignored = currentContextWith(span)) { + Context context = contextRef.getAndSet(null); + if (context != null) { + Throwable error = null; + try (Scope ignored = withScopedContext(context)) { delegate.onCompleted(); - } catch (Throwable e) { - // Repopulate the spanRef for onError - spanRef.compareAndSet(null, span); - onError(e); - errored = true; + } catch (Throwable t) { + error = t; + throw t; } finally { - // finish called by onError, so don't finish again. - if (!errored) { + Span span = getSpan(context); + if (error != null) { + tracer.endExceptionally(span, error); + } else { tracer.end(span); } } @@ -90,10 +78,11 @@ public void onCompleted() { @Override public void onError(Throwable e) { - Span span = spanRef.getAndSet(null); - if (span != null) { - tracer.endExceptionally(span, e); + Context context = contextRef.getAndSet(null); + if (context != null) { + tracer.endExceptionally(getSpan(context), e); } + // TODO (trask) should this be wrapped in parent of context(?) delegate.onError(e); } } diff --git a/instrumentation/rxjava-1.0/src/main/java/rx/__OpenTelemetryTracingUtil.java b/instrumentation/rxjava-1.0/src/main/java/rx/__OpenTelemetryTracingUtil.java index 633d5acdd32d..16b757a4a480 100644 --- a/instrumentation/rxjava-1.0/src/main/java/rx/__OpenTelemetryTracingUtil.java +++ b/instrumentation/rxjava-1.0/src/main/java/rx/__OpenTelemetryTracingUtil.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 rx; diff --git a/instrumentation/scala-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/scalaconcurrent/ScalaForkJoinPoolInstrumentation.java b/instrumentation/scala-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/scalaconcurrent/ScalaForkJoinPoolInstrumentation.java index 0383fe99f1fe..939c722df421 100644 --- a/instrumentation/scala-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/scalaconcurrent/ScalaForkJoinPoolInstrumentation.java +++ b/instrumentation/scala-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/scalaconcurrent/ScalaForkJoinPoolInstrumentation.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.scalaconcurrent; diff --git a/instrumentation/scala-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/scalaconcurrent/ScalaForkJoinTaskInstrumentation.java b/instrumentation/scala-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/scalaconcurrent/ScalaForkJoinTaskInstrumentation.java index e934f17b54ff..d241327fc0c6 100644 --- a/instrumentation/scala-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/scalaconcurrent/ScalaForkJoinTaskInstrumentation.java +++ b/instrumentation/scala-concurrent/src/main/java/io/opentelemetry/instrumentation/auto/scalaconcurrent/ScalaForkJoinTaskInstrumentation.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.scalaconcurrent; diff --git a/instrumentation/scala-concurrent/src/slickTest/groovy/SlickTest.groovy b/instrumentation/scala-concurrent/src/slickTest/groovy/SlickTest.groovy index 349886bf26ba..2c785b9450a3 100644 --- a/instrumentation/scala-concurrent/src/slickTest/groovy/SlickTest.groovy +++ b/instrumentation/scala-concurrent/src/slickTest/groovy/SlickTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.CLIENT @@ -36,15 +25,15 @@ class SlickTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "run query" - parent() + name "run query" + hasNoParent() errored false attributes { } } span(1) { - operationName JDBCUtils.normalizeSql(SlickUtils.TestQuery()) - spanKind CLIENT + name JDBCUtils.normalizeSql(SlickUtils.TestQuery()) + kind CLIENT childOf span(0) errored false attributes { @@ -75,11 +64,11 @@ class SlickTest extends AgentTestRunner { assertTraces(2) { trace(0, 2, { span(0) {} - span(1) { spanKind CLIENT } + span(1) { kind CLIENT } }) trace(1, 2, { span(0) {} - span(1) { spanKind CLIENT } + span(1) { kind CLIENT } }) } } diff --git a/instrumentation/scala-concurrent/src/slickTest/scala/SlickUtils.scala b/instrumentation/scala-concurrent/src/slickTest/scala/SlickUtils.scala index 6233a069993f..9c89afc2d9a9 100644 --- a/instrumentation/scala-concurrent/src/slickTest/scala/SlickUtils.scala +++ b/instrumentation/scala-concurrent/src/slickTest/scala/SlickUtils.scala @@ -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 */ import io.opentelemetry.OpenTelemetry diff --git a/instrumentation/scala-concurrent/src/test/groovy/ScalaExecutorInstrumentationTest.groovy b/instrumentation/scala-concurrent/src/test/groovy/ScalaExecutorInstrumentationTest.groovy index 562a9920f717..037d795bf2d7 100644 --- a/instrumentation/scala-concurrent/src/test/groovy/ScalaExecutorInstrumentationTest.groovy +++ b/instrumentation/scala-concurrent/src/test/groovy/ScalaExecutorInstrumentationTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace diff --git a/instrumentation/scala-concurrent/src/test/groovy/ScalaInstrumentationTest.groovy b/instrumentation/scala-concurrent/src/test/groovy/ScalaInstrumentationTest.groovy index a34ca6522a29..81b34d68909b 100644 --- a/instrumentation/scala-concurrent/src/test/groovy/ScalaInstrumentationTest.groovy +++ b/instrumentation/scala-concurrent/src/test/groovy/ScalaInstrumentationTest.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestRunner @@ -29,7 +18,7 @@ class ScalaInstrumentationTest extends AgentTestRunner { assertTraces(1) { trace(0, 5) { span(0) { - operationName "parent" + name "parent" attributes { } } @@ -68,7 +57,7 @@ class ScalaInstrumentationTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "parent" + name "parent" attributes { } } @@ -92,7 +81,7 @@ class ScalaInstrumentationTest extends AgentTestRunner { assertTraces(1) { trace(0, 5) { span(0) { - operationName "parent" + name "parent" attributes { } } @@ -131,7 +120,7 @@ class ScalaInstrumentationTest extends AgentTestRunner { assertTraces(1) { trace(0, 4) { span(0) { - operationName "parent" + name "parent" attributes { } } diff --git a/instrumentation/scala-concurrent/src/test/scala/ScalaAsyncChild.java b/instrumentation/scala-concurrent/src/test/scala/ScalaAsyncChild.java index affe92cd48ec..0afa06da18e6 100644 --- a/instrumentation/scala-concurrent/src/test/scala/ScalaAsyncChild.java +++ b/instrumentation/scala-concurrent/src/test/scala/ScalaAsyncChild.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 */ import io.opentelemetry.OpenTelemetry; diff --git a/instrumentation/scala-concurrent/src/test/scala/ScalaConcurrentTests.scala b/instrumentation/scala-concurrent/src/test/scala/ScalaConcurrentTests.scala index ad24a7a41f6e..643510f48abe 100644 --- a/instrumentation/scala-concurrent/src/test/scala/ScalaConcurrentTests.scala +++ b/instrumentation/scala-concurrent/src/test/scala/ScalaConcurrentTests.scala @@ -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 */ import java.util.concurrent.CountDownLatch diff --git a/instrumentation/servlet/README.md b/instrumentation/servlet/README.md index 4348eba1c404..585db0910364 100644 --- a/instrumentation/servlet/README.md +++ b/instrumentation/servlet/README.md @@ -8,7 +8,7 @@ They are divided into 3 sub-modules: `servlet-common` contains instrumentations applicable to all API versions that we support. -`servlet-2.2` contains instrumentations applicable to Servlet API 2.2, but not to to 3+. +`servlet-2.2` contains instrumentations applicable to Servlet API 2.2, but not to 3+. `servlet-3.0` contains instrumentations that require Servlet API 3.0 or newer. @@ -42,7 +42,7 @@ at java.base/java.lang.Thread.run(Thread.java:834) Everything starts when HTTP request processing reaches the first class from Servlet specification. In the example above this is `ApplicationFilterChain.doFilter(ServletRequest, ServletResponse)` method. Let us call this first servlet specific method an "entry point". -This is the main target for `Servlet3Instrumentation` and `Servlet2Instrumentation` instrumenters: +This is the main target for `Servlet3Instrumentation` and `Servlet2Instrumentation` instruments: `public void javax.servlet.FilterChain#doFilter(ServletRequest, ServletResponse)` @@ -67,9 +67,9 @@ In rare cases when you need it, you can enable it using configuration property ` In exactly the same situation are all other Servlet filters beyond the initial entry point. Usually unimportant, they may be sometimes of interest during troubleshooting. -They are instrumented by `FilterInstrumentation` which is too disabled by default. +They are instrumented by `FilterInstrumentation` which is also disabled by default. You can enable it with the configuration property `otel.integration.servlet-filter.enabled`. -At last, request processing may reach the specific framework that you application uses. +At last, request processing may reach the specific framework that your application uses. In this case Spring MVC and `OwnerController.initCreationForm`. If all instrumentations are enabled, then a new span will be created for every highlighted frame. diff --git a/instrumentation/servlet/glassfish-testing/src/test/groovy/GlassFishServerTest.groovy b/instrumentation/servlet/glassfish-testing/src/test/groovy/GlassFishServerTest.groovy index 604e3322a08a..9334dd0817c6 100644 --- a/instrumentation/servlet/glassfish-testing/src/test/groovy/GlassFishServerTest.groovy +++ b/instrumentation/servlet/glassfish-testing/src/test/groovy/GlassFishServerTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.EXCEPTION @@ -83,14 +72,14 @@ class GlassFishServerTest extends HttpServerTest { @Override void serverSpan(TraceAssert trace, int index, String traceID = null, String parentID = null, String method = "GET", Long responseContentLength = null, ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName entryPointName() - spanKind SERVER + name entryPointName() + kind SERVER errored endpoint.errored if (parentID != null) { traceId traceID - parentId parentID + parentSpanId parentID } else { - parent() + hasNoParent() } if (endpoint == EXCEPTION) { errorEvent(Exception, EXCEPTION.body) diff --git a/instrumentation/servlet/glassfish-testing/src/test/groovy/TestServlets.java b/instrumentation/servlet/glassfish-testing/src/test/groovy/TestServlets.java index 732d3e82145a..f1688cabab7e 100644 --- a/instrumentation/servlet/glassfish-testing/src/test/groovy/TestServlets.java +++ b/instrumentation/servlet/glassfish-testing/src/test/groovy/TestServlets.java @@ -1,21 +1,10 @@ /* * 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 */ -import groovy.lang.Closure; import io.opentelemetry.auto.test.base.HttpServerTest; +import java.util.concurrent.Callable; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; @@ -31,8 +20,9 @@ protected void service(HttpServletRequest req, final HttpServletResponse resp) { HttpServerTest.ServerEndpoint.forPath(req.getServletPath()); HttpServerTest.controller( endpoint, - new Closure(null) { - public Object doCall() throws Exception { + new Callable() { + @Override + public Object call() throws Exception { resp.setContentType("text/plain"); resp.setStatus(endpoint.getStatus()); resp.getWriter().print(endpoint.getBody()); @@ -50,8 +40,8 @@ protected void service(final HttpServletRequest req, final HttpServletResponse r HttpServerTest.ServerEndpoint.forPath(req.getServletPath()); HttpServerTest.controller( endpoint, - new Closure(null) { - public Object doCall() throws Exception { + new Callable() { + public Object call() throws Exception { resp.setContentType("text/plain"); resp.setStatus(endpoint.getStatus()); resp.getWriter().print(req.getQueryString()); @@ -69,8 +59,8 @@ protected void service(HttpServletRequest req, final HttpServletResponse resp) { HttpServerTest.ServerEndpoint.forPath(req.getServletPath()); HttpServerTest.controller( endpoint, - new Closure(null) { - public Object doCall() throws Exception { + new Callable() { + public Object call() throws Exception { resp.sendRedirect(endpoint.getBody()); return null; } @@ -86,8 +76,8 @@ protected void service(HttpServletRequest req, final HttpServletResponse resp) { HttpServerTest.ServerEndpoint.forPath(req.getServletPath()); HttpServerTest.controller( endpoint, - new Closure(null) { - public Object doCall() throws Exception { + new Callable() { + public Object call() throws Exception { resp.setContentType("text/plain"); resp.sendError(endpoint.getStatus(), endpoint.getBody()); return null; @@ -104,8 +94,8 @@ protected void service(HttpServletRequest req, HttpServletResponse resp) { HttpServerTest.ServerEndpoint.forPath(req.getServletPath()); HttpServerTest.controller( endpoint, - new Closure(null) { - public Object doCall() throws Exception { + new Callable() { + public Object call() throws Exception { throw new Exception(endpoint.getBody()); } }); diff --git a/instrumentation/servlet/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v2_2/ResponseWithStatus.java b/instrumentation/servlet/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v2_2/ResponseWithStatus.java index 559e24430413..e853128159d7 100644 --- a/instrumentation/servlet/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v2_2/ResponseWithStatus.java +++ b/instrumentation/servlet/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v2_2/ResponseWithStatus.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.servlet.v2_2; diff --git a/instrumentation/servlet/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v2_2/Servlet2Advice.java b/instrumentation/servlet/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v2_2/Servlet2Advice.java index d761efad56b2..fbf39f344468 100644 --- a/instrumentation/servlet/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v2_2/Servlet2Advice.java +++ b/instrumentation/servlet/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v2_2/Servlet2Advice.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.servlet.v2_2; diff --git a/instrumentation/servlet/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v2_2/Servlet2HttpServerTracer.java b/instrumentation/servlet/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v2_2/Servlet2HttpServerTracer.java index 727d4d51201b..76d9ba8657ea 100644 --- a/instrumentation/servlet/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v2_2/Servlet2HttpServerTracer.java +++ b/instrumentation/servlet/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v2_2/Servlet2HttpServerTracer.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.servlet.v2_2; diff --git a/instrumentation/servlet/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v2_2/Servlet2Instrumentation.java b/instrumentation/servlet/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v2_2/Servlet2Instrumentation.java index 8d51142e3c96..6671fd3c0618 100644 --- a/instrumentation/servlet/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v2_2/Servlet2Instrumentation.java +++ b/instrumentation/servlet/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v2_2/Servlet2Instrumentation.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.servlet.v2_2; diff --git a/instrumentation/servlet/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v2_2/Servlet2ResponseStatusInstrumentation.java b/instrumentation/servlet/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v2_2/Servlet2ResponseStatusInstrumentation.java index 98c49072701f..9b876bc90c36 100644 --- a/instrumentation/servlet/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v2_2/Servlet2ResponseStatusInstrumentation.java +++ b/instrumentation/servlet/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v2_2/Servlet2ResponseStatusInstrumentation.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.servlet.v2_2; diff --git a/instrumentation/servlet/servlet-2.2/src/test/groovy/JettyServlet2Test.groovy b/instrumentation/servlet/servlet-2.2/src/test/groovy/JettyServlet2Test.groovy index de2ec2a3102e..d852adc09613 100644 --- a/instrumentation/servlet/servlet-2.2/src/test/groovy/JettyServlet2Test.groovy +++ b/instrumentation/servlet/servlet-2.2/src/test/groovy/JettyServlet2Test.groovy @@ -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 */ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.AUTH_REQUIRED @@ -86,8 +75,8 @@ class JettyServlet2Test extends HttpServerTest { @Override void responseSpan(TraceAssert trace, int index, Object parent, String method = "GET", ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName endpoint == REDIRECT ? "HttpServletResponse.sendRedirect" : "HttpServletResponse.sendError" - spanKind INTERNAL + name endpoint == REDIRECT ? "HttpServletResponse.sendRedirect" : "HttpServletResponse.sendError" + kind INTERNAL errored false childOf((SpanData) parent) attributes { @@ -98,14 +87,14 @@ class JettyServlet2Test extends HttpServerTest { // parent span must be cast otherwise it breaks debugging classloading (junit loads it early) void serverSpan(TraceAssert trace, int index, String traceID = null, String parentID = null, String method = "GET", Long responseContentLength = null, ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName 'HttpServlet.service' - spanKind SERVER + name 'HttpServlet.service' + kind SERVER errored endpoint.errored if (parentID != null) { traceId traceID - parentId parentID + parentSpanId parentID } else { - parent() + hasNoParent() } if (endpoint == EXCEPTION) { errorEvent(Exception, EXCEPTION.body) diff --git a/instrumentation/servlet/servlet-2.2/src/test/groovy/TestServlet2.groovy b/instrumentation/servlet/servlet-2.2/src/test/groovy/TestServlet2.groovy index 59ab1725f554..b7c98ce4573b 100644 --- a/instrumentation/servlet/servlet-2.2/src/test/groovy/TestServlet2.groovy +++ b/instrumentation/servlet/servlet-2.2/src/test/groovy/TestServlet2.groovy @@ -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 */ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.ERROR diff --git a/instrumentation/servlet/servlet-3.0/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v3_0/AsyncContextInstrumentation.java b/instrumentation/servlet/servlet-3.0/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v3_0/AsyncContextInstrumentation.java index 919042c33078..bdf69ded7917 100644 --- a/instrumentation/servlet/servlet-3.0/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v3_0/AsyncContextInstrumentation.java +++ b/instrumentation/servlet/servlet-3.0/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v3_0/AsyncContextInstrumentation.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.servlet.v3_0; diff --git a/instrumentation/servlet/servlet-3.0/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v3_0/Servlet3Advice.java b/instrumentation/servlet/servlet-3.0/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v3_0/Servlet3Advice.java index a61058c3f77a..2d942de2dd11 100644 --- a/instrumentation/servlet/servlet-3.0/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v3_0/Servlet3Advice.java +++ b/instrumentation/servlet/servlet-3.0/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v3_0/Servlet3Advice.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.servlet.v3_0; diff --git a/instrumentation/servlet/servlet-3.0/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v3_0/Servlet3HttpServerTracer.java b/instrumentation/servlet/servlet-3.0/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v3_0/Servlet3HttpServerTracer.java index c316c247528b..d780443afc8e 100644 --- a/instrumentation/servlet/servlet-3.0/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v3_0/Servlet3HttpServerTracer.java +++ b/instrumentation/servlet/servlet-3.0/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v3_0/Servlet3HttpServerTracer.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.servlet.v3_0; @@ -21,7 +10,7 @@ import io.grpc.Context; import io.opentelemetry.instrumentation.servlet.ServletHttpServerTracer; import io.opentelemetry.trace.Span; -import io.opentelemetry.trace.Status; +import io.opentelemetry.trace.StatusCanonicalCode; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -64,7 +53,7 @@ public void end(Span span, HttpServletResponse response, long timestamp) { } public void onTimeout(Span span, long timeout) { - span.setStatus(Status.DEADLINE_EXCEEDED); + span.setStatus(StatusCanonicalCode.ERROR); span.setAttribute("timeout", timeout); span.end(); } diff --git a/instrumentation/servlet/servlet-3.0/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v3_0/Servlet3Instrumentation.java b/instrumentation/servlet/servlet-3.0/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v3_0/Servlet3Instrumentation.java index a28ee4662c00..166f21c3bb38 100644 --- a/instrumentation/servlet/servlet-3.0/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v3_0/Servlet3Instrumentation.java +++ b/instrumentation/servlet/servlet-3.0/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v3_0/Servlet3Instrumentation.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.servlet.v3_0; diff --git a/instrumentation/servlet/servlet-3.0/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v3_0/TagSettingAsyncListener.java b/instrumentation/servlet/servlet-3.0/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v3_0/TagSettingAsyncListener.java index 40eb2f450cb6..ada4b6ed044a 100644 --- a/instrumentation/servlet/servlet-3.0/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v3_0/TagSettingAsyncListener.java +++ b/instrumentation/servlet/servlet-3.0/src/main/java/io/opentelemetry/instrumentation/auto/servlet/v3_0/TagSettingAsyncListener.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.servlet.v3_0; diff --git a/instrumentation/servlet/servlet-3.0/src/test/groovy/AbstractServlet3Test.groovy b/instrumentation/servlet/servlet-3.0/src/test/groovy/AbstractServlet3Test.groovy index 1fbba02f9367..7da0d0da3112 100644 --- a/instrumentation/servlet/servlet-3.0/src/test/groovy/AbstractServlet3Test.groovy +++ b/instrumentation/servlet/servlet-3.0/src/test/groovy/AbstractServlet3Test.groovy @@ -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 */ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.AUTH_REQUIRED @@ -71,14 +60,14 @@ abstract class AbstractServlet3Test extends HttpServerTest { - static { - ConfigUtils.updateConfig { - //We want to test spans produced by servlet instrumentation, not those of jetty - System.setProperty("otel.integration.jetty.enabled", "false") - } + //We want to test spans produced by servlet instrumentation, not those of jetty + static final PREVIOUS_CONFIG = ConfigUtils.updateConfigAndResetInstrumentation { + it.setProperty("otel.integration.jetty.enabled", "false") } @Override def cleanupSpec() { - ConfigUtils.updateConfig { - System.clearProperty("otel.integration.jetty.enabled") - } + ConfigUtils.setConfig(PREVIOUS_CONFIG) } @Override diff --git a/instrumentation/servlet/servlet-3.0/src/test/groovy/JettyServletHandlerTest.groovy b/instrumentation/servlet/servlet-3.0/src/test/groovy/JettyServletHandlerTest.groovy index 8d7cf5819641..e669b2aa9bf5 100644 --- a/instrumentation/servlet/servlet-3.0/src/test/groovy/JettyServletHandlerTest.groovy +++ b/instrumentation/servlet/servlet-3.0/src/test/groovy/JettyServletHandlerTest.groovy @@ -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 */ import javax.servlet.Servlet diff --git a/instrumentation/servlet/servlet-3.0/src/test/groovy/RequestDispatcherServlet.java b/instrumentation/servlet/servlet-3.0/src/test/groovy/RequestDispatcherServlet.java index 8391c2a8cab3..a0914660d0c7 100644 --- a/instrumentation/servlet/servlet-3.0/src/test/groovy/RequestDispatcherServlet.java +++ b/instrumentation/servlet/servlet-3.0/src/test/groovy/RequestDispatcherServlet.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 */ import java.io.IOException; diff --git a/instrumentation/servlet/servlet-3.0/src/test/groovy/TestServlet3.groovy b/instrumentation/servlet/servlet-3.0/src/test/groovy/TestServlet3.groovy index e9ab5fe1b231..f7a73950a6a4 100644 --- a/instrumentation/servlet/servlet-3.0/src/test/groovy/TestServlet3.groovy +++ b/instrumentation/servlet/servlet-3.0/src/test/groovy/TestServlet3.groovy @@ -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 */ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.ERROR diff --git a/instrumentation/servlet/servlet-3.0/src/test/groovy/TomcatServlet3Test.groovy b/instrumentation/servlet/servlet-3.0/src/test/groovy/TomcatServlet3Test.groovy index 8a85a530ee3a..040adf7e0b89 100644 --- a/instrumentation/servlet/servlet-3.0/src/test/groovy/TomcatServlet3Test.groovy +++ b/instrumentation/servlet/servlet-3.0/src/test/groovy/TomcatServlet3Test.groovy @@ -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 */ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.AUTH_REQUIRED diff --git a/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/dispatcher/RequestDispatcherInstrumentation.java b/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/dispatcher/RequestDispatcherInstrumentation.java index 53a5127d2c9e..86ed962eba28 100644 --- a/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/dispatcher/RequestDispatcherInstrumentation.java +++ b/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/dispatcher/RequestDispatcherInstrumentation.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.servlet.dispatcher; diff --git a/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/dispatcher/RequestDispatcherTracer.java b/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/dispatcher/RequestDispatcherTracer.java index c36909fb35b1..a0fdbaad9c5a 100644 --- a/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/dispatcher/RequestDispatcherTracer.java +++ b/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/dispatcher/RequestDispatcherTracer.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.servlet.dispatcher; diff --git a/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/filter/FilterInstrumentation.java b/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/filter/FilterInstrumentation.java index 38443638f8bf..74b32012eeab 100644 --- a/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/filter/FilterInstrumentation.java +++ b/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/filter/FilterInstrumentation.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.servlet.filter; diff --git a/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/filter/FilterTracer.java b/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/filter/FilterTracer.java index 928bd90515a5..eb02570d30ec 100644 --- a/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/filter/FilterTracer.java +++ b/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/filter/FilterTracer.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.servlet.filter; diff --git a/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/http/HttpServletInstrumentation.java b/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/http/HttpServletInstrumentation.java index 95df4b454355..a8b35dcf8ab6 100644 --- a/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/http/HttpServletInstrumentation.java +++ b/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/http/HttpServletInstrumentation.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.servlet.http; diff --git a/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/http/HttpServletResponseInstrumentation.java b/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/http/HttpServletResponseInstrumentation.java index 947b5c5d38fc..16002628ff8d 100644 --- a/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/http/HttpServletResponseInstrumentation.java +++ b/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/http/HttpServletResponseInstrumentation.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.servlet.http; diff --git a/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/http/HttpServletResponseTracer.java b/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/http/HttpServletResponseTracer.java index 131a26d84f94..cdcca67d7723 100644 --- a/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/http/HttpServletResponseTracer.java +++ b/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/http/HttpServletResponseTracer.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.servlet.http; diff --git a/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/http/HttpServletTracer.java b/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/http/HttpServletTracer.java index 4b5365bddbe8..dd8b549e1090 100644 --- a/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/http/HttpServletTracer.java +++ b/instrumentation/servlet/servlet-common/src/main/java/io/opentelemetry/instrumentation/auto/servlet/http/HttpServletTracer.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.servlet.http; diff --git a/instrumentation/servlet/servlet-common/src/test/groovy/FilterTest.groovy b/instrumentation/servlet/servlet-common/src/test/groovy/FilterTest.groovy index c0a3c92ba761..47d7e0a4a9bf 100644 --- a/instrumentation/servlet/servlet-common/src/test/groovy/FilterTest.groovy +++ b/instrumentation/servlet/servlet-common/src/test/groovy/FilterTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.basicSpan @@ -27,19 +16,14 @@ import javax.servlet.ServletRequest import javax.servlet.ServletResponse class FilterTest extends AgentTestRunner { - static { - ConfigUtils.updateConfig { - System.setProperty("otel.integration.servlet-filter.enabled", "true") - } + static final PREVIOUS_CONFIG = ConfigUtils.updateConfigAndResetInstrumentation { + it.setProperty("otel.integration.servlet-filter.enabled", "true") } - def specCleanup() { - ConfigUtils.updateConfig { - System.clearProperty("otel.integration.servlet-filter.enabled") - } + def cleanupSpec() { + ConfigUtils.setConfig(PREVIOUS_CONFIG) } - def "test doFilter no-parent"() { when: filter.doFilter(null, null, null) @@ -62,7 +46,7 @@ class FilterTest extends AgentTestRunner { trace(0, 2) { basicSpan(it, 0, "parent") span(1) { - operationName "${filter.class.simpleName}.doFilter" + name "${filter.class.simpleName}.doFilter" childOf span(0) attributes { } @@ -97,7 +81,7 @@ class FilterTest extends AgentTestRunner { trace(0, 2) { basicSpan(it, 0, "parent", null, ex) span(1) { - operationName "${filter.class.simpleName}.doFilter" + name "${filter.class.simpleName}.doFilter" childOf span(0) errored true errorEvent(ex.class, ex.message) diff --git a/instrumentation/servlet/servlet-common/src/test/groovy/HttpServletResponseTest.groovy b/instrumentation/servlet/servlet-common/src/test/groovy/HttpServletResponseTest.groovy index 37d5f7449ee6..5dd6b7e3eff7 100644 --- a/instrumentation/servlet/servlet-common/src/test/groovy/HttpServletResponseTest.groovy +++ b/instrumentation/servlet/servlet-common/src/test/groovy/HttpServletResponseTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.basicSpan @@ -69,19 +58,19 @@ class HttpServletResponseTest extends AgentTestRunner { trace(0, 4) { basicSpan(it, 0, "parent") span(1) { - operationName "TestResponse.sendError" + name "TestResponse.sendError" childOf span(0) attributes { } } span(2) { - operationName "TestResponse.sendError" + name "TestResponse.sendError" childOf span(0) attributes { } } span(3) { - operationName "TestResponse.sendRedirect" + name "TestResponse.sendRedirect" childOf span(0) attributes { } @@ -117,7 +106,7 @@ class HttpServletResponseTest extends AgentTestRunner { trace(0, 2) { basicSpan(it, 0, "parent", null, ex) span(1) { - operationName 'HttpServletResponseTest$2.sendRedirect' + name 'HttpServletResponseTest$2.sendRedirect' childOf span(0) errored true errorEvent(ex.class, ex.message) diff --git a/instrumentation/servlet/servlet-common/src/test/groovy/HttpServletTest.groovy b/instrumentation/servlet/servlet-common/src/test/groovy/HttpServletTest.groovy index ea7dbad4b99c..65b5f77c4989 100644 --- a/instrumentation/servlet/servlet-common/src/test/groovy/HttpServletTest.groovy +++ b/instrumentation/servlet/servlet-common/src/test/groovy/HttpServletTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.basicSpan @@ -24,19 +13,14 @@ import javax.servlet.http.HttpServletRequest import javax.servlet.http.HttpServletResponse class HttpServletTest extends AgentTestRunner { - static { - ConfigUtils.updateConfig { - System.setProperty("otel.integration.servlet-service.enabled", "true") - } + static final PREVIOUS_CONFIG = ConfigUtils.updateConfigAndResetInstrumentation { + it.setProperty("otel.integration.servlet-service.enabled", "true") } def specCleanup() { - ConfigUtils.updateConfig { - System.clearProperty("otel.integration.servlet-service.enabled") - } + ConfigUtils.setConfig(PREVIOUS_CONFIG) } - def req = Mock(HttpServletRequest) { getMethod() >> "GET" getProtocol() >> "TEST" @@ -65,13 +49,13 @@ class HttpServletTest extends AgentTestRunner { trace(0, 3) { basicSpan(it, 0, "parent") span(1) { - operationName "HttpServlet.service" + name "HttpServlet.service" childOf span(0) attributes { } } span(2) { - operationName "${expectedSpanName}.doGet" + name "${expectedSpanName}.doGet" childOf span(1) attributes { } @@ -112,13 +96,13 @@ class HttpServletTest extends AgentTestRunner { trace(0, 3) { basicSpan(it, 0, "parent", null, ex) span(1) { - operationName "HttpServlet.service" + name "HttpServlet.service" childOf span(0) errored true errorEvent(ex.class, ex.message) } span(2) { - operationName "${servlet.class.name}.doGet" + name "${servlet.class.name}.doGet" childOf span(1) errored true errorEvent(ex.class, ex.message) diff --git a/instrumentation/servlet/servlet-common/src/test/groovy/RequestDispatcherTest.groovy b/instrumentation/servlet/servlet-common/src/test/groovy/RequestDispatcherTest.groovy index 17bde005da5d..6c298e124e7f 100644 --- a/instrumentation/servlet/servlet-common/src/test/groovy/RequestDispatcherTest.groovy +++ b/instrumentation/servlet/servlet-common/src/test/groovy/RequestDispatcherTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.basicSpan @@ -66,7 +55,7 @@ class RequestDispatcherTest extends AgentTestRunner { trace(0, 3) { basicSpan(it, 0, "parent") span(1) { - operationName "TestDispatcher.$operation" + name "TestDispatcher.$operation" childOf span(0) } basicSpan(it, 2, "$operation-child", span(1)) @@ -110,7 +99,7 @@ class RequestDispatcherTest extends AgentTestRunner { trace(0, 3) { basicSpan(it, 0, "parent", null, ex) span(1) { - operationName "TestDispatcher.$operation" + name "TestDispatcher.$operation" childOf span(0) errored true errorEvent(ex.class, ex.message) diff --git a/instrumentation/servlet/servlet-common/src/test/groovy/RequestDispatcherUtils.java b/instrumentation/servlet/servlet-common/src/test/groovy/RequestDispatcherUtils.java index 2853855077ce..274a8ab6f8f0 100644 --- a/instrumentation/servlet/servlet-common/src/test/groovy/RequestDispatcherUtils.java +++ b/instrumentation/servlet/servlet-common/src/test/groovy/RequestDispatcherUtils.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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace; diff --git a/instrumentation/spark-web-framework-2.3/src/main/java/io/opentelemetry/instrumentation/auto/sparkjava/RoutesInstrumentation.java b/instrumentation/spark-web-framework-2.3/src/main/java/io/opentelemetry/instrumentation/auto/sparkjava/RoutesInstrumentation.java index b83e12a20fd8..40924a45b49c 100644 --- a/instrumentation/spark-web-framework-2.3/src/main/java/io/opentelemetry/instrumentation/auto/sparkjava/RoutesInstrumentation.java +++ b/instrumentation/spark-web-framework-2.3/src/main/java/io/opentelemetry/instrumentation/auto/sparkjava/RoutesInstrumentation.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.sparkjava; diff --git a/instrumentation/spark-web-framework-2.3/src/test/groovy/SparkJavaBasedTest.groovy b/instrumentation/spark-web-framework-2.3/src/test/groovy/SparkJavaBasedTest.groovy index 07b4b22460eb..ac0238653a18 100644 --- a/instrumentation/spark-web-framework-2.3/src/test/groovy/SparkJavaBasedTest.groovy +++ b/instrumentation/spark-web-framework-2.3/src/test/groovy/SparkJavaBasedTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.SERVER @@ -57,10 +46,10 @@ class SparkJavaBasedTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "/param/:param" - spanKind SERVER + name "/param/:param" + kind SERVER errored false - parent() + hasNoParent() attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key()}" Long diff --git a/instrumentation/spark-web-framework-2.3/src/test/java/TestSparkJavaApplication.java b/instrumentation/spark-web-framework-2.3/src/test/java/TestSparkJavaApplication.java index f47ed319327d..4b5bb1e9904c 100644 --- a/instrumentation/spark-web-framework-2.3/src/test/java/TestSparkJavaApplication.java +++ b/instrumentation/spark-web-framework-2.3/src/test/java/TestSparkJavaApplication.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 */ import spark.Spark; diff --git a/instrumentation/spring/README.md b/instrumentation/spring/README.md index b1b6ad5d739c..d849662a8feb 100644 --- a/instrumentation/spring/README.md +++ b/instrumentation/spring/README.md @@ -111,7 +111,7 @@ public class OtelConfig { Tracer tracer = OpenTelemetry.getTracer(tracerName); SpanProcessor logProcessor = SimpleSpanProcessor.newBuilder(new LoggingSpanExporter()).build(); - OpenTelemetrySdk.getTracerProvider().addSpanProcessor(logProcessor); + OpenTelemetrySdk.getTracerManagement().addSpanProcessor(logProcessor); return tracer; } @@ -130,7 +130,7 @@ SpanProcessor jaegerProcessor = SimpleSpanProcessor .setChannel(ManagedChannelBuilder.forAddress("localhost", 14250).usePlaintext().build()) .build()) .build(); -OpenTelemetrySdk.getTracerProvider().addSpanProcessor(jaegerProcessor); +OpenTelemetrySdk.getTracerManagement().addSpanProcessor(jaegerProcessor); ``` ### Project Background diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/EnableOpenTelemetryTracing.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/EnableOpenTelemetryTracing.java index d600e299e244..e2a8216f0aaf 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/EnableOpenTelemetryTracing.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/EnableOpenTelemetryTracing.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.spring.autoconfigure; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/TracerAutoConfiguration.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/TracerAutoConfiguration.java index 4462ec919c86..d3e4c551d3a7 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/TracerAutoConfiguration.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/TracerAutoConfiguration.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.spring.autoconfigure; @@ -36,8 +25,7 @@ /** * Create {@link io.opentelemetry.trace.Tracer} bean if bean is missing. * - *

Adds span exporter beans to the active tracer provider {@code - * OpenTelemetrySdk.getTracerProvider()} + *

Adds span exporter beans to the active tracer provider. * *

Updates the sampler probability in the active {@link TraceConfig} */ @@ -69,18 +57,16 @@ private void addSpanProcessors(List spanExporters) { .map(spanExporter -> SimpleSpanProcessor.newBuilder(spanExporter).build()) .collect(Collectors.toList()); - OpenTelemetrySdk.getTracerProvider() + OpenTelemetrySdk.getTracerManagement() .addSpanProcessor(MultiSpanProcessor.create(spanProcessors)); } private void setSampler(TracerProperties tracerProperties) { TraceConfig updatedTraceConfig = - OpenTelemetrySdk.getTracerProvider() - .getActiveTraceConfig() - .toBuilder() + OpenTelemetrySdk.getTracerManagement().getActiveTraceConfig().toBuilder() .setSampler(Samplers.traceIdRatioBased(tracerProperties.getSamplerProbability())) .build(); - OpenTelemetrySdk.getTracerProvider().updateActiveTraceConfig(updatedTraceConfig); + OpenTelemetrySdk.getTracerManagement().updateActiveTraceConfig(updatedTraceConfig); } } diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/TracerProperties.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/TracerProperties.java index 8fb6f403eb64..3459f8336318 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/TracerProperties.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/TracerProperties.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.spring.autoconfigure; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/TraceAspectAutoConfiguration.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/TraceAspectAutoConfiguration.java index 34ca63c55c67..00dde7a358f1 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/TraceAspectAutoConfiguration.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/TraceAspectAutoConfiguration.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.spring.autoconfigure.aspects; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/TraceAspectProperties.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/TraceAspectProperties.java index 1b643cc244bb..68cd4a9ec85f 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/TraceAspectProperties.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/TraceAspectProperties.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.spring.autoconfigure.aspects; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/WithSpanAspect.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/WithSpanAspect.java index 6f29f9482aac..28d5b298be68 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/WithSpanAspect.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/WithSpanAspect.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.spring.autoconfigure.aspects; @@ -19,7 +8,7 @@ import io.opentelemetry.context.Scope; import io.opentelemetry.extensions.auto.annotations.WithSpan; import io.opentelemetry.trace.Span; -import io.opentelemetry.trace.Status; +import io.opentelemetry.trace.StatusCanonicalCode; import io.opentelemetry.trace.Tracer; import java.lang.reflect.Method; import org.aspectj.lang.ProceedingJoinPoint; @@ -57,7 +46,7 @@ public Object traceMethod(ProceedingJoinPoint pjp) throws Throwable { try (Scope scope = tracer.withSpan(span)) { return pjp.proceed(); } catch (Throwable t) { - span.setStatus(Status.INTERNAL); + span.setStatus(StatusCanonicalCode.ERROR); span.recordException(t); throw t; } finally { diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/jaeger/JaegerSpanExporterAutoConfiguration.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/jaeger/JaegerSpanExporterAutoConfiguration.java index 08e0ffd56276..a9bb93c42e89 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/jaeger/JaegerSpanExporterAutoConfiguration.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/jaeger/JaegerSpanExporterAutoConfiguration.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.spring.autoconfigure.exporters.jaeger; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/jaeger/JaegerSpanExporterProperties.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/jaeger/JaegerSpanExporterProperties.java index 6980dabf3d13..e4c8a22d50d5 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/jaeger/JaegerSpanExporterProperties.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/jaeger/JaegerSpanExporterProperties.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.spring.autoconfigure.exporters.jaeger; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/logging/LoggingSpanExporterAutoConfiguration.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/logging/LoggingSpanExporterAutoConfiguration.java index 363e538cfe9b..3ea9201f55fb 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/logging/LoggingSpanExporterAutoConfiguration.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/logging/LoggingSpanExporterAutoConfiguration.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.spring.autoconfigure.exporters.logging; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/logging/LoggingSpanExporterProperties.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/logging/LoggingSpanExporterProperties.java index dabf249583ac..7d79776afb3a 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/logging/LoggingSpanExporterProperties.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/logging/LoggingSpanExporterProperties.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.spring.autoconfigure.exporters.logging; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpGrpcSpanExporterAutoConfiguration.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpGrpcSpanExporterAutoConfiguration.java index 0bc60adca8a3..9ab6d99c978d 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpGrpcSpanExporterAutoConfiguration.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpGrpcSpanExporterAutoConfiguration.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.spring.autoconfigure.exporters.otlp; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpGrpcSpanExporterProperties.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpGrpcSpanExporterProperties.java index bd543ae02af9..9bbc364c0b4a 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpGrpcSpanExporterProperties.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpGrpcSpanExporterProperties.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.spring.autoconfigure.exporters.otlp; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/zipkin/ZipkinSpanExporterAutoConfiguration.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/zipkin/ZipkinSpanExporterAutoConfiguration.java index 15b30a5897f0..713e2e8e90dd 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/zipkin/ZipkinSpanExporterAutoConfiguration.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/zipkin/ZipkinSpanExporterAutoConfiguration.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.spring.autoconfigure.exporters.zipkin; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/zipkin/ZipkinSpanExporterProperties.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/zipkin/ZipkinSpanExporterProperties.java index bf3aa273357c..219f7164f82a 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/zipkin/ZipkinSpanExporterProperties.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/zipkin/ZipkinSpanExporterProperties.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.spring.autoconfigure.exporters.zipkin; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/HttpClientsProperties.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/HttpClientsProperties.java index fc3c37c7a0bd..e5e31d07f475 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/HttpClientsProperties.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/HttpClientsProperties.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.spring.autoconfigure.httpclients; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateAutoConfiguration.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateAutoConfiguration.java index 56035b5b5a73..4440672e6962 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateAutoConfiguration.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateAutoConfiguration.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.spring.autoconfigure.httpclients.resttemplate; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateBeanPostProcessor.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateBeanPostProcessor.java index f53a2b48fe2d..b831d0fafcff 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateBeanPostProcessor.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateBeanPostProcessor.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.spring.autoconfigure.httpclients.resttemplate; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientAutoConfiguration.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientAutoConfiguration.java index ea6907de6385..83679dbe547c 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientAutoConfiguration.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientAutoConfiguration.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.spring.autoconfigure.httpclients.webclient; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientBeanPostProcessor.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientBeanPostProcessor.java index 789043630195..1910f01b010d 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientBeanPostProcessor.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientBeanPostProcessor.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.spring.autoconfigure.httpclients.webclient; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcFilterAutoConfiguration.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcFilterAutoConfiguration.java index 1b89019c6586..ab0d52854fff 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcFilterAutoConfiguration.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcFilterAutoConfiguration.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.spring.autoconfigure.webmvc; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcProperties.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcProperties.java index beceec1f4682..d31c512c385a 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcProperties.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcProperties.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.spring.autoconfigure.webmvc; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/TracerAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/TracerAutoConfigurationTest.java index f408cd2300d9..02e8fa68fe43 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/TracerAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/TracerAutoConfigurationTest.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.spring.autoconfigure; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/TraceAspectAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/TraceAspectAutoConfigurationTest.java index 2525e0a09327..1c493e6e16cc 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/TraceAspectAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/TraceAspectAutoConfigurationTest.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.spring.autoconfigure.aspects; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/WithSpanAspectTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/WithSpanAspectTest.java index e7a602a8f915..8acb4ab3569c 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/WithSpanAspectTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/WithSpanAspectTest.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.spring.autoconfigure.aspects; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/JaegerSpanExporterAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/JaegerSpanExporterAutoConfigurationTest.java index abb848e1a9c1..81d0e0cef1c2 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/JaegerSpanExporterAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/JaegerSpanExporterAutoConfigurationTest.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.spring.autoconfigure.exporters; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/LoggingSpanExporterAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/LoggingSpanExporterAutoConfigurationTest.java index b088795bfc65..0623ac644a0c 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/LoggingSpanExporterAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/LoggingSpanExporterAutoConfigurationTest.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.spring.autoconfigure.exporters; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/OtlpGrpcSpanExporterAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/OtlpGrpcSpanExporterAutoConfigurationTest.java index 9d19d7fcfc50..0e06670ec5e7 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/OtlpGrpcSpanExporterAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/OtlpGrpcSpanExporterAutoConfigurationTest.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.spring.autoconfigure.exporters; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/ZipkinSpanExporterAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/ZipkinSpanExporterAutoConfigurationTest.java index 84e939d76b14..215d86ce6412 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/ZipkinSpanExporterAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/ZipkinSpanExporterAutoConfigurationTest.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.spring.autoconfigure.exporters; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateAutoConfigurationTest.java index f2bfc06a9e05..1338c2ae6089 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateAutoConfigurationTest.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.spring.autoconfigure.httpclients.resttemplate; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateBeanPostProcessorTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateBeanPostProcessorTest.java index 2166b02eea41..c360b22cf73d 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateBeanPostProcessorTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateBeanPostProcessorTest.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.spring.autoconfigure.httpclients.resttemplate; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientAutoConfigurationTest.java index 38c768ad61cd..41348796056c 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientAutoConfigurationTest.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.spring.autoconfigure.httpclients.webclient; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientBeanPostProcessorTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientBeanPostProcessorTest.java index 484645987ea3..f7aec091fe93 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientBeanPostProcessorTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientBeanPostProcessorTest.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.spring.autoconfigure.httpclients.webclient; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcFilterAutoConfigurationTest.java b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcFilterAutoConfigurationTest.java index d8b0777075d4..bbc1e1f585df 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcFilterAutoConfigurationTest.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcFilterAutoConfigurationTest.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.spring.autoconfigure.webmvc; diff --git a/instrumentation/spring/spring-data-1.8/src/main/java/io/opentelemetry/instrumentation/auto/spring/data/SpringDataTracer.java b/instrumentation/spring/spring-data-1.8/src/main/java/io/opentelemetry/instrumentation/auto/spring/data/SpringDataTracer.java index 42f009279f0c..121353577610 100644 --- a/instrumentation/spring/spring-data-1.8/src/main/java/io/opentelemetry/instrumentation/auto/spring/data/SpringDataTracer.java +++ b/instrumentation/spring/spring-data-1.8/src/main/java/io/opentelemetry/instrumentation/auto/spring/data/SpringDataTracer.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.spring.data; diff --git a/instrumentation/spring/spring-data-1.8/src/main/java/io/opentelemetry/instrumentation/auto/spring/data/SpringRepositoryInstrumentation.java b/instrumentation/spring/spring-data-1.8/src/main/java/io/opentelemetry/instrumentation/auto/spring/data/SpringRepositoryInstrumentation.java index aab078dd9572..30909dc12f4b 100644 --- a/instrumentation/spring/spring-data-1.8/src/main/java/io/opentelemetry/instrumentation/auto/spring/data/SpringRepositoryInstrumentation.java +++ b/instrumentation/spring/spring-data-1.8/src/main/java/io/opentelemetry/instrumentation/auto/spring/data/SpringRepositoryInstrumentation.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.spring.data; diff --git a/instrumentation/spring/spring-data-1.8/src/test/groovy/SpringJpaTest.groovy b/instrumentation/spring/spring-data-1.8/src/test/groovy/SpringJpaTest.groovy index 8be533fe4795..1814a9364a34 100644 --- a/instrumentation/spring/spring-data-1.8/src/test/groovy/SpringJpaTest.groovy +++ b/instrumentation/spring/spring-data-1.8/src/test/groovy/SpringJpaTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace @@ -44,7 +33,7 @@ class SpringJpaTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "toString test" + name "toString test" attributes { } } @@ -70,15 +59,15 @@ class SpringJpaTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "JpaRepository.findAll" - spanKind INTERNAL + name "JpaRepository.findAll" + kind INTERNAL errored false attributes { } } span(1) { // select - operationName ~/^select / - spanKind CLIENT + name ~/^select / + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "hsqldb" @@ -101,15 +90,15 @@ class SpringJpaTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "CrudRepository.save" - spanKind INTERNAL + name "CrudRepository.save" + kind INTERNAL errored false attributes { } } span(1) { // insert - operationName ~/^insert / - spanKind CLIENT + name ~/^insert / + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "hsqldb" @@ -132,15 +121,15 @@ class SpringJpaTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName "CrudRepository.save" - spanKind INTERNAL + name "CrudRepository.save" + kind INTERNAL errored false attributes { } } span(1) { // select - operationName ~/^select / - spanKind CLIENT + name ~/^select / + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "hsqldb" @@ -151,8 +140,8 @@ class SpringJpaTest extends AgentTestRunner { } } span(2) { // update - operationName ~/^update / - spanKind CLIENT + name ~/^update / + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "hsqldb" @@ -173,15 +162,15 @@ class SpringJpaTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "JpaCustomerRepository.findByLastName" - spanKind INTERNAL + name "JpaCustomerRepository.findByLastName" + kind INTERNAL errored false attributes { } } span(1) { // select - operationName ~/^select / - spanKind CLIENT + name ~/^select / + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "hsqldb" @@ -202,15 +191,15 @@ class SpringJpaTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName "CrudRepository.delete" - spanKind INTERNAL + name "CrudRepository.delete" + kind INTERNAL errored false attributes { } } span(1) { // select - operationName ~/^select / - spanKind CLIENT + name ~/^select / + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "hsqldb" @@ -221,8 +210,8 @@ class SpringJpaTest extends AgentTestRunner { } } span(2) { // delete - operationName ~/^delete / - spanKind CLIENT + name ~/^delete / + kind CLIENT childOf span(0) attributes { "${SemanticAttributes.DB_SYSTEM.key()}" "hsqldb" diff --git a/instrumentation/spring/spring-data-1.8/src/test/java/spring/jpa/JpaCustomer.java b/instrumentation/spring/spring-data-1.8/src/test/java/spring/jpa/JpaCustomer.java index 89d07c1169db..961cfa9b6767 100644 --- a/instrumentation/spring/spring-data-1.8/src/test/java/spring/jpa/JpaCustomer.java +++ b/instrumentation/spring/spring-data-1.8/src/test/java/spring/jpa/JpaCustomer.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 spring.jpa; diff --git a/instrumentation/spring/spring-data-1.8/src/test/java/spring/jpa/JpaCustomerRepository.java b/instrumentation/spring/spring-data-1.8/src/test/java/spring/jpa/JpaCustomerRepository.java index 2d0868978c37..0aba55ef65e2 100644 --- a/instrumentation/spring/spring-data-1.8/src/test/java/spring/jpa/JpaCustomerRepository.java +++ b/instrumentation/spring/spring-data-1.8/src/test/java/spring/jpa/JpaCustomerRepository.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 spring.jpa; diff --git a/instrumentation/spring/spring-data-1.8/src/test/java/spring/jpa/JpaPersistenceConfig.java b/instrumentation/spring/spring-data-1.8/src/test/java/spring/jpa/JpaPersistenceConfig.java index a9d8edfad7fc..88d031184638 100644 --- a/instrumentation/spring/spring-data-1.8/src/test/java/spring/jpa/JpaPersistenceConfig.java +++ b/instrumentation/spring/spring-data-1.8/src/test/java/spring/jpa/JpaPersistenceConfig.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 spring.jpa; diff --git a/instrumentation/spring/spring-scheduling-3.1/src/main/java/io/opentelemetry/instrumentation/auto/spring/scheduling/SpringSchedulingInstrumentation.java b/instrumentation/spring/spring-scheduling-3.1/src/main/java/io/opentelemetry/instrumentation/auto/spring/scheduling/SpringSchedulingInstrumentation.java index d134238ba310..af8aacdb0d25 100644 --- a/instrumentation/spring/spring-scheduling-3.1/src/main/java/io/opentelemetry/instrumentation/auto/spring/scheduling/SpringSchedulingInstrumentation.java +++ b/instrumentation/spring/spring-scheduling-3.1/src/main/java/io/opentelemetry/instrumentation/auto/spring/scheduling/SpringSchedulingInstrumentation.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.spring.scheduling; diff --git a/instrumentation/spring/spring-scheduling-3.1/src/main/java/io/opentelemetry/instrumentation/auto/spring/scheduling/SpringSchedulingRunnableWrapper.java b/instrumentation/spring/spring-scheduling-3.1/src/main/java/io/opentelemetry/instrumentation/auto/spring/scheduling/SpringSchedulingRunnableWrapper.java index ceef53ebf11e..1038c8e4b254 100644 --- a/instrumentation/spring/spring-scheduling-3.1/src/main/java/io/opentelemetry/instrumentation/auto/spring/scheduling/SpringSchedulingRunnableWrapper.java +++ b/instrumentation/spring/spring-scheduling-3.1/src/main/java/io/opentelemetry/instrumentation/auto/spring/scheduling/SpringSchedulingRunnableWrapper.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.spring.scheduling; diff --git a/instrumentation/spring/spring-scheduling-3.1/src/main/java/io/opentelemetry/instrumentation/auto/spring/scheduling/SpringSchedulingTracer.java b/instrumentation/spring/spring-scheduling-3.1/src/main/java/io/opentelemetry/instrumentation/auto/spring/scheduling/SpringSchedulingTracer.java index 17e7c1c86c66..23b1d587b43f 100644 --- a/instrumentation/spring/spring-scheduling-3.1/src/main/java/io/opentelemetry/instrumentation/auto/spring/scheduling/SpringSchedulingTracer.java +++ b/instrumentation/spring/spring-scheduling-3.1/src/main/java/io/opentelemetry/instrumentation/auto/spring/scheduling/SpringSchedulingTracer.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.spring.scheduling; diff --git a/instrumentation/spring/spring-scheduling-3.1/src/test/groovy/SpringSchedulingTest.groovy b/instrumentation/spring/spring-scheduling-3.1/src/test/groovy/SpringSchedulingTest.groovy index c4453748bbd0..b71ffdf0b060 100644 --- a/instrumentation/spring/spring-scheduling-3.1/src/test/groovy/SpringSchedulingTest.groovy +++ b/instrumentation/spring/spring-scheduling-3.1/src/test/groovy/SpringSchedulingTest.groovy @@ -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 */ import io.opentelemetry.auto.test.AgentTestRunner @@ -32,8 +21,8 @@ class SpringSchedulingTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "TriggerTask.run" - parent() + name "TriggerTask.run" + hasNoParent() errored false attributes { } @@ -54,8 +43,8 @@ class SpringSchedulingTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "IntervalTask.run" - parent() + name "IntervalTask.run" + hasNoParent() errored false attributes { } @@ -76,8 +65,8 @@ class SpringSchedulingTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationNameContains "LambdaTaskConfigurer\$\$Lambda\$" - parent() + nameContains "LambdaTaskConfigurer\$\$Lambda\$" + hasNoParent() errored false attributes { } diff --git a/instrumentation/spring/spring-scheduling-3.1/src/test/java/IntervalTask.java b/instrumentation/spring/spring-scheduling-3.1/src/test/java/IntervalTask.java index 0a5bf5169cfb..d7143a0fdee3 100644 --- a/instrumentation/spring/spring-scheduling-3.1/src/test/java/IntervalTask.java +++ b/instrumentation/spring/spring-scheduling-3.1/src/test/java/IntervalTask.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 */ import java.util.concurrent.CountDownLatch; diff --git a/instrumentation/spring/spring-scheduling-3.1/src/test/java/IntervalTaskConfig.java b/instrumentation/spring/spring-scheduling-3.1/src/test/java/IntervalTaskConfig.java index dd3139002b10..62fd7dbbcad3 100644 --- a/instrumentation/spring/spring-scheduling-3.1/src/test/java/IntervalTaskConfig.java +++ b/instrumentation/spring/spring-scheduling-3.1/src/test/java/IntervalTaskConfig.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 */ import org.springframework.context.annotation.Bean; diff --git a/instrumentation/spring/spring-scheduling-3.1/src/test/java/LambdaTaskConfig.java b/instrumentation/spring/spring-scheduling-3.1/src/test/java/LambdaTaskConfig.java index a8e67007561a..4d7ec3a3477d 100644 --- a/instrumentation/spring/spring-scheduling-3.1/src/test/java/LambdaTaskConfig.java +++ b/instrumentation/spring/spring-scheduling-3.1/src/test/java/LambdaTaskConfig.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 */ import org.springframework.context.annotation.Bean; diff --git a/instrumentation/spring/spring-scheduling-3.1/src/test/java/LambdaTaskConfigurer.java b/instrumentation/spring/spring-scheduling-3.1/src/test/java/LambdaTaskConfigurer.java index a4ae0e36135f..59051a534b46 100644 --- a/instrumentation/spring/spring-scheduling-3.1/src/test/java/LambdaTaskConfigurer.java +++ b/instrumentation/spring/spring-scheduling-3.1/src/test/java/LambdaTaskConfigurer.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 */ import java.util.concurrent.CountDownLatch; diff --git a/instrumentation/spring/spring-scheduling-3.1/src/test/java/TriggerTask.java b/instrumentation/spring/spring-scheduling-3.1/src/test/java/TriggerTask.java index 61da4cc3d7a1..87003be1364f 100644 --- a/instrumentation/spring/spring-scheduling-3.1/src/test/java/TriggerTask.java +++ b/instrumentation/spring/spring-scheduling-3.1/src/test/java/TriggerTask.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 */ import java.util.concurrent.CountDownLatch; diff --git a/instrumentation/spring/spring-scheduling-3.1/src/test/java/TriggerTaskConfig.java b/instrumentation/spring/spring-scheduling-3.1/src/test/java/TriggerTaskConfig.java index 6264dc7626bf..c8fa9dc79f07 100644 --- a/instrumentation/spring/spring-scheduling-3.1/src/test/java/TriggerTaskConfig.java +++ b/instrumentation/spring/spring-scheduling-3.1/src/test/java/TriggerTaskConfig.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 */ import org.springframework.context.annotation.Bean; diff --git a/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/httpclients/HttpHeadersInjectAdapter.java b/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/httpclients/HttpHeadersInjectAdapter.java index aca44ffeda76..57b9cbaf0eb6 100644 --- a/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/httpclients/HttpHeadersInjectAdapter.java +++ b/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/httpclients/HttpHeadersInjectAdapter.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.spring.httpclients; diff --git a/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/httpclients/RestTemplateInterceptor.java b/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/httpclients/RestTemplateInterceptor.java index feb08c45cb7d..e9e8f1826bcf 100644 --- a/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/httpclients/RestTemplateInterceptor.java +++ b/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/httpclients/RestTemplateInterceptor.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.spring.httpclients; diff --git a/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/httpclients/RestTemplateTracer.java b/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/httpclients/RestTemplateTracer.java index 34691856b769..b0a8327c9c74 100644 --- a/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/httpclients/RestTemplateTracer.java +++ b/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/httpclients/RestTemplateTracer.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.spring.httpclients; diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/client/WebClientFilterAdvice.java b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/client/WebClientFilterAdvice.java index a4888641e1ed..2d00b7200fa0 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/client/WebClientFilterAdvice.java +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/client/WebClientFilterAdvice.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.spring.webflux.client; diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/client/WebClientFilterInstrumentation.java b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/client/WebClientFilterInstrumentation.java index 05440f522879..932558f6bf12 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/client/WebClientFilterInstrumentation.java +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/client/WebClientFilterInstrumentation.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.spring.webflux.client; diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/AbstractWebfluxInstrumentation.java b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/AbstractWebfluxInstrumentation.java index 54fc53e44aa8..76cc64112308 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/AbstractWebfluxInstrumentation.java +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/AbstractWebfluxInstrumentation.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.spring.webflux.server; diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/AdviceUtils.java b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/AdviceUtils.java index c07e6251b347..12bc246b99d9 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/AdviceUtils.java +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/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.spring.webflux.server; @@ -22,7 +11,7 @@ import io.opentelemetry.context.Scope; import io.opentelemetry.instrumentation.api.decorator.BaseDecorator; import io.opentelemetry.trace.Span; -import io.opentelemetry.trace.Status; +import io.opentelemetry.trace.StatusCanonicalCode; import io.opentelemetry.trace.TracingContextUtils; import java.util.Map; import java.util.function.Function; @@ -91,7 +80,7 @@ static void finishSpanIfPresent(io.grpc.Context context, Throwable throwable) { if (context != null) { Span span = TracingContextUtils.getSpan(context); if (throwable != null) { - span.setStatus(Status.UNKNOWN); + span.setStatus(StatusCanonicalCode.ERROR); BaseDecorator.addThrowable(span, throwable); } span.end(); diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/DispatcherHandlerAdvice.java b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/DispatcherHandlerAdvice.java index 37d50d7fd014..96ebdf1c7de7 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/DispatcherHandlerAdvice.java +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/DispatcherHandlerAdvice.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.spring.webflux.server; diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/DispatcherHandlerInstrumentation.java b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/DispatcherHandlerInstrumentation.java index fb0f7082ad8d..e9d6750fa7da 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/DispatcherHandlerInstrumentation.java +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/DispatcherHandlerInstrumentation.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.spring.webflux.server; diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/HandlerAdapterAdvice.java b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/HandlerAdapterAdvice.java index 35a7078ba81f..0dad184756bc 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/HandlerAdapterAdvice.java +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/HandlerAdapterAdvice.java @@ -1,23 +1,12 @@ /* * 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.spring.webflux.server; +import static io.opentelemetry.context.ContextUtils.withScopedContext; import static io.opentelemetry.instrumentation.auto.spring.webflux.server.SpringWebfluxHttpServerTracer.TRACER; -import static io.opentelemetry.trace.TracingContextUtils.currentContextWith; import io.grpc.Context; import io.opentelemetry.instrumentation.api.tracer.BaseTracer; @@ -56,7 +45,7 @@ public static SpanWithScope methodEnter( span.updateName(operationName); span.setAttribute("handler.type", handlerType); - spanWithScope = new SpanWithScope(span, currentContextWith(span)); + spanWithScope = new SpanWithScope(span, withScopedContext(context)); } if (context != null) { diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/HandlerAdapterInstrumentation.java b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/HandlerAdapterInstrumentation.java index baa4b6af2730..e56668255598 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/HandlerAdapterInstrumentation.java +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/HandlerAdapterInstrumentation.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.spring.webflux.server; diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/RouteOnSuccessOrError.java b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/RouteOnSuccessOrError.java index 770666c50ec0..e444e55092f0 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/RouteOnSuccessOrError.java +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/RouteOnSuccessOrError.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.spring.webflux.server; diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/RouterFunctionAdvice.java b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/RouterFunctionAdvice.java index ef9ecd4c7ca0..ba9791fd58f7 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/RouterFunctionAdvice.java +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/RouterFunctionAdvice.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.spring.webflux.server; diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/RouterFunctionInstrumentation.java b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/RouterFunctionInstrumentation.java index 51d123c13c8c..d38d9144d66f 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/RouterFunctionInstrumentation.java +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/RouterFunctionInstrumentation.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.spring.webflux.server; diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/SpringWebfluxHttpServerTracer.java b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/SpringWebfluxHttpServerTracer.java index 14bcebcf0b81..eff37f3dd00e 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/SpringWebfluxHttpServerTracer.java +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/main/java/io/opentelemetry/instrumentation/auto/spring/webflux/server/SpringWebfluxHttpServerTracer.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.spring.webflux.server; diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/SingleThreadedSpringWebfluxTest.groovy b/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/SingleThreadedSpringWebfluxTest.groovy index 6f6e338d3e35..54b724e89546 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/SingleThreadedSpringWebfluxTest.groovy +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/SingleThreadedSpringWebfluxTest.groovy @@ -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 */ import org.springframework.boot.test.context.SpringBootTest diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/SpringWebfluxTest.groovy b/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/SpringWebfluxTest.groovy index adc11e5a569b..373c335e1fb3 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/SpringWebfluxTest.groovy +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/SpringWebfluxTest.groovy @@ -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 */ import static io.opentelemetry.trace.Span.Kind.INTERNAL @@ -67,9 +56,9 @@ class SpringWebfluxTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName urlPathWithVariables - spanKind SERVER - parent() + name urlPathWithVariables + kind SERVER + hasNoParent() attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key()}" Long @@ -84,12 +73,12 @@ class SpringWebfluxTest extends AgentTestRunner { span(1) { if (annotatedMethod == null) { // Functional API - operationNameContains(SPRING_APP_CLASS_ANON_NESTED_CLASS_PREFIX, ".handle") + nameContains(SPRING_APP_CLASS_ANON_NESTED_CLASS_PREFIX, ".handle") } else { // Annotation API - operationName TestController.getSimpleName() + "." + annotatedMethod + name TestController.getSimpleName() + "." + annotatedMethod } - spanKind INTERNAL + kind INTERNAL childOf span(0) attributes { if (annotatedMethod == null) { @@ -133,9 +122,9 @@ class SpringWebfluxTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName urlPathWithVariables - spanKind SERVER - parent() + name urlPathWithVariables + kind SERVER + hasNoParent() attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key()}" Long @@ -150,12 +139,12 @@ class SpringWebfluxTest extends AgentTestRunner { span(1) { if (annotatedMethod == null) { // Functional API - operationNameContains(SPRING_APP_CLASS_ANON_NESTED_CLASS_PREFIX, ".handle") + nameContains(SPRING_APP_CLASS_ANON_NESTED_CLASS_PREFIX, ".handle") } else { // Annotation API - operationName TestController.getSimpleName() + "." + annotatedMethod + name TestController.getSimpleName() + "." + annotatedMethod } - spanKind INTERNAL + kind INTERNAL childOf span(0) attributes { if (annotatedMethod == null) { @@ -171,7 +160,7 @@ class SpringWebfluxTest extends AgentTestRunner { } } span(2) { - operationName "tracedMethod" + name "tracedMethod" childOf span(0) errored false attributes { @@ -221,9 +210,9 @@ class SpringWebfluxTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName urlPathWithVariables - spanKind SERVER - parent() + name urlPathWithVariables + kind SERVER + hasNoParent() attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key()}" Long @@ -238,12 +227,12 @@ class SpringWebfluxTest extends AgentTestRunner { span(1) { if (annotatedMethod == null) { // Functional API - operationNameContains(SPRING_APP_CLASS_ANON_NESTED_CLASS_PREFIX, ".handle") + nameContains(SPRING_APP_CLASS_ANON_NESTED_CLASS_PREFIX, ".handle") } else { // Annotation API - operationName TestController.getSimpleName() + "." + annotatedMethod + name TestController.getSimpleName() + "." + annotatedMethod } - spanKind INTERNAL + kind INTERNAL childOf span(0) attributes { if (annotatedMethod == null) { @@ -259,7 +248,7 @@ class SpringWebfluxTest extends AgentTestRunner { } } span(2) { - operationName "tracedMethod" + name "tracedMethod" childOf span(annotatedMethod ? 0 : 1) errored false attributes { @@ -287,9 +276,9 @@ class SpringWebfluxTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "/**" - spanKind SERVER - parent() + name "/**" + kind SERVER + hasNoParent() errored true attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -303,8 +292,8 @@ class SpringWebfluxTest extends AgentTestRunner { } } span(1) { - operationName "ResourceWebHandler.handle" - spanKind INTERNAL + name "ResourceWebHandler.handle" + kind INTERNAL childOf span(0) errored true errorEvent(ResponseStatusException, String) @@ -332,9 +321,9 @@ class SpringWebfluxTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName "/echo" - spanKind SERVER - parent() + name "/echo" + kind SERVER + hasNoParent() attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key()}" Long @@ -347,8 +336,8 @@ class SpringWebfluxTest extends AgentTestRunner { } } span(1) { - operationName EchoHandlerFunction.getSimpleName() + ".handle" - spanKind INTERNAL + name EchoHandlerFunction.getSimpleName() + ".handle" + kind INTERNAL childOf span(0) attributes { "request.predicate" "(POST && /echo)" @@ -358,7 +347,7 @@ class SpringWebfluxTest extends AgentTestRunner { } } span(2) { - operationName "echo" + name "echo" childOf span(1) attributes { } @@ -380,10 +369,10 @@ class SpringWebfluxTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName urlPathWithVariables - spanKind SERVER + name urlPathWithVariables + kind SERVER errored true - parent() + hasNoParent() attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key()}" Long @@ -398,12 +387,12 @@ class SpringWebfluxTest extends AgentTestRunner { span(1) { if (annotatedMethod == null) { // Functional API - operationNameContains(SPRING_APP_CLASS_ANON_NESTED_CLASS_PREFIX, ".handle") + nameContains(SPRING_APP_CLASS_ANON_NESTED_CLASS_PREFIX, ".handle") } else { // Annotation API - operationName TestController.getSimpleName() + "." + annotatedMethod + name TestController.getSimpleName() + "." + annotatedMethod } - spanKind INTERNAL + kind INTERNAL childOf span(0) errored true errorEvent(RuntimeException, "bad things happen") @@ -447,9 +436,9 @@ class SpringWebfluxTest extends AgentTestRunner { // TODO: why order of spans is different in these traces? trace(0, 2) { span(0) { - operationName "/double-greet-redirect" - spanKind SERVER - parent() + name "/double-greet-redirect" + kind SERVER + hasNoParent() attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key()}" Long @@ -462,8 +451,8 @@ class SpringWebfluxTest extends AgentTestRunner { } } span(1) { - operationName "RedirectComponent.lambda" - spanKind INTERNAL + name "RedirectComponent.lambda" + kind INTERNAL childOf span(0) attributes { "request.predicate" "(GET && /double-greet-redirect)" @@ -476,9 +465,9 @@ class SpringWebfluxTest extends AgentTestRunner { } trace(1, 2) { span(0) { - operationName "/double-greet" - spanKind SERVER - parent() + name "/double-greet" + kind SERVER + hasNoParent() attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key()}" Long @@ -491,8 +480,8 @@ class SpringWebfluxTest extends AgentTestRunner { } } span(1) { - operationNameContains(SpringWebFluxTestApplication.getSimpleName() + "\$", ".handle") - spanKind INTERNAL + nameContains(SpringWebFluxTestApplication.getSimpleName() + "\$", ".handle") + kind INTERNAL childOf span(0) attributes { "request.predicate" "(GET && /double-greet)" @@ -520,9 +509,9 @@ class SpringWebfluxTest extends AgentTestRunner { responses.eachWithIndex { def response, int i -> trace(i, 2) { span(0) { - operationName urlPathWithVariables - spanKind SERVER - parent() + name urlPathWithVariables + kind SERVER + hasNoParent() attributes { "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key()}" Long @@ -537,12 +526,12 @@ class SpringWebfluxTest extends AgentTestRunner { span(1) { if (annotatedMethod == null) { // Functional API - operationNameContains(SPRING_APP_CLASS_ANON_NESTED_CLASS_PREFIX, ".handle") + nameContains(SPRING_APP_CLASS_ANON_NESTED_CLASS_PREFIX, ".handle") } else { // Annotation API - operationName TestController.getSimpleName() + "." + annotatedMethod + name TestController.getSimpleName() + "." + annotatedMethod } - spanKind INTERNAL + kind INTERNAL childOf span(0) attributes { if (annotatedMethod == null) { diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/client/SpringWebfluxHttpClientTest.groovy b/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/client/SpringWebfluxHttpClientTest.groovy index e4a126e4bedc..0ff60499ee2b 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/client/SpringWebfluxHttpClientTest.groovy +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/client/SpringWebfluxHttpClientTest.groovy @@ -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 client diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/server/EchoHandler.groovy b/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/server/EchoHandler.groovy index 56be24f741e2..cc57cd7e1090 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/server/EchoHandler.groovy +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/server/EchoHandler.groovy @@ -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 server diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/server/EchoHandlerFunction.groovy b/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/server/EchoHandlerFunction.groovy index f5f7583abfe2..b1ca5c3ca57a 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/server/EchoHandlerFunction.groovy +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/server/EchoHandlerFunction.groovy @@ -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 server diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/server/FooModel.groovy b/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/server/FooModel.groovy index 6281e848240c..43c47f2a1847 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/server/FooModel.groovy +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/server/FooModel.groovy @@ -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 server diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/server/SpringWebFluxTestApplication.groovy b/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/server/SpringWebFluxTestApplication.groovy index e2b59693bcd3..68dffbf644a4 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/server/SpringWebFluxTestApplication.groovy +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/server/SpringWebFluxTestApplication.groovy @@ -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 server diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/server/TestController.groovy b/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/server/TestController.groovy index 0865ea94bbac..8573f272f0e6 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/server/TestController.groovy +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/test/groovy/server/TestController.groovy @@ -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 server diff --git a/instrumentation/spring/spring-webflux-5.0/auto/src/test/java/server/RedirectComponent.java b/instrumentation/spring/spring-webflux-5.0/auto/src/test/java/server/RedirectComponent.java index 3088bb54dee6..fef1801cf25b 100644 --- a/instrumentation/spring/spring-webflux-5.0/auto/src/test/java/server/RedirectComponent.java +++ b/instrumentation/spring/spring-webflux-5.0/auto/src/test/java/server/RedirectComponent.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 server; diff --git a/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/HttpHeadersInjectAdapter.java b/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/HttpHeadersInjectAdapter.java index 410f8c8fdaa6..bcc0b9cf078e 100644 --- a/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/HttpHeadersInjectAdapter.java +++ b/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/HttpHeadersInjectAdapter.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.spring.webflux.client; diff --git a/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/SpringWebfluxHttpClientTracer.java b/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/SpringWebfluxHttpClientTracer.java index 2388c0b805b0..bd4af9d5e125 100644 --- a/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/SpringWebfluxHttpClientTracer.java +++ b/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/SpringWebfluxHttpClientTracer.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.spring.webflux.client; diff --git a/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/TraceWebClientSubscriber.java b/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/TraceWebClientSubscriber.java index 75dc1835c713..57b184f3cec2 100644 --- a/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/TraceWebClientSubscriber.java +++ b/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/TraceWebClientSubscriber.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.spring.webflux.client; diff --git a/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/WebClientTracingFilter.java b/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/WebClientTracingFilter.java index 7b081cab4226..a51e3359b456 100644 --- a/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/WebClientTracingFilter.java +++ b/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/WebClientTracingFilter.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.spring.webflux.client; diff --git a/instrumentation/spring/spring-webmvc-3.1/auto/src/main/java/io/opentelemetry/instrumentation/auto/springwebmvc/DispatcherServletInstrumentation.java b/instrumentation/spring/spring-webmvc-3.1/auto/src/main/java/io/opentelemetry/instrumentation/auto/springwebmvc/DispatcherServletInstrumentation.java index 5126575a6e37..bca814081d20 100644 --- a/instrumentation/spring/spring-webmvc-3.1/auto/src/main/java/io/opentelemetry/instrumentation/auto/springwebmvc/DispatcherServletInstrumentation.java +++ b/instrumentation/spring/spring-webmvc-3.1/auto/src/main/java/io/opentelemetry/instrumentation/auto/springwebmvc/DispatcherServletInstrumentation.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.springwebmvc; diff --git a/instrumentation/spring/spring-webmvc-3.1/auto/src/main/java/io/opentelemetry/instrumentation/auto/springwebmvc/HandlerAdapterInstrumentation.java b/instrumentation/spring/spring-webmvc-3.1/auto/src/main/java/io/opentelemetry/instrumentation/auto/springwebmvc/HandlerAdapterInstrumentation.java index fe0f6777132e..8a769403b2d7 100644 --- a/instrumentation/spring/spring-webmvc-3.1/auto/src/main/java/io/opentelemetry/instrumentation/auto/springwebmvc/HandlerAdapterInstrumentation.java +++ b/instrumentation/spring/spring-webmvc-3.1/auto/src/main/java/io/opentelemetry/instrumentation/auto/springwebmvc/HandlerAdapterInstrumentation.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.springwebmvc; diff --git a/instrumentation/spring/spring-webmvc-3.1/auto/src/main/java/io/opentelemetry/instrumentation/auto/springwebmvc/HandlerMappingResourceNameFilter.java b/instrumentation/spring/spring-webmvc-3.1/auto/src/main/java/io/opentelemetry/instrumentation/auto/springwebmvc/HandlerMappingResourceNameFilter.java index 3330588bf18d..c01448dee531 100644 --- a/instrumentation/spring/spring-webmvc-3.1/auto/src/main/java/io/opentelemetry/instrumentation/auto/springwebmvc/HandlerMappingResourceNameFilter.java +++ b/instrumentation/spring/spring-webmvc-3.1/auto/src/main/java/io/opentelemetry/instrumentation/auto/springwebmvc/HandlerMappingResourceNameFilter.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.springwebmvc; diff --git a/instrumentation/spring/spring-webmvc-3.1/auto/src/main/java/io/opentelemetry/instrumentation/auto/springwebmvc/SpringWebMvcTracer.java b/instrumentation/spring/spring-webmvc-3.1/auto/src/main/java/io/opentelemetry/instrumentation/auto/springwebmvc/SpringWebMvcTracer.java index 0b24bba816c2..2a98a1fff9a7 100644 --- a/instrumentation/spring/spring-webmvc-3.1/auto/src/main/java/io/opentelemetry/instrumentation/auto/springwebmvc/SpringWebMvcTracer.java +++ b/instrumentation/spring/spring-webmvc-3.1/auto/src/main/java/io/opentelemetry/instrumentation/auto/springwebmvc/SpringWebMvcTracer.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.springwebmvc; diff --git a/instrumentation/spring/spring-webmvc-3.1/auto/src/main/java/io/opentelemetry/instrumentation/auto/springwebmvc/WebApplicationContextInstrumentation.java b/instrumentation/spring/spring-webmvc-3.1/auto/src/main/java/io/opentelemetry/instrumentation/auto/springwebmvc/WebApplicationContextInstrumentation.java index 3bb9acc480e0..16d140e0e75a 100644 --- a/instrumentation/spring/spring-webmvc-3.1/auto/src/main/java/io/opentelemetry/instrumentation/auto/springwebmvc/WebApplicationContextInstrumentation.java +++ b/instrumentation/spring/spring-webmvc-3.1/auto/src/main/java/io/opentelemetry/instrumentation/auto/springwebmvc/WebApplicationContextInstrumentation.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.springwebmvc; diff --git a/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/AppConfig.groovy b/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/AppConfig.groovy index 3b535c6db86f..99fa2366adf5 100644 --- a/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/AppConfig.groovy +++ b/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/AppConfig.groovy @@ -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 test.boot diff --git a/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/AuthServerConfig.groovy b/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/AuthServerConfig.groovy index 9f4c729fc76a..51c71ccfaedd 100644 --- a/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/AuthServerConfig.groovy +++ b/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/AuthServerConfig.groovy @@ -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 test.boot diff --git a/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/SavingAuthenticationProvider.groovy b/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/SavingAuthenticationProvider.groovy index 66abef8f6c14..2c87e396c481 100644 --- a/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/SavingAuthenticationProvider.groovy +++ b/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/SavingAuthenticationProvider.groovy @@ -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 test.boot diff --git a/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/SecurityConfig.groovy b/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/SecurityConfig.groovy index d94ee5972c52..0036a05c51c6 100644 --- a/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/SecurityConfig.groovy +++ b/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/SecurityConfig.groovy @@ -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 test.boot diff --git a/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/SpringBootBasedTest.groovy b/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/SpringBootBasedTest.groovy index fd0bb9cd49d9..c1bf70273525 100644 --- a/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/SpringBootBasedTest.groovy +++ b/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/SpringBootBasedTest.groovy @@ -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 test.boot @@ -126,8 +115,8 @@ class SpringBootBasedTest extends HttpServerTest @Override void errorPageSpans(TraceAssert trace, int index, Object parent, String method = "GET", ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName "BasicErrorController.error" - spanKind INTERNAL + name "BasicErrorController.error" + kind INTERNAL errored false attributes { } @@ -137,8 +126,8 @@ class SpringBootBasedTest extends HttpServerTest @Override void responseSpan(TraceAssert trace, int index, Object parent, String method = "GET", ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName "HttpServletResponse.sendRedirect" - spanKind INTERNAL + name "HttpServletResponse.sendRedirect" + kind INTERNAL errored false attributes { } @@ -148,8 +137,8 @@ class SpringBootBasedTest extends HttpServerTest @Override void renderSpan(TraceAssert trace, int index, Object parent, String method = "GET", ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName "Render RedirectView" - spanKind INTERNAL + name "Render RedirectView" + kind INTERNAL errored false attributes { "view.type" RedirectView.simpleName @@ -160,8 +149,8 @@ class SpringBootBasedTest extends HttpServerTest @Override void handlerSpan(TraceAssert trace, int index, Object parent, String method = "GET", ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName "TestController.${endpoint.name().toLowerCase()}" - spanKind INTERNAL + name "TestController.${endpoint.name().toLowerCase()}" + kind INTERNAL errored endpoint == EXCEPTION if (endpoint == EXCEPTION) { errorEvent(Exception, EXCEPTION.body) @@ -174,14 +163,14 @@ class SpringBootBasedTest extends HttpServerTest void serverSpan(TraceAssert trace, int index, String traceID = null, String parentID = null, String method = "GET", Long responseContentLength = null, ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName endpoint == LOGIN ? "ApplicationFilterChain.doFilter" : endpoint == PATH_PARAM ? "/path/{id}/param" : endpoint.resolvePath(address).path - spanKind SERVER + name endpoint == LOGIN ? "ApplicationFilterChain.doFilter" : endpoint == PATH_PARAM ? "/path/{id}/param" : endpoint.resolvePath(address).path + kind SERVER errored endpoint.errored if (parentID != null) { traceId traceID - parentId parentID + parentSpanId parentID } else { - parent() + hasNoParent() } if (endpoint == EXCEPTION) { errorEvent(Exception, EXCEPTION.body) diff --git a/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/TestController.groovy b/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/TestController.groovy index d1abdeba45e6..70ed2ffcdf6b 100644 --- a/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/TestController.groovy +++ b/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/boot/TestController.groovy @@ -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 test.boot diff --git a/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/filter/FilteredAppConfig.groovy b/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/filter/FilteredAppConfig.groovy index 38ed68c22e26..427fea400d3e 100644 --- a/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/filter/FilteredAppConfig.groovy +++ b/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/filter/FilteredAppConfig.groovy @@ -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 test.filter diff --git a/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/filter/ServletFilterTest.groovy b/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/filter/ServletFilterTest.groovy index e40ec9f38bea..b6f044a70fac 100644 --- a/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/filter/ServletFilterTest.groovy +++ b/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/filter/ServletFilterTest.groovy @@ -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 test.filter @@ -77,8 +66,8 @@ class ServletFilterTest extends HttpServerTest { @Override void handlerSpan(TraceAssert trace, int index, Object parent, String method = "GET", ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName "TestController.${endpoint.name().toLowerCase()}" - spanKind INTERNAL + name "TestController.${endpoint.name().toLowerCase()}" + kind INTERNAL errored endpoint == EXCEPTION childOf((SpanData) parent) if (endpoint == EXCEPTION) { @@ -90,14 +79,14 @@ class ServletFilterTest extends HttpServerTest { @Override void serverSpan(TraceAssert trace, int index, String traceID = null, String parentID = null, String method = "GET", Long responseContentLength = null, ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName endpoint == PATH_PARAM ? "/path/{id}/param" : endpoint.resolvePath(address).path - spanKind SERVER + name endpoint == PATH_PARAM ? "/path/{id}/param" : endpoint.resolvePath(address).path + kind SERVER errored endpoint.errored if (parentID != null) { traceId traceID - parentId parentID + parentSpanId parentID } else { - parent() + hasNoParent() } if (endpoint == EXCEPTION) { errorEvent(Exception, EXCEPTION.body) @@ -118,8 +107,8 @@ class ServletFilterTest extends HttpServerTest { @Override void errorPageSpans(TraceAssert trace, int index, Object parent, String method = "GET", ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName "BasicErrorController.error" - spanKind INTERNAL + name "BasicErrorController.error" + kind INTERNAL errored false childOf((SpanData) parent) attributes { diff --git a/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/filter/TestController.groovy b/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/filter/TestController.groovy index d7659dc6c076..2540c65b0201 100644 --- a/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/filter/TestController.groovy +++ b/instrumentation/spring/spring-webmvc-3.1/auto/src/test/groovy/test/filter/TestController.groovy @@ -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 test.filter diff --git a/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcServerTracer.java b/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcServerTracer.java index 96bdc4556007..9dcd90bdd301 100644 --- a/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcServerTracer.java +++ b/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcServerTracer.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.spring.webmvc; diff --git a/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/WebMvcTracingFilter.java b/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/WebMvcTracingFilter.java index 0d49277b13e9..e8f1b858a938 100644 --- a/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/WebMvcTracingFilter.java +++ b/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/WebMvcTracingFilter.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.spring.webmvc; diff --git a/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/BulkGetCompletionListener.java b/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/BulkGetCompletionListener.java index 87fd46a72c2b..fbd24ab92e8b 100644 --- a/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/BulkGetCompletionListener.java +++ b/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/BulkGetCompletionListener.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.spymemcached; diff --git a/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/CompletionListener.java b/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/CompletionListener.java index 168845aee965..7536e49f606a 100644 --- a/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/CompletionListener.java +++ b/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/CompletionListener.java @@ -1,24 +1,14 @@ /* * 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.spymemcached; +import static io.opentelemetry.context.ContextUtils.withScopedContext; import static io.opentelemetry.instrumentation.auto.spymemcached.MemcacheClientTracer.TRACER; -import static io.opentelemetry.trace.TracingContextUtils.currentContextWith; +import io.grpc.Context; import io.opentelemetry.context.Scope; import io.opentelemetry.trace.Span; import java.util.concurrent.CancellationException; @@ -32,14 +22,16 @@ public abstract class CompletionListener { static final String HIT = "hit"; static final String MISS = "miss"; + private final Context context; private final Span span; public CompletionListener(MemcachedConnection connection, String methodName) { + context = Context.current(); span = TRACER.startSpan(connection, methodName); } protected void closeAsyncSpan(T future) { - try (Scope ignored = currentContextWith(span)) { + try (Scope ignored = withScopedContext(context)) { try { processResult(span, future); } catch (CancellationException e) { diff --git a/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/GetCompletionListener.java b/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/GetCompletionListener.java index e4e049256b0f..29c0b1001a75 100644 --- a/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/GetCompletionListener.java +++ b/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/GetCompletionListener.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.spymemcached; diff --git a/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/MemcacheClientTracer.java b/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/MemcacheClientTracer.java index 97b903f09898..c518d9f72191 100644 --- a/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/MemcacheClientTracer.java +++ b/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/MemcacheClientTracer.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.spymemcached; diff --git a/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/MemcachedClientInstrumentation.java b/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/MemcachedClientInstrumentation.java index 35892a1d5597..cb7e0f19434e 100644 --- a/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/MemcachedClientInstrumentation.java +++ b/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/MemcachedClientInstrumentation.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.spymemcached; diff --git a/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/OperationCompletionListener.java b/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/OperationCompletionListener.java index b6cb78ceb134..841c9b92b5af 100644 --- a/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/OperationCompletionListener.java +++ b/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/OperationCompletionListener.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.spymemcached; diff --git a/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/SyncCompletionListener.java b/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/SyncCompletionListener.java index 7c9597a04fd2..bd51b859853a 100644 --- a/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/SyncCompletionListener.java +++ b/instrumentation/spymemcached-2.12/src/main/java/io/opentelemetry/instrumentation/auto/spymemcached/SyncCompletionListener.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.spymemcached; diff --git a/instrumentation/spymemcached-2.12/src/test/groovy/SpymemcachedTest.groovy b/instrumentation/spymemcached-2.12/src/test/groovy/SpymemcachedTest.groovy index 8e9d1db95cd9..b9bc1b43a767 100644 --- a/instrumentation/spymemcached-2.12/src/test/groovy/SpymemcachedTest.groovy +++ b/instrumentation/spymemcached-2.12/src/test/groovy/SpymemcachedTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace @@ -616,8 +605,8 @@ class SpymemcachedTest extends AgentTestRunner { def getParentSpan(TraceAssert trace, int index) { return trace.span(index) { - operationName parentOperation - parent() + name parentOperation + hasNoParent() errored false attributes { } @@ -630,8 +619,8 @@ class SpymemcachedTest extends AgentTestRunner { childOf(trace.span(0)) } - operationName operation - spanKind CLIENT + name operation + kind CLIENT errored(error != null && error != "canceled") if (error == "timeout") { diff --git a/instrumentation/twilio-6.6/src/main/java/io/opentelemetry/instrumentation/auto/twilio/TwilioAsyncInstrumentation.java b/instrumentation/twilio-6.6/src/main/java/io/opentelemetry/instrumentation/auto/twilio/TwilioAsyncInstrumentation.java index b42ad64c03a8..fbb797bd8893 100644 --- a/instrumentation/twilio-6.6/src/main/java/io/opentelemetry/instrumentation/auto/twilio/TwilioAsyncInstrumentation.java +++ b/instrumentation/twilio-6.6/src/main/java/io/opentelemetry/instrumentation/auto/twilio/TwilioAsyncInstrumentation.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.twilio; diff --git a/instrumentation/twilio-6.6/src/main/java/io/opentelemetry/instrumentation/auto/twilio/TwilioClientDecorator.java b/instrumentation/twilio-6.6/src/main/java/io/opentelemetry/instrumentation/auto/twilio/TwilioClientDecorator.java index 0dfee2ce1731..c2dccde19dfd 100644 --- a/instrumentation/twilio-6.6/src/main/java/io/opentelemetry/instrumentation/auto/twilio/TwilioClientDecorator.java +++ b/instrumentation/twilio-6.6/src/main/java/io/opentelemetry/instrumentation/auto/twilio/TwilioClientDecorator.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.twilio; diff --git a/instrumentation/twilio-6.6/src/main/java/io/opentelemetry/instrumentation/auto/twilio/TwilioSyncInstrumentation.java b/instrumentation/twilio-6.6/src/main/java/io/opentelemetry/instrumentation/auto/twilio/TwilioSyncInstrumentation.java index 98f668a288e5..3668760ace55 100644 --- a/instrumentation/twilio-6.6/src/main/java/io/opentelemetry/instrumentation/auto/twilio/TwilioSyncInstrumentation.java +++ b/instrumentation/twilio-6.6/src/main/java/io/opentelemetry/instrumentation/auto/twilio/TwilioSyncInstrumentation.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.twilio; diff --git a/instrumentation/twilio-6.6/src/test/groovy/test/TwilioClientTest.groovy b/instrumentation/twilio-6.6/src/test/groovy/test/TwilioClientTest.groovy index 6bcf436dc397..7b785a6c9d6e 100644 --- a/instrumentation/twilio-6.6/src/test/groovy/test/TwilioClientTest.groovy +++ b/instrumentation/twilio-6.6/src/test/groovy/test/TwilioClientTest.groovy @@ -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 test @@ -147,15 +136,15 @@ class TwilioClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "test" + name "test" errored false - parent() + hasNoParent() attributes { } } span(1) { - operationName "MessageCreator.create" - spanKind CLIENT + name "MessageCreator.create" + kind CLIENT errored false attributes { "twilio.type" "com.twilio.rest.api.v2010.account.Message" @@ -191,15 +180,15 @@ class TwilioClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "test" + name "test" errored false - parent() + hasNoParent() attributes { } } span(1) { - operationName "CallCreator.create" - spanKind CLIENT + name "CallCreator.create" + kind CLIENT errored false attributes { "twilio.type" "com.twilio.rest.api.v2010.account.Call" @@ -257,15 +246,15 @@ class TwilioClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName "test" + name "test" errored false - parent() + hasNoParent() attributes { } } span(1) { - operationName "MessageCreator.create" - spanKind CLIENT + name "MessageCreator.create" + kind CLIENT childOf(span(0)) errored false attributes { @@ -276,8 +265,8 @@ class TwilioClientTest extends AgentTestRunner { } } span(2) { - operationName expectedOperationName("POST") - spanKind CLIENT + name expectedOperationName("POST") + kind CLIENT childOf(span(1)) errored false attributes { @@ -353,15 +342,15 @@ class TwilioClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 4) { span(0) { - operationName "test" + name "test" errored false - parent() + hasNoParent() attributes { } } span(1) { - operationName "MessageCreator.create" - spanKind CLIENT + name "MessageCreator.create" + kind CLIENT childOf(span(0)) errored false attributes { @@ -372,8 +361,8 @@ class TwilioClientTest extends AgentTestRunner { } } span(2) { - operationName expectedOperationName("POST") - spanKind CLIENT + name expectedOperationName("POST") + kind CLIENT childOf(span(1)) errored true attributes { @@ -386,8 +375,8 @@ class TwilioClientTest extends AgentTestRunner { } } span(3) { - operationName expectedOperationName("POST") - spanKind CLIENT + name expectedOperationName("POST") + kind CLIENT childOf(span(1)) errored false attributes { @@ -470,15 +459,15 @@ class TwilioClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 5) { span(0) { - operationName "test" + name "test" errored false - parent() + hasNoParent() attributes { } } span(1) { - operationName "MessageCreator.createAsync" - spanKind CLIENT + name "MessageCreator.createAsync" + kind CLIENT childOf(span(0)) errored false attributes { @@ -489,8 +478,8 @@ class TwilioClientTest extends AgentTestRunner { } } span(2) { - operationName "MessageCreator.create" - spanKind CLIENT + name "MessageCreator.create" + kind CLIENT childOf(span(1)) errored false attributes { @@ -501,8 +490,8 @@ class TwilioClientTest extends AgentTestRunner { } } span(3) { - operationName expectedOperationName("POST") - spanKind CLIENT + name expectedOperationName("POST") + kind CLIENT childOf(span(2)) errored true attributes { @@ -515,8 +504,8 @@ class TwilioClientTest extends AgentTestRunner { } } span(4) { - operationName expectedOperationName("POST") - spanKind CLIENT + name expectedOperationName("POST") + kind CLIENT childOf(span(2)) errored false attributes { @@ -560,14 +549,14 @@ class TwilioClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "test" + name "test" errored true errorEvent(ApiException, "Testing Failure") - parent() + hasNoParent() } span(1) { - operationName "MessageCreator.create" - spanKind CLIENT + name "MessageCreator.create" + kind CLIENT errored true errorEvent(ApiException, "Testing Failure") } @@ -594,9 +583,9 @@ class TwilioClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "MessageCreator.create" - spanKind CLIENT - parent() + name "MessageCreator.create" + kind CLIENT + hasNoParent() errored false attributes { "twilio.type" "com.twilio.rest.api.v2010.account.Message" @@ -641,15 +630,15 @@ class TwilioClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName "test" + name "test" errored false - parent() + hasNoParent() attributes { } } span(1) { - operationName "MessageCreator.createAsync" - spanKind CLIENT + name "MessageCreator.createAsync" + kind CLIENT errored false attributes { "twilio.type" "com.twilio.rest.api.v2010.account.Message" @@ -659,8 +648,8 @@ class TwilioClientTest extends AgentTestRunner { } } span(2) { - operationName "MessageCreator.create" - spanKind CLIENT + name "MessageCreator.create" + kind CLIENT errored false attributes { "twilio.type" "com.twilio.rest.api.v2010.account.Message" @@ -712,20 +701,20 @@ class TwilioClientTest extends AgentTestRunner { assertTraces(1) { trace(0, 3) { span(0) { - operationName "test" + name "test" errored true errorEvent(ApiException, "Testing Failure") - parent() + hasNoParent() } span(1) { - operationName "MessageCreator.createAsync" - spanKind CLIENT + name "MessageCreator.createAsync" + kind CLIENT errored true errorEvent(ApiException, "Testing Failure") } span(2) { - operationName "MessageCreator.create" - spanKind CLIENT + name "MessageCreator.create" + kind CLIENT errored true errorEvent(ApiException, "Testing Failure") } diff --git a/instrumentation/vertx-3.0/src/main/java/io/opentelemetry/instrumentation/auto/vertx/RouteInstrumentation.java b/instrumentation/vertx-3.0/src/main/java/io/opentelemetry/instrumentation/auto/vertx/RouteInstrumentation.java index 739f34509078..cdc73f34705a 100644 --- a/instrumentation/vertx-3.0/src/main/java/io/opentelemetry/instrumentation/auto/vertx/RouteInstrumentation.java +++ b/instrumentation/vertx-3.0/src/main/java/io/opentelemetry/instrumentation/auto/vertx/RouteInstrumentation.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.vertx; diff --git a/instrumentation/vertx-3.0/src/main/java/io/opentelemetry/instrumentation/auto/vertx/RoutingContextHandlerWrapper.java b/instrumentation/vertx-3.0/src/main/java/io/opentelemetry/instrumentation/auto/vertx/RoutingContextHandlerWrapper.java index cf6dabeaf7a8..250f6d395a78 100644 --- a/instrumentation/vertx-3.0/src/main/java/io/opentelemetry/instrumentation/auto/vertx/RoutingContextHandlerWrapper.java +++ b/instrumentation/vertx-3.0/src/main/java/io/opentelemetry/instrumentation/auto/vertx/RoutingContextHandlerWrapper.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.vertx; diff --git a/instrumentation/vertx-3.0/src/main/java/io/opentelemetry/instrumentation/auto/vertx/VertxTracer.java b/instrumentation/vertx-3.0/src/main/java/io/opentelemetry/instrumentation/auto/vertx/VertxTracer.java index c3a67cb516e0..af09039d8527 100644 --- a/instrumentation/vertx-3.0/src/main/java/io/opentelemetry/instrumentation/auto/vertx/VertxTracer.java +++ b/instrumentation/vertx-3.0/src/main/java/io/opentelemetry/instrumentation/auto/vertx/VertxTracer.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.vertx; diff --git a/instrumentation/vertx-3.0/src/test/groovy/client/VertxHttpClientTest.groovy b/instrumentation/vertx-3.0/src/test/groovy/client/VertxHttpClientTest.groovy index 0388ceafd5e6..97f92a3306dc 100644 --- a/instrumentation/vertx-3.0/src/test/groovy/client/VertxHttpClientTest.groovy +++ b/instrumentation/vertx-3.0/src/test/groovy/client/VertxHttpClientTest.groovy @@ -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 client diff --git a/instrumentation/vertx-3.0/src/test/groovy/server/VertxHttpServerTest.groovy b/instrumentation/vertx-3.0/src/test/groovy/server/VertxHttpServerTest.groovy index ddbd989cc706..c430f2988a15 100644 --- a/instrumentation/vertx-3.0/src/test/groovy/server/VertxHttpServerTest.groovy +++ b/instrumentation/vertx-3.0/src/test/groovy/server/VertxHttpServerTest.groovy @@ -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 server diff --git a/instrumentation/vertx-3.0/src/test/groovy/server/VertxWebServer.java b/instrumentation/vertx-3.0/src/test/groovy/server/VertxWebServer.java index 7283ba244c74..f06d1ed3c3a9 100644 --- a/instrumentation/vertx-3.0/src/test/groovy/server/VertxWebServer.java +++ b/instrumentation/vertx-3.0/src/test/groovy/server/VertxWebServer.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 server; diff --git a/instrumentation/vertx-reactive-3.5/src/main/java/io/opentelemetry/instrumentation/auto/vertx/reactive/AsyncResultConsumerWrapper.java b/instrumentation/vertx-reactive-3.5/src/main/java/io/opentelemetry/instrumentation/auto/vertx/reactive/AsyncResultConsumerWrapper.java index 96c74300dcc6..cc1e42717e2e 100644 --- a/instrumentation/vertx-reactive-3.5/src/main/java/io/opentelemetry/instrumentation/auto/vertx/reactive/AsyncResultConsumerWrapper.java +++ b/instrumentation/vertx-reactive-3.5/src/main/java/io/opentelemetry/instrumentation/auto/vertx/reactive/AsyncResultConsumerWrapper.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.vertx.reactive; diff --git a/instrumentation/vertx-reactive-3.5/src/main/java/io/opentelemetry/instrumentation/auto/vertx/reactive/AsyncResultHandlerWrapper.java b/instrumentation/vertx-reactive-3.5/src/main/java/io/opentelemetry/instrumentation/auto/vertx/reactive/AsyncResultHandlerWrapper.java index 43ade0a91992..edb24fb68e09 100644 --- a/instrumentation/vertx-reactive-3.5/src/main/java/io/opentelemetry/instrumentation/auto/vertx/reactive/AsyncResultHandlerWrapper.java +++ b/instrumentation/vertx-reactive-3.5/src/main/java/io/opentelemetry/instrumentation/auto/vertx/reactive/AsyncResultHandlerWrapper.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.vertx.reactive; diff --git a/instrumentation/vertx-reactive-3.5/src/main/java/io/opentelemetry/instrumentation/auto/vertx/reactive/VertxRxInstrumentation.java b/instrumentation/vertx-reactive-3.5/src/main/java/io/opentelemetry/instrumentation/auto/vertx/reactive/VertxRxInstrumentation.java index b569e6a271ee..9e13c7e250cd 100644 --- a/instrumentation/vertx-reactive-3.5/src/main/java/io/opentelemetry/instrumentation/auto/vertx/reactive/VertxRxInstrumentation.java +++ b/instrumentation/vertx-reactive-3.5/src/main/java/io/opentelemetry/instrumentation/auto/vertx/reactive/VertxRxInstrumentation.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.vertx.reactive; diff --git a/instrumentation/vertx-reactive-3.5/src/test/groovy/VertxReactivePropagationTest.groovy b/instrumentation/vertx-reactive-3.5/src/test/groovy/VertxReactivePropagationTest.groovy index d169ff28e598..765cad8646d6 100644 --- a/instrumentation/vertx-reactive-3.5/src/test/groovy/VertxReactivePropagationTest.groovy +++ b/instrumentation/vertx-reactive-3.5/src/test/groovy/VertxReactivePropagationTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.SUCCESS @@ -62,10 +51,10 @@ class VertxReactivePropagationTest extends AgentTestRunner { assertTraces(1) { trace(0, 4) { span(0) { - operationName "/listProducts" - spanKind SERVER + name "/listProducts" + kind SERVER errored false - parent() + hasNoParent() attributes { "${SemanticAttributes.NET_PEER_PORT.key()}" Long "${SemanticAttributes.NET_PEER_IP.key()}" "127.0.0.1" @@ -80,8 +69,8 @@ class VertxReactivePropagationTest extends AgentTestRunner { basicSpan(it, 1, "handleListProducts", span(0)) basicSpan(it, 2, "listProducts", span(1)) span(3) { - operationName "SELECT id, name, price, weight FROM products" - spanKind CLIENT + name "SELECT id, name, price, weight FROM products" + kind CLIENT childOf span(2) errored false attributes { diff --git a/instrumentation/vertx-reactive-3.5/src/test/groovy/VertxReactiveWebServer.java b/instrumentation/vertx-reactive-3.5/src/test/groovy/VertxReactiveWebServer.java index 1789938cc63a..9cd28cd29b6a 100644 --- a/instrumentation/vertx-reactive-3.5/src/test/groovy/VertxReactiveWebServer.java +++ b/instrumentation/vertx-reactive-3.5/src/test/groovy/VertxReactiveWebServer.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 */ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.SUCCESS; diff --git a/instrumentation/vertx-reactive-3.5/src/test/groovy/client/VertxRxCircuitBreakerWebClientTest.groovy b/instrumentation/vertx-reactive-3.5/src/test/groovy/client/VertxRxCircuitBreakerWebClientTest.groovy index 920187cdf127..07333acb15fa 100644 --- a/instrumentation/vertx-reactive-3.5/src/test/groovy/client/VertxRxCircuitBreakerWebClientTest.groovy +++ b/instrumentation/vertx-reactive-3.5/src/test/groovy/client/VertxRxCircuitBreakerWebClientTest.groovy @@ -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 client diff --git a/instrumentation/vertx-reactive-3.5/src/test/groovy/client/VertxRxWebClientTest.groovy b/instrumentation/vertx-reactive-3.5/src/test/groovy/client/VertxRxWebClientTest.groovy index c46fce684c1d..035ac12a477e 100644 --- a/instrumentation/vertx-reactive-3.5/src/test/groovy/client/VertxRxWebClientTest.groovy +++ b/instrumentation/vertx-reactive-3.5/src/test/groovy/client/VertxRxWebClientTest.groovy @@ -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 client diff --git a/instrumentation/vertx-reactive-3.5/src/test/groovy/server/VertxRxCircuitBreakerHttpServerTest.groovy b/instrumentation/vertx-reactive-3.5/src/test/groovy/server/VertxRxCircuitBreakerHttpServerTest.groovy index 711057f80e2a..6a834bf7eb2f 100644 --- a/instrumentation/vertx-reactive-3.5/src/test/groovy/server/VertxRxCircuitBreakerHttpServerTest.groovy +++ b/instrumentation/vertx-reactive-3.5/src/test/groovy/server/VertxRxCircuitBreakerHttpServerTest.groovy @@ -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 server diff --git a/instrumentation/vertx-reactive-3.5/src/test/groovy/server/VertxRxHttpServerTest.groovy b/instrumentation/vertx-reactive-3.5/src/test/groovy/server/VertxRxHttpServerTest.groovy index 3a32a44fffb2..894cd532b7cd 100644 --- a/instrumentation/vertx-reactive-3.5/src/test/groovy/server/VertxRxHttpServerTest.groovy +++ b/instrumentation/vertx-reactive-3.5/src/test/groovy/server/VertxRxHttpServerTest.groovy @@ -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 server diff --git a/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/AgentClassLoader.java b/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/AgentClassLoader.java index c44978d820e8..1b8ffbf7f7bc 100644 --- a/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/AgentClassLoader.java +++ b/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/AgentClassLoader.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.javaagent.bootstrap; diff --git a/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/AgentInitializer.java b/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/AgentInitializer.java index 4d9a0b4023d5..33120b7f527a 100644 --- a/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/AgentInitializer.java +++ b/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/AgentInitializer.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.javaagent.bootstrap; diff --git a/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/ExceptionLogger.java b/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/ExceptionLogger.java index e5e3e8f632c7..0a1b72a61e4f 100644 --- a/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/ExceptionLogger.java +++ b/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/ExceptionLogger.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.javaagent.bootstrap; diff --git a/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/FieldBackedContextStoreAppliedMarker.java b/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/FieldBackedContextStoreAppliedMarker.java index c8acd35fcc0d..e64133f2221a 100644 --- a/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/FieldBackedContextStoreAppliedMarker.java +++ b/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/FieldBackedContextStoreAppliedMarker.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.javaagent.bootstrap; diff --git a/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/HelperResources.java b/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/HelperResources.java index 23d92a6e0cab..f46815171f24 100644 --- a/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/HelperResources.java +++ b/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/HelperResources.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.javaagent.bootstrap; diff --git a/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/InternalJarURLHandler.java b/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/InternalJarURLHandler.java index 7a120f278cd3..ff9f85e9ee0a 100644 --- a/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/InternalJarURLHandler.java +++ b/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/InternalJarURLHandler.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.javaagent.bootstrap; diff --git a/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/PatchLogger.java b/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/PatchLogger.java index 316dfe0a70ae..d294a7d1407f 100644 --- a/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/PatchLogger.java +++ b/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/PatchLogger.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.javaagent.bootstrap; diff --git a/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/WeakCache.java b/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/WeakCache.java index 50702a897e1b..b456d2479f4c 100644 --- a/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/WeakCache.java +++ b/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/WeakCache.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.javaagent.bootstrap; diff --git a/javaagent-bootstrap/src/test/java/io/opentelemetry/javaagent/bootstrap/PatchLoggerTest.java b/javaagent-bootstrap/src/test/java/io/opentelemetry/javaagent/bootstrap/PatchLoggerTest.java index 72f8bf9dc5ec..64c208d1f551 100644 --- a/javaagent-bootstrap/src/test/java/io/opentelemetry/javaagent/bootstrap/PatchLoggerTest.java +++ b/javaagent-bootstrap/src/test/java/io/opentelemetry/javaagent/bootstrap/PatchLoggerTest.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.javaagent.bootstrap; diff --git a/javaagent-exporters/jaeger/src/main/java/io/opentelemetry/javaagent/exporters/jaeger/JaegerExporterFactory.java b/javaagent-exporters/jaeger/src/main/java/io/opentelemetry/javaagent/exporters/jaeger/JaegerExporterFactory.java index 3f661a6ac10a..fc3408f0da7d 100644 --- a/javaagent-exporters/jaeger/src/main/java/io/opentelemetry/javaagent/exporters/jaeger/JaegerExporterFactory.java +++ b/javaagent-exporters/jaeger/src/main/java/io/opentelemetry/javaagent/exporters/jaeger/JaegerExporterFactory.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.javaagent.exporters.jaeger; diff --git a/javaagent-exporters/javaagent-exporters.gradle b/javaagent-exporters/javaagent-exporters.gradle index 2c3f74c9abb7..45386cbd4e55 100644 --- a/javaagent-exporters/javaagent-exporters.gradle +++ b/javaagent-exporters/javaagent-exporters.gradle @@ -12,6 +12,7 @@ dependencies { testImplementation project(':javaagent-exporters:jaeger') testImplementation project(':javaagent-exporters:logging') testImplementation project(':javaagent-exporters:zipkin') + testImplementation project(':javaagent-exporters:prometheus') } tasks.withType(Test).configureEach() { @@ -19,6 +20,7 @@ tasks.withType(Test).configureEach() { dependsOn ':javaagent-exporters:jaeger:shadowJar' dependsOn ':javaagent-exporters:logging:shadowJar' dependsOn ':javaagent-exporters:zipkin:shadowJar' + dependsOn ':javaagent-exporters:prometheus:shadowJar' doFirst { systemProperty 'projectVersion', allprojects.version[0] systemProperty 'adapterRoot', "$rootDir/javaagent-exporters" @@ -26,6 +28,7 @@ tasks.withType(Test).configureEach() { systemProperty 'jaegerExporterJar', project(':javaagent-exporters:jaeger').tasks.shadowJar.archivePath systemProperty 'loggingExporterJar', project(':javaagent-exporters:logging').tasks.shadowJar.archivePath systemProperty 'zipkinExporterJar', project(':javaagent-exporters:zipkin').tasks.shadowJar.archivePath + systemProperty 'prometheusExporterJar', project(':javaagent-exporters:prometheus').tasks.shadowJar.archivePath } } @@ -38,6 +41,7 @@ dependencies { shadowInclude project(path: ':javaagent-exporters:otlp', configuration: 'shadow') shadowInclude project(path: ':javaagent-exporters:jaeger', configuration: 'shadow') shadowInclude project(path: ':javaagent-exporters:zipkin', configuration: 'shadow') + shadowInclude project(path: ':javaagent-exporters:prometheus', configuration: 'shadow') } jar.enabled = false @@ -58,8 +62,8 @@ shadowJar { // relocate OpenTelemetry API usage relocate "io.opentelemetry.OpenTelemetry", "io.opentelemetry.javaagent.shaded.io.opentelemetry.OpenTelemetry" relocate "io.opentelemetry.common", "io.opentelemetry.javaagent.shaded.io.opentelemetry.common" + relocate "io.opentelemetry.baggage", "io.opentelemetry.javaagent.shaded.io.opentelemetry.baggage" relocate "io.opentelemetry.context", "io.opentelemetry.javaagent.shaded.io.opentelemetry.context" - relocate "io.opentelemetry.correlationcontext", "io.opentelemetry.javaagent.shaded.io.opentelemetry.correlationcontext" relocate "io.opentelemetry.internal", "io.opentelemetry.javaagent.shaded.io.opentelemetry.internal" relocate "io.opentelemetry.metrics", "io.opentelemetry.javaagent.shaded.io.opentelemetry.metrics" relocate "io.opentelemetry.trace", "io.opentelemetry.javaagent.shaded.io.opentelemetry.trace" diff --git a/javaagent-exporters/logging/src/main/java/io/opentelemetry/javaagent/exporters/logging/LoggingExporter.java b/javaagent-exporters/logging/src/main/java/io/opentelemetry/javaagent/exporters/logging/LoggingExporter.java index 713cfad43ce8..58030aaefe53 100644 --- a/javaagent-exporters/logging/src/main/java/io/opentelemetry/javaagent/exporters/logging/LoggingExporter.java +++ b/javaagent-exporters/logging/src/main/java/io/opentelemetry/javaagent/exporters/logging/LoggingExporter.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.javaagent.exporters.logging; diff --git a/javaagent-exporters/logging/src/main/java/io/opentelemetry/javaagent/exporters/logging/LoggingExporterFactory.java b/javaagent-exporters/logging/src/main/java/io/opentelemetry/javaagent/exporters/logging/LoggingExporterFactory.java index baa6301b2723..f60580937a29 100644 --- a/javaagent-exporters/logging/src/main/java/io/opentelemetry/javaagent/exporters/logging/LoggingExporterFactory.java +++ b/javaagent-exporters/logging/src/main/java/io/opentelemetry/javaagent/exporters/logging/LoggingExporterFactory.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.javaagent.exporters.logging; diff --git a/javaagent-exporters/otlp/src/main/java/io/opentelemetry/javaagent/exporters/otlp/OtlpMetricExporterFactory.java b/javaagent-exporters/otlp/src/main/java/io/opentelemetry/javaagent/exporters/otlp/OtlpMetricExporterFactory.java index e43a8398a950..7be17af1739d 100644 --- a/javaagent-exporters/otlp/src/main/java/io/opentelemetry/javaagent/exporters/otlp/OtlpMetricExporterFactory.java +++ b/javaagent-exporters/otlp/src/main/java/io/opentelemetry/javaagent/exporters/otlp/OtlpMetricExporterFactory.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.javaagent.exporters.otlp; diff --git a/javaagent-exporters/otlp/src/main/java/io/opentelemetry/javaagent/exporters/otlp/OtlpSpanExporterFactory.java b/javaagent-exporters/otlp/src/main/java/io/opentelemetry/javaagent/exporters/otlp/OtlpSpanExporterFactory.java index 9246267e87ec..4024206e8e55 100644 --- a/javaagent-exporters/otlp/src/main/java/io/opentelemetry/javaagent/exporters/otlp/OtlpSpanExporterFactory.java +++ b/javaagent-exporters/otlp/src/main/java/io/opentelemetry/javaagent/exporters/otlp/OtlpSpanExporterFactory.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.javaagent.exporters.otlp; diff --git a/javaagent-exporters/prometheus/prometheus.gradle b/javaagent-exporters/prometheus/prometheus.gradle new file mode 100644 index 000000000000..83f1855f4874 --- /dev/null +++ b/javaagent-exporters/prometheus/prometheus.gradle @@ -0,0 +1,28 @@ +plugins { + id "com.github.johnrengelman.shadow" +} + +apply from: "$rootDir/gradle/java.gradle" +apply from: "$rootDir/gradle/publish.gradle" + +archivesBaseName = 'javaagent-exporters-prometheus' + +dependencies { + compileOnly(project(':javaagent-spi')) + compileOnly(deps.opentelemetrySdk) + + implementation deps.slf4j + implementation(deps.prometheus) + + annotationProcessor deps.autoservice + compileOnly deps.autoservice + + implementation(deps.opentelemetryPrometheus) { + exclude group: 'io.opentelemetry', module: 'opentelemetry-sdk' + } +} + +jar.enabled = false +shadowJar { + archiveClassifier = '' +} diff --git a/javaagent-exporters/prometheus/src/main/java/io/opentelemetry/javaagent/exporters/prometheus/PrometheusMetricServer.java b/javaagent-exporters/prometheus/src/main/java/io/opentelemetry/javaagent/exporters/prometheus/PrometheusMetricServer.java new file mode 100644 index 000000000000..8d3a1612eaf9 --- /dev/null +++ b/javaagent-exporters/prometheus/src/main/java/io/opentelemetry/javaagent/exporters/prometheus/PrometheusMetricServer.java @@ -0,0 +1,47 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.javaagent.exporters.prometheus; + +import com.google.auto.service.AutoService; +import io.opentelemetry.exporters.prometheus.PrometheusCollector; +import io.opentelemetry.javaagent.spi.exporter.MetricServer; +import io.opentelemetry.sdk.metrics.export.MetricProducer; +import io.prometheus.client.exporter.HTTPServer; +import java.io.IOException; +import java.util.Properties; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link PrometheusMetricServer} registers {@link MetricProducer} to the {@link + * PrometheusCollector}. The collector pulls metrics from the producer when the Prometheus server + * scraps metric endpoint. + */ +@AutoService(MetricServer.class) +public class PrometheusMetricServer implements MetricServer { + private static final Logger log = LoggerFactory.getLogger(PrometheusMetricServer.class); + + private static final String EXPORTER_NAME = "otel.exporter.prometheus"; + private static final String PORT_CONF_PROP_NAME = EXPORTER_NAME + ".port"; + private static final String HOST_CONF_PROP_NAME = EXPORTER_NAME + ".host"; + private static final String DEFAULT_PORT = "9464"; + // The empty address equals to any address + private static final String DEFAULT_HOST = "0.0.0.0"; + + @Override + public void start(MetricProducer producer, Properties config) { + PrometheusCollector.newBuilder().setMetricProducer(producer).buildAndRegister(); + try { + String portStr = config.getProperty(PORT_CONF_PROP_NAME, DEFAULT_PORT); + String host = config.getProperty(HOST_CONF_PROP_NAME, DEFAULT_HOST); + log.info("Creating Prometheus exporter on host: '{}' and port: '{}'", host, portStr); + // Prometheus HTTP server uses global registry configured by PrometheusCollector. + new HTTPServer(host, Integer.parseInt(portStr), true); + } catch (IOException e) { + log.error("Failed to create Prometheus server", e); + } + } +} diff --git a/javaagent-exporters/src/test/groovy/io/opentelemetry/javaagent/exporteradapters/ExporterAdaptersTest.groovy b/javaagent-exporters/src/test/groovy/io/opentelemetry/javaagent/exporteradapters/ExporterAdaptersTest.groovy index e33e302f2d6a..3797578718dd 100644 --- a/javaagent-exporters/src/test/groovy/io/opentelemetry/javaagent/exporteradapters/ExporterAdaptersTest.groovy +++ b/javaagent-exporters/src/test/groovy/io/opentelemetry/javaagent/exporteradapters/ExporterAdaptersTest.groovy @@ -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 */ import io.opentelemetry.javaagent.tooling.ExporterClassLoader diff --git a/javaagent-exporters/zipkin/src/main/java/io/opentelemetry/javaagent/exporters/zipkin/ZipkinExporterFactory.java b/javaagent-exporters/zipkin/src/main/java/io/opentelemetry/javaagent/exporters/zipkin/ZipkinExporterFactory.java index 252ae5b34328..2e6616d29c43 100644 --- a/javaagent-exporters/zipkin/src/main/java/io/opentelemetry/javaagent/exporters/zipkin/ZipkinExporterFactory.java +++ b/javaagent-exporters/zipkin/src/main/java/io/opentelemetry/javaagent/exporters/zipkin/ZipkinExporterFactory.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.javaagent.exporters.zipkin; diff --git a/javaagent-spi/src/main/java/io/opentelemetry/javaagent/spi/TracerCustomizer.java b/javaagent-spi/src/main/java/io/opentelemetry/javaagent/spi/TracerCustomizer.java index e7007e096038..d44107a26cce 100644 --- a/javaagent-spi/src/main/java/io/opentelemetry/javaagent/spi/TracerCustomizer.java +++ b/javaagent-spi/src/main/java/io/opentelemetry/javaagent/spi/TracerCustomizer.java @@ -1,22 +1,12 @@ /* * 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.javaagent.spi; import io.opentelemetry.context.propagation.ContextPropagators; +import io.opentelemetry.sdk.trace.TracerSdkManagement; import io.opentelemetry.sdk.trace.TracerSdkProvider; import io.opentelemetry.sdk.trace.config.TraceConfig; @@ -35,5 +25,5 @@ public interface TracerCustomizer { /** Callback executed after the initial {@link TracerSdkProvider} has been initialized. */ - void configure(TracerSdkProvider tracerSdkProvider); + void configure(TracerSdkManagement tracerManagement); } diff --git a/javaagent-spi/src/main/java/io/opentelemetry/javaagent/spi/config/PropertySource.java b/javaagent-spi/src/main/java/io/opentelemetry/javaagent/spi/config/PropertySource.java index fc62e02fa11d..53088b684c92 100644 --- a/javaagent-spi/src/main/java/io/opentelemetry/javaagent/spi/config/PropertySource.java +++ b/javaagent-spi/src/main/java/io/opentelemetry/javaagent/spi/config/PropertySource.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.javaagent.spi.config; diff --git a/javaagent-spi/src/main/java/io/opentelemetry/javaagent/spi/exporter/MetricExporterFactory.java b/javaagent-spi/src/main/java/io/opentelemetry/javaagent/spi/exporter/MetricExporterFactory.java index 28f06d82dfd0..a3f64b84e311 100644 --- a/javaagent-spi/src/main/java/io/opentelemetry/javaagent/spi/exporter/MetricExporterFactory.java +++ b/javaagent-spi/src/main/java/io/opentelemetry/javaagent/spi/exporter/MetricExporterFactory.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.javaagent.spi.exporter; diff --git a/javaagent-spi/src/main/java/io/opentelemetry/javaagent/spi/exporter/MetricServer.java b/javaagent-spi/src/main/java/io/opentelemetry/javaagent/spi/exporter/MetricServer.java new file mode 100644 index 000000000000..d35e9aa3e450 --- /dev/null +++ b/javaagent-spi/src/main/java/io/opentelemetry/javaagent/spi/exporter/MetricServer.java @@ -0,0 +1,26 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.javaagent.spi.exporter; + +import io.opentelemetry.sdk.metrics.export.MetricProducer; +import java.util.Properties; + +/** + * A {@link MetricServer} acts as the bootstrap for metric exporters that use {@link MetricProducer} + * to consume the metrics. + * + *

Implementation of {@link MetricServer} must be registered through the Java SPI framework. + */ +public interface MetricServer { + + /** + * Start the metric server that pulls metric from the {@link MetricProducer}. + * + * @param producer The metric producer + * @param config The configuration + */ + void start(MetricProducer producer, Properties config); +} diff --git a/javaagent-spi/src/main/java/io/opentelemetry/javaagent/spi/exporter/SpanExporterFactory.java b/javaagent-spi/src/main/java/io/opentelemetry/javaagent/spi/exporter/SpanExporterFactory.java index 9a938798de41..85f23e6ee6c2 100644 --- a/javaagent-spi/src/main/java/io/opentelemetry/javaagent/spi/exporter/SpanExporterFactory.java +++ b/javaagent-spi/src/main/java/io/opentelemetry/javaagent/spi/exporter/SpanExporterFactory.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.javaagent.spi.exporter; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/AddThreadDetailsSpanProcessor.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/AddThreadDetailsSpanProcessor.java index b3acfb72f110..44be53e572cc 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/AddThreadDetailsSpanProcessor.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/AddThreadDetailsSpanProcessor.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.javaagent.tooling; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/AgentInstaller.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/AgentInstaller.java index 5bf16645e8b5..734d6142abcd 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/AgentInstaller.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/AgentInstaller.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.javaagent.tooling; @@ -34,6 +23,7 @@ import java.lang.instrument.Instrumentation; import java.util.ArrayList; import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -108,7 +98,7 @@ public static ResettableClassFileTransformer installBytebuddyAgent( new ForceFlusher() { @Override public void run(int timeout, TimeUnit unit) { - OpenTelemetrySdk.getTracerProvider().forceFlush().join(timeout, unit); + OpenTelemetrySdk.getTracerManagement().forceFlush().join(timeout, unit); } }); @@ -150,9 +140,10 @@ public void run(int timeout, TimeUnit unit) { for (AgentBuilder.Listener listener : listeners) { agentBuilder = agentBuilder.with(listener); } + Iterable instrumenters = + SafeServiceLoader.load(Instrumenter.class, AgentInstaller.class.getClassLoader()); int numInstrumenters = 0; - for (Instrumenter instrumenter : - SafeServiceLoader.load(Instrumenter.class, AgentInstaller.class.getClassLoader())) { + for (Instrumenter instrumenter : orderInstrumenters(instrumenters)) { log.debug("Loading instrumentation {}", instrumenter.getClass().getName()); try { agentBuilder = instrumenter.instrument(agentBuilder); @@ -166,6 +157,13 @@ public void run(int timeout, TimeUnit unit) { return agentBuilder.installOn(inst); } + private static Iterable orderInstrumenters(Iterable instrumenters) { + List orderedInstrumenters = new ArrayList<>(); + instrumenters.forEach(orderedInstrumenters::add); + Collections.sort(orderedInstrumenters, Comparator.comparingInt(Instrumenter::getOrder)); + return orderedInstrumenters; + } + private static void addByteBuddyRawSetting() { String savedPropertyValue = System.getProperty(TypeDefinition.RAW_TYPES_PROPERTY); try { diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/AgentTooling.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/AgentTooling.java index 5bfe4e504814..f467811296e3 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/AgentTooling.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/AgentTooling.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.javaagent.tooling; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/AutoVersionResourceProvider.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/AutoVersionResourceProvider.java index ee7354585623..95399c829f06 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/AutoVersionResourceProvider.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/AutoVersionResourceProvider.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.javaagent.tooling; @@ -19,7 +8,6 @@ import com.google.auto.service.AutoService; import io.opentelemetry.common.AttributeKey; import io.opentelemetry.common.Attributes; -import io.opentelemetry.common.AttributesKeys; import io.opentelemetry.instrumentation.api.InstrumentationVersion; import io.opentelemetry.sdk.resources.ResourceProvider; @@ -27,7 +15,7 @@ public class AutoVersionResourceProvider extends ResourceProvider { private static final AttributeKey TELEMETRY_AUTO_VERSION = - AttributesKeys.stringKey("telemetry.auto.version"); + AttributeKey.stringKey("telemetry.auto.version"); @Override protected Attributes getAttributes() { diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ClassHierarchyIterable.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ClassHierarchyIterable.java index cebe894be946..d70810eba90f 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ClassHierarchyIterable.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ClassHierarchyIterable.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.javaagent.tooling; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ClassLoaderMatcher.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ClassLoaderMatcher.java index c3133148c5cb..63a5a58738fc 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ClassLoaderMatcher.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ClassLoaderMatcher.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.javaagent.tooling; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/CommonTaskExecutor.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/CommonTaskExecutor.java index 823054a9b9c5..2f5a73121f9c 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/CommonTaskExecutor.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/CommonTaskExecutor.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.javaagent.tooling; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/Constants.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/Constants.java index 9295ac804993..1f9a87edb4fe 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/Constants.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/Constants.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.javaagent.tooling; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/DaemonThreadFactory.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/DaemonThreadFactory.java index 1156ee32f2c1..c2d2445dcc65 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/DaemonThreadFactory.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/DaemonThreadFactory.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.javaagent.tooling; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ExporterClassLoader.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ExporterClassLoader.java index 733ca110bbb2..2fb866fe1754 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ExporterClassLoader.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ExporterClassLoader.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.javaagent.tooling; @@ -46,12 +35,12 @@ public class ExporterClassLoader extends URLClassLoader { rule( "#io.opentelemetry.common", "#io.opentelemetry.javaagent.shaded.io.opentelemetry.common"), + rule( + "#io.opentelemetry.baggage", + "#io.opentelemetry.javaagent.shaded.io.opentelemetry.baggage"), rule( "#io.opentelemetry.context", "#io.opentelemetry.javaagent.shaded.io.opentelemetry.context"), - rule( - "#io.opentelemetry.correlationcontext", - "#io.opentelemetry.javaagent.shaded.io.opentelemetry.correlationcontext"), rule( "#io.opentelemetry.internal", "#io.opentelemetry.javaagent.shaded.io.opentelemetry.internal"), diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/GuavaWeakCache.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/GuavaWeakCache.java index ed7dff5250d4..ea43c9b752fb 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/GuavaWeakCache.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/GuavaWeakCache.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.javaagent.tooling; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/HelperInjector.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/HelperInjector.java index 5722192affb6..7025792644c0 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/HelperInjector.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/HelperInjector.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.javaagent.tooling; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/Instrumenter.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/Instrumenter.java index b6933b8374e7..235eb5c9dd87 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/Instrumenter.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/Instrumenter.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.javaagent.tooling; @@ -62,6 +51,14 @@ public interface Instrumenter { */ AgentBuilder instrument(AgentBuilder agentBuilder); + /** + * Order of adding instrumentation to ByteBuddy. For example instrumentation with order 1 runs + * after an instrumentation with order 0 (default) matched on the same API. + * + * @return the order of adding an instrumentation to ByteBuddy. Default value is 0 - no order. + */ + int getOrder(); + abstract class Default implements Instrumenter { private static final Logger log = LoggerFactory.getLogger(Default.class); @@ -150,6 +147,12 @@ private AgentBuilder.Identified.Extendable applyInstrumentationTransformers( return agentBuilder; } + /** @return 0 - default order. */ + @Override + public int getOrder() { + return 0; + } + /** Matches classes for which instrumentation is not muzzled. */ private class MuzzleMatcher implements AgentBuilder.RawMatcher { @Override diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/PropagatorsInitializer.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/PropagatorsInitializer.java index 6e382617dd70..093c239fa977 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/PropagatorsInitializer.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/PropagatorsInitializer.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.javaagent.tooling; @@ -58,6 +47,12 @@ public class PropagatorsInitializer { public static void initializePropagators(List propagators) { /* Only override the default propagators *if* the user specified any. */ if (propagators.size() == 0) { + // TODO this is probably temporary until default propagators are supplied by SDK + // https://github.com/open-telemetry/opentelemetry-java/issues/1742 + OpenTelemetry.setPropagators( + DefaultContextPropagators.builder() + .addTextMapPropagator(HttpTraceContext.getInstance()) + .build()); return; } diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ShadingRemapper.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ShadingRemapper.java index ec7f9e80e1d8..480ec234d99b 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ShadingRemapper.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ShadingRemapper.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.javaagent.tooling; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/TracerInstaller.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/TracerInstaller.java index 0ca83f84e097..610a42317127 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/TracerInstaller.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/TracerInstaller.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.javaagent.tooling; @@ -19,11 +8,13 @@ import io.opentelemetry.instrumentation.api.config.Config; import io.opentelemetry.javaagent.spi.TracerCustomizer; import io.opentelemetry.javaagent.spi.exporter.MetricExporterFactory; +import io.opentelemetry.javaagent.spi.exporter.MetricServer; import io.opentelemetry.javaagent.spi.exporter.SpanExporterFactory; import io.opentelemetry.sdk.OpenTelemetrySdk; import io.opentelemetry.sdk.metrics.export.IntervalMetricReader; import io.opentelemetry.sdk.metrics.export.MetricExporter; -import io.opentelemetry.sdk.trace.TracerSdkProvider; +import io.opentelemetry.sdk.metrics.export.MetricProducer; +import io.opentelemetry.sdk.trace.TracerSdkManagement; import io.opentelemetry.sdk.trace.config.TraceConfig; import io.opentelemetry.sdk.trace.export.BatchSpanProcessor; import io.opentelemetry.sdk.trace.export.SpanExporter; @@ -84,6 +75,13 @@ private static synchronized void installExporters(List exporters, Proper } else { log.debug("No {} metric exporter found", exporterName); } + + MetricServer metricServer = findMetricServer(exporterName); + if (metricServer != null) { + installMetricServer(metricServer, config); + } else { + log.debug("No {} metric server found", exporterName); + } } } @@ -104,6 +102,23 @@ private static MetricExporterFactory findMetricExporterFactory(String exporterNa return null; } + private static MetricServer findMetricServer(String exporterName) { + ServiceLoader serviceLoader = + ServiceLoader.load(MetricServer.class, TracerInstaller.class.getClassLoader()); + + for (MetricServer metricServer : serviceLoader) { + if (metricServer + .getClass() + .getSimpleName() + .replace("_", "") + .toLowerCase() + .startsWith(exporterName.toLowerCase())) { + return metricServer; + } + } + return null; + } + private static SpanExporterFactory findSpanExporterFactory(String exporterName) { ServiceLoader serviceLoader = ServiceLoader.load(SpanExporterFactory.class, TracerInstaller.class.getClassLoader()); @@ -166,10 +181,16 @@ private static void installExporter(SpanExporterFactory spanExporterFactory, Pro SpanExporter spanExporter = spanExporterFactory.fromConfig(config); BatchSpanProcessor spanProcessor = BatchSpanProcessor.newBuilder(spanExporter).readProperties(config).build(); - OpenTelemetrySdk.getTracerProvider().addSpanProcessor(spanProcessor); + OpenTelemetrySdk.getTracerManagement().addSpanProcessor(spanProcessor); log.info("Installed span exporter: " + spanExporter.getClass().getName()); } + private static void installMetricServer(MetricServer metricServer, Properties config) { + MetricProducer metricProducer = OpenTelemetrySdk.getMeterProvider().getMetricProducer(); + metricServer.start(metricProducer, config); + log.info("Installed metric server: " + metricServer.getClass().getName()); + } + private static F getExporterFactory(Class service, ExporterClassLoader exporterLoader) { ServiceLoader serviceLoader = ServiceLoader.load(service, exporterLoader); Iterator i = serviceLoader.iterator(); @@ -186,21 +207,21 @@ private static F getExporterFactory(Class service, ExporterClassLoader ex } private static void configure(Properties config) { - TracerSdkProvider tracerSdkProvider = OpenTelemetrySdk.getTracerProvider(); + TracerSdkManagement tracerManagement = OpenTelemetrySdk.getTracerManagement(); // Register additional thread details logging span processor - tracerSdkProvider.addSpanProcessor(new AddThreadDetailsSpanProcessor()); + tracerManagement.addSpanProcessor(new AddThreadDetailsSpanProcessor()); // Execute any user-provided (usually vendor-provided) configuration logic. ServiceLoader serviceLoader = ServiceLoader.load(TracerCustomizer.class, TracerInstaller.class.getClassLoader()); for (TracerCustomizer customizer : serviceLoader) { - customizer.configure(tracerSdkProvider); + customizer.configure(tracerManagement); } /* Update trace config from env vars or sys props */ - TraceConfig activeTraceConfig = tracerSdkProvider.getActiveTraceConfig(); - tracerSdkProvider.updateActiveTraceConfig( + TraceConfig activeTraceConfig = tracerManagement.getActiveTraceConfig(); + tracerManagement.updateActiveTraceConfig( activeTraceConfig.toBuilder().readProperties(config).build()); } diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/Utils.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/Utils.java index 81ece671b1b5..4829c75e95b1 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/Utils.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/Utils.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.javaagent.tooling; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/VersionLogger.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/VersionLogger.java index b290e4211279..874f23101ebb 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/VersionLogger.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/VersionLogger.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.javaagent.tooling; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/WeakMapSuppliers.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/WeakMapSuppliers.java index 656438a478b3..e09382067e36 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/WeakMapSuppliers.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/WeakMapSuppliers.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.javaagent.tooling; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/AgentCachingPoolStrategy.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/AgentCachingPoolStrategy.java index 396c15182e7d..7b5e0079a1ea 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/AgentCachingPoolStrategy.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/AgentCachingPoolStrategy.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.javaagent.tooling.bytebuddy; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/AgentLocationStrategy.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/AgentLocationStrategy.java index a5d0d49d689a..c6d497bda0b1 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/AgentLocationStrategy.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/AgentLocationStrategy.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.javaagent.tooling.bytebuddy; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/AgentTransformers.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/AgentTransformers.java index 4a71d2867098..69c339bfba47 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/AgentTransformers.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/AgentTransformers.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.javaagent.tooling.bytebuddy; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/ExceptionHandlers.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/ExceptionHandlers.java index fca6d70d7c42..1ab72d7422bb 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/ExceptionHandlers.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/ExceptionHandlers.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.javaagent.tooling.bytebuddy; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/AgentElementMatchers.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/AgentElementMatchers.java index a439cdd22c36..e6577e994c41 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/AgentElementMatchers.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/AgentElementMatchers.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.javaagent.tooling.bytebuddy.matcher; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/HasSuperMethodMatcher.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/HasSuperMethodMatcher.java index 77c32864b6c4..29728f7062dc 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/HasSuperMethodMatcher.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/HasSuperMethodMatcher.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.javaagent.tooling.bytebuddy.matcher; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/LoggingFailSafeMatcher.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/LoggingFailSafeMatcher.java index 1beca59d8d75..7aa6bb970a38 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/LoggingFailSafeMatcher.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/LoggingFailSafeMatcher.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.javaagent.tooling.bytebuddy.matcher; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/SafeErasureMatcher.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/SafeErasureMatcher.java index 74e38ebcfdb9..f899f37b1234 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/SafeErasureMatcher.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/SafeErasureMatcher.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.javaagent.tooling.bytebuddy.matcher; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/SafeExtendsClassMatcher.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/SafeExtendsClassMatcher.java index cdfcbc5e97d5..883029ade392 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/SafeExtendsClassMatcher.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/SafeExtendsClassMatcher.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.javaagent.tooling.bytebuddy.matcher; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/SafeHasSuperTypeMatcher.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/SafeHasSuperTypeMatcher.java index e561eddc2ebb..a3d47ca5abbe 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/SafeHasSuperTypeMatcher.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/SafeHasSuperTypeMatcher.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.javaagent.tooling.bytebuddy.matcher; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/config/ConfigBuilder.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/config/AgentConfigBuilder.java similarity index 62% rename from javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/config/ConfigBuilder.java rename to javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/config/AgentConfigBuilder.java index fc4264201b94..091bed01b09d 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/config/ConfigBuilder.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/config/AgentConfigBuilder.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.javaagent.tooling.config; @@ -19,16 +8,16 @@ import static io.opentelemetry.instrumentation.api.config.Config.normalizePropertyName; import io.opentelemetry.instrumentation.api.config.Config; +import io.opentelemetry.sdk.common.export.ConfigBuilder; import java.util.HashMap; import java.util.Map; import java.util.Properties; -public final class ConfigBuilder - extends io.opentelemetry.sdk.common.export.ConfigBuilder { +public final class AgentConfigBuilder extends ConfigBuilder { private final Map allProperties = new HashMap<>(); @Override - public ConfigBuilder readProperties(Properties properties) { + public AgentConfigBuilder readProperties(Properties properties) { return this.fromConfigMap(normalizedProperties(properties), NamingConvention.DOT); } @@ -40,7 +29,7 @@ private static Map normalizedProperties(Properties properties) { return configMap; } - ConfigBuilder readPropertiesFromAllSources( + AgentConfigBuilder readPropertiesFromAllSources( Properties spiConfiguration, Properties configurationFile) { // ordering from least to most important return readProperties(spiConfiguration) @@ -50,7 +39,7 @@ ConfigBuilder readPropertiesFromAllSources( } @Override - protected ConfigBuilder fromConfigMap( + protected AgentConfigBuilder fromConfigMap( Map configMap, NamingConvention namingConvention) { configMap = namingConvention.normalize(configMap); allProperties.putAll(configMap); diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/config/ConfigInitializer.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/config/ConfigInitializer.java index f8a410ef1b0d..72cf1b95381c 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/config/ConfigInitializer.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/config/ConfigInitializer.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.javaagent.tooling.config; @@ -20,9 +9,11 @@ import io.opentelemetry.javaagent.spi.config.PropertySource; import io.opentelemetry.javaagent.tooling.AgentInstaller; import java.io.File; +import java.io.FileInputStream; import java.io.FileNotFoundException; -import java.io.FileReader; import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; import java.util.Properties; import java.util.ServiceLoader; import org.slf4j.Logger; @@ -36,7 +27,7 @@ public final class ConfigInitializer { public static void initialize() { Config.internalInitializeConfig( - new ConfigBuilder() + new AgentConfigBuilder() .readPropertiesFromAllSources(loadSpiConfiguration(), loadConfigurationFile()) .build()); } @@ -80,8 +71,9 @@ private static Properties loadConfigurationFile() { return properties; } - try (FileReader fileReader = new FileReader(configurationFile)) { - properties.load(fileReader); + try (InputStreamReader reader = + new InputStreamReader(new FileInputStream(configurationFile), StandardCharsets.UTF_8)) { + properties.load(reader); } catch (FileNotFoundException fnf) { log.error("Configuration file '{}' not found.", configurationFilePath); } catch (IOException ioe) { diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/context/FieldBackedProvider.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/context/FieldBackedProvider.java index 66a0caad43c0..f025871a3f00 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/context/FieldBackedProvider.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/context/FieldBackedProvider.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.javaagent.tooling.context; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/context/InstrumentationContextProvider.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/context/InstrumentationContextProvider.java index b766740e1c57..16e8860d6b77 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/context/InstrumentationContextProvider.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/context/InstrumentationContextProvider.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.javaagent.tooling.context; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/context/NoopContextProvider.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/context/NoopContextProvider.java index 4ebbb6b07af5..6573fcc7add7 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/context/NoopContextProvider.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/context/NoopContextProvider.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.javaagent.tooling.context; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/matcher/AdditionalLibraryIgnoresMatcher.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/matcher/AdditionalLibraryIgnoresMatcher.java index 363bc2898121..3704f17428a7 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/matcher/AdditionalLibraryIgnoresMatcher.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/matcher/AdditionalLibraryIgnoresMatcher.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.javaagent.tooling.matcher; @@ -161,7 +150,9 @@ public boolean matches(T target) { } if (name.startsWith("org.springframework.jms.")) { - if (name.startsWith("org.springframework.jms.listener.")) { + if (name.startsWith("org.springframework.jms.listener.") + || name.equals( + "org.springframework.jms.config.JmsListenerEndpointRegistry$AggregatingCallback")) { return false; } return true; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/matcher/GlobalIgnoresMatcher.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/matcher/GlobalIgnoresMatcher.java index 2cd0cf9bc494..9b5dba68c3e1 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/matcher/GlobalIgnoresMatcher.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/matcher/GlobalIgnoresMatcher.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.javaagent.tooling.matcher; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/matcher/NameMatchers.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/matcher/NameMatchers.java index f6bae3d0ab5d..769c982a12d5 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/matcher/NameMatchers.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/matcher/NameMatchers.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.javaagent.tooling.matcher; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/HelperReferenceWrapper.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/HelperReferenceWrapper.java index c98f38c271ea..4b4a5c6353be 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/HelperReferenceWrapper.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/HelperReferenceWrapper.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.javaagent.tooling.muzzle; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/MuzzleGradlePlugin.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/MuzzleGradlePlugin.java index 5f692a4f3288..912aa2001023 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/MuzzleGradlePlugin.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/MuzzleGradlePlugin.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.javaagent.tooling.muzzle; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/MuzzleVersionScanPlugin.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/MuzzleVersionScanPlugin.java index ec472b11deb8..4ac3fa701b9c 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/MuzzleVersionScanPlugin.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/MuzzleVersionScanPlugin.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.javaagent.tooling.muzzle; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/MuzzleVisitor.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/MuzzleVisitor.java index 351964a7386e..c65f063e0d03 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/MuzzleVisitor.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/MuzzleVisitor.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.javaagent.tooling.muzzle; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/Reference.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/Reference.java index 9601255947a7..5a965c7c41c9 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/Reference.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/Reference.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.javaagent.tooling.muzzle; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/ReferenceCreationPredicate.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/ReferenceCreationPredicate.java index eab3f4990c6b..a9d36400e804 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/ReferenceCreationPredicate.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/ReferenceCreationPredicate.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.javaagent.tooling.muzzle; @@ -23,24 +12,25 @@ * create references from the method advice and helper classes. */ final class ReferenceCreationPredicate { - private static final String REFERENCE_CREATION_PACKAGE = "io.opentelemetry.instrumentation."; + // non-shaded packages + private static final String AUTO_INSTRUMENTATION_PACKAGE = + "io.opentelemetry.instrumentation.auto."; + private static final String JAVA_AGENT_TOOLING_PACKAGE = "io.opentelemetry.javaagent.tooling."; + private static final String AUTO_INSTRUMENTATION_API_PACKAGE = + "io.opentelemetry.instrumentation.auto.api."; - private static final String JAVA_AGENT_PACKAGE = "io.opentelemetry.javaagent.tooling."; - - private static final String[] REFERENCE_CREATION_PACKAGE_EXCLUDES = { - "io.opentelemetry.instrumentation.api.", "io.opentelemetry.instrumentation.auto.api." - }; + // shaded packages + private static final String LIBRARY_INSTRUMENTATION_PACKAGE = "io.opentelemetry.instrumentation."; + private static final String INSTRUMENTATION_API_PACKAGE = "io.opentelemetry.instrumentation.api."; static boolean shouldCreateReferenceFor(String className) { - if (!className.startsWith(REFERENCE_CREATION_PACKAGE)) { - return className.startsWith(JAVA_AGENT_PACKAGE); - } - for (String exclude : REFERENCE_CREATION_PACKAGE_EXCLUDES) { - if (className.startsWith(exclude)) { - return false; - } + if (className.startsWith(INSTRUMENTATION_API_PACKAGE) + || className.startsWith(AUTO_INSTRUMENTATION_API_PACKAGE)) { + return false; } - return true; + return className.startsWith(AUTO_INSTRUMENTATION_PACKAGE) + || className.startsWith(JAVA_AGENT_TOOLING_PACKAGE) + || className.startsWith(LIBRARY_INSTRUMENTATION_PACKAGE); } private ReferenceCreationPredicate() {} diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/ReferenceCreator.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/ReferenceCreator.java index a088aec7c26a..66fc037e02bd 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/ReferenceCreator.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/ReferenceCreator.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.javaagent.tooling.muzzle; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/ReferenceMatcher.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/ReferenceMatcher.java index 0f73f1467659..67fc8279cec1 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/ReferenceMatcher.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/ReferenceMatcher.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.javaagent.tooling.muzzle; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/base/BaseTypedSpan.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/base/BaseTypedSpan.java index 4d2ddb16e1cf..5b621b50760e 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/base/BaseTypedSpan.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/base/BaseTypedSpan.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.javaagent.typed.base; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/base/BaseTypedTracer.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/base/BaseTypedTracer.java index a79d03ba06e1..d6a198b3f1cc 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/base/BaseTypedTracer.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/base/BaseTypedTracer.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.javaagent.typed.base; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/base/DelegatingSpan.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/base/DelegatingSpan.java index b13a761aa1ef..eb102ca838d0 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/base/DelegatingSpan.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/base/DelegatingSpan.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.javaagent.typed.base; @@ -19,10 +8,10 @@ import io.opentelemetry.common.AttributeKey; import io.opentelemetry.common.Attributes; import io.opentelemetry.trace.EndSpanOptions; -import io.opentelemetry.trace.Event; import io.opentelemetry.trace.Span; import io.opentelemetry.trace.SpanContext; -import io.opentelemetry.trace.Status; +import io.opentelemetry.trace.StatusCanonicalCode; +import org.checkerframework.checker.nullness.qual.Nullable; // TODO: This should be moved into the API. public class DelegatingSpan implements Span { @@ -78,18 +67,13 @@ public void addEvent(String name, Attributes attributes, long timestamp) { } @Override - public void addEvent(Event event) { - delegate.addEvent(event); - } - - @Override - public void addEvent(Event event, long timestamp) { - delegate.addEvent(event, timestamp); + public void setStatus(StatusCanonicalCode status) { + delegate.setStatus(status); } @Override - public void setStatus(Status status) { - delegate.setStatus(status); + public void setStatus(StatusCanonicalCode status, @Nullable String description) { + delegate.setStatus(status, description); } @Override diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/client/ClientTypedSpan.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/client/ClientTypedSpan.java index ec195c248fd9..07c5d4b05f00 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/client/ClientTypedSpan.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/client/ClientTypedSpan.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.javaagent.typed.client; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/client/ClientTypedTracer.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/client/ClientTypedTracer.java index e076a9634ac0..9a914e7dd282 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/client/ClientTypedTracer.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/client/ClientTypedTracer.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.javaagent.typed.client; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/client/http/HttpClientTypedSpan.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/client/http/HttpClientTypedSpan.java index 5049439b664b..db709ec4d7b9 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/client/http/HttpClientTypedSpan.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/client/http/HttpClientTypedSpan.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.javaagent.typed.client.http; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/client/http/HttpClientTypedTracer.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/client/http/HttpClientTypedTracer.java index 64a844332821..98dce6e40c8b 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/client/http/HttpClientTypedTracer.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/client/http/HttpClientTypedTracer.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.javaagent.typed.client.http; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/server/ServerTypedSpan.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/server/ServerTypedSpan.java index 7da306e2e009..1c11a749ebbb 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/server/ServerTypedSpan.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/server/ServerTypedSpan.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.javaagent.typed.server; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/server/ServerTypedTracer.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/server/ServerTypedTracer.java index 74edad7e303f..234bff45c9f6 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/server/ServerTypedTracer.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/server/ServerTypedTracer.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.javaagent.typed.server; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/server/http/HttpServerTypedSpan.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/server/http/HttpServerTypedSpan.java index 040c6610b7ad..4c393a44a53a 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/server/http/HttpServerTypedSpan.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/server/http/HttpServerTypedSpan.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.javaagent.typed.server.http; diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/server/http/HttpServerTypedTracer.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/server/http/HttpServerTypedTracer.java index aa100e5c828b..482770b7c5ad 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/server/http/HttpServerTypedTracer.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/typed/server/http/HttpServerTypedTracer.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.javaagent.typed.server.http; diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/test/ClassLoaderMatcherTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/test/ClassLoaderMatcherTest.groovy index 5d98c42bc9a8..6c4766e419e5 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/test/ClassLoaderMatcherTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/test/ClassLoaderMatcherTest.groovy @@ -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.javaagent.test diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/test/DefaultInstrumenterTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/test/DefaultInstrumenterTest.groovy index 5b5a1ce206e0..d6d9ba4705af 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/test/DefaultInstrumenterTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/test/DefaultInstrumenterTest.groovy @@ -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.javaagent.test @@ -74,8 +63,8 @@ class DefaultInstrumenterTest extends Specification { def "default disabled can override to enabled"() { setup: - ConfigUtils.updateConfig { - System.setProperty("otel.integration.test.enabled", "$enabled") + def previousConfig = ConfigUtils.updateConfig { + it.setProperty("otel.integration.test.enabled", "$enabled") } def target = new TestDefaultInstrumenter("test") { @Override @@ -89,14 +78,17 @@ class DefaultInstrumenterTest extends Specification { target.enabled == enabled target.applyCalled == enabled + cleanup: + ConfigUtils.setConfig(previousConfig) + where: enabled << [true, false] } def "configure default sys prop as #value"() { setup: - ConfigUtils.updateConfig { - System.setProperty("otel.integrations.enabled", value) + def previousConfig = ConfigUtils.updateConfig { + it.setProperty("otel.integrations.enabled", value) } def target = new TestDefaultInstrumenter("test") target.instrument(new AgentBuilder.Default()) @@ -105,23 +97,8 @@ class DefaultInstrumenterTest extends Specification { target.enabled == enabled target.applyCalled == enabled - where: - value | enabled - "true" | true - "false" | false - "asdf" | false - } - - def "configure default env var as #value"() { - setup: - environmentVariables.set("OTEL_INTEGRATIONS_ENABLED", value) - ConfigUtils.resetConfig() - def target = new TestDefaultInstrumenter("test") - target.instrument(new AgentBuilder.Default()) - - expect: - target.enabled == enabled - target.applyCalled == enabled + cleanup: + ConfigUtils.setConfig(previousConfig) where: value | enabled @@ -132,9 +109,9 @@ class DefaultInstrumenterTest extends Specification { def "configure sys prop enabled for #value when default is disabled"() { setup: - ConfigUtils.updateConfig { - System.setProperty("otel.integrations.enabled", "false") - System.setProperty("otel.integration.${value}.enabled", "true") + def previousConfig = ConfigUtils.updateConfig { + it.setProperty("otel.integrations.enabled", "false") + it.setProperty("otel.integration.${value}.enabled", "true") } def target = new TestDefaultInstrumenter(name, altName) target.instrument(new AgentBuilder.Default()) @@ -143,6 +120,9 @@ class DefaultInstrumenterTest extends Specification { target.enabled == enabled target.applyCalled == enabled + cleanup: + ConfigUtils.setConfig(previousConfig) + where: value | enabled | name | altName "test" | true | "test" | "asdf" @@ -154,31 +134,6 @@ class DefaultInstrumenterTest extends Specification { "period.test" | true | "period.test" | "asdf" } - def "configure env var enabled for #value when default is disabled"() { - setup: - ConfigUtils.updateConfig { - environmentVariables.set("OTEL_INTEGRATIONS_ENABLED", "false") - environmentVariables.set("OTEL_INTEGRATION_${value}_ENABLED", "true") - } - def target = new TestDefaultInstrumenter(name, altName) - target.instrument(new AgentBuilder.Default()) - - expect: - System.getenv("OTEL_INTEGRATION_${value}_ENABLED") == "true" - target.enabled == enabled - target.applyCalled == enabled - - where: - value | enabled | name | altName - "TEST" | true | "test" | "asdf" - "DUPLICATE" | true | "duplicate" | "duplicate" - "BAD" | false | "not" | "valid" - "ALTTEST" | true | "asdf" | "altTest" - "DASH_TEST" | true | "dash-test" | "asdf" - "UNDERSCORE_TEST" | true | "asdf" | "underscore_test" - "PERIOD_TEST" | true | "period.test" | "asdf" - } - class TestDefaultInstrumenter extends Instrumenter.Default { boolean applyCalled = false diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/test/ExceptionHandlerTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/test/ExceptionHandlerTest.groovy index f9f96531b35a..69738132182a 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/test/ExceptionHandlerTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/test/ExceptionHandlerTest.groovy @@ -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.javaagent.test diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/test/HelperInjectionTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/test/HelperInjectionTest.groovy index 93724fadffe6..356f25bb30b6 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/test/HelperInjectionTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/test/HelperInjectionTest.groovy @@ -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.javaagent.test diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/test/ResourceLocatingTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/test/ResourceLocatingTest.groovy index bfa1eddbbd7f..8bd705e82cf4 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/test/ResourceLocatingTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/test/ResourceLocatingTest.groovy @@ -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.javaagent.test diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/AddThreadDetailsSpanProcessorTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/AddThreadDetailsSpanProcessorTest.groovy index 91ddad0ea32f..f2319de7bfee 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/AddThreadDetailsSpanProcessorTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/AddThreadDetailsSpanProcessorTest.groovy @@ -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.javaagent.tooling diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/CacheProviderTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/CacheProviderTest.groovy index 6201f336e8e8..2d1bdfad09a2 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/CacheProviderTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/CacheProviderTest.groovy @@ -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.javaagent.tooling diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/ExporterClassLoaderTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/ExporterClassLoaderTest.groovy index b3e7181abbd7..a9c95a5c9a38 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/ExporterClassLoaderTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/ExporterClassLoaderTest.groovy @@ -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.javaagent.tooling diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/PeriodicSchedulingTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/PeriodicSchedulingTest.groovy index 674f1c3277d9..a836d54d2f1d 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/PeriodicSchedulingTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/PeriodicSchedulingTest.groovy @@ -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.javaagent.tooling diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/UtilsTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/UtilsTest.groovy index fa02ee3f43e0..cadbe5233d0e 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/UtilsTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/UtilsTest.groovy @@ -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.javaagent.tooling diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/WeakCacheTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/WeakCacheTest.groovy index 84c74b679023..d03819b216fb 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/WeakCacheTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/WeakCacheTest.groovy @@ -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.javaagent.tooling diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/WeakConcurrentSupplierTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/WeakConcurrentSupplierTest.groovy index 9255064b096a..4b1e2b1173a0 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/WeakConcurrentSupplierTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/WeakConcurrentSupplierTest.groovy @@ -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.javaagent.tooling diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/ExtendsClassMatcherTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/ExtendsClassMatcherTest.groovy index 22889dab5167..4ca0342da320 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/ExtendsClassMatcherTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/ExtendsClassMatcherTest.groovy @@ -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.javaagent.tooling.bytebuddy.matcher diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/HasInterfaceMatcherTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/HasInterfaceMatcherTest.groovy index e359b2531273..aa52a36944cb 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/HasInterfaceMatcherTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/HasInterfaceMatcherTest.groovy @@ -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.javaagent.tooling.bytebuddy.matcher diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/HasSuperMethodMatcherTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/HasSuperMethodMatcherTest.groovy index f669c403b26b..0cf6a0ecda7f 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/HasSuperMethodMatcherTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/HasSuperMethodMatcherTest.groovy @@ -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.javaagent.tooling.bytebuddy.matcher diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/ImplementsInterfaceMatcherTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/ImplementsInterfaceMatcherTest.groovy index e86c17348670..12d87a53d95e 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/ImplementsInterfaceMatcherTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/ImplementsInterfaceMatcherTest.groovy @@ -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.javaagent.tooling.bytebuddy.matcher diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/NameMatchersTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/NameMatchersTest.groovy index aa74f41d3aa9..909cbb4598e9 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/NameMatchersTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/NameMatchersTest.groovy @@ -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.javaagent.tooling.bytebuddy.matcher diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/SafeHasSuperTypeMatcherTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/SafeHasSuperTypeMatcherTest.groovy index be2e84877ccc..9b3c3c57a006 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/SafeHasSuperTypeMatcherTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/SafeHasSuperTypeMatcherTest.groovy @@ -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.javaagent.tooling.bytebuddy.matcher diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/SafeMatcherTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/SafeMatcherTest.groovy index 71d7c52aa03c..d0b64266a1c6 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/SafeMatcherTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/SafeMatcherTest.groovy @@ -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.javaagent.tooling.bytebuddy.matcher diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/ThrowOnFirstElement.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/ThrowOnFirstElement.groovy index 440d745a0ddd..f9012bb8d4b2 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/ThrowOnFirstElement.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/ThrowOnFirstElement.groovy @@ -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.javaagent.tooling.bytebuddy.matcher diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/A.java b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/A.java index c77ae5f6ee52..3d0cb737fdb6 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/A.java +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/A.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.javaagent.tooling.bytebuddy.matcher.testclasses; diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/B.java b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/B.java index dc8ae6431dc8..af7b94c1b747 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/B.java +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/B.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.javaagent.tooling.bytebuddy.matcher.testclasses; diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/C.java b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/C.java index b7c688989fa8..ff40c0e9986d 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/C.java +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/C.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.javaagent.tooling.bytebuddy.matcher.testclasses; diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/D.java b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/D.java index 05273b407d38..64994ce0c974 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/D.java +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/D.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.javaagent.tooling.bytebuddy.matcher.testclasses; diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/E.java b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/E.java index 4a2306669716..0495a94aafae 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/E.java +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/E.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.javaagent.tooling.bytebuddy.matcher.testclasses; diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/F.java b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/F.java index 75387454bf05..64dd9fdff065 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/F.java +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/F.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.javaagent.tooling.bytebuddy.matcher.testclasses; diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/G.java b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/G.java index 6a5ea07488dc..bab5c07f3609 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/G.java +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/G.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.javaagent.tooling.bytebuddy.matcher.testclasses; diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/Trace.java b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/Trace.java index 8c8abc3cbd13..1b0af6d56ecf 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/Trace.java +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/Trace.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.javaagent.tooling.bytebuddy.matcher.testclasses; diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/TracedClass.java b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/TracedClass.java index 646f3ba0692a..40d9e7981785 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/TracedClass.java +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/TracedClass.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.javaagent.tooling.bytebuddy.matcher.testclasses; diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/UntracedClass.java b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/UntracedClass.java index d25d52b7c070..2fd9de343a9a 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/UntracedClass.java +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/bytebuddy/matcher/testclasses/UntracedClass.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.javaagent.tooling.bytebuddy.matcher.testclasses; diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/config/ConfigBuilderTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/config/AgentConfigBuilderTest.groovy similarity index 85% rename from javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/config/ConfigBuilderTest.groovy rename to javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/config/AgentConfigBuilderTest.groovy index ca54ab35c131..ba1350670b8e 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/config/ConfigBuilderTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/config/AgentConfigBuilderTest.groovy @@ -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.javaagent.tooling.config @@ -21,7 +10,7 @@ import org.junit.contrib.java.lang.system.EnvironmentVariables import org.junit.contrib.java.lang.system.RestoreSystemProperties import spock.lang.Specification -class ConfigBuilderTest extends Specification { +class AgentConfigBuilderTest extends Specification { @Rule public final RestoreSystemProperties restoreSystemProperties = new RestoreSystemProperties() @Rule @@ -36,7 +25,7 @@ class ConfigBuilderTest extends Specification { spiConfiguration.put("property4", "spi-4") when: - def config = new ConfigBuilder() + def config = new AgentConfigBuilder() .readPropertiesFromAllSources(spiConfiguration, new Properties()) .build() @@ -61,7 +50,7 @@ class ConfigBuilderTest extends Specification { configurationFile.put("property3", "cf-3") when: - def config = new ConfigBuilder() + def config = new AgentConfigBuilder() .readPropertiesFromAllSources(spiConfiguration, configurationFile) .build() @@ -89,7 +78,7 @@ class ConfigBuilderTest extends Specification { environmentVariables.set("property2", "env-2") when: - def config = new ConfigBuilder() + def config = new AgentConfigBuilder() .readPropertiesFromAllSources(spiConfiguration, configurationFile) .build() @@ -119,7 +108,7 @@ class ConfigBuilderTest extends Specification { System.setProperty("property1", "sp-1") when: - def config = new ConfigBuilder() + def config = new AgentConfigBuilder() .readPropertiesFromAllSources(spiConfiguration, configurationFile) .build() @@ -143,7 +132,7 @@ class ConfigBuilderTest extends Specification { System.setProperty("otel.some-system_property", "value") when: - def config = new ConfigBuilder() + def config = new AgentConfigBuilder() .readPropertiesFromAllSources(spiConfiguration, configurationFile) .build() diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/matcher/AdditionalLibraryIgnoresMatcherTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/matcher/AdditionalLibraryIgnoresMatcherTest.groovy index 2ba3c569ee39..534b56fc32d3 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/matcher/AdditionalLibraryIgnoresMatcherTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/matcher/AdditionalLibraryIgnoresMatcherTest.groovy @@ -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.javaagent.tooling.matcher diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/muzzle/ReferenceCreationPredicateTest.groovy b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/muzzle/ReferenceCreationPredicateTest.groovy index 87a5b56d8b03..a19c10df468b 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/muzzle/ReferenceCreationPredicateTest.groovy +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/tooling/muzzle/ReferenceCreationPredicateTest.groovy @@ -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.javaagent.tooling.muzzle @@ -26,9 +15,10 @@ class ReferenceCreationPredicateTest extends Specification { ReferenceCreationPredicate.shouldCreateReferenceFor(className) where: - desc | className - "Instrumentation class" | "io.opentelemetry.instrumentation.some_instrumentation.Advice" - "javaagent-tooling class" | "io.opentelemetry.javaagent.tooling.Constants" + desc | className + "auto instrumentation class" | "io.opentelemetry.instrumentation.auto.some_instrumentation.Advice" + "javaagent-tooling class" | "io.opentelemetry.javaagent.tooling.Constants" + "library instrumentation class" | "io.opentelemetry.instrumentation.LibraryClass" } @Unroll diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/typed/TypedTracerDemonstration.java b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/typed/TypedTracerDemonstration.java index c9efdea768e4..0d6a4cf1503b 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/typed/TypedTracerDemonstration.java +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/typed/TypedTracerDemonstration.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.javaagent.typed; diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/typed/client/SampleHttpClientTypedSpan.java b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/typed/client/SampleHttpClientTypedSpan.java index d7fea20b4c20..eb216c1a9e1e 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/typed/client/SampleHttpClientTypedSpan.java +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/typed/client/SampleHttpClientTypedSpan.java @@ -1,24 +1,13 @@ /* * 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.javaagent.typed.client; import io.opentelemetry.javaagent.typed.client.http.HttpClientTypedSpan; import io.opentelemetry.trace.Span; -import io.opentelemetry.trace.Status; +import io.opentelemetry.trace.StatusCanonicalCode; public class SampleHttpClientTypedSpan extends HttpClientTypedSpan { @@ -34,7 +23,7 @@ protected SampleHttpClientTypedSpan onRequest(String o) { @Override protected SampleHttpClientTypedSpan onResponse(String o) { - delegate.setStatus(Status.OK); + delegate.setStatus(StatusCanonicalCode.OK); return this; } diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/typed/client/SampleHttpClientTypedTracer.java b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/typed/client/SampleHttpClientTypedTracer.java index 9fa1638c9420..cbd816df4196 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/typed/client/SampleHttpClientTypedTracer.java +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/typed/client/SampleHttpClientTypedTracer.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.javaagent.typed.client; diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/typed/server/SampleHttpServerTypedSpan.java b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/typed/server/SampleHttpServerTypedSpan.java index a9bee40c8215..d2a0f986903f 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/typed/server/SampleHttpServerTypedSpan.java +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/typed/server/SampleHttpServerTypedSpan.java @@ -1,24 +1,13 @@ /* * 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.javaagent.typed.server; import io.opentelemetry.javaagent.typed.server.http.HttpServerTypedSpan; import io.opentelemetry.trace.Span; -import io.opentelemetry.trace.Status; +import io.opentelemetry.trace.StatusCanonicalCode; public class SampleHttpServerTypedSpan extends HttpServerTypedSpan { @@ -34,7 +23,7 @@ protected SampleHttpServerTypedSpan onRequest(String o) { @Override protected SampleHttpServerTypedSpan onResponse(String o) { - delegate.setStatus(Status.OK); + delegate.setStatus(StatusCanonicalCode.OK); return this; } diff --git a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/typed/server/SampleHttpServerTypedTracer.java b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/typed/server/SampleHttpServerTypedTracer.java index ea013471ff3c..1c1f3d3953f3 100644 --- a/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/typed/server/SampleHttpServerTypedTracer.java +++ b/javaagent-tooling/src/test/groovy/io/opentelemetry/javaagent/typed/server/SampleHttpServerTypedTracer.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.javaagent.typed.server; diff --git a/javaagent-tooling/src/test/java/io/opentelemetry/javaagent/test/BadAdvice.java b/javaagent-tooling/src/test/java/io/opentelemetry/javaagent/test/BadAdvice.java index 295ab7063385..d3c8c7bd279f 100644 --- a/javaagent-tooling/src/test/java/io/opentelemetry/javaagent/test/BadAdvice.java +++ b/javaagent-tooling/src/test/java/io/opentelemetry/javaagent/test/BadAdvice.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.javaagent.test; diff --git a/javaagent-tooling/src/test/java/io/opentelemetry/javaagent/test/HelperClass.java b/javaagent-tooling/src/test/java/io/opentelemetry/javaagent/test/HelperClass.java index 1d59201b61c8..600384a24f4b 100644 --- a/javaagent-tooling/src/test/java/io/opentelemetry/javaagent/test/HelperClass.java +++ b/javaagent-tooling/src/test/java/io/opentelemetry/javaagent/test/HelperClass.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.javaagent.test; diff --git a/javaagent/javaagent.gradle b/javaagent/javaagent.gradle index 589c28f64231..e1e10f23e3ef 100644 --- a/javaagent/javaagent.gradle +++ b/javaagent/javaagent.gradle @@ -89,8 +89,8 @@ tasks.withType(ShadowJar).configureEach { // relocate OpenTelemetry API relocate "io.opentelemetry.OpenTelemetry", "io.opentelemetry.javaagent.shaded.io.opentelemetry.OpenTelemetry" relocate "io.opentelemetry.common", "io.opentelemetry.javaagent.shaded.io.opentelemetry.common" + relocate "io.opentelemetry.baggage", "io.opentelemetry.javaagent.shaded.io.opentelemetry.baggage" relocate "io.opentelemetry.context", "io.opentelemetry.javaagent.shaded.io.opentelemetry.context" - relocate "io.opentelemetry.correlationcontext", "io.opentelemetry.javaagent.shaded.io.opentelemetry.correlationcontext" relocate "io.opentelemetry.internal", "io.opentelemetry.javaagent.shaded.io.opentelemetry.internal" relocate "io.opentelemetry.metrics", "io.opentelemetry.javaagent.shaded.io.opentelemetry.metrics" relocate "io.opentelemetry.trace", "io.opentelemetry.javaagent.shaded.io.opentelemetry.trace" diff --git a/javaagent/src/main/java/io/opentelemetry/javaagent/OpenTelemetryAgent.java b/javaagent/src/main/java/io/opentelemetry/javaagent/OpenTelemetryAgent.java index 468eb69e87ff..4f26d854b4ac 100644 --- a/javaagent/src/main/java/io/opentelemetry/javaagent/OpenTelemetryAgent.java +++ b/javaagent/src/main/java/io/opentelemetry/javaagent/OpenTelemetryAgent.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.javaagent; diff --git a/javaagent/src/test/groovy/io/opentelemetry/auto/AgentLoadedIntoBootstrapTest.groovy b/javaagent/src/test/groovy/io/opentelemetry/auto/AgentLoadedIntoBootstrapTest.groovy index 2e52a2c0cf4d..1621e9ad6c24 100644 --- a/javaagent/src/test/groovy/io/opentelemetry/auto/AgentLoadedIntoBootstrapTest.groovy +++ b/javaagent/src/test/groovy/io/opentelemetry/auto/AgentLoadedIntoBootstrapTest.groovy @@ -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.auto diff --git a/javaagent/src/test/groovy/io/opentelemetry/auto/LogLevelTest.groovy b/javaagent/src/test/groovy/io/opentelemetry/auto/LogLevelTest.groovy index 4dc484e888c7..5de9460e71fc 100644 --- a/javaagent/src/test/groovy/io/opentelemetry/auto/LogLevelTest.groovy +++ b/javaagent/src/test/groovy/io/opentelemetry/auto/LogLevelTest.groovy @@ -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.auto diff --git a/javaagent/src/test/groovy/io/opentelemetry/auto/integration/classloading/ClassLoadingTest.groovy b/javaagent/src/test/groovy/io/opentelemetry/auto/integration/classloading/ClassLoadingTest.groovy index 75934505f14f..0d2acf77c1b0 100644 --- a/javaagent/src/test/groovy/io/opentelemetry/auto/integration/classloading/ClassLoadingTest.groovy +++ b/javaagent/src/test/groovy/io/opentelemetry/auto/integration/classloading/ClassLoadingTest.groovy @@ -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.auto.integration.classloading diff --git a/javaagent/src/test/groovy/io/opentelemetry/auto/integration/classloading/ShadowPackageRenamingTest.groovy b/javaagent/src/test/groovy/io/opentelemetry/auto/integration/classloading/ShadowPackageRenamingTest.groovy index cfba62c32fce..76f5805b96b0 100644 --- a/javaagent/src/test/groovy/io/opentelemetry/auto/integration/classloading/ShadowPackageRenamingTest.groovy +++ b/javaagent/src/test/groovy/io/opentelemetry/auto/integration/classloading/ShadowPackageRenamingTest.groovy @@ -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.auto.integration.classloading diff --git a/javaagent/src/test/groovy/io/opentelemetry/auto/integration/muzzle/MuzzleBytecodeTransformTest.groovy b/javaagent/src/test/groovy/io/opentelemetry/auto/integration/muzzle/MuzzleBytecodeTransformTest.groovy index d6c8bd018f71..ee4abcdb6ea9 100644 --- a/javaagent/src/test/groovy/io/opentelemetry/auto/integration/muzzle/MuzzleBytecodeTransformTest.groovy +++ b/javaagent/src/test/groovy/io/opentelemetry/auto/integration/muzzle/MuzzleBytecodeTransformTest.groovy @@ -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.auto.integration.muzzle diff --git a/javaagent/src/test/java/io/opentelemetry/auto/test/IntegrationTestUtils.java b/javaagent/src/test/java/io/opentelemetry/auto/test/IntegrationTestUtils.java index 93d831ee8cf6..1eff269583c6 100644 --- a/javaagent/src/test/java/io/opentelemetry/auto/test/IntegrationTestUtils.java +++ b/javaagent/src/test/java/io/opentelemetry/auto/test/IntegrationTestUtils.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.auto.test; @@ -27,6 +16,7 @@ import java.lang.reflect.Field; import java.lang.reflect.Method; import java.net.URL; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -266,7 +256,8 @@ private StreamGobbler(InputStream stream, String type, boolean print) { @Override public void run() { try { - BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); + BufferedReader reader = + new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8)); String line = null; while ((line = reader.readLine()) != null) { if (print) { diff --git a/javaagent/src/test/java/io/opentelemetry/test/ClassToInstrument.java b/javaagent/src/test/java/io/opentelemetry/test/ClassToInstrument.java index c1df32ce499b..b37223b07324 100644 --- a/javaagent/src/test/java/io/opentelemetry/test/ClassToInstrument.java +++ b/javaagent/src/test/java/io/opentelemetry/test/ClassToInstrument.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.test; diff --git a/javaagent/src/test/java/io/opentelemetry/test/ClassToInstrumentChild.java b/javaagent/src/test/java/io/opentelemetry/test/ClassToInstrumentChild.java index 106f5bb33aef..5d75d9c93673 100644 --- a/javaagent/src/test/java/io/opentelemetry/test/ClassToInstrumentChild.java +++ b/javaagent/src/test/java/io/opentelemetry/test/ClassToInstrumentChild.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.test; diff --git a/javaagent/src/test/java/jvmbootstraptest/AgentLoadedChecker.java b/javaagent/src/test/java/jvmbootstraptest/AgentLoadedChecker.java index 427f07a16bfe..0e80a0eb1f7a 100644 --- a/javaagent/src/test/java/jvmbootstraptest/AgentLoadedChecker.java +++ b/javaagent/src/test/java/jvmbootstraptest/AgentLoadedChecker.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 jvmbootstraptest; diff --git a/javaagent/src/test/java/jvmbootstraptest/LogLevelChecker.java b/javaagent/src/test/java/jvmbootstraptest/LogLevelChecker.java index da32b547071f..97820b095c02 100644 --- a/javaagent/src/test/java/jvmbootstraptest/LogLevelChecker.java +++ b/javaagent/src/test/java/jvmbootstraptest/LogLevelChecker.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 jvmbootstraptest; diff --git a/javaagent/src/test/java/jvmbootstraptest/MyClassLoaderIsNotBootstrap.java b/javaagent/src/test/java/jvmbootstraptest/MyClassLoaderIsNotBootstrap.java index 3b360590b07f..3b217b837c00 100644 --- a/javaagent/src/test/java/jvmbootstraptest/MyClassLoaderIsNotBootstrap.java +++ b/javaagent/src/test/java/jvmbootstraptest/MyClassLoaderIsNotBootstrap.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 jvmbootstraptest; diff --git a/load-generator/src/main/java/io/opentelemetry/loadgenerator/LoadGenerator.java b/load-generator/src/main/java/io/opentelemetry/loadgenerator/LoadGenerator.java index df58851c986c..cf02d97a5539 100644 --- a/load-generator/src/main/java/io/opentelemetry/loadgenerator/LoadGenerator.java +++ b/load-generator/src/main/java/io/opentelemetry/loadgenerator/LoadGenerator.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.loadgenerator; diff --git a/settings.gradle b/settings.gradle index 3a99f4bb3494..8af70cb8a9ae 100644 --- a/settings.gradle +++ b/settings.gradle @@ -88,7 +88,9 @@ include ':instrumentation:geode-1.4' include ':instrumentation:google-http-client-1.19' include ':instrumentation:grizzly-2.0' include ':instrumentation:grizzly-client-1.9' -include ':instrumentation:grpc-1.5' +include ':instrumentation:grpc-1.5:auto' +include ':instrumentation:grpc-1.5:library' +include ':instrumentation:grpc-1.5:testing' include ':instrumentation:guava-10.0' include ':instrumentation:hibernate:hibernate-3.3' include ':instrumentation:hibernate:hibernate-4.0' @@ -193,6 +195,7 @@ include ":javaagent-exporters:jaeger" include ":javaagent-exporters:logging" include ":javaagent-exporters:otlp" include ":javaagent-exporters:zipkin" +include ":javaagent-exporters:prometheus" // benchmark include ':benchmark' diff --git a/smoke-tests/smoke-tests.gradle b/smoke-tests/smoke-tests.gradle index effcfac36bb6..9b15b705c564 100644 --- a/smoke-tests/smoke-tests.gradle +++ b/smoke-tests/smoke-tests.gradle @@ -17,7 +17,7 @@ dependencies { implementation deps.slf4j implementation deps.opentelemetryProto implementation deps.opentelemetryApi - implementation "org.testcontainers:testcontainers:1.14.3" + implementation deps.testcontainers implementation 'com.fasterxml.jackson.core:jackson-databind:2.11.2' implementation 'com.google.protobuf:protobuf-java-util:3.12.4' } diff --git a/smoke-tests/src/test/groovy/io/opentelemetry/smoketest/PlaySmokeTest.groovy b/smoke-tests/src/test/groovy/io/opentelemetry/smoketest/PlaySmokeTest.groovy index 604ce7510d11..5d961b41e33a 100644 --- a/smoke-tests/src/test/groovy/io/opentelemetry/smoketest/PlaySmokeTest.groovy +++ b/smoke-tests/src/test/groovy/io/opentelemetry/smoketest/PlaySmokeTest.groovy @@ -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.smoketest @@ -32,7 +21,7 @@ class PlaySmokeTest extends SmokeTest { def request = new Request.Builder().url(url).get().build() when: - def response = client.newCall(request).execute() + def response = CLIENT.newCall(request).execute() Collection traces = waitForTraces() then: diff --git a/smoke-tests/src/test/groovy/io/opentelemetry/smoketest/SmokeTest.groovy b/smoke-tests/src/test/groovy/io/opentelemetry/smoketest/SmokeTest.groovy index 750e54b5fb5f..8c6b9eb39d05 100644 --- a/smoke-tests/src/test/groovy/io/opentelemetry/smoketest/SmokeTest.groovy +++ b/smoke-tests/src/test/groovy/io/opentelemetry/smoketest/SmokeTest.groovy @@ -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.smoketest @@ -46,7 +35,7 @@ abstract class SmokeTest extends Specification { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper() - protected static OkHttpClient client = OkHttpUtils.client() + protected static final OkHttpClient CLIENT = OkHttpUtils.client() @Shared private Network network = Network.newNetwork() @@ -80,7 +69,7 @@ abstract class SmokeTest extends Specification { .withLogConsumer(new Slf4jLogConsumer(logger)) backend.start() - collector = new GenericContainer<>("otel/opentelemetry-collector-dev") + collector = new GenericContainer<>("otel/opentelemetry-collector-dev:latest") .dependsOn(backend) .withNetwork(network) .withNetworkAliases("collector") @@ -108,7 +97,7 @@ abstract class SmokeTest extends Specification { } def cleanup() { - client.newCall(new Request.Builder() + CLIENT.newCall(new Request.Builder() .url("http://localhost:${backend.getMappedPort(8080)}/clear-requests") .build()) .execute() @@ -160,7 +149,7 @@ abstract class SmokeTest extends Specification { long deadline = System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(30) String content = "[]" while (System.currentTimeMillis() < deadline) { - def body = content = client.newCall(new Request.Builder() + def body = content = CLIENT.newCall(new Request.Builder() .url("http://localhost:${backend.getMappedPort(8080)}/get-requests") .build()) .execute() diff --git a/smoke-tests/src/test/groovy/io/opentelemetry/smoketest/SpringBootSmokeTest.groovy b/smoke-tests/src/test/groovy/io/opentelemetry/smoketest/SpringBootSmokeTest.groovy index d1128f3f042e..87eefcd2ae01 100644 --- a/smoke-tests/src/test/groovy/io/opentelemetry/smoketest/SpringBootSmokeTest.groovy +++ b/smoke-tests/src/test/groovy/io/opentelemetry/smoketest/SpringBootSmokeTest.groovy @@ -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.smoketest @@ -41,7 +30,7 @@ class SpringBootSmokeTest extends SmokeTest { def currentAgentVersion = new JarFile(agentPath).getManifest().getMainAttributes().get(Attributes.Name.IMPLEMENTATION_VERSION) when: - def response = client.newCall(request).execute() + def response = CLIENT.newCall(request).execute() Collection traces = waitForTraces() then: diff --git a/smoke-tests/src/test/groovy/io/opentelemetry/smoketest/SpringBootWithSamplingSmokeTest.groovy b/smoke-tests/src/test/groovy/io/opentelemetry/smoketest/SpringBootWithSamplingSmokeTest.groovy index 26e023959445..8c9f7c73828e 100644 --- a/smoke-tests/src/test/groovy/io/opentelemetry/smoketest/SpringBootWithSamplingSmokeTest.groovy +++ b/smoke-tests/src/test/groovy/io/opentelemetry/smoketest/SpringBootWithSamplingSmokeTest.groovy @@ -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.smoketest @@ -42,7 +31,7 @@ class SpringBootWithSamplingSmokeTest extends SmokeTest { when: for (int i = 1; i <= NUM_TRIES; i++) { - client.newCall(request).execute() + CLIENT.newCall(request).execute() } Collection traces = waitForTraces() diff --git a/smoke-tests/src/test/groovy/io/opentelemetry/smoketest/WildflySmokeTest.groovy b/smoke-tests/src/test/groovy/io/opentelemetry/smoketest/WildflySmokeTest.groovy index 0db639b61b24..399df5cb51a7 100644 --- a/smoke-tests/src/test/groovy/io/opentelemetry/smoketest/WildflySmokeTest.groovy +++ b/smoke-tests/src/test/groovy/io/opentelemetry/smoketest/WildflySmokeTest.groovy @@ -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.smoketest @@ -34,7 +23,7 @@ class WildflySmokeTest extends SmokeTest { def request = new Request.Builder().url(url).get().build() when: - def response = client.newCall(request).execute() + def response = CLIENT.newCall(request).execute() then: def responseBodyStr = response.body().string() diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/AgentTestRunner.java b/testing-common/src/main/groovy/io/opentelemetry/auto/test/AgentTestRunner.java index 60ccbdaa1bec..016b9a7a6fcf 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/AgentTestRunner.java +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/AgentTestRunner.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.auto.test; @@ -27,13 +16,15 @@ import groovy.transform.stc.SimpleType; import io.opentelemetry.OpenTelemetry; import io.opentelemetry.auto.test.asserts.InMemoryExporterAssert; +import io.opentelemetry.auto.test.utils.ConfigUtils; +import io.opentelemetry.context.propagation.DefaultContextPropagators; import io.opentelemetry.javaagent.tooling.AgentInstaller; import io.opentelemetry.javaagent.tooling.Instrumenter; -import io.opentelemetry.javaagent.tooling.config.ConfigInitializer; import io.opentelemetry.javaagent.tooling.matcher.AdditionalLibraryIgnoresMatcher; import io.opentelemetry.sdk.OpenTelemetrySdk; import io.opentelemetry.sdk.trace.data.SpanData; import io.opentelemetry.trace.Tracer; +import io.opentelemetry.trace.propagation.HttpTraceContext; import java.lang.instrument.ClassFileTransformer; import java.lang.instrument.Instrumentation; import java.util.ArrayList; @@ -108,7 +99,21 @@ public abstract class AgentTestRunner extends Specification { ((Logger) LoggerFactory.getLogger("io.opentelemetry")).setLevel(Level.DEBUG); TEST_WRITER = new InMemoryExporter(); - OpenTelemetrySdk.getTracerProvider().addSpanProcessor(TEST_WRITER); + // TODO this is probably temporary until default propagators are supplied by SDK + // https://github.com/open-telemetry/opentelemetry-java/issues/1742 + // currently checking against no-op implementation so that it won't override aws-lambda + // propagator configuration + if (OpenTelemetry.getPropagators() + .getTextMapPropagator() + .getClass() + .getSimpleName() + .equals("NoopTextMapPropagator")) { + OpenTelemetry.setPropagators( + DefaultContextPropagators.builder() + .addTextMapPropagator(HttpTraceContext.getInstance()) + .build()); + } + OpenTelemetrySdk.getTracerManagement().addSpanProcessor(TEST_WRITER); TEST_TRACER = OpenTelemetry.getTracer("io.opentelemetry.auto"); } @@ -160,7 +165,7 @@ public static synchronized void resetInstrumentation() { */ @BeforeClass public void setupBeforeTests() { - ConfigInitializer.initialize(); + ConfigUtils.initializeConfig(); if (activeTransformer == null) { activeTransformer = diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/AgentTestTrait.groovy b/testing-common/src/main/groovy/io/opentelemetry/auto/test/AgentTestTrait.groovy index 05b8bad874bc..e711a468eb72 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/AgentTestTrait.groovy +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/AgentTestTrait.groovy @@ -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.auto.test diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/InMemoryExporter.java b/testing-common/src/main/groovy/io/opentelemetry/auto/test/InMemoryExporter.java index 7d16851191b5..127679f5feca 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/InMemoryExporter.java +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/InMemoryExporter.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.auto.test; diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/InstrumentationSpecification.groovy b/testing-common/src/main/groovy/io/opentelemetry/auto/test/InstrumentationSpecification.groovy index f53ebc254071..8ae4707b5271 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/InstrumentationSpecification.groovy +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/InstrumentationSpecification.groovy @@ -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.auto.test diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/InstrumentationTestRunner.groovy b/testing-common/src/main/groovy/io/opentelemetry/auto/test/InstrumentationTestRunner.groovy index b2fa97b2cf8e..a2c311da0683 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/InstrumentationTestRunner.groovy +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/InstrumentationTestRunner.groovy @@ -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.auto.test @@ -20,9 +9,12 @@ import com.google.common.base.Predicate import com.google.common.base.Predicates import groovy.transform.stc.ClosureParams import groovy.transform.stc.SimpleType +import io.opentelemetry.OpenTelemetry import io.opentelemetry.auto.test.asserts.InMemoryExporterAssert +import io.opentelemetry.context.propagation.DefaultContextPropagators import io.opentelemetry.sdk.OpenTelemetrySdk import io.opentelemetry.sdk.trace.data.SpanData +import io.opentelemetry.trace.propagation.HttpTraceContext import org.junit.Before import spock.lang.Specification @@ -36,7 +28,16 @@ abstract class InstrumentationTestRunner extends Specification { static { TEST_WRITER = new InMemoryExporter() - OpenTelemetrySdk.getTracerProvider().addSpanProcessor(TEST_WRITER) + // TODO this is probably temporary until default propagators are supplied by SDK + // https://github.com/open-telemetry/opentelemetry-java/issues/1742 + // currently checking against no-op implementation so that it won't override aws-lambda + // propagator configuration + if (OpenTelemetry.getPropagators().getTextMapPropagator().getClass().getSimpleName() == "NoopTextMapPropagator") { + OpenTelemetry.setPropagators(DefaultContextPropagators.builder() + .addTextMapPropagator(HttpTraceContext.getInstance()) + .build()) + } + OpenTelemetrySdk.getTracerManagement().addSpanProcessor(TEST_WRITER) } @Before diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/InstrumentationTestTrait.groovy b/testing-common/src/main/groovy/io/opentelemetry/auto/test/InstrumentationTestTrait.groovy index cc191b947c79..20d8fae8c4b1 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/InstrumentationTestTrait.groovy +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/InstrumentationTestTrait.groovy @@ -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.auto.test diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/asserts/AttributesAssert.groovy b/testing-common/src/main/groovy/io/opentelemetry/auto/test/asserts/AttributesAssert.groovy index 0e1cb2704d1a..a48a4042d20a 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/asserts/AttributesAssert.groovy +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/asserts/AttributesAssert.groovy @@ -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.auto.test.asserts diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/asserts/EventAssert.groovy b/testing-common/src/main/groovy/io/opentelemetry/auto/test/asserts/EventAssert.groovy index 076110fa1454..c40af84aa9ce 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/asserts/EventAssert.groovy +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/asserts/EventAssert.groovy @@ -1,29 +1,18 @@ /* * 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.auto.test.asserts import static AttributesAssert.assertAttributes +import static io.opentelemetry.sdk.trace.data.SpanData.Event import groovy.transform.stc.ClosureParams import groovy.transform.stc.SimpleType import io.opentelemetry.common.AttributeConsumer import io.opentelemetry.common.AttributeKey import io.opentelemetry.common.Attributes -import io.opentelemetry.trace.Event class EventAssert { private final Event event diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/asserts/InMemoryExporterAssert.groovy b/testing-common/src/main/groovy/io/opentelemetry/auto/test/asserts/InMemoryExporterAssert.groovy index 51846899063b..b364b3f15781 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/asserts/InMemoryExporterAssert.groovy +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/asserts/InMemoryExporterAssert.groovy @@ -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.auto.test.asserts diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/asserts/SpanAssert.groovy b/testing-common/src/main/groovy/io/opentelemetry/auto/test/asserts/SpanAssert.groovy index 9d74306ccfdf..c138d36a8e47 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/asserts/SpanAssert.groovy +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/asserts/SpanAssert.groovy @@ -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.auto.test.asserts @@ -27,7 +16,7 @@ import io.opentelemetry.common.ReadableAttributes import io.opentelemetry.sdk.trace.data.SpanData import io.opentelemetry.trace.Span import io.opentelemetry.trace.SpanId -import io.opentelemetry.trace.Status +import io.opentelemetry.trace.StatusCanonicalCode import io.opentelemetry.trace.attributes.SemanticAttributes import java.util.regex.Pattern @@ -67,44 +56,44 @@ class SpanAssert { assertEvent(span.events.get(index), spec) } - def assertSpanNameContains(String spanName, String... shouldContainArr) { + def assertNameContains(String spanName, String... shouldContainArr) { for (String shouldContain : shouldContainArr) { assert spanName.contains(shouldContain) } } - def operationName(String name) { + def name(String name) { assert span.name == name checked.name = true } - def operationName(Pattern pattern) { + def name(Pattern pattern) { assert span.name =~ pattern checked.name = true } - def operationName(Closure spec) { + def name(Closure spec) { assert ((Closure) spec).call(span.name) checked.name = true } - def operationNameContains(String... operationNameParts) { - assertSpanNameContains(span.name, operationNameParts) + def nameContains(String... nameParts) { + assertNameContains(span.name, nameParts) checked.name = true } - def spanKind(Span.Kind spanKind) { - assert span.kind == spanKind + def kind(Span.Kind kind) { + assert span.kind == kind checked.kind = true } - def parent() { + def hasNoParent() { assert !SpanId.isValid(span.parentSpanId) checked.parentSpanId = true } - def parentId(String parentId) { - assert span.parentSpanId == parentId + def parentSpanId(String parentSpanId) { + assert span.parentSpanId == parentSpanId checked.parentId = true } @@ -114,7 +103,7 @@ class SpanAssert { } def childOf(SpanData parent) { - parentId(parent.spanId) + parentSpanId(parent.spanId) traceId(parent.traceId) } @@ -133,16 +122,17 @@ class SpanAssert { assert found } - def status(Status status) { - assert span.status == status + def status(StatusCanonicalCode status) { + assert span.status.canonicalCode == status checked.status = true } def errored(boolean errored) { if (errored) { - assert span.status != Status.OK + // comparing only canonical code, since description may be different + assert span.status.canonicalCode == StatusCanonicalCode.ERROR } else { - assert span.status == Status.OK + assert span.status.canonicalCode == StatusCanonicalCode.UNSET } checked.status = true } diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/asserts/TraceAssert.groovy b/testing-common/src/main/groovy/io/opentelemetry/auto/test/asserts/TraceAssert.groovy index 92b4bee8b101..8378ade7f586 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/asserts/TraceAssert.groovy +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/asserts/TraceAssert.groovy @@ -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.auto.test.asserts diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/base/AbstractPromiseTest.groovy b/testing-common/src/main/groovy/io/opentelemetry/auto/test/base/AbstractPromiseTest.groovy index c8424ab53674..5a978a22752c 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/base/AbstractPromiseTest.groovy +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/base/AbstractPromiseTest.groovy @@ -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.auto.test.base diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/base/HttpClientTest.groovy b/testing-common/src/main/groovy/io/opentelemetry/auto/test/base/HttpClientTest.groovy index cf81b0259a7e..951fbc791ba0 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/base/HttpClientTest.groovy +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/base/HttpClientTest.groovy @@ -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.auto.test.base @@ -412,12 +401,12 @@ abstract class HttpClientTest extends AgentTestRunner { def userAgent = userAgent() trace.span(index) { if (parentSpan == null) { - parent() + hasNoParent() } else { childOf((SpanData) parentSpan) } - operationName expectedOperationName(method) - spanKind CLIENT + name expectedOperationName(method) + kind CLIENT errored exception != null if (exception) { errorEvent(exception.class, exception.message) @@ -442,11 +431,11 @@ abstract class HttpClientTest extends AgentTestRunner { void serverSpan(TraceAssert traces, int index, Object parentSpan = null) { traces.span(index) { - operationName "test-http-server" - spanKind SERVER + name "test-http-server" + kind SERVER errored false if (parentSpan == null) { - parent() + hasNoParent() } else { childOf((SpanData) parentSpan) } diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/base/HttpServerTest.groovy b/testing-common/src/main/groovy/io/opentelemetry/auto/test/base/HttpServerTest.groovy index 5541386a3fc8..4a7a7f2e4c35 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/base/HttpServerTest.groovy +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/base/HttpServerTest.groovy @@ -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.auto.test.base @@ -23,7 +12,6 @@ import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.PATH import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.QUERY_PARAM import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.REDIRECT import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.SUCCESS -import static io.opentelemetry.auto.test.utils.ConfigUtils.withConfigOverride import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace import static org.junit.Assume.assumeTrue @@ -269,9 +257,7 @@ abstract class HttpServerTest extends AgentTestRunner { def "test tag query string for #endpoint"() { setup: def request = request(endpoint, method, body).build() - Response response = withConfigOverride("http.server.tag.query-string", "true") { - client.newCall(request).execute() - } + Response response = client.newCall(request).execute() expect: response.code() == endpoint.status @@ -428,7 +414,7 @@ abstract class HttpServerTest extends AgentTestRunner { void controllerSpan(TraceAssert trace, int index, Object parent, String errorMessage = null) { trace.span(index) { - operationName "controller" + name "controller" errored errorMessage != null if (errorMessage) { errorEvent(Exception, errorMessage) @@ -456,14 +442,14 @@ abstract class HttpServerTest extends AgentTestRunner { // parent span must be cast otherwise it breaks debugging classloading (junit loads it early) void serverSpan(TraceAssert trace, int index, String traceID = null, String parentID = null, String method = "GET", Long responseContentLength = null, ServerEndpoint endpoint = SUCCESS) { trace.span(index) { - operationName expectedServerSpanName(method, endpoint) - spanKind Span.Kind.SERVER // can't use static import because of SERVER type parameter + name expectedServerSpanName(method, endpoint) + kind Span.Kind.SERVER // can't use static import because of SERVER type parameter errored endpoint.errored if (parentID != null) { traceId traceID - parentId parentID + parentSpanId parentID } else { - parent() + hasNoParent() } if (endpoint == EXCEPTION && !hasHandlerSpan()) { event(0) { diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/log/events/LogEventsTestBase.groovy b/testing-common/src/main/groovy/io/opentelemetry/auto/test/log/events/LogEventsTestBase.groovy deleted file mode 100644 index ec36e205e25b..000000000000 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/log/events/LogEventsTestBase.groovy +++ /dev/null @@ -1,111 +0,0 @@ -/* - * 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. - */ - -package io.opentelemetry.auto.test.log.events - -import static io.opentelemetry.auto.test.utils.ConfigUtils.withConfigOverride -import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace - -import io.opentelemetry.auto.test.AgentTestRunner -import io.opentelemetry.instrumentation.api.config.Config -import spock.lang.Unroll - -/** - * This class represents the standard test cases that new logging library integrations MUST - * satisfy in order to support log events. - */ -@Unroll -abstract class LogEventsTestBase extends AgentTestRunner { - - abstract Object createLogger(String name) - - String warn() { - return "warn" - } - - String error() { - return "error" - } - - def "capture #testMethod (#capture)"() { - setup: - runUnderTrace("test") { - def logger = createLogger("abc") - withConfigOverride(Config.EXPERIMENTAL_LOG_CAPTURE_THRESHOLD, "WARN") { - logger."$testMethod"("xyz") - } - } - - expect: - assertTraces(1) { - trace(0, capture ? 2 : 1) { - span(0) { - operationName "test" - } - if (capture) { - span(1) { - operationName "log.message" - attributes { - "message" "xyz" - "level" testMethod.toUpperCase() - "loggerName" "abc" - } - } - } - } - } - - where: - testMethod | capture - "info" | false - warn() | true - error() | true - } - - def "capture #testMethod (#capture) as span when no current span"() { - when: - def logger = createLogger("abc") - withConfigOverride(Config.EXPERIMENTAL_LOG_CAPTURE_THRESHOLD, "WARN") { - logger."$testMethod"("xyz") - } - - then: - if (capture) { - assertTraces(1) { - trace(0, 1) { - span(0) { - operationName "log.message" - attributes { - "message" "xyz" - "level" testMethod.toUpperCase() - "loggerName" "abc" - } - } - } - } - } else { - Thread.sleep(500) // sleep a bit just to make sure no span is captured - assertTraces(0) { - } - } - - where: - testMethod | capture - "info" | false - warn() | true - error() | true - } -} diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/server/http/TestHttpServer.groovy b/testing-common/src/main/groovy/io/opentelemetry/auto/test/server/http/TestHttpServer.groovy index 90626a67e7b0..85384ecccc0b 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/server/http/TestHttpServer.groovy +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/server/http/TestHttpServer.groovy @@ -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.auto.test.server.http @@ -125,10 +114,10 @@ class TestHttpServer implements AutoCloseable { static distributedRequestSpan(TraceAssert trace, int index, SpanData parentSpan = null) { trace.span(index) { - operationName "test-http-server" + name "test-http-server" errored false if (parentSpan == null) { - parent() + hasNoParent() } else { childOf(parentSpan) } diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/ClasspathUtils.java b/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/ClasspathUtils.java index 2435efd5cd12..2afc1f545f5d 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/ClasspathUtils.java +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/ClasspathUtils.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.auto.test.utils; diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/ConfigUtils.groovy b/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/ConfigUtils.groovy index 6e967f915ea5..fb943f746f94 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/ConfigUtils.groovy +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/ConfigUtils.groovy @@ -1,67 +1,65 @@ /* * 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.auto.test.utils import io.opentelemetry.auto.test.AgentTestRunner import io.opentelemetry.instrumentation.api.config.Config -import io.opentelemetry.javaagent.tooling.config.ConfigBuilder +import io.opentelemetry.javaagent.tooling.config.AgentConfigBuilder import io.opentelemetry.javaagent.tooling.config.ConfigInitializer -import java.util.concurrent.Callable +import java.util.function.Consumer +/** + * This class provides utility methods for changing {@link Config} values during tests. + */ class ConfigUtils { - synchronized static Object withConfigOverride(final String name, final String value, final Callable r) { - try { - def existingConfig = Config.get() - Properties properties = new Properties() - properties.put(name, value) - setConfig(new ConfigBuilder() - .readProperties(existingConfig.asJavaProperties()) - .readProperties(properties) - .build()) - assert Config.get() != existingConfig - try { - return r.call() - } finally { - setConfig(existingConfig) - } - } catch (Throwable t) { - throw ExceptionUtils.sneakyThrow(t) - } - } - /** - * Provides an callback to set up the testing environment and reset the global configuration after system properties and envs are set. + * Same as {@link #updateConfig(java.util.function.Consumer)}, but resets the instrumentation + * afterwards. {@link AgentTestRunner#setupBeforeTests()} will re-apply the instrumentation once + * again, but this time it'll use the modified config. + * + * It is suggested to call this method in a {@code static} block so that it evaluates before + * {@code @BeforeClass}-annotated methods. + * + * @return Previous configuration. */ - static updateConfig(final Callable r) { - r.call() - resetConfig() + synchronized static Config updateConfigAndResetInstrumentation(Consumer configModifications) { + def previousConfig = updateConfig(configModifications) AgentTestRunner.resetInstrumentation() + return previousConfig } /** - * Reset the global configuration. Please note that Runtime ID is preserved to the pre-existing value. + * Allows the caller to modify (add property, remove property, etc) currently used configuration + * and then sets the current {@link Config#INSTANCE} singleton value to the modified config. + * + * @return Previous configuration. */ - static void resetConfig() { - setConfig(Config.DEFAULT) - ConfigInitializer.initialize() + synchronized static Config updateConfig(Consumer configModifications) { + def properties = Config.get().asJavaProperties() + configModifications.accept(properties) + + def newConfig = new AgentConfigBuilder() + .readProperties(properties) + .build() + return setConfig(newConfig) } - private static setConfig(Config config) { + /** + * Sets {@link Config#INSTANCE} singleton value. + * + * @return Previous configuration. + */ + synchronized static Config setConfig(Config config) { + def previous = Config.get() Config.INSTANCE = config + return previous + } + + synchronized static initializeConfig() { + ConfigInitializer.initialize() } } diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/ExceptionUtils.java b/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/ExceptionUtils.java index ac6ecf8aaaea..16eb53192ecc 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/ExceptionUtils.java +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/ExceptionUtils.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.auto.test.utils; diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/OkHttpUtils.java b/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/OkHttpUtils.java index 8422ac2e454d..edab8be5abf4 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/OkHttpUtils.java +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/OkHttpUtils.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.auto.test.utils; diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/PortUtils.java b/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/PortUtils.java index 1deb558e2f32..43a25d00b0f3 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/PortUtils.java +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/PortUtils.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.auto.test.utils; diff --git a/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/TraceUtils.groovy b/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/TraceUtils.groovy index db8df92ec13d..15410995a516 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/TraceUtils.groovy +++ b/testing-common/src/main/groovy/io/opentelemetry/auto/test/utils/TraceUtils.groovy @@ -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.auto.test.utils @@ -81,11 +70,11 @@ class TraceUtils { static basicSpan(TraceAssert trace, int index, String operation, Object parentSpan = null, Throwable exception = null) { trace.span(index) { if (parentSpan == null) { - parent() + hasNoParent() } else { childOf((SpanData) parentSpan) } - operationName operation + name operation errored exception != null if (exception) { errorEvent(exception.class, exception.message) diff --git a/testing-common/src/main/java/io/opentelemetry/auto/test/server/http/HttpServletRequestExtractAdapter.java b/testing-common/src/main/java/io/opentelemetry/auto/test/server/http/HttpServletRequestExtractAdapter.java index 7d00d46979b0..94c4a52889df 100644 --- a/testing-common/src/main/java/io/opentelemetry/auto/test/server/http/HttpServletRequestExtractAdapter.java +++ b/testing-common/src/main/java/io/opentelemetry/auto/test/server/http/HttpServletRequestExtractAdapter.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.auto.test.server.http; diff --git a/testing-common/src/test/groovy/AgentTestRunnerTest.groovy b/testing-common/src/test/groovy/AgentTestRunnerTest.groovy index d38fa343abdd..6901c7727134 100644 --- a/testing-common/src/test/groovy/AgentTestRunnerTest.groovy +++ b/testing-common/src/test/groovy/AgentTestRunnerTest.groovy @@ -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 */ import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace @@ -28,16 +17,19 @@ class AgentTestRunnerTest extends AgentTestRunner { private static final ClassLoader BOOTSTRAP_CLASSLOADER = null private static final boolean AGENT_INSTALLED_IN_CLINIT - static { - ConfigUtils.updateConfig { - System.setProperty( - "otel.trace.classes.exclude", - "config.exclude.packagename.*, config.exclude.SomeClass,config.exclude.SomeClass\$NestedClass") - } + static final PREVIOUS_CONFIG = ConfigUtils.updateConfig { + it.setProperty("otel.trace.classes.exclude", + "config.exclude.packagename.*, config.exclude.SomeClass,config.exclude.SomeClass\$NestedClass") + } + static { AGENT_INSTALLED_IN_CLINIT = getAgentTransformer() != null } + def cleanupSpec() { + ConfigUtils.setConfig(PREVIOUS_CONFIG) + } + def "classpath setup"() { setup: final List bootstrapClassesIncorrectlyLoaded = [] @@ -95,7 +87,7 @@ class AgentTestRunnerTest extends AgentTestRunner { assertTraces(1) { trace(0, 1) { span(0) { - operationName "parent" + name "parent" } } } @@ -118,11 +110,11 @@ class AgentTestRunnerTest extends AgentTestRunner { assertTraces(1) { trace(0, 2) { span(0) { - operationName "parent" - parent() + name "parent" + hasNoParent() } span(1) { - operationName "child" + name "child" childOf span(0) } } diff --git a/testing-common/src/test/groovy/InstrumentOldBytecode.groovy b/testing-common/src/test/groovy/InstrumentOldBytecode.groovy index 2fa3ffcbf412..bee01c6f06ea 100644 --- a/testing-common/src/test/groovy/InstrumentOldBytecode.groovy +++ b/testing-common/src/test/groovy/InstrumentOldBytecode.groovy @@ -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 */ import com.ibm.as400.resource.ResourceLevel diff --git a/testing-common/src/test/groovy/context/FieldBackedProviderTest.groovy b/testing-common/src/test/groovy/context/FieldBackedProviderTest.groovy index a8803bae2a8c..bf3ff941a4e5 100644 --- a/testing-common/src/test/groovy/context/FieldBackedProviderTest.groovy +++ b/testing-common/src/test/groovy/context/FieldBackedProviderTest.groovy @@ -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 context diff --git a/testing-common/src/test/groovy/muzzle/HelperReferenceWrapperTest.groovy b/testing-common/src/test/groovy/muzzle/HelperReferenceWrapperTest.groovy index 0c8d098bc227..580067b53f96 100644 --- a/testing-common/src/test/groovy/muzzle/HelperReferenceWrapperTest.groovy +++ b/testing-common/src/test/groovy/muzzle/HelperReferenceWrapperTest.groovy @@ -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 muzzle diff --git a/testing-common/src/test/groovy/muzzle/ReferenceCreatorTest.groovy b/testing-common/src/test/groovy/muzzle/ReferenceCreatorTest.groovy index 87dfee78c324..eebe30aa1ba0 100644 --- a/testing-common/src/test/groovy/muzzle/ReferenceCreatorTest.groovy +++ b/testing-common/src/test/groovy/muzzle/ReferenceCreatorTest.groovy @@ -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 muzzle diff --git a/testing-common/src/test/groovy/muzzle/ReferenceMatcherTest.groovy b/testing-common/src/test/groovy/muzzle/ReferenceMatcherTest.groovy index b2aca78d05c0..632dc7fd36e8 100644 --- a/testing-common/src/test/groovy/muzzle/ReferenceMatcherTest.groovy +++ b/testing-common/src/test/groovy/muzzle/ReferenceMatcherTest.groovy @@ -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 muzzle diff --git a/testing-common/src/test/groovy/server/ServerTest.groovy b/testing-common/src/test/groovy/server/ServerTest.groovy index ba0b10cdd206..6caa57ceb4b4 100644 --- a/testing-common/src/test/groovy/server/ServerTest.groovy +++ b/testing-common/src/test/groovy/server/ServerTest.groovy @@ -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 server diff --git a/testing-common/src/test/java/IBMResourceLevelInstrumentation.java b/testing-common/src/test/java/IBMResourceLevelInstrumentation.java index 396a86d033a4..c164012fe43b 100644 --- a/testing-common/src/test/java/IBMResourceLevelInstrumentation.java +++ b/testing-common/src/test/java/IBMResourceLevelInstrumentation.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 */ import static java.util.Collections.singletonMap; diff --git a/testing-common/src/test/java/config/exclude/SomeClass.java b/testing-common/src/test/java/config/exclude/SomeClass.java index f9c7e5bf6cda..688f6f20b1f4 100644 --- a/testing-common/src/test/java/config/exclude/SomeClass.java +++ b/testing-common/src/test/java/config/exclude/SomeClass.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 config.exclude; diff --git a/testing-common/src/test/java/config/exclude/packagename/SomeClass.java b/testing-common/src/test/java/config/exclude/packagename/SomeClass.java index 4440f58b8e3f..570d3c383f8d 100644 --- a/testing-common/src/test/java/config/exclude/packagename/SomeClass.java +++ b/testing-common/src/test/java/config/exclude/packagename/SomeClass.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 config.exclude.packagename; diff --git a/testing-common/src/test/java/context/ContextTestInstrumentation.java b/testing-common/src/test/java/context/ContextTestInstrumentation.java index dc9f7b9f1b2d..6c1a0d386d63 100644 --- a/testing-common/src/test/java/context/ContextTestInstrumentation.java +++ b/testing-common/src/test/java/context/ContextTestInstrumentation.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 context; diff --git a/testing-common/src/test/java/io/opentelemetry/instrumentation/TestHelperClasses.java b/testing-common/src/test/java/io/opentelemetry/instrumentation/TestHelperClasses.java index e8baad5c7a1c..21959561a533 100644 --- a/testing-common/src/test/java/io/opentelemetry/instrumentation/TestHelperClasses.java +++ b/testing-common/src/test/java/io/opentelemetry/instrumentation/TestHelperClasses.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; diff --git a/testing-common/src/test/java/muzzle/HelperReferenceWrapperTestClasses.java b/testing-common/src/test/java/muzzle/HelperReferenceWrapperTestClasses.java index 5aac74e4f628..652dc4c62e73 100644 --- a/testing-common/src/test/java/muzzle/HelperReferenceWrapperTestClasses.java +++ b/testing-common/src/test/java/muzzle/HelperReferenceWrapperTestClasses.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 muzzle; diff --git a/testing-common/src/test/java/muzzle/MuzzleWeakReferenceTest.java b/testing-common/src/test/java/muzzle/MuzzleWeakReferenceTest.java index 15e0279ffe56..f8f4ee2615ed 100644 --- a/testing-common/src/test/java/muzzle/MuzzleWeakReferenceTest.java +++ b/testing-common/src/test/java/muzzle/MuzzleWeakReferenceTest.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 muzzle; diff --git a/testing-common/src/test/java/muzzle/TestClasses.java b/testing-common/src/test/java/muzzle/TestClasses.java index 6e3c750624c5..62720b5ce98d 100644 --- a/testing-common/src/test/java/muzzle/TestClasses.java +++ b/testing-common/src/test/java/muzzle/TestClasses.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 muzzle; diff --git a/utils/test-utils/src/main/java/io/opentelemetry/auto/util/gc/GCUtils.java b/utils/test-utils/src/main/java/io/opentelemetry/auto/util/gc/GCUtils.java index b549fe2304a9..53db4d4989f8 100644 --- a/utils/test-utils/src/main/java/io/opentelemetry/auto/util/gc/GCUtils.java +++ b/utils/test-utils/src/main/java/io/opentelemetry/auto/util/gc/GCUtils.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.auto.util.gc;