diff --git a/.github/workflows/benchmark-tags.yml b/.github/workflows/benchmark-tags.yml index f43fda3bef3..124651823fb 100644 --- a/.github/workflows/benchmark-tags.yml +++ b/.github/workflows/benchmark-tags.yml @@ -13,7 +13,7 @@ jobs: name: Benchmark SDK runs-on: oracle-bare-metal-64cpu-1024gb-x86-64-ubuntu-24 container: - image: ubuntu:26.04@sha256:3131b4cc82a783df6c9df078f86e01819a13594b865c2cad47bd1bca2b7063bb + image: ubuntu:26.04@sha256:678c6550cc43645e08669028bc177f50be4e7c5b8cca677067b1914d4afc7a03 timeout-minutes: 20 # since there is only a single bare metal runner across all repos strategy: fail-fast: false @@ -28,13 +28,13 @@ jobs: - id: setup-java name: Set up Java for build - uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 + uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 with: distribution: temurin java-version: 21 - name: Set up gradle - uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0 + uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 - name: Run jmh run: ./gradlew jmhJar env: diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 258a22c2f9d..89ff69f63d9 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -16,7 +16,7 @@ jobs: name: Benchmark SDK runs-on: oracle-bare-metal-64cpu-1024gb-x86-64-ubuntu-24 container: - image: ubuntu:26.04@sha256:3131b4cc82a783df6c9df078f86e01819a13594b865c2cad47bd1bca2b7063bb + image: ubuntu:26.04@sha256:678c6550cc43645e08669028bc177f50be4e7c5b8cca677067b1914d4afc7a03 timeout-minutes: 120 # since there is only a single bare metal runner across all repos steps: - name: Install Git @@ -31,13 +31,13 @@ jobs: - id: setup-java name: Set up Java for build - uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 + uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 with: distribution: temurin java-version: 21 - name: Set up gradle - uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0 + uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 - name: Run jmh run: ./gradlew jmhJar env: diff --git a/.github/workflows/build-daily.yml b/.github/workflows/build-daily.yml index 15f3f8c03f1..0b0b97c9d55 100644 --- a/.github/workflows/build-daily.yml +++ b/.github/workflows/build-daily.yml @@ -22,13 +22,13 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Set up Java - uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 + uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 with: distribution: temurin java-version: 21 - name: Set up gradle - uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0 + uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 - name: Publish to Sonatype run: ./gradlew assemble publishToSonatype diff --git a/.github/workflows/build-tracecontext-testsuite.yml b/.github/workflows/build-tracecontext-testsuite.yml index de7586806a6..aefa81a86bd 100644 --- a/.github/workflows/build-tracecontext-testsuite.yml +++ b/.github/workflows/build-tracecontext-testsuite.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Login to GitHub package registry - uses: docker/login-action@371161bbe7024a29a25c5e19bfcbc0804fe9ad2c # v4.5.2 + uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 with: registry: ghcr.io username: ${{ github.repository_owner }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aef1339eef9..25acff015e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,11 +31,12 @@ jobs: - 11 - 17 - 21 + - 25 - 26 # renovate(java-version) # Collect coverage on latest LTS include: - os: ubuntu-latest - test-java-version: 21 + test-java-version: 25 coverage: true jmh-based-tests: true steps: @@ -43,7 +44,7 @@ jobs: - id: setup-java-test name: Set up Java ${{ matrix.test-java-version }} for tests - uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 + uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 with: # using zulu for 26 because new releases get published quickly distribution: zulu @@ -51,13 +52,13 @@ jobs: - id: setup-java name: Set up Java for build - uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 + uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 with: distribution: temurin java-version: 21 - name: Set up gradle - uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0 + uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 - name: Build run: > ./gradlew build diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c59bd531bef..4f74db1b12b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -35,17 +35,17 @@ jobs: - name: Set up Java 21 if: matrix.language == 'java' - uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 + uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 with: distribution: temurin java-version: 21 - name: Set up gradle if: matrix.language == 'java' - uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0 + uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 - name: Initialize CodeQL - uses: github/codeql-action/init@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 + uses: github/codeql-action/init@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 with: languages: ${{ matrix.language }} # using "linked" helps to keep up with the latest Kotlin support @@ -62,7 +62,7 @@ jobs: DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} - name: Perform CodeQL analysis - uses: github/codeql-action/analyze@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 + uses: github/codeql-action/analyze@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml index 5eb702bacbf..c1ec5b7ea7e 100644 --- a/.github/workflows/gradle-wrapper-validation.yml +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -14,4 +14,4 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 # this needs to be in its own workflow in order to make OSSF scorecard happy - - uses: gradle/actions/wrapper-validation@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0 + - uses: gradle/actions/wrapper-validation@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 diff --git a/.github/workflows/javadoc-crawler.yml b/.github/workflows/javadoc-crawler.yml index 886cc7cee3f..a4ef63579e7 100644 --- a/.github/workflows/javadoc-crawler.yml +++ b/.github/workflows/javadoc-crawler.yml @@ -15,13 +15,13 @@ jobs: steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 + - uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 with: distribution: temurin java-version: 21 - name: Set up gradle - uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0 + uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 - name: Run crawler run: ./gradlew :javadoc-crawler:crawl diff --git a/.github/workflows/ossf-scorecard.yml b/.github/workflows/ossf-scorecard.yml index c36df2a374b..f38713eb78d 100644 --- a/.github/workflows/ossf-scorecard.yml +++ b/.github/workflows/ossf-scorecard.yml @@ -44,7 +44,7 @@ jobs: # Upload the results to GitHub's code scanning dashboard (optional). # Commenting out will disable upload of results to your repo's Code Scanning dashboard - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 + uses: github/codeql-action/upload-sarif@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 with: sarif_file: results.sarif diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2f1de71af56..4ae73d35c52 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,13 +23,13 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 + - uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 with: distribution: temurin java-version: 21 - name: Set up gradle - uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0 + uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 - name: Build and publish artifacts run: ./gradlew assemble publishToSonatype closeAndReleaseSonatypeStagingRepository @@ -182,13 +182,13 @@ jobs: done - name: Set up JDK for running Gradle - uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 + uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 with: distribution: temurin java-version: 21 - name: Set up Gradle - uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0 + uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 - name: Update apidiff baseline env: diff --git a/.github/workflows/reusable-link-check.yml b/.github/workflows/reusable-link-check.yml index 09f9b4bd61d..61e297a7343 100644 --- a/.github/workflows/reusable-link-check.yml +++ b/.github/workflows/reusable-link-check.yml @@ -14,7 +14,7 @@ jobs: with: fetch-depth: 0 # needed for merge-base used in modified-files mode - - uses: jdx/mise-action@9e7f7633ff6f6d6048a9418a68d48f288f50eb14 # v4.2.3 + - uses: jdx/mise-action@7e36c90d9ab29c415a2384db3006f3ec8a8cc654 # v4.2.4 - name: Link check for pull requests if: github.event_name == 'pull_request' diff --git a/.github/workflows/sonatype-guide-dependency-audit-daily.yml b/.github/workflows/sonatype-guide-dependency-audit-daily.yml index 2f0334bff80..0c5c2448c5f 100644 --- a/.github/workflows/sonatype-guide-dependency-audit-daily.yml +++ b/.github/workflows/sonatype-guide-dependency-audit-daily.yml @@ -18,13 +18,13 @@ jobs: steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 + - uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 with: distribution: temurin java-version: 21 - name: Set up gradle - uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0 + uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 # --no-parallel is needed to avoid OverlappingFileLockException on the shared OSS Index cache - run: ./gradlew ossIndexAudit --no-configuration-cache --no-parallel --info diff --git a/CHANGELOG.md b/CHANGELOG.md index cf04a42f4d9..0e1687e75c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,19 +2,132 @@ ## Unreleased +## Version 1.65.0 (2026-08-07) + +**NOTE:** The `opentelemetry-exporter-zipkin` artifact has stopped being published. It was +deprecated in a prior release. Users should migrate to OTLP or use a Zipkin-compatible collector +exporter. + ### API +* Ignore empty baggage keys in `ImmutableBaggage.put` + ([#8658](https://github.com/open-telemetry/opentelemetry-java/pull/8658)) +* Use `NumberFormatException` in baggage decoder + ([#8593](https://github.com/open-telemetry/opentelemetry-java/pull/8593)) * Fix `TraceStateBuilder.remove` corrupting the builder when the same key is removed twice ([#8613](https://github.com/open-telemetry/opentelemetry-java/pull/8613)) +#### Incubating + +* Add bound instrument APIs (`BoundLongCounter`, `BoundDoubleCounter`, `BoundLongHistogram`, + `BoundDoubleHistogram`, `BoundLongUpDownCounter`, `BoundDoubleUpDownCounter`, `BoundLongGauge`, + `BoundDoubleGauge`) to the incubator metrics API + ([#8527](https://github.com/open-telemetry/opentelemetry-java/pull/8527)) + +#### Extensions + +* Trace propagators: Fix `JaegerPropagator` baggage header key case sensitivity + ([#8496](https://github.com/open-telemetry/opentelemetry-java/pull/8496)) +* Trace propagators: Do not overwrite existing baggage with empty baggage in `JaegerPropagator` + ([#8632](https://github.com/open-telemetry/opentelemetry-java/pull/8632)) +* Trace propagators: Skip empty baggage keys in `OtTracePropagator` extract + ([#8631](https://github.com/open-telemetry/opentelemetry-java/pull/8631)) +* Trace propagators: Stop parsing a `jaeger-baggage` header after 64 tokens, including malformed + tokens ([#8702](https://github.com/open-telemetry/opentelemetry-java/pull/8702)) + ### SDK +* Update SDK attributes implementation (`AttributesMap`) to enforce last-value-win semantics based + on string value of `AttributeKey.getKey()` + ([#8548](https://github.com/open-telemetry/opentelemetry-java/pull/8548)) + +#### Traces + +* Add `Sampler` shutdown lifecycle: `Sampler` now extends `Closeable` and exposes a default + `shutdown()` invoked when the `SdkTracerProvider` is shut down; `JaegerRemoteSampler` implements + it to stop its polling executor + ([#8574](https://github.com/open-telemetry/opentelemetry-java/pull/8574)) + +#### Metrics + +* Gate `PeriodicMetricReader` self-observability metrics by internal telemetry version + ([#8597](https://github.com/open-telemetry/opentelemetry-java/pull/8597)) +* Record `error.type` on failed collections in `PeriodicMetricReader` + ([#8650](https://github.com/open-telemetry/opentelemetry-java/pull/8650)) +* Testing: Fix `LongExemplarAssert.hasFilteredAttributesSatisfyingExactly` to enforce exact + attribute matching + ([#8518](https://github.com/open-telemetry/opentelemetry-java/pull/8518)) + +#### Logs + +* Fix `ReadWriteLogRecord` default `getObservedTimestampEpochNanos` returning the record timestamp + ([#8504](https://github.com/open-telemetry/opentelemetry-java/pull/8504)) + +#### Profiles + +* Fix profiles data model attribute count parameter name and timestamp doc unit + ([#8514](https://github.com/open-telemetry/opentelemetry-java/pull/8514)) + #### Exporters +* **WARNING** Zipkin: Delete `opentelemetry-exporter-zipkin`; the artifact is no longer published + ([#8677](https://github.com/open-telemetry/opentelemetry-java/pull/8677)) +* OTLP: Use HTTP error response bodies in `HttpExporter` warning logs + ([#8428](https://github.com/open-telemetry/opentelemetry-java/pull/8428)) +* OTLP: Fix `OkHttpHttpSender` mTLS when using the platform default trust store + ([#8565](https://github.com/open-telemetry/opentelemetry-java/pull/8565)) +* OTLP: Fix sign extension on `LogRecord` flags in the low-allocation log marshaler + ([#8493](https://github.com/open-telemetry/opentelemetry-java/pull/8493)) +* OTLP: Standardize `OkHttpHttpSender`, `JdkHttpSender`, and `UpstreamGrpcSender` shutdown to + await executor/channel termination + ([#8495](https://github.com/open-telemetry/opentelemetry-java/pull/8495), + [#8627](https://github.com/open-telemetry/opentelemetry-java/pull/8627), + [#8624](https://github.com/open-telemetry/opentelemetry-java/pull/8624)) +* OTLP: Log the underlying except/ion when a gRPC response frame is invalid + ([#8626](https://github.com/open-telemetry/opentelemetry-java/pull/8626)) +* OTLP: Avoid the unsafe string encoder on Android + ([#8637](https://github.com/open-telemetry/opentelemetry-java/pull/8637)) +* Prometheus: Merge colliding Prometheus label values + ([#8364](https://github.com/open-telemetry/opentelemetry-java/pull/8364)) * Prometheus: Fix `PrometheusHttpServer.toBuilder()` dropping the configured default handler ([#8619](https://github.com/open-telemetry/opentelemetry-java/pull/8619)) * Logging: Output event name in `SystemOutLogRecordExporter` ([#8609](https://github.com/open-telemetry/opentelemetry-java/pull/8609)) +* Logging: Include aggregation temporality in `LoggingMetricExporter` `toString` + ([#8623](https://github.com/open-telemetry/opentelemetry-java/pull/8623)) + +#### Extensions + +* Autoconfigure: Avoid exposing configuration values in error messages + ([#8669](https://github.com/open-telemetry/opentelemetry-java/pull/8669)) +* Declarative config: Fix Jaeger sampler polling interval configuration + ([#8668](https://github.com/open-telemetry/opentelemetry-java/pull/8668)) +* Declarative config: Remove duplicate `getStringList` resolver in `DeclarativeConfigPropertyUtil` + ([#8572](https://github.com/open-telemetry/opentelemetry-java/pull/8572)) +* Declarative config: Replace `jsonschema2pojo` with a hand-rolled POJO generator + ([#8600](https://github.com/open-telemetry/opentelemetry-java/pull/8600)) +* Incubator: Restore compliance between composite samplers code and the spec + ([#8450](https://github.com/open-telemetry/opentelemetry-java/pull/8450)) + +### Shims + +* **DEPRECATION** Deprecate the OpenCensus shim public API + ([#8674](https://github.com/open-telemetry/opentelemetry-java/pull/8674)) +* OpenCensus: Preserve OpenCensus status description when converting to OpenTelemetry + ([#8511](https://github.com/open-telemetry/opentelemetry-java/pull/8511)) +* OpenCensus: Add links to the OpenTelemetry span instead of logging a warning and dropping them + ([#8635](https://github.com/open-telemetry/opentelemetry-java/pull/8635)) +* OpenTracing: Return `null` from `TracerShim` extract when the carrier has no span context + ([#8505](https://github.com/open-telemetry/opentelemetry-java/pull/8505)) +* OpenTracing: Return the extracted `SpanContext` when it is sampled but invalid + ([#8634](https://github.com/open-telemetry/opentelemetry-java/pull/8634)) + +### Project tooling + +* Pin japicmp baseline in `version.gradle.kts` + ([#8591](https://github.com/open-telemetry/opentelemetry-java/pull/8591)) +* Update contributing guide in response to feedback + ([#8655](https://github.com/open-telemetry/opentelemetry-java/pull/8655)) ## Version 1.64.0 (2026-07-10) diff --git a/README.md b/README.md index 311bfd7a294..372a1d90d8a 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,6 @@ SDK exporters for shipping traces, metrics, and logs out of process. | [OTLP Logging Exporters](./exporters/logging-otlp) | Logging exporters in OTLP JSON encoding, including traces, metrics, and logs | `opentelemetry-exporter-logging-otlp` | 1.64.0 | [](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-logging-otlp) | | [OTLP Common](./exporters/otlp/common) | Shared OTLP components (internal) | `opentelemetry-exporter-otlp-common` | 1.64.0 | [](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-otlp-common) | | [Logging Exporter](./exporters/logging) | Logging exporters, including metrics, traces, and logs | `opentelemetry-exporter-logging` | 1.64.0 | [](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-logging) | -| [Zipkin Exporter](./exporters/zipkin) | **DEPRECATED** Zipkin trace exporter | `opentelemetry-exporter-zipkin` | 1.64.0 | [](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-zipkin) | | [Prometheus Exporter](./exporters/prometheus) | Prometheus metric exporter | `opentelemetry-exporter-prometheus` | 1.64.0-alpha | [](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-prometheus) | | [Exporter Common](./exporters/common) | Shared exporter components (internal) | `opentelemetry-exporter-common` | 1.64.0 | [](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-common) | | [OkHttp Sender](./exporters/sender/okhttp) | OkHttp implementation of HttpSender (internal) | `opentelemetry-exporter-sender-okhttp` | 1.64.0 | [](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-sender-okhttp) | @@ -142,7 +141,7 @@ Shims for bridging data from one observability library to another. | Component | Description | Artifact ID | Version | Javadoc | |----------------------------------------|--------------------------------------------------------------|----------------------------------|-------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| [OpenCensus Shim](./opencensus-shim) | Bridge opencensus metrics into the OpenTelemetry metrics SDK | `opentelemetry-opencensus-shim` | 1.64.0-alpha | [](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-opencensus-shim) | +| [OpenCensus Shim](./opencensus-shim) | **DEPRECATED** Bridge opencensus metrics into the OpenTelemetry metrics SDK | `opentelemetry-opencensus-shim` | 1.64.0-alpha | [](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-opencensus-shim) | | [OpenTracing Shim](./opentracing-shim) | **DEPRECATED** Bridge opentracing spans into the OpenTelemetry trace API | `opentelemetry-opentracing-shim` | 1.64.0 | [](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-opentracing-shim) | diff --git a/dependencyManagement/build.gradle.kts b/dependencyManagement/build.gradle.kts index 092909c5743..bf414902e86 100644 --- a/dependencyManagement/build.gradle.kts +++ b/dependencyManagement/build.gradle.kts @@ -31,11 +31,9 @@ val DEPENDENCY_BOMS = listOf( "com.google.guava:guava-bom:33.6.0-jre", "com.google.protobuf:protobuf-bom:4.35.1", "com.squareup.okhttp3:okhttp-bom:$okhttpVersion", - "com.squareup.okio:okio-bom:3.18.0", // applies to transitive dependencies of okhttp - "io.grpc:grpc-bom:1.83.0", + "com.squareup.okio:okio-bom:3.18.1", // applies to transitive dependencies of okhttp + "io.grpc:grpc-bom:1.83.1", "io.netty:netty-bom:4.2.16.Final", - "io.zipkin.brave:brave-bom:6.3.1", - "io.zipkin.reporter2:zipkin-reporter-bom:3.5.3", "org.assertj:assertj-bom:3.27.7", "org.osgi:org.osgi.test.bom:1.3.0", "org.testcontainers:testcontainers-bom:2.0.5", @@ -74,12 +72,12 @@ val DEPENDENCIES = listOf( "io.prometheus:prometheus-metrics-exposition-formats-no-protobuf:${prometheusServerVersion}", "javax.annotation:javax.annotation-api:1.3.2", "com.github.stefanbirkner:system-rules:1.19.0", - "com.google.api.grpc:proto-google-common-protos:2.73.0", + "com.google.api.grpc:proto-google-common-protos:2.74.0", "com.google.code.findbugs:jsr305:3.0.2", "com.google.guava:guava-beta-checker:1.0", "com.sun.net.httpserver:http:20070405", "com.squareup.okhttp3:okhttp:$okhttpVersion", - "com.tngtech.archunit:archunit-junit5:1.4.2", + "com.tngtech.archunit:archunit-junit5:1.5.0", "com.uber.nullaway:nullaway:0.13.8", "edu.berkeley.cs.jqf:jqf-fuzz:1.7", // jqf-fuzz version 1.8+ requires Java 11+ "eu.rekawek.toxiproxy:toxiproxy-java:2.1.11", @@ -92,10 +90,7 @@ val DEPENDENCIES = listOf( "io.opentelemetry.proto:opentelemetry-proto:1.11.0-alpha", "io.opentracing:opentracing-api:0.33.0", "io.opentracing:opentracing-noop:0.33.0", - // zipkin-reporter-bom depends on zipkin v2.x for java 6 compatibility - // we only need java 8 compatibility. upgrade to 3.x to avoid problematic shaded gson dependency version - // See: https://github.com/open-telemetry/opentelemetry-java/issues/8427 - "io.zipkin.zipkin2:zipkin:3.6.1", + "io.zipkin.brave:brave:6.3.1", "junit:junit:4.13.2", "nl.jqno.equalsverifier:equalsverifier:3.19.4", "org.apache.aries.spifly:org.apache.aries.spifly.dynamic.bundle:1.3.7", diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-api.txt b/docs/apidiffs/current_vs_latest/opentelemetry-api.txt index 1826bf86ffb..6fe01816a12 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-api.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-api.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-api-1.65.0-SNAPSHOT.jar against opentelemetry-api-1.64.0.jar +Comparing source compatibility of opentelemetry-api-1.66.0-SNAPSHOT.jar against opentelemetry-api-1.64.0.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-common.txt b/docs/apidiffs/current_vs_latest/opentelemetry-common.txt index f26a0d7020c..2a3fcdb7ae1 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-common.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-common.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-common-1.65.0-SNAPSHOT.jar against opentelemetry-common-1.64.0.jar +Comparing source compatibility of opentelemetry-common-1.66.0-SNAPSHOT.jar against opentelemetry-common-1.64.0.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-context.txt b/docs/apidiffs/current_vs_latest/opentelemetry-context.txt index b068eb401b4..c5059f73a1c 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-context.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-context.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-context-1.65.0-SNAPSHOT.jar against opentelemetry-context-1.64.0.jar +Comparing source compatibility of opentelemetry-context-1.66.0-SNAPSHOT.jar against opentelemetry-context-1.64.0.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-exporter-common.txt b/docs/apidiffs/current_vs_latest/opentelemetry-exporter-common.txt index ba981ccbfbb..d19399ae3d1 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-exporter-common.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-exporter-common.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-exporter-common-1.65.0-SNAPSHOT.jar against opentelemetry-exporter-common-1.64.0.jar +Comparing source compatibility of opentelemetry-exporter-common-1.66.0-SNAPSHOT.jar against opentelemetry-exporter-common-1.64.0.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-exporter-logging-otlp.txt b/docs/apidiffs/current_vs_latest/opentelemetry-exporter-logging-otlp.txt index f85d55a7f9b..6ced3f40cb6 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-exporter-logging-otlp.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-exporter-logging-otlp.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-exporter-logging-otlp-1.65.0-SNAPSHOT.jar against opentelemetry-exporter-logging-otlp-1.64.0.jar +Comparing source compatibility of opentelemetry-exporter-logging-otlp-1.66.0-SNAPSHOT.jar against opentelemetry-exporter-logging-otlp-1.64.0.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-exporter-logging.txt b/docs/apidiffs/current_vs_latest/opentelemetry-exporter-logging.txt index 8fe92da2d2d..4192dd98749 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-exporter-logging.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-exporter-logging.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-exporter-logging-1.65.0-SNAPSHOT.jar against opentelemetry-exporter-logging-1.64.0.jar +Comparing source compatibility of opentelemetry-exporter-logging-1.66.0-SNAPSHOT.jar against opentelemetry-exporter-logging-1.64.0.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-exporter-otlp-common.txt b/docs/apidiffs/current_vs_latest/opentelemetry-exporter-otlp-common.txt index e12d123e6da..651df817180 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-exporter-otlp-common.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-exporter-otlp-common.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-exporter-otlp-common-1.65.0-SNAPSHOT.jar against opentelemetry-exporter-otlp-common-1.64.0.jar +Comparing source compatibility of opentelemetry-exporter-otlp-common-1.66.0-SNAPSHOT.jar against opentelemetry-exporter-otlp-common-1.64.0.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-exporter-otlp.txt b/docs/apidiffs/current_vs_latest/opentelemetry-exporter-otlp.txt index 9c08edf8a45..a0699dd4e07 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-exporter-otlp.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-exporter-otlp.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-exporter-otlp-1.65.0-SNAPSHOT.jar against opentelemetry-exporter-otlp-1.64.0.jar +Comparing source compatibility of opentelemetry-exporter-otlp-1.66.0-SNAPSHOT.jar against opentelemetry-exporter-otlp-1.64.0.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-exporter-sender-grpc-managed-channel.txt b/docs/apidiffs/current_vs_latest/opentelemetry-exporter-sender-grpc-managed-channel.txt index 34b822e8a0b..2a289ead2ca 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-exporter-sender-grpc-managed-channel.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-exporter-sender-grpc-managed-channel.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-exporter-sender-grpc-managed-channel-1.65.0-SNAPSHOT.jar against opentelemetry-exporter-sender-grpc-managed-channel-1.64.0.jar +Comparing source compatibility of opentelemetry-exporter-sender-grpc-managed-channel-1.66.0-SNAPSHOT.jar against opentelemetry-exporter-sender-grpc-managed-channel-1.64.0.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-exporter-sender-jdk.txt b/docs/apidiffs/current_vs_latest/opentelemetry-exporter-sender-jdk.txt index 95c5f416597..00efa675f07 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-exporter-sender-jdk.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-exporter-sender-jdk.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-exporter-sender-jdk-1.65.0-SNAPSHOT.jar against opentelemetry-exporter-sender-jdk-1.64.0.jar +Comparing source compatibility of opentelemetry-exporter-sender-jdk-1.66.0-SNAPSHOT.jar against opentelemetry-exporter-sender-jdk-1.64.0.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-exporter-sender-okhttp.txt b/docs/apidiffs/current_vs_latest/opentelemetry-exporter-sender-okhttp.txt index 105a2fb7db8..3478cf3669b 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-exporter-sender-okhttp.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-exporter-sender-okhttp.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-exporter-sender-okhttp-1.65.0-SNAPSHOT.jar against opentelemetry-exporter-sender-okhttp-1.64.0.jar +Comparing source compatibility of opentelemetry-exporter-sender-okhttp-1.66.0-SNAPSHOT.jar against opentelemetry-exporter-sender-okhttp-1.64.0.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-exporter-zipkin.txt b/docs/apidiffs/current_vs_latest/opentelemetry-exporter-zipkin.txt deleted file mode 100644 index 11551cefc22..00000000000 --- a/docs/apidiffs/current_vs_latest/opentelemetry-exporter-zipkin.txt +++ /dev/null @@ -1,2 +0,0 @@ -Comparing source compatibility of opentelemetry-exporter-zipkin-1.65.0-SNAPSHOT.jar against opentelemetry-exporter-zipkin-1.64.0.jar -No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-extension-kotlin.txt b/docs/apidiffs/current_vs_latest/opentelemetry-extension-kotlin.txt index ccfbe91b872..c3c030d5410 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-extension-kotlin.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-extension-kotlin.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-extension-kotlin-1.65.0-SNAPSHOT.jar against opentelemetry-extension-kotlin-1.64.0.jar +Comparing source compatibility of opentelemetry-extension-kotlin-1.66.0-SNAPSHOT.jar against opentelemetry-extension-kotlin-1.64.0.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-extension-trace-propagators.txt b/docs/apidiffs/current_vs_latest/opentelemetry-extension-trace-propagators.txt index bdf69e42f4d..30677a48308 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-extension-trace-propagators.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-extension-trace-propagators.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-extension-trace-propagators-1.65.0-SNAPSHOT.jar against opentelemetry-extension-trace-propagators-1.64.0.jar +Comparing source compatibility of opentelemetry-extension-trace-propagators-1.66.0-SNAPSHOT.jar against opentelemetry-extension-trace-propagators-1.64.0.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-opentracing-shim.txt b/docs/apidiffs/current_vs_latest/opentelemetry-opentracing-shim.txt index 1c2aae35098..971633b4d5f 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-opentracing-shim.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-opentracing-shim.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-opentracing-shim-1.65.0-SNAPSHOT.jar against opentelemetry-opentracing-shim-1.64.0.jar +Comparing source compatibility of opentelemetry-opentracing-shim-1.66.0-SNAPSHOT.jar against opentelemetry-opentracing-shim-1.64.0.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-common.txt b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-common.txt index 8a99a2cd80e..1df67ed44c8 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-common.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-common.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-sdk-common-1.65.0-SNAPSHOT.jar against opentelemetry-sdk-common-1.64.0.jar +Comparing source compatibility of opentelemetry-sdk-common-1.66.0-SNAPSHOT.jar against opentelemetry-sdk-common-1.64.0.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-extension-autoconfigure-spi.txt b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-extension-autoconfigure-spi.txt index 284fe3df542..174e31862a0 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-extension-autoconfigure-spi.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-extension-autoconfigure-spi.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-sdk-extension-autoconfigure-spi-1.65.0-SNAPSHOT.jar against opentelemetry-sdk-extension-autoconfigure-spi-1.64.0.jar +Comparing source compatibility of opentelemetry-sdk-extension-autoconfigure-spi-1.66.0-SNAPSHOT.jar against opentelemetry-sdk-extension-autoconfigure-spi-1.64.0.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-extension-autoconfigure.txt b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-extension-autoconfigure.txt index 2ab71f7e8b0..2340889da32 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-extension-autoconfigure.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-extension-autoconfigure.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-sdk-extension-autoconfigure-1.65.0-SNAPSHOT.jar against opentelemetry-sdk-extension-autoconfigure-1.64.0.jar +Comparing source compatibility of opentelemetry-sdk-extension-autoconfigure-1.66.0-SNAPSHOT.jar against opentelemetry-sdk-extension-autoconfigure-1.64.0.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-extension-jaeger-remote-sampler.txt b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-extension-jaeger-remote-sampler.txt index 8052854dd9d..883cc8f4be8 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-extension-jaeger-remote-sampler.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-extension-jaeger-remote-sampler.txt @@ -1,4 +1,4 @@ -Comparing source compatibility of opentelemetry-sdk-extension-jaeger-remote-sampler-1.65.0-SNAPSHOT.jar against opentelemetry-sdk-extension-jaeger-remote-sampler-1.64.0.jar +Comparing source compatibility of opentelemetry-sdk-extension-jaeger-remote-sampler-1.66.0-SNAPSHOT.jar against opentelemetry-sdk-extension-jaeger-remote-sampler-1.64.0.jar *** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.sdk.extension.trace.jaeger.sampler.JaegerRemoteSampler (not serializable) === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 === UNCHANGED METHOD: PUBLIC void close() diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-logs.txt b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-logs.txt index 489ebe91aa3..e8bfa93243a 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-logs.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-logs.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-sdk-logs-1.65.0-SNAPSHOT.jar against opentelemetry-sdk-logs-1.64.0.jar +Comparing source compatibility of opentelemetry-sdk-logs-1.66.0-SNAPSHOT.jar against opentelemetry-sdk-logs-1.64.0.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-metrics.txt b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-metrics.txt index 9eef89292bc..ea360d6fad9 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-metrics.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-metrics.txt @@ -1,4 +1,4 @@ -Comparing source compatibility of opentelemetry-sdk-metrics-1.65.0-SNAPSHOT.jar against opentelemetry-sdk-metrics-1.64.0.jar +Comparing source compatibility of opentelemetry-sdk-metrics-1.66.0-SNAPSHOT.jar against opentelemetry-sdk-metrics-1.64.0.jar *** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.sdk.metrics.export.PeriodicMetricReaderBuilder (not serializable) === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 +++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.metrics.export.PeriodicMetricReaderBuilder setInternalTelemetryVersion(io.opentelemetry.sdk.common.InternalTelemetryVersion) diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-testing.txt b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-testing.txt index 900e009e735..ca7d5e278de 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-testing.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-testing.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-sdk-testing-1.65.0-SNAPSHOT.jar against opentelemetry-sdk-testing-1.64.0.jar +Comparing source compatibility of opentelemetry-sdk-testing-1.66.0-SNAPSHOT.jar against opentelemetry-sdk-testing-1.64.0.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-trace.txt b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-trace.txt index b5b3a82f5bd..b98cefc0631 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-trace.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-trace.txt @@ -1,4 +1,4 @@ -Comparing source compatibility of opentelemetry-sdk-trace-1.65.0-SNAPSHOT.jar against opentelemetry-sdk-trace-1.64.0.jar +Comparing source compatibility of opentelemetry-sdk-trace-1.66.0-SNAPSHOT.jar against opentelemetry-sdk-trace-1.64.0.jar *** MODIFIED INTERFACE: PUBLIC ABSTRACT io.opentelemetry.sdk.trace.samplers.Sampler (not serializable) === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 +++ NEW INTERFACE: java.io.Closeable diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-sdk.txt b/docs/apidiffs/current_vs_latest/opentelemetry-sdk.txt index fb263c8667e..63d6ea6be80 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-sdk.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-sdk.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-sdk-1.65.0-SNAPSHOT.jar against opentelemetry-sdk-1.64.0.jar +Comparing source compatibility of opentelemetry-sdk-1.66.0-SNAPSHOT.jar against opentelemetry-sdk-1.64.0.jar No changes. \ No newline at end of file diff --git a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/StringEncoderHolder.java b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/StringEncoderHolder.java index 3f0155b20fe..ba64ba4ebda 100644 --- a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/StringEncoderHolder.java +++ b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/StringEncoderHolder.java @@ -39,6 +39,12 @@ public static StringEncoder createFallbackEncoder() { */ @Nullable public static StringEncoder createUnsafeEncoder() { + // Android exposes sun.misc.Unsafe, but String does not have the OpenJDK internal fields used by + // UnsafeStringEncoder. ART logs an error when these missing fields are queried, even though the + // exception is caught. + if ("Dalvik".equals(System.getProperty("java.vm.name"))) { + return null; + } return UnsafeStringEncoder.createIfAvailable(); } diff --git a/exporters/common/src/test/java/io/opentelemetry/exporter/internal/marshal/StringEncoderTest.java b/exporters/common/src/test/java/io/opentelemetry/exporter/internal/marshal/StringEncoderTest.java index 6a0f3e8a813..a0b117292cf 100644 --- a/exporters/common/src/test/java/io/opentelemetry/exporter/internal/marshal/StringEncoderTest.java +++ b/exporters/common/src/test/java/io/opentelemetry/exporter/internal/marshal/StringEncoderTest.java @@ -13,6 +13,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledOnJre; import org.junit.jupiter.api.condition.JRE; +import org.junitpioneer.jupiter.SetSystemProperty; class StringEncoderTest { @@ -57,6 +58,12 @@ void testUtf8SizeLatin1_VarHandle() { testUtf8SizeLatin1(varHandleStringEncoder); } + @Test + @SetSystemProperty(key = "java.vm.name", value = "Dalvik") + void unsafeStringEncoderNotAvailableOnAndroid() { + assertThat(StringEncoderHolder.createUnsafeEncoder()).isNull(); + } + @SuppressWarnings("AvoidEscapedUnicodeCharacters") private static void testUtf8Encoding(StringEncoder stringEncoder) { assertThat(stringEncoder).isNotNull(); diff --git a/exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/OtlpJsonLoggingLogRecordExporter.java b/exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/OtlpJsonLoggingLogRecordExporter.java index 0c00cca908e..f45ccc0f62c 100644 --- a/exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/OtlpJsonLoggingLogRecordExporter.java +++ b/exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/OtlpJsonLoggingLogRecordExporter.java @@ -17,6 +17,9 @@ * A {@link LogRecordExporter} which writes {@linkplain LogRecordData logs} to a {@link Logger} in * OTLP JSON format. Each log line will include a single {@code ResourceLogs}. * + *
Note: This class is superseded by {@link OtlpStdoutLogRecordExporter}, which allows + * configuring a custom logger or output stream. + * * @since 1.19.0 */ public final class OtlpJsonLoggingLogRecordExporter implements LogRecordExporter { diff --git a/exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/OtlpJsonLoggingMetricExporter.java b/exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/OtlpJsonLoggingMetricExporter.java index 520b047f5f8..23a5579d0c5 100644 --- a/exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/OtlpJsonLoggingMetricExporter.java +++ b/exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/OtlpJsonLoggingMetricExporter.java @@ -18,6 +18,9 @@ /** * A {@link MetricExporter} which writes {@linkplain MetricData metrics} to a {@link Logger} in OTLP * JSON format. Each log line will include a single {@code ResourceMetrics}. + * + *
Note: This class is superseded by {@link OtlpStdoutMetricExporter}, which allows configuring a + * custom logger or output stream. */ public final class OtlpJsonLoggingMetricExporter implements MetricExporter { diff --git a/exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/OtlpJsonLoggingSpanExporter.java b/exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/OtlpJsonLoggingSpanExporter.java index 63901351326..a2500935cc2 100644 --- a/exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/OtlpJsonLoggingSpanExporter.java +++ b/exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/OtlpJsonLoggingSpanExporter.java @@ -16,6 +16,9 @@ /** * A {@link SpanExporter} which writes {@linkplain SpanData spans} to a {@link Logger} in OTLP JSON * format. Each log line will include a single {@code ResourceSpans}. + * + *
Note: This class is superseded by {@link OtlpStdoutSpanExporter}, which allows configuring a
+ * custom logger or output stream.
*/
public final class OtlpJsonLoggingSpanExporter implements SpanExporter {
diff --git a/exporters/otlp/all/src/main/java/io/opentelemetry/exporter/otlp/internal/OtlpConfigUtil.java b/exporters/otlp/all/src/main/java/io/opentelemetry/exporter/otlp/internal/OtlpConfigUtil.java
index 27872dbf03b..5948edb3b3e 100644
--- a/exporters/otlp/all/src/main/java/io/opentelemetry/exporter/otlp/internal/OtlpConfigUtil.java
+++ b/exporters/otlp/all/src/main/java/io/opentelemetry/exporter/otlp/internal/OtlpConfigUtil.java
@@ -165,7 +165,7 @@ static void configureOtlpHeaders(
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#specifying-headers-via-environment-variables
addHeader.accept(key, URLDecoder.decode(value, StandardCharsets.UTF_8.name()));
} catch (Exception e) {
- throw new ConfigurationException("Cannot decode header value: " + value, e);
+ throw new ConfigurationException("Cannot decode header value for header: " + key, e);
}
}
}
diff --git a/exporters/otlp/all/src/test/java/io/opentelemetry/exporter/otlp/internal/OtlpSpanExporterProviderTest.java b/exporters/otlp/all/src/test/java/io/opentelemetry/exporter/otlp/internal/OtlpSpanExporterProviderTest.java
index 1454d209da4..827fdc009ba 100644
--- a/exporters/otlp/all/src/test/java/io/opentelemetry/exporter/otlp/internal/OtlpSpanExporterProviderTest.java
+++ b/exporters/otlp/all/src/test/java/io/opentelemetry/exporter/otlp/internal/OtlpSpanExporterProviderTest.java
@@ -303,9 +303,10 @@ void createExporter_decodingError() {
() -> {
provider.createExporter(
DefaultConfigProperties.createFromMap(
- Collections.singletonMap("otel.exporter.otlp.headers", "header-key=%-1")));
+ Collections.singletonMap(
+ "otel.exporter.otlp.headers", "header-key=Bearer%20s3cr3t%-1")));
})
.isInstanceOf(ConfigurationException.class)
- .hasMessage("Cannot decode header value: %-1");
+ .hasMessage("Cannot decode header value for header: header-key");
}
}
diff --git a/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServerBuilder.java b/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServerBuilder.java
index 7b85bb027ac..156c721e449 100644
--- a/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServerBuilder.java
+++ b/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServerBuilder.java
@@ -97,7 +97,7 @@ public PrometheusHttpServerBuilder setOtelScopeLabelsEnabled(boolean otelScopeLa
return this;
}
- /** Set if the {@code otel_target_info} metric is generated. Default is {@code true}. */
+ /** Set if the {@code target_info} metric is generated. Default is {@code true}. */
public PrometheusHttpServerBuilder setTargetInfoMetricEnabled(boolean targetInfoMetricEnabled) {
metricReaderBuilder.setTargetInfoMetricEnabled(targetInfoMetricEnabled);
return this;
diff --git a/exporters/sender/okhttp/src/main/java/io/opentelemetry/exporter/sender/okhttp/internal/OkHttpGrpcSender.java b/exporters/sender/okhttp/src/main/java/io/opentelemetry/exporter/sender/okhttp/internal/OkHttpGrpcSender.java
index d9c1e490051..878cca34781 100644
--- a/exporters/sender/okhttp/src/main/java/io/opentelemetry/exporter/sender/okhttp/internal/OkHttpGrpcSender.java
+++ b/exporters/sender/okhttp/src/main/java/io/opentelemetry/exporter/sender/okhttp/internal/OkHttpGrpcSender.java
@@ -188,7 +188,7 @@ private void handleResponse(Response response, Consumer See the
- * zipkin exporter spec for details.
- */
-final class EventDataToAnnotation {
-
- private EventDataToAnnotation() {}
-
- static String apply(EventData eventData) {
- String name = eventData.getName();
- String value = toJson(eventData.getAttributes());
- return "\"" + name + "\":" + value;
- }
-
- private static String toJson(Attributes attributes) {
- return attributes.asMap().entrySet().stream()
- .map(entry -> "\"" + entry.getKey() + "\":" + toValue(entry.getValue()))
- .collect(joining(",", "{", "}"));
- }
-
- private static String toValue(Object o) {
- if (o instanceof String) {
- return "\"" + o + "\"";
- }
- if (o instanceof List) {
- return ((List>) o)
- .stream().map(EventDataToAnnotation::toValue).collect(joining(",", "[", "]"));
- }
- if (o instanceof Value) {
- return toJsonValue((Value>) o);
- }
- return String.valueOf(o);
- }
-
- // note: simple types (STRING, BOOLEAN, LONG, DOUBLE) won't actually come here
- // but handling here for completeness
- private static String toJsonValue(Value> value) {
- ValueType type = value.getType();
- switch (type) {
- case STRING:
- case BYTES:
- // For JSON encoding, strings and bytes need to be quoted
- return "\"" + value.asString() + "\"";
- case EMPTY:
- // For JSON encoding, empty values should be null
- return "null";
- case ARRAY:
- case KEY_VALUE_LIST:
- case BOOLEAN:
- case LONG:
- case DOUBLE:
- // Arrays, maps, and primitives are already valid JSON from asString()
- return value.asString();
- }
- throw new IllegalStateException("Unknown value type: " + type);
- }
-}
diff --git a/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/LocalInetAddressSupplier.java b/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/LocalInetAddressSupplier.java
deleted file mode 100644
index a5376eb88a9..00000000000
--- a/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/LocalInetAddressSupplier.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright The OpenTelemetry Authors
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package io.opentelemetry.exporter.zipkin;
-
-import java.net.InetAddress;
-import java.net.NetworkInterface;
-import java.util.Enumeration;
-import java.util.function.Supplier;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.annotation.Nullable;
-
-class LocalInetAddressSupplier implements Supplier The {@link BytesMessageSender#close()} method will be called when the exporter is shut down.
- *
- * @param sender the Zipkin sender implementation.
- * @return this.
- * @deprecated Use {@link #setSender(BytesMessageSender)} insteead.
- */
- @Deprecated
- public ZipkinSpanExporterBuilder setSender(Sender sender) {
- return setSender((BytesMessageSender) sender);
- }
-
- /**
- * Sets the Zipkin sender. Implements the client side of the span transport. An {@link
- * OkHttpSender} is a good default.
- *
- * The {@link BytesMessageSender#close()} method will be called when the exporter is shut down.
- *
- * @param sender the Zipkin sender implementation.
- * @return this.
- * @since 1.35.0
- */
- public ZipkinSpanExporterBuilder setSender(BytesMessageSender sender) {
- requireNonNull(sender, "sender");
- this.sender = sender;
- return this;
- }
-
- /**
- * Sets the {@link zipkin2.codec.BytesEncoder}, which controls the format used by the {@link
- * BytesMessageSender}. Defaults to the {@link zipkin2.codec.SpanBytesEncoder#JSON_V2}.
- *
- * @param encoder the {@code BytesEncoder} to use.
- * @return this.
- * @see zipkin2.codec.SpanBytesEncoder
- * @deprecated Use {@link #setEncoder(BytesEncoder)} instead.
- */
- @Deprecated
- public ZipkinSpanExporterBuilder setEncoder(zipkin2.codec.BytesEncoder encoder) {
- requireNonNull(encoder, "encoder");
- return setEncoder(new BytesEncoderAdapter(encoder));
- }
-
- /**
- * Sets the {@link BytesEncoder}, which controls the format used by the {@link
- * BytesMessageSender}. Defaults to the {@link SpanBytesEncoder#JSON_V2}.
- *
- * @param encoder the {@code BytesEncoder} to use.
- * @return this.
- * @see SpanBytesEncoder
- * @since 1.35.0
- */
- public ZipkinSpanExporterBuilder setEncoder(BytesEncoder encoder) {
- requireNonNull(encoder, "encoder");
- this.encoder = encoder;
- return this;
- }
-
- /**
- * Sets the Supplier of InetAddress. This Supplier will be used by the {@link
- * OtelToZipkinSpanTransformer} when creating the Zipkin local endpoint. The default
- * implementation uses a Supplier that returns a single unchanging IP address that is captured at
- * creation time.
- *
- * @param localIpAddressSupplier - A supplier that returns an InetAddress that may be null.
- * @return this
- * @since 1.18.0
- */
- public ZipkinSpanExporterBuilder setLocalIpAddressSupplier(
- Supplier The compression method is ignored when a custom Zipkin sender is set via {@link
- * #setSender(BytesMessageSender)}.
- *
- * @param compressionMethod The compression method, ex. "gzip".
- * @return this.
- * @see OkHttpSender
- * @since 1.20.0
- */
- public ZipkinSpanExporterBuilder setCompression(String compressionMethod) {
- requireNonNull(compressionMethod, "compressionMethod");
- if (!compressionMethod.equals("gzip") && !compressionMethod.equals("none")) {
- throw new IllegalArgumentException(
- "Unsupported compression method. Supported compression methods include: gzip, none.");
- }
- this.compressionEnabled = compressionMethod.equals("gzip");
- return this;
- }
-
- /**
- * Sets the maximum time to wait for the export of a batch of spans. If unset, defaults to 10s.
- *
- * @return this.
- * @since 1.2.0
- */
- public ZipkinSpanExporterBuilder setReadTimeout(long timeout, TimeUnit unit) {
- requireNonNull(unit, "unit");
- if (timeout < 0) {
- throw new IllegalArgumentException("timeout must be non-negative");
- }
- long timeoutMillis = timeout == 0 ? Long.MAX_VALUE : unit.toMillis(timeout);
- this.readTimeoutMillis = (int) Math.min(timeoutMillis, Integer.MAX_VALUE);
- return this;
- }
-
- /**
- * Sets the maximum time to wait for the export of a batch of spans. If unset, defaults to 10s.
- *
- * @return this.
- * @since 1.2.0
- */
- public ZipkinSpanExporterBuilder setReadTimeout(Duration timeout) {
- requireNonNull(timeout, "timeout");
- setReadTimeout(timeout.toMillis(), TimeUnit.MILLISECONDS);
- return this;
- }
-
- /**
- * Sets the {@link MeterProvider} to use to collect metrics related to export. If not set, uses
- * {@link GlobalOpenTelemetry#getMeterProvider()}.
- *
- * @return this.
- * @since 1.17.0
- */
- public ZipkinSpanExporterBuilder setMeterProvider(MeterProvider meterProvider) {
- requireNonNull(meterProvider, "meterProvider");
- this.meterProviderSupplier = () -> meterProvider;
- return this;
- }
-
- /**
- * Sets the {@link InternalTelemetryVersion} defining which self-monitoring metrics this exporter
- * collects.
- *
- * @since 1.51.0
- */
- public ZipkinSpanExporterBuilder setInternalTelemetryVersion(InternalTelemetryVersion level) {
- requireNonNull(level, "level");
- this.internalTelemetryVersion = level;
- return this;
- }
-
- String toString(boolean includePrefixAndSuffix) {
- StringJoiner joiner =
- includePrefixAndSuffix
- ? new StringJoiner(", ", "ZipkinSpanExporterBuilder{", "}")
- : new StringJoiner(", ");
- joiner.add("endpoint=" + endpoint);
- joiner.add("compressionEnabled=" + compressionEnabled);
- joiner.add("readTimeoutMillis=" + readTimeoutMillis);
- joiner.add("internalTelemetrySchemaVersion=" + internalTelemetryVersion);
- // Note: omit sender because we can't log the configuration in any readable way
- // Note: omit encoder because we can't log the configuration in any readable way
- // Note: omit localIpAddressSupplier because we can't log the configuration in any readable way
- // Note: omit meterProviderSupplier because we can't log the configuration in any readable way
- return joiner.toString();
- }
-
- /**
- * Builds a {@link ZipkinSpanExporter}.
- *
- * @return a {@code ZipkinSpanExporter}.
- */
- public ZipkinSpanExporter build() {
- BytesMessageSender sender = this.sender;
- if (sender == null) {
- sender =
- OkHttpSender.newBuilder()
- .endpoint(endpoint)
- .compressionEnabled(compressionEnabled)
- .readTimeout(readTimeoutMillis)
- .build();
- }
- OtelToZipkinSpanTransformer transformer =
- OtelToZipkinSpanTransformer.create(localIpAddressSupplier);
- return new ZipkinSpanExporter(
- this,
- encoder,
- sender,
- meterProviderSupplier,
- internalTelemetryVersion,
- endpoint,
- transformer);
- }
-}
diff --git a/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/internal/ComponentId.java b/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/internal/ComponentId.java
deleted file mode 100644
index 15d735df0cf..00000000000
--- a/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/internal/ComponentId.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright The OpenTelemetry Authors
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package io.opentelemetry.exporter.zipkin.internal;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicInteger;
-import javax.annotation.Nullable;
-
-/**
- * The component id used for SDK health metrics. This corresponds to the otel.component.name and
- * otel.component.id semconv attributes.
- *
- * Copied from {@code io.opentelemetry.sdk.common.internal.ComponentId} to avoid shared internal
- * code.
- *
- * This class is internal and is hence not for public use. Its APIs are unstable and can change
- * at any time.
- */
-public abstract class ComponentId {
-
- private ComponentId() {}
-
- public abstract String getTypeName();
-
- public abstract String getComponentName();
-
- static class Lazy extends ComponentId {
-
- private static final Map This class is internal and is hence not for public use. Its APIs are unstable and can change
- * at any time.
- */
-public class ExporterInstrumentation {
-
- private final ExporterMetrics implementation;
-
- public ExporterInstrumentation(
- InternalTelemetryVersion schema,
- Supplier This class is internal and is hence not for public use. Its APIs are unstable and can change
- * at any time.
- */
-public interface ExporterMetrics {
-
- Recording startRecordingExport(int itemCount);
-
- /**
- * This class is internal and is hence not for public use. Its APIs are unstable and can change at
- * any time.
- */
- abstract class Recording {
-
- private boolean alreadyEnded = false;
-
- protected Recording() {}
-
- public final void finishSuccessful(Attributes requestAttributes) {
- ensureEndedOnce();
- doFinish(null, requestAttributes);
- }
-
- public final void finishFailed(String errorType, Attributes requestAttributes) {
- ensureEndedOnce();
- if (errorType == null || errorType.isEmpty()) {
- throw new IllegalArgumentException("The export failed but no failure reason was provided");
- }
- doFinish(errorType, requestAttributes);
- }
-
- private void ensureEndedOnce() {
- if (alreadyEnded) {
- throw new IllegalStateException("Recording already ended");
- }
- alreadyEnded = true;
- }
-
- /**
- * Invoked when the export has finished, either successfully or failed.
- *
- * @param errorType null if the export was successful, otherwise a failure reason suitable for
- * the error.type attribute
- * @param requestAttributes additional attributes to add to request metrics
- */
- protected abstract void doFinish(@Nullable String errorType, Attributes requestAttributes);
- }
-}
diff --git a/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/internal/LegacyExporterMetrics.java b/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/internal/LegacyExporterMetrics.java
deleted file mode 100644
index 9eae9e1f843..00000000000
--- a/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/internal/LegacyExporterMetrics.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright The OpenTelemetry Authors
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package io.opentelemetry.exporter.zipkin.internal;
-
-import static io.opentelemetry.api.common.AttributeKey.booleanKey;
-import static io.opentelemetry.api.common.AttributeKey.stringKey;
-
-import io.opentelemetry.api.common.AttributeKey;
-import io.opentelemetry.api.common.Attributes;
-import io.opentelemetry.api.metrics.LongCounter;
-import io.opentelemetry.api.metrics.Meter;
-import io.opentelemetry.api.metrics.MeterProvider;
-import java.util.function.Supplier;
-import javax.annotation.Nullable;
-
-/**
- * Implements health metrics for exporters which were defined prior to the standardization in
- * semantic conventions.
- *
- * Copied from {@code io.opentelemetry.exporter.internal.LegacyExporterMetrics} to avoid shared
- * internal code.
- *
- * This class is internal and is hence not for public use. Its APIs are unstable and can change
- * at any time.
- */
-public class LegacyExporterMetrics implements ExporterMetrics {
-
- private static final AttributeKey Variables have been renamed for clarity.
- *
- * Copied from {@code io.opentelemetry.sdk.common.internal.RateLimiter} to avoid shared internal
- * code.
- *
- * This class is internal and is hence not for public use. Its APIs are unstable and can change
- * at any time.
- */
-public class RateLimiter {
- private final Clock clock;
- private final double creditsPerNanosecond;
- private final long maxBalance; // max balance in nano ticks
- private final AtomicLong currentBalance; // last op nano time less remaining balance
-
- /**
- * Create a new RateLimiter with the provided parameters.
- *
- * @param creditsPerSecond How many credits to accrue per second.
- * @param maxBalance The maximum balance that the limiter can hold, which corresponds to the rate
- * that is being limited to.
- * @param clock An implementation of the {@link Clock} interface.
- */
- public RateLimiter(double creditsPerSecond, double maxBalance, Clock clock) {
- this.clock = clock;
- this.creditsPerNanosecond = creditsPerSecond / 1.0e9;
- this.maxBalance = (long) (maxBalance / creditsPerNanosecond);
- this.currentBalance = new AtomicLong(clock.nanoTime() - this.maxBalance);
- }
-
- /**
- * Check to see if the provided cost can be spent within the current limits. Will deduct the cost
- * from the current balance if it can be spent.
- */
- public boolean trySpend(double itemCost) {
- long cost = (long) (itemCost / creditsPerNanosecond);
- long currentNanos;
- long currentBalanceNanos;
- long availableBalanceAfterWithdrawal;
- do {
- currentBalanceNanos = this.currentBalance.get();
- currentNanos = clock.nanoTime();
- long currentAvailableBalance = currentNanos - currentBalanceNanos;
- if (currentAvailableBalance > maxBalance) {
- currentAvailableBalance = maxBalance;
- }
- availableBalanceAfterWithdrawal = currentAvailableBalance - cost;
- if (availableBalanceAfterWithdrawal < 0) {
- return false;
- }
- } while (!this.currentBalance.compareAndSet(
- currentBalanceNanos, currentNanos - availableBalanceAfterWithdrawal));
- return true;
- }
-}
diff --git a/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/internal/SemConvAttributes.java b/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/internal/SemConvAttributes.java
deleted file mode 100644
index 14a39c7c0a7..00000000000
--- a/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/internal/SemConvAttributes.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright The OpenTelemetry Authors
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package io.opentelemetry.exporter.zipkin.internal;
-
-import io.opentelemetry.api.common.AttributeKey;
-
-/**
- * Provides access to semantic convention attributes used within the SDK implementation. This avoids
- * having to pull in semantic conventions as a dependency, which would easily collide and conflict
- * with user-provided dependencies.
- *
- * Copied from {@code io.opentelemetry.sdk.common.internal.SemConvAttributes} to avoid shared
- * internal code.
- *
- * This class is internal and is hence not for public use. Its APIs are unstable and can change
- * at any time.
- */
-public class SemConvAttributes {
-
- private SemConvAttributes() {}
-
- public static final AttributeKey This class is internal and is hence not for public use. Its APIs are unstable and can change
- * at any time.
- */
-public class SemConvExporterMetrics implements ExporterMetrics {
-
- private static final Clock CLOCK = Clock.getDefault();
-
- private final Supplier This class is internal and is hence not for public use. Its APIs are unstable and can change
- * at any time.
- */
-public enum Signal {
- SPAN("otel.sdk.exporter.span", "span");
-
- private final String exporterMetricNamespace;
- private final String metricUnit;
-
- Signal(String exporterMetricNamespace, String metricUnit) {
- this.exporterMetricNamespace = exporterMetricNamespace;
- this.metricUnit = metricUnit;
- }
-
- public String getExporterMetricNamespace() {
- return exporterMetricNamespace;
- }
-
- public String getMetricUnit() {
- return metricUnit;
- }
-}
diff --git a/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/internal/StandardComponentId.java b/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/internal/StandardComponentId.java
deleted file mode 100644
index 608a361e9b7..00000000000
--- a/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/internal/StandardComponentId.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright The OpenTelemetry Authors
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package io.opentelemetry.exporter.zipkin.internal;
-
-/**
- * A {@link ComponentId} where the component type is one of {@link ExporterType}.
- *
- * Copied from {@code io.opentelemetry.sdk.common.internal.StandardComponentId} to avoid shared
- * internal code.
- *
- * This class is internal and is hence not for public use. Its APIs are unstable and can change
- * at any time.
- */
-public class StandardComponentId extends ComponentId.Lazy {
-
- /**
- * This class is internal and is hence not for public use. Its APIs are unstable and can change at
- * any time.
- */
- public enum ExporterType {
- ZIPKIN_HTTP_SPAN_EXPORTER("zipkin_http_span_exporter", Signal.SPAN),
- /**
- * Has the same semconv attribute value as ZIPKIN_HTTP_SPAN_EXPORTER, but we still use a
- * different enum value for now because they produce separate legacy metrics.
- */
- ZIPKIN_HTTP_JSON_SPAN_EXPORTER("zipkin_http_span_exporter", Signal.SPAN);
-
- final String value;
- private final Signal signal;
-
- ExporterType(String value, Signal signal) {
- this.value = value;
- this.signal = signal;
- }
-
- public Signal signal() {
- return signal;
- }
- }
-
- private final ExporterType standardType;
-
- StandardComponentId(ExporterType standardType) {
- super(standardType.value);
- this.standardType = standardType;
- }
-
- public ExporterType getStandardType() {
- return standardType;
- }
-}
diff --git a/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/internal/ThrottlingLogger.java b/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/internal/ThrottlingLogger.java
deleted file mode 100644
index b5d8c808bc5..00000000000
--- a/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/internal/ThrottlingLogger.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright The OpenTelemetry Authors
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package io.opentelemetry.exporter.zipkin.internal;
-
-import static java.util.concurrent.TimeUnit.MINUTES;
-
-import io.opentelemetry.sdk.common.Clock;
-import java.util.Locale;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.annotation.Nullable;
-
-/**
- * Will limit the number of log messages emitted, so as not to spam when problems are happening.
- *
- * Copied from {@code io.opentelemetry.sdk.common.internal.ThrottlingLogger} to avoid shared
- * internal code.
- *
- * This class is internal and is hence not for public use. Its APIs are unstable and can change
- * at any time.
- */
-public class ThrottlingLogger {
- private static final double DEFAULT_RATE_LIMIT = 5;
- private static final double DEFAULT_THROTTLED_RATE_LIMIT = 1;
- private static final TimeUnit DEFAULT_RATE_TIME_UNIT = MINUTES;
-
- private final Logger delegate;
- private final AtomicBoolean throttled = new AtomicBoolean(false);
- private final RateLimiter fastRateLimiter;
- private final RateLimiter throttledRateLimiter;
-
- private final double rateLimit;
- private final double throttledRateLimit;
- private final TimeUnit rateTimeUnit;
-
- /** Create a new logger which will enforce a max number of messages per minute. */
- public ThrottlingLogger(Logger delegate) {
- Clock clock = Clock.getDefault();
- this.delegate = delegate;
- this.rateLimit = DEFAULT_RATE_LIMIT;
- this.throttledRateLimit = DEFAULT_THROTTLED_RATE_LIMIT;
- this.rateTimeUnit = DEFAULT_RATE_TIME_UNIT;
- this.fastRateLimiter =
- new RateLimiter(this.rateLimit / this.rateTimeUnit.toSeconds(1), this.rateLimit, clock);
- this.throttledRateLimiter =
- new RateLimiter(
- this.throttledRateLimit / this.rateTimeUnit.toSeconds(1),
- this.throttledRateLimit,
- clock);
- }
-
- /** Log a message at the given level. */
- public void log(Level level, String message) {
- log(level, message, null);
- }
-
- /** Log a message at the given level with a throwable. */
- public void log(Level level, String message, @Nullable Throwable throwable) {
- if (!isLoggable(level)) {
- return;
- }
- if (throttled.get()) {
- if (throttledRateLimiter.trySpend(1.0)) {
- doLog(level, message, throwable);
- }
- return;
- }
-
- if (fastRateLimiter.trySpend(1.0)) {
- doLog(level, message, throwable);
- return;
- }
-
- if (throttled.compareAndSet(false, true)) {
- // spend the balance in the throttled one, so that it starts at zero.
- throttledRateLimiter.trySpend(throttledRateLimit);
- String timeUnitString = rateTimeUnit.toString().toLowerCase(Locale.ROOT);
- String throttleMessage =
- String.format(
- Locale.ROOT,
- "Too many log messages detected. Will only log %.0f time(s) per %s from now on.",
- throttledRateLimit,
- timeUnitString.substring(0, timeUnitString.length() - 1));
- delegate.log(level, throttleMessage);
- doLog(level, message, throwable);
- }
- }
-
- private void doLog(Level level, String message, @Nullable Throwable throwable) {
- if (throwable != null) {
- delegate.log(level, message, throwable);
- } else {
- delegate.log(level, message);
- }
- }
-
- /**
- * Returns whether the current wrapped logger is set to log at the given level.
- *
- * @return true if the logger set to log at the requested level.
- */
- public boolean isLoggable(Level level) {
- return delegate.isLoggable(level);
- }
-}
diff --git a/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/internal/ZipkinSpanExporterProvider.java b/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/internal/ZipkinSpanExporterProvider.java
deleted file mode 100644
index fc5e0ab64a2..00000000000
--- a/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/internal/ZipkinSpanExporterProvider.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright The OpenTelemetry Authors
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package io.opentelemetry.exporter.zipkin.internal;
-
-import io.opentelemetry.exporter.zipkin.ZipkinSpanExporter;
-import io.opentelemetry.exporter.zipkin.ZipkinSpanExporterBuilder;
-import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
-import io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSpanExporterProvider;
-import io.opentelemetry.sdk.trace.export.SpanExporter;
-import java.time.Duration;
-
-/**
- * {@link SpanExporter} SPI implementation for {@link
- * io.opentelemetry.exporter.zipkin.ZipkinSpanExporter}.
- *
- * This class is internal and is hence not for public use. Its APIs are unstable and can change
- * at any time.
- */
-@SuppressWarnings("deprecation")
-public class ZipkinSpanExporterProvider implements ConfigurableSpanExporterProvider {
- @Override
- public String getName() {
- return "zipkin";
- }
-
- @Override
- public SpanExporter createExporter(ConfigProperties config) {
- ZipkinSpanExporterBuilder builder = ZipkinSpanExporter.builder();
-
- String endpoint = config.getString("otel.exporter.zipkin.endpoint");
- if (endpoint != null) {
- builder.setEndpoint(endpoint);
- }
-
- Duration timeout = config.getDuration("otel.exporter.zipkin.timeout");
- if (timeout != null) {
- builder.setReadTimeout(timeout);
- }
-
- return builder.build();
- }
-}
diff --git a/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/package-info.java b/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/package-info.java
deleted file mode 100644
index 8e03649dd64..00000000000
--- a/exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin/package-info.java
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Copyright The OpenTelemetry Authors
- * SPDX-License-Identifier: Apache-2.0
- */
-
-@ParametersAreNonnullByDefault
-package io.opentelemetry.exporter.zipkin;
-
-import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/exporters/zipkin/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSpanExporterProvider b/exporters/zipkin/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSpanExporterProvider
deleted file mode 100644
index 8a45b6fab18..00000000000
--- a/exporters/zipkin/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSpanExporterProvider
+++ /dev/null
@@ -1 +0,0 @@
-io.opentelemetry.exporter.zipkin.internal.ZipkinSpanExporterProvider
diff --git a/exporters/zipkin/src/test/java/io/opentelemetry/exporter/zipkin/BytesEncoderAdapterTest.java b/exporters/zipkin/src/test/java/io/opentelemetry/exporter/zipkin/BytesEncoderAdapterTest.java
deleted file mode 100644
index 24b16eb3a06..00000000000
--- a/exporters/zipkin/src/test/java/io/opentelemetry/exporter/zipkin/BytesEncoderAdapterTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright The OpenTelemetry Authors
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package io.opentelemetry.exporter.zipkin;
-
-import static io.opentelemetry.exporter.zipkin.ZipkinTestUtil.PARENT_SPAN_ID;
-import static io.opentelemetry.exporter.zipkin.ZipkinTestUtil.SPAN_ID;
-import static io.opentelemetry.exporter.zipkin.ZipkinTestUtil.TRACE_ID;
-import static org.assertj.core.api.Assertions.assertThat;
-
-import org.junit.jupiter.api.Test;
-import zipkin2.Endpoint;
-import zipkin2.Span;
-import zipkin2.reporter.Encoding;
-import zipkin2.reporter.SpanBytesEncoder;
-
-class BytesEncoderAdapterTest {
-
- /** Contains {@link Span#localEndpoint()} to ensure would be encoded differently. */
- private final Span testSpan =
- Span.newBuilder()
- .traceId(TRACE_ID)
- .parentId(PARENT_SPAN_ID)
- .id(SPAN_ID)
- .localEndpoint(Endpoint.newBuilder().serviceName("test").build())
- .build();
-
- @Test
- void testJsonV2() {
- BytesEncoderAdapter adapter = new BytesEncoderAdapter(zipkin2.codec.SpanBytesEncoder.JSON_V2);
- assertThat(adapter.encoding()).isEqualTo(Encoding.JSON);
- assertThat(adapter.encode(testSpan)).isEqualTo(SpanBytesEncoder.JSON_V2.encode(testSpan));
- assertThat(adapter.sizeInBytes(testSpan))
- .isEqualTo(SpanBytesEncoder.JSON_V2.sizeInBytes(testSpan));
- assertThat(adapter).hasToString(SpanBytesEncoder.JSON_V2.toString());
- }
-
- @Test
- void testProtobuf() {
- BytesEncoderAdapter adapter = new BytesEncoderAdapter(zipkin2.codec.SpanBytesEncoder.PROTO3);
- assertThat(adapter.encoding()).isEqualTo(Encoding.PROTO3);
- assertThat(adapter.encode(testSpan)).isEqualTo(SpanBytesEncoder.PROTO3.encode(testSpan));
- assertThat(adapter.sizeInBytes(testSpan))
- .isEqualTo(SpanBytesEncoder.PROTO3.sizeInBytes(testSpan));
- assertThat(adapter).hasToString(SpanBytesEncoder.PROTO3.toString());
- }
-
- @Test
- @SuppressWarnings("deprecation") // we have to use the deprecated thrift encoding to test it
- void testThrift() {
- BytesEncoderAdapter adapter = new BytesEncoderAdapter(zipkin2.codec.SpanBytesEncoder.THRIFT);
- assertThat(adapter.encoding()).isEqualTo(Encoding.THRIFT);
- assertThat(adapter.encode(testSpan)).isEqualTo(SpanBytesEncoder.THRIFT.encode(testSpan));
- assertThat(adapter.sizeInBytes(testSpan))
- .isEqualTo(SpanBytesEncoder.THRIFT.sizeInBytes(testSpan));
- assertThat(adapter).hasToString(SpanBytesEncoder.THRIFT.toString());
- }
-
- @Test
- void testJsonV1() {
- BytesEncoderAdapter adapter = new BytesEncoderAdapter(zipkin2.codec.SpanBytesEncoder.JSON_V1);
- assertThat(adapter.encoding()).isEqualTo(Encoding.JSON);
- assertThat(adapter.encode(testSpan)).isEqualTo(SpanBytesEncoder.JSON_V1.encode(testSpan));
- assertThat(adapter.sizeInBytes(testSpan))
- .isEqualTo(SpanBytesEncoder.JSON_V1.sizeInBytes(testSpan));
- assertThat(adapter).hasToString(SpanBytesEncoder.JSON_V1.toString());
- }
-}
diff --git a/exporters/zipkin/src/test/java/io/opentelemetry/exporter/zipkin/EventDataToAnnotationTest.java b/exporters/zipkin/src/test/java/io/opentelemetry/exporter/zipkin/EventDataToAnnotationTest.java
deleted file mode 100644
index 429ccd06bf1..00000000000
--- a/exporters/zipkin/src/test/java/io/opentelemetry/exporter/zipkin/EventDataToAnnotationTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright The OpenTelemetry Authors
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package io.opentelemetry.exporter.zipkin;
-
-import static io.opentelemetry.api.common.AttributeKey.valueKey;
-import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
-
-import io.opentelemetry.api.common.Attributes;
-import io.opentelemetry.api.common.KeyValue;
-import io.opentelemetry.api.common.Value;
-import io.opentelemetry.sdk.trace.data.EventData;
-import org.junit.jupiter.api.Test;
-
-class EventDataToAnnotationTest {
-
- @Test
- void basicConversion() {
-
- Attributes attrs =
- Attributes.builder()
- .put("v01", "v1")
- .put("v02", 12L)
- .put("v03", 123.45)
- .put("v04", false)
- .put("v05", "foo", "bar", "baz")
- .put("v06", 1, 2, 3)
- .put("v07", 1.23, 3.45)
- .put("v08", true, false, true)
- .put(valueKey("v09"), Value.of(new byte[] {1, 2, 3}))
- .put(valueKey("v10"), Value.of(KeyValue.of("nested", Value.of("value"))))
- .put(valueKey("v11"), Value.of(Value.of("string"), Value.of(123L)))
- .put(valueKey("v12"), Value.empty())
- .build();
- String expected =
- "\"cat\":{\"v01\":\"v1\",\"v02\":12,\"v03\":123.45,\"v04\":false,\"v05\":[\"foo\",\"bar\",\"baz\"],\"v06\":[1,2,3],\"v07\":[1.23,3.45],\"v08\":[true,false,true],\"v09\":\"AQID\",\"v10\":{\"nested\":\"value\"},\"v11\":[\"string\",123],\"v12\":null}";
- EventData eventData = EventData.create(0, "cat", attrs);
-
- String result = EventDataToAnnotation.apply(eventData);
-
- assertThat(result).isEqualTo(expected);
- }
-
- @Test
- void empty() {
- Attributes attrs = Attributes.empty();
- String expected = "\"dog\":{}";
- EventData eventData = EventData.create(0, "dog", attrs);
-
- String result = EventDataToAnnotation.apply(eventData);
-
- assertThat(result).isEqualTo(expected);
- }
-}
diff --git a/exporters/zipkin/src/test/java/io/opentelemetry/exporter/zipkin/OtelToZipkinSpanTransformerTest.java b/exporters/zipkin/src/test/java/io/opentelemetry/exporter/zipkin/OtelToZipkinSpanTransformerTest.java
deleted file mode 100644
index e81e3a3c0e1..00000000000
--- a/exporters/zipkin/src/test/java/io/opentelemetry/exporter/zipkin/OtelToZipkinSpanTransformerTest.java
+++ /dev/null
@@ -1,515 +0,0 @@
-/*
- * Copyright The OpenTelemetry Authors
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package io.opentelemetry.exporter.zipkin;
-
-import static io.opentelemetry.api.common.AttributeKey.booleanArrayKey;
-import static io.opentelemetry.api.common.AttributeKey.booleanKey;
-import static io.opentelemetry.api.common.AttributeKey.doubleArrayKey;
-import static io.opentelemetry.api.common.AttributeKey.doubleKey;
-import static io.opentelemetry.api.common.AttributeKey.longArrayKey;
-import static io.opentelemetry.api.common.AttributeKey.longKey;
-import static io.opentelemetry.api.common.AttributeKey.stringArrayKey;
-import static io.opentelemetry.api.common.AttributeKey.stringKey;
-import static io.opentelemetry.api.common.AttributeKey.valueKey;
-import static io.opentelemetry.exporter.zipkin.ZipkinTestUtil.spanBuilder;
-import static io.opentelemetry.exporter.zipkin.ZipkinTestUtil.zipkinSpan;
-import static io.opentelemetry.exporter.zipkin.ZipkinTestUtil.zipkinSpanBuilder;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
-
-import io.opentelemetry.api.common.Attributes;
-import io.opentelemetry.api.common.KeyValue;
-import io.opentelemetry.api.common.Value;
-import io.opentelemetry.api.trace.SpanKind;
-import io.opentelemetry.api.trace.StatusCode;
-import io.opentelemetry.sdk.common.InstrumentationScopeInfo;
-import io.opentelemetry.sdk.resources.Resource;
-import io.opentelemetry.sdk.trace.data.SpanData;
-import io.opentelemetry.sdk.trace.data.StatusData;
-import java.net.InetAddress;
-import java.util.Arrays;
-import java.util.Collections;
-import javax.annotation.Nullable;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.EnumSource;
-import zipkin2.Endpoint;
-import zipkin2.Span;
-
-class OtelToZipkinSpanTransformerTest {
-
- private OtelToZipkinSpanTransformer transformer;
- private InetAddress localIp;
-
- @BeforeEach
- void setup() {
- localIp = mock(InetAddress.class);
- transformer = OtelToZipkinSpanTransformer.create(() -> localIp);
- }
-
- @Test
- void generateSpan_remoteParent() {
- SpanData data = spanBuilder().build();
-
- assertThat(transformer.generateSpan(data))
- .isEqualTo(
- zipkinSpanBuilder(Span.Kind.SERVER, localIp)
- .putTag(OtelToZipkinSpanTransformer.OTEL_STATUS_CODE, "OK")
- .build());
- }
-
- @Test
- void generateSpan_subMicroDurations() {
- SpanData data =
- spanBuilder()
- .setStartEpochNanos(1505855794_194009601L)
- .setEndEpochNanos(1505855794_194009999L)
- .build();
-
- Span expected =
- zipkinSpanBuilder(Span.Kind.SERVER, localIp)
- .putTag(OtelToZipkinSpanTransformer.OTEL_STATUS_CODE, "OK")
- .duration(1)
- .build();
- assertThat(transformer.generateSpan(data)).isEqualTo(expected);
- }
-
- @Test
- void generateSpan_ServerKind() {
- SpanData data = spanBuilder().setKind(SpanKind.SERVER).build();
-
- assertThat(transformer.generateSpan(data))
- .isEqualTo(
- zipkinSpanBuilder(Span.Kind.SERVER, localIp)
- .putTag(OtelToZipkinSpanTransformer.OTEL_STATUS_CODE, "OK")
- .build());
- }
-
- @Test
- void generateSpan_ClientKind() {
- SpanData data = spanBuilder().setKind(SpanKind.CLIENT).build();
-
- assertThat(transformer.generateSpan(data))
- .isEqualTo(
- zipkinSpanBuilder(Span.Kind.CLIENT, localIp)
- .putTag(OtelToZipkinSpanTransformer.OTEL_STATUS_CODE, "OK")
- .build());
- }
-
- @Test
- void generateSpan_InternalKind() {
- SpanData data = spanBuilder().setKind(SpanKind.INTERNAL).build();
-
- assertThat(transformer.generateSpan(data))
- .isEqualTo(
- zipkinSpanBuilder(null, localIp)
- .putTag(OtelToZipkinSpanTransformer.OTEL_STATUS_CODE, "OK")
- .build());
- }
-
- @Test
- void generateSpan_ConsumeKind() {
- SpanData data = spanBuilder().setKind(SpanKind.CONSUMER).build();
-
- assertThat(transformer.generateSpan(data))
- .isEqualTo(
- zipkinSpanBuilder(Span.Kind.CONSUMER, localIp)
- .putTag(OtelToZipkinSpanTransformer.OTEL_STATUS_CODE, "OK")
- .build());
- }
-
- @Test
- void generateSpan_ProducerKind() {
- SpanData data = spanBuilder().setKind(SpanKind.PRODUCER).build();
-
- assertThat(transformer.generateSpan(data))
- .isEqualTo(
- zipkinSpanBuilder(Span.Kind.PRODUCER, localIp)
- .putTag(OtelToZipkinSpanTransformer.OTEL_STATUS_CODE, "OK")
- .build());
- }
-
- @Test
- void generateSpan_ResourceServiceNameMapping() {
- Resource resource =
- Resource.create(Attributes.of(stringKey("service.name"), "super-zipkin-service"));
- SpanData data = spanBuilder().setResource(resource).build();
-
- Endpoint expectedLocalEndpoint =
- Endpoint.newBuilder().serviceName("super-zipkin-service").ip(localIp).build();
- Span expectedZipkinSpan =
- zipkinSpan(Span.Kind.SERVER, localIp).toBuilder()
- .localEndpoint(expectedLocalEndpoint)
- .putTag(OtelToZipkinSpanTransformer.OTEL_STATUS_CODE, "OK")
- .build();
- assertThat(transformer.generateSpan(data)).isEqualTo(expectedZipkinSpan);
- }
-
- @Test
- void generateSpan_defaultResourceServiceName() {
- SpanData data = spanBuilder().setResource(Resource.empty()).build();
-
- Endpoint expectedLocalEndpoint =
- Endpoint.newBuilder()
- .serviceName(Resource.getDefault().getAttribute(stringKey("service.name")))
- .ip(localIp)
- .build();
- Span expectedZipkinSpan =
- zipkinSpan(Span.Kind.SERVER, localIp).toBuilder()
- .localEndpoint(expectedLocalEndpoint)
- .putTag(OtelToZipkinSpanTransformer.OTEL_STATUS_CODE, "OK")
- .build();
- assertThat(transformer.generateSpan(data)).isEqualTo(expectedZipkinSpan);
- }
-
- @ParameterizedTest
- @EnumSource(
- value = SpanKind.class,
- names = {"CLIENT", "PRODUCER"})
- void generateSpan_RemoteEndpointMapping(SpanKind spanKind) {
- Attributes attributes =
- Attributes.builder()
- .put(stringKey("peer.service"), "remote-test-service")
- .put(stringKey("server.socket.address"), "8.8.8.8")
- .put(longKey("server.socket.port"), 42L)
- .build();
-
- SpanData spanData =
- spanBuilder()
- .setKind(spanKind)
- .setResource(Resource.empty())
- .setAttributes(attributes)
- .build();
-
- Endpoint expectedLocalEndpoint =
- Endpoint.newBuilder()
- .serviceName(Resource.getDefault().getAttribute(stringKey("service.name")))
- .ip(localIp)
- .build();
-
- Endpoint expectedRemoteEndpoint =
- Endpoint.newBuilder().serviceName("remote-test-service").ip("8.8.8.8").port(42).build();
-
- Span expectedSpan =
- zipkinSpan(toZipkinSpanKind(spanKind), localIp).toBuilder()
- .localEndpoint(expectedLocalEndpoint)
- .remoteEndpoint(expectedRemoteEndpoint)
- .putTag("peer.service", "remote-test-service")
- .putTag("server.socket.address", "8.8.8.8")
- .putTag("server.socket.port", "42")
- .putTag(OtelToZipkinSpanTransformer.OTEL_STATUS_CODE, "OK")
- .build();
-
- assertThat(transformer.generateSpan(spanData)).isEqualTo(expectedSpan);
- }
-
- @ParameterizedTest
- @EnumSource(
- value = SpanKind.class,
- names = {"SERVER", "CONSUMER", "INTERNAL"})
- void generateSpan_RemoteEndpointMappingWhenKindIsNotClientOrProducer(SpanKind spanKind) {
- Attributes attributes =
- Attributes.builder()
- .put("peer.service", "remote-test-service")
- .put("server.socket.address", "8.8.8.8")
- .put("server.socket.port", 42L)
- .build();
-
- SpanData spanData =
- spanBuilder()
- .setKind(spanKind)
- .setResource(Resource.empty())
- .setAttributes(attributes)
- .build();
-
- Endpoint expectedLocalEndpoint =
- Endpoint.newBuilder()
- .serviceName(Resource.getDefault().getAttribute(stringKey("service.name")))
- .ip(localIp)
- .build();
-
- Span expectedSpan =
- zipkinSpan(toZipkinSpanKind(spanKind), localIp).toBuilder()
- .localEndpoint(expectedLocalEndpoint)
- .remoteEndpoint(null)
- .putTag("peer.service", "remote-test-service")
- .putTag("server.socket.address", "8.8.8.8")
- .putTag("server.socket.port", "42")
- .putTag(OtelToZipkinSpanTransformer.OTEL_STATUS_CODE, "OK")
- .build();
-
- assertThat(transformer.generateSpan(spanData)).isEqualTo(expectedSpan);
- }
-
- @ParameterizedTest
- @EnumSource(
- value = SpanKind.class,
- names = {"CLIENT", "PRODUCER"})
- void generateSpan_RemoteEndpointMappingWhenServiceNameIsMissing(SpanKind spanKind) {
- Attributes attributes =
- Attributes.builder()
- .put("server.socket.address", "8.8.8.8")
- .put("server.socket.port", 42L)
- .build();
-
- SpanData spanData =
- spanBuilder()
- .setKind(spanKind)
- .setResource(Resource.empty())
- .setAttributes(attributes)
- .build();
-
- Endpoint expectedLocalEndpoint =
- Endpoint.newBuilder()
- .serviceName(Resource.getDefault().getAttribute(stringKey("service.name")))
- .ip(localIp)
- .build();
-
- Span expectedSpan =
- zipkinSpan(toZipkinSpanKind(spanKind), localIp).toBuilder()
- .localEndpoint(expectedLocalEndpoint)
- .remoteEndpoint(null)
- .putTag("server.socket.address", "8.8.8.8")
- .putTag("server.socket.port", "42")
- .putTag(OtelToZipkinSpanTransformer.OTEL_STATUS_CODE, "OK")
- .build();
-
- assertThat(transformer.generateSpan(spanData)).isEqualTo(expectedSpan);
- }
-
- @ParameterizedTest
- @EnumSource(
- value = SpanKind.class,
- names = {"CLIENT", "PRODUCER"})
- void generateSpan_RemoteEndpointMappingWhenPortIsMissing(SpanKind spanKind) {
- Attributes attributes =
- Attributes.builder()
- .put("peer.service", "remote-test-service")
- .put("server.socket.address", "8.8.8.8")
- .build();
-
- SpanData spanData =
- spanBuilder()
- .setKind(spanKind)
- .setResource(Resource.empty())
- .setAttributes(attributes)
- .build();
-
- Endpoint expectedLocalEndpoint =
- Endpoint.newBuilder()
- .serviceName(Resource.getDefault().getAttribute(stringKey("service.name")))
- .ip(localIp)
- .build();
-
- Endpoint expectedRemoteEndpoint =
- Endpoint.newBuilder().serviceName("remote-test-service").ip("8.8.8.8").build();
-
- Span expectedSpan =
- zipkinSpan(toZipkinSpanKind(spanKind), localIp).toBuilder()
- .localEndpoint(expectedLocalEndpoint)
- .remoteEndpoint(expectedRemoteEndpoint)
- .putTag("peer.service", "remote-test-service")
- .putTag("server.socket.address", "8.8.8.8")
- .putTag(OtelToZipkinSpanTransformer.OTEL_STATUS_CODE, "OK")
- .build();
-
- assertThat(transformer.generateSpan(spanData)).isEqualTo(expectedSpan);
- }
-
- @ParameterizedTest
- @EnumSource(
- value = SpanKind.class,
- names = {"CLIENT", "PRODUCER"})
- void generateSpan_RemoteEndpointMappingWhenIpAndPortAreMissing(SpanKind spanKind) {
- Attributes attributes = Attributes.builder().put("peer.service", "remote-test-service").build();
-
- SpanData spanData =
- spanBuilder()
- .setKind(spanKind)
- .setResource(Resource.empty())
- .setAttributes(attributes)
- .build();
-
- Endpoint expectedLocalEndpoint =
- Endpoint.newBuilder()
- .serviceName(Resource.getDefault().getAttribute(stringKey("service.name")))
- .ip(localIp)
- .build();
-
- Endpoint expectedRemoteEndpoint =
- Endpoint.newBuilder().serviceName("remote-test-service").build();
-
- Span expectedSpan =
- zipkinSpan(toZipkinSpanKind(spanKind), localIp).toBuilder()
- .localEndpoint(expectedLocalEndpoint)
- .remoteEndpoint(expectedRemoteEndpoint)
- .putTag("peer.service", "remote-test-service")
- .putTag(OtelToZipkinSpanTransformer.OTEL_STATUS_CODE, "OK")
- .build();
-
- assertThat(transformer.generateSpan(spanData)).isEqualTo(expectedSpan);
- }
-
- @Test
- void generateSpan_WithAttributes() {
- Attributes attributes =
- Attributes.builder()
- .put(stringKey("string"), "string value")
- .put(booleanKey("boolean"), false)
- .put(longKey("long"), 9999L)
- .put(doubleKey("double"), 222.333d)
- .put(booleanArrayKey("booleanArray"), Arrays.asList(true, false))
- .put(stringArrayKey("stringArray"), Collections.singletonList("Hello"))
- .put(doubleArrayKey("doubleArray"), Arrays.asList(32.33d, -98.3d))
- .put(longArrayKey("longArray"), Arrays.asList(33L, 999L))
- .put(valueKey("bytes"), Value.of(new byte[] {1, 2, 3}))
- .put(valueKey("map"), Value.of(KeyValue.of("nested", Value.of("value"))))
- .put(valueKey("heterogeneousArray"), Value.of(Value.of("string"), Value.of(123L)))
- .put(valueKey("empty"), Value.empty())
- .build();
- SpanData data =
- spanBuilder()
- .setAttributes(attributes)
- .setTotalAttributeCount(32)
- .setTotalRecordedEvents(3)
- .setKind(SpanKind.CLIENT)
- .build();
-
- assertThat(transformer.generateSpan(data))
- .isEqualTo(
- zipkinSpan(Span.Kind.CLIENT, localIp).toBuilder()
- .putTag("string", "string value")
- .putTag("boolean", "false")
- .putTag("long", "9999")
- .putTag("double", "222.333")
- .putTag("booleanArray", "true,false")
- .putTag("stringArray", "Hello")
- .putTag("doubleArray", "32.33,-98.3")
- .putTag("longArray", "33,999")
- .putTag("bytes", "AQID")
- .putTag("map", "{\"nested\":\"value\"}")
- .putTag("heterogeneousArray", "[\"string\",123]")
- .putTag("empty", "")
- .putTag(OtelToZipkinSpanTransformer.OTEL_STATUS_CODE, "OK")
- .putTag(OtelToZipkinSpanTransformer.OTEL_DROPPED_ATTRIBUTES_COUNT, "20")
- .putTag(OtelToZipkinSpanTransformer.OTEL_DROPPED_EVENTS_COUNT, "1")
- .build());
- }
-
- @Test
- void generateSpan_WithInstrumentationLibraryInfo() {
- SpanData data =
- spanBuilder()
- .setInstrumentationScopeInfo(
- InstrumentationScopeInfo.builder("io.opentelemetry.auto")
- .setVersion("1.0.0")
- .build())
- .setKind(SpanKind.CLIENT)
- .build();
-
- assertThat(transformer.generateSpan(data))
- .isEqualTo(
- zipkinSpan(Span.Kind.CLIENT, localIp).toBuilder()
- .putTag("otel.scope.name", "io.opentelemetry.auto")
- .putTag("otel.scope.version", "1.0.0")
- .putTag("otel.library.name", "io.opentelemetry.auto")
- .putTag("otel.library.version", "1.0.0")
- .putTag(OtelToZipkinSpanTransformer.OTEL_STATUS_CODE, "OK")
- .build());
- }
-
- @Test
- void generateSpan_AlreadyHasHttpStatusInfo() {
- Attributes attributes =
- Attributes.of(
- longKey("http.response.status.code"),
- 404L,
- stringKey("error"),
- "A user provided error");
- SpanData data =
- spanBuilder()
- .setAttributes(attributes)
- .setKind(SpanKind.CLIENT)
- .setStatus(StatusData.error())
- .setTotalAttributeCount(2)
- .build();
-
- assertThat(transformer.generateSpan(data))
- .isEqualTo(
- zipkinSpan(Span.Kind.CLIENT, localIp).toBuilder()
- .clearTags()
- .putTag("http.response.status.code", "404")
- .putTag(OtelToZipkinSpanTransformer.OTEL_STATUS_CODE, "ERROR")
- .putTag("error", "A user provided error")
- .build());
- }
-
- @Test
- void generateSpan_WithRpcTimeoutErrorStatus_WithTimeoutErrorDescription() {
- Attributes attributes = Attributes.of(stringKey("rpc.service"), "my service name");
-
- String errorMessage = "timeout";
-
- SpanData data =
- spanBuilder()
- .setStatus(StatusData.create(StatusCode.ERROR, errorMessage))
- .setAttributes(attributes)
- .setTotalAttributeCount(1)
- .build();
-
- assertThat(transformer.generateSpan(data))
- .isEqualTo(
- zipkinSpan(Span.Kind.SERVER, localIp).toBuilder()
- .putTag("rpc.service", "my service name")
- .putTag(OtelToZipkinSpanTransformer.OTEL_STATUS_CODE, "ERROR")
- .putTag(OtelToZipkinSpanTransformer.STATUS_ERROR.getKey(), errorMessage)
- .build());
- }
-
- @Test
- void generateSpan_WithRpcErrorStatus_WithEmptyErrorDescription() {
- Attributes attributes = Attributes.of(stringKey("rpc.service"), "my service name");
-
- SpanData data =
- spanBuilder()
- .setStatus(StatusData.create(StatusCode.ERROR, ""))
- .setAttributes(attributes)
- .setTotalAttributeCount(1)
- .build();
-
- assertThat(transformer.generateSpan(data))
- .isEqualTo(
- zipkinSpan(Span.Kind.SERVER, localIp).toBuilder()
- .putTag("rpc.service", "my service name")
- .putTag(OtelToZipkinSpanTransformer.OTEL_STATUS_CODE, "ERROR")
- .putTag(OtelToZipkinSpanTransformer.STATUS_ERROR.getKey(), "")
- .build());
- }
-
- @Test
- void generateSpan_WithRpcUnsetStatus() {
- Attributes attributes = Attributes.of(stringKey("rpc.service"), "my service name");
-
- SpanData data =
- spanBuilder()
- .setStatus(StatusData.create(StatusCode.UNSET, ""))
- .setAttributes(attributes)
- .setTotalAttributeCount(1)
- .build();
-
- assertThat(transformer.generateSpan(data))
- .isEqualTo(
- zipkinSpan(Span.Kind.SERVER, localIp).toBuilder()
- .putTag("rpc.service", "my service name")
- .build());
- }
-
- @Nullable
- private static Span.Kind toZipkinSpanKind(SpanKind spanKind) {
- return spanKind != SpanKind.INTERNAL ? Span.Kind.valueOf(spanKind.name()) : null;
- }
-}
diff --git a/exporters/zipkin/src/test/java/io/opentelemetry/exporter/zipkin/ZipkinSpanExporterEndToEndHttpTest.java b/exporters/zipkin/src/test/java/io/opentelemetry/exporter/zipkin/ZipkinSpanExporterEndToEndHttpTest.java
deleted file mode 100644
index 38fb9ee078e..00000000000
--- a/exporters/zipkin/src/test/java/io/opentelemetry/exporter/zipkin/ZipkinSpanExporterEndToEndHttpTest.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * Copyright The OpenTelemetry Authors
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package io.opentelemetry.exporter.zipkin;
-
-import static io.opentelemetry.api.common.AttributeKey.stringKey;
-import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
-import static org.mockito.Mockito.mock;
-
-import com.linecorp.armeria.client.WebClient;
-import com.linecorp.armeria.common.AggregatedHttpResponse;
-import com.linecorp.armeria.common.HttpData;
-import com.linecorp.armeria.common.HttpStatus;
-import io.opentelemetry.api.common.AttributeKey;
-import io.opentelemetry.api.common.Attributes;
-import io.opentelemetry.api.metrics.MeterProvider;
-import io.opentelemetry.api.trace.SpanContext;
-import io.opentelemetry.api.trace.SpanKind;
-import io.opentelemetry.api.trace.TraceFlags;
-import io.opentelemetry.api.trace.TraceState;
-import io.opentelemetry.internal.testing.slf4j.SuppressLogger;
-import io.opentelemetry.sdk.common.CompletableResultCode;
-import io.opentelemetry.sdk.common.InstrumentationScopeInfo;
-import io.opentelemetry.sdk.metrics.SdkMeterProvider;
-import io.opentelemetry.sdk.resources.Resource;
-import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader;
-import io.opentelemetry.sdk.testing.trace.TestSpanData;
-import io.opentelemetry.sdk.trace.IdGenerator;
-import io.opentelemetry.sdk.trace.data.EventData;
-import io.opentelemetry.sdk.trace.data.SpanData;
-import io.opentelemetry.sdk.trace.data.StatusData;
-import java.net.InetAddress;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.Test;
-import org.testcontainers.containers.GenericContainer;
-import org.testcontainers.containers.wait.strategy.Wait;
-import org.testcontainers.junit.jupiter.Container;
-import org.testcontainers.junit.jupiter.Testcontainers;
-import zipkin2.Endpoint;
-import zipkin2.Span;
-import zipkin2.codec.SpanBytesDecoder;
-import zipkin2.reporter.BytesMessageSender;
-import zipkin2.reporter.Encoding;
-import zipkin2.reporter.SpanBytesEncoder;
-import zipkin2.reporter.okhttp3.OkHttpSender;
-
-@SuppressWarnings("deprecation") // testing deprecated code
-@Testcontainers(disabledWithoutDocker = true)
-class ZipkinSpanExporterEndToEndHttpTest {
- private static final WebClient client = WebClient.of();
-
- private static final int ZIPKIN_API_PORT = 9411;
-
- private static final String SPAN_ID = "9cc1e3049173be09";
- private static final String PARENT_SPAN_ID = "8b03ab423da481c5";
- private static final String SPAN_NAME = "Recv.helloworld.Greeter.SayHello";
- private static final long START_EPOCH_NANOS = 1505855794_194009601L;
- private static final long END_EPOCH_NANOS = 1505855799_465726528L;
- private static final long RECEIVED_TIMESTAMP_NANOS = 1505855799_433901068L;
- private static final long SENT_TIMESTAMP_NANOS = 1505855799_459486280L;
- private static final Attributes attributes = Attributes.empty();
- private static final List {@code maxTokens} bounds the parse work and counts malformed tokens, so a header of entirely
+ * malformed tokens cannot keep the loop running to the end of the input. {@code maxEntries} is a
+ * separate acceptance bound, so malformed tokens do not consume the caller's remaining entry
+ * budget.
+ *
+ * Returns a two-element array of {@code [entriesAdded, bytesAdded]}, reflecting what was
+ * actually added to {@code builder}.
+ */
private static int[] parseBaggageHeader(
- String header, BaggageBuilder builder, int maxEntries, int maxBytes) {
+ String header, BaggageBuilder builder, int maxTokens, int maxEntries, int maxBytes) {
int entriesAdded = 0;
int bytesAdded = 0;
+ int tokensParsed = 0;
for (String part : header.split("\\s*,\\s*")) {
- if (entriesAdded >= maxEntries || bytesAdded > maxBytes) {
+ if (tokensParsed >= maxTokens || entriesAdded >= maxEntries) {
break;
}
+ tokensParsed++;
String[] kv = part.split("\\s*=\\s*");
if (kv.length == 2) {
if (bytesAdded + kv[0].length() + kv[1].length() > maxBytes) {
@@ -311,7 +334,7 @@ private static int[] parseBaggageHeader(
builder.put(kv[0], kv[1]);
entriesAdded++;
bytesAdded += kv[0].length() + kv[1].length();
- } else {
+ } else if (logger.isLoggable(Level.FINE)) {
logger.fine("malformed token in " + BAGGAGE_HEADER + " header: " + part);
}
}
diff --git a/extensions/trace-propagators/src/main/java/io/opentelemetry/extension/trace/propagation/OtTracePropagator.java b/extensions/trace-propagators/src/main/java/io/opentelemetry/extension/trace/propagation/OtTracePropagator.java
index 10f3c8d8e8e..a8ebb8c7a6e 100644
--- a/extensions/trace-propagators/src/main/java/io/opentelemetry/extension/trace/propagation/OtTracePropagator.java
+++ b/extensions/trace-propagators/src/main/java/io/opentelemetry/extension/trace/propagation/OtTracePropagator.java
@@ -146,7 +146,8 @@ public To use, register with {@link SdkMeterProviderBuilder#registerMetricProducer(MetricProducer)}.
+ *
+ * @deprecated OpenCensus compatibility is deprecated in the OpenTelemetry specification (see #5138).
+ * Expect this artifact to no longer be published after June 2027.
*/
+@Deprecated
public final class OpenCensusMetricProducer implements MetricProducer {
private final MetricProducerManager openCensusMetricStorage;
@@ -32,7 +37,12 @@ private OpenCensusMetricProducer(MetricProducerManager openCensusMetricStorage)
/**
* Constructs a new {@link OpenCensusMetricProducer} that reports against the given {@link
* Resource}.
+ *
+ * @deprecated OpenCensus compatibility is deprecated in the OpenTelemetry specification (see #5138).
+ * Expect this artifact to no longer be published after June 2027.
*/
+ @Deprecated
public static MetricProducer create() {
return new OpenCensusMetricProducer(Metrics.getExportComponent().getMetricProducerManager());
}
diff --git a/opencensus-shim/src/main/java/io/opentelemetry/opencensusshim/OpenTelemetryContextManager.java b/opencensus-shim/src/main/java/io/opentelemetry/opencensusshim/OpenTelemetryContextManager.java
index 24d9818645c..65c7a9174b4 100644
--- a/opencensus-shim/src/main/java/io/opentelemetry/opencensusshim/OpenTelemetryContextManager.java
+++ b/opencensus-shim/src/main/java/io/opentelemetry/opencensusshim/OpenTelemetryContextManager.java
@@ -16,12 +16,25 @@
* {@link io.opencensus.trace.unsafe.ContextManagerImpl}. It is loaded by OpenCensus via reflection
* automatically in {@link io.opencensus.trace.unsafe.ContextHandleUtils} when the OpenCensus shim
* library exists as a dependency.
+ *
+ * @deprecated OpenCensus compatibility is deprecated in the OpenTelemetry specification (see #5138).
+ * Expect this artifact to no longer be published after June 2027.
*/
+@Deprecated
public final class OpenTelemetryContextManager implements ContextManager {
private static final Logger LOGGER =
Logger.getLogger(OpenTelemetryContextManager.class.getName());
+ /**
+ * Creates the context manager loaded by OpenCensus through reflection.
+ *
+ * @deprecated OpenCensus compatibility is deprecated in the OpenTelemetry specification (see #5138).
+ * Expect this artifact to no longer be published after June 2027.
+ */
+ @Deprecated
@SuppressWarnings("unused") // Loaded via reflection
public OpenTelemetryContextManager() {}
diff --git a/opencensus-shim/src/main/java/io/opentelemetry/opencensusshim/OpenTelemetrySpanImpl.java b/opencensus-shim/src/main/java/io/opentelemetry/opencensusshim/OpenTelemetrySpanImpl.java
index 87c41b1ff07..5e4c76a386b 100644
--- a/opencensus-shim/src/main/java/io/opentelemetry/opencensusshim/OpenTelemetrySpanImpl.java
+++ b/opencensus-shim/src/main/java/io/opentelemetry/opencensusshim/OpenTelemetrySpanImpl.java
@@ -39,6 +39,8 @@
import io.opencensus.trace.MessageEvent;
import io.opencensus.trace.Span;
import io.opencensus.trace.Status;
+import io.opencensus.trace.TraceOptions;
+import io.opencensus.trace.Tracestate;
import io.opentelemetry.api.common.AttributeKey;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.common.AttributesBuilder;
@@ -46,13 +48,12 @@
import io.opentelemetry.api.trace.StatusCode;
import java.util.EnumSet;
import java.util.Map;
-import java.util.logging.Logger;
class OpenTelemetrySpanImpl extends Span
implements io.opentelemetry.api.trace.Span, DelegatingSpan {
- private static final Logger LOGGER = Logger.getLogger(OpenTelemetrySpanImpl.class.getName());
private static final EnumSet OpenCensus compatibility is deprecated in the OpenTelemetry specification, and this shim is
+ * deprecated accordingly. Use this package only for legacy compatibility while migrating OpenCensus
+ * instrumentation to the OpenTelemetry APIs.
+ */
@ParametersAreNonnullByDefault
package io.opentelemetry.opencensusshim;
diff --git a/opencensus-shim/src/test/java/io/opentelemetry/opencensusshim/OpenCensusMetricProducerTest.java b/opencensus-shim/src/test/java/io/opentelemetry/opencensusshim/OpenCensusMetricProducerTest.java
index 67996be5e06..c4fbca32ff3 100644
--- a/opencensus-shim/src/test/java/io/opentelemetry/opencensusshim/OpenCensusMetricProducerTest.java
+++ b/opencensus-shim/src/test/java/io/opentelemetry/opencensusshim/OpenCensusMetricProducerTest.java
@@ -30,6 +30,7 @@
import org.awaitility.Awaitility;
import org.junit.jupiter.api.Test;
+@SuppressWarnings("deprecation") // testing deprecated shim API
class OpenCensusMetricProducerTest {
private final MetricProducer openCensusMetrics = OpenCensusMetricProducer.create();
diff --git a/opencensus-shim/src/test/java/io/opentelemetry/opencensusshim/OpenCensusMetricsTest.java b/opencensus-shim/src/test/java/io/opentelemetry/opencensusshim/OpenCensusMetricsTest.java
index 4539045c435..3c0db5297b1 100644
--- a/opencensus-shim/src/test/java/io/opentelemetry/opencensusshim/OpenCensusMetricsTest.java
+++ b/opencensus-shim/src/test/java/io/opentelemetry/opencensusshim/OpenCensusMetricsTest.java
@@ -19,6 +19,7 @@
import org.awaitility.Awaitility;
import org.junit.jupiter.api.Test;
+@SuppressWarnings("deprecation") // testing deprecated shim API
class OpenCensusMetricsTest {
private static final StatsRecorder STATS_RECORDER = Stats.getStatsRecorder();
diff --git a/opencensus-shim/src/test/java/io/opentelemetry/opencensusshim/OpenTelemetrySpanImplTest.java b/opencensus-shim/src/test/java/io/opentelemetry/opencensusshim/OpenTelemetrySpanImplTest.java
index 448c032a3f8..e700d5b30f6 100644
--- a/opencensus-shim/src/test/java/io/opentelemetry/opencensusshim/OpenTelemetrySpanImplTest.java
+++ b/opencensus-shim/src/test/java/io/opentelemetry/opencensusshim/OpenTelemetrySpanImplTest.java
@@ -5,16 +5,27 @@
package io.opentelemetry.opencensusshim;
+import static io.opentelemetry.api.common.AttributeKey.stringKey;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import io.opencensus.trace.AttributeValue;
+import io.opencensus.trace.Link;
+import io.opencensus.trace.SpanId;
import io.opencensus.trace.Status;
+import io.opencensus.trace.TraceId;
+import io.opencensus.trace.TraceOptions;
+import io.opencensus.trace.Tracestate;
+import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.trace.Span;
import io.opentelemetry.api.trace.SpanContext;
import io.opentelemetry.api.trace.StatusCode;
+import io.opentelemetry.api.trace.TraceFlags;
+import io.opentelemetry.api.trace.TraceState;
+import java.util.Collections;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
@@ -26,6 +37,9 @@
@MockitoSettings(strictness = Strictness.LENIENT)
class OpenTelemetrySpanImplTest {
+ private static final String TRACE_ID = "0123456789abcdef0123456789abcdef";
+ private static final String SPAN_ID = "fedcba9876543210";
+
@Mock private Span otelSpan;
private OpenTelemetrySpanImpl shimSpan() {
@@ -47,4 +61,35 @@ void setStatus_withoutDescription_setsCodeOnly() {
verify(otelSpan).setStatus(StatusCode.OK);
verify(otelSpan, never()).setStatus(any(StatusCode.class), anyString());
}
+
+ @Test
+ void addLink_delegatesToOtelSpan() {
+ shimSpan().addLink(Link.fromSpanContext(ocSpanContext(), Link.Type.CHILD_LINKED_SPAN));
+
+ verify(otelSpan).addLink(expectedOtelSpanContext(), Attributes.empty());
+ }
+
+ @Test
+ void addLink_mapsAttributes() {
+ shimSpan()
+ .addLink(
+ Link.fromSpanContext(
+ ocSpanContext(),
+ Link.Type.PARENT_LINKED_SPAN,
+ Collections.singletonMap("key", AttributeValue.stringAttributeValue("value"))));
+
+ verify(otelSpan).addLink(expectedOtelSpanContext(), Attributes.of(stringKey("key"), "value"));
+ }
+
+ private static io.opencensus.trace.SpanContext ocSpanContext() {
+ return io.opencensus.trace.SpanContext.create(
+ TraceId.fromLowerBase16(TRACE_ID),
+ SpanId.fromLowerBase16(SPAN_ID),
+ TraceOptions.DEFAULT,
+ Tracestate.builder().build());
+ }
+
+ private static SpanContext expectedOtelSpanContext() {
+ return SpanContext.create(TRACE_ID, SPAN_ID, TraceFlags.getDefault(), TraceState.getDefault());
+ }
}
diff --git a/opentracing-shim/src/main/java/io/opentelemetry/opentracingshim/Propagation.java b/opentracing-shim/src/main/java/io/opentelemetry/opentracingshim/Propagation.java
index 04f0407b4a8..e67bf4fa73d 100644
--- a/opentracing-shim/src/main/java/io/opentelemetry/opentracingshim/Propagation.java
+++ b/opentracing-shim/src/main/java/io/opentelemetry/opentracingshim/Propagation.java
@@ -46,7 +46,9 @@ Multiple calls will execute the customizers in order.
*/
diff --git a/sdk-extensions/autoconfigure/src/main/java/io/opentelemetry/sdk/autoconfigure/SpanExporterConfiguration.java b/sdk-extensions/autoconfigure/src/main/java/io/opentelemetry/sdk/autoconfigure/SpanExporterConfiguration.java
index 1cb0f84181c..f98fe404330 100644
--- a/sdk-extensions/autoconfigure/src/main/java/io/opentelemetry/sdk/autoconfigure/SpanExporterConfiguration.java
+++ b/sdk-extensions/autoconfigure/src/main/java/io/opentelemetry/sdk/autoconfigure/SpanExporterConfiguration.java
@@ -32,7 +32,6 @@ final class SpanExporterConfiguration {
EXPORTER_ARTIFACT_ID_BY_NAME.put("logging", "opentelemetry-exporter-logging");
EXPORTER_ARTIFACT_ID_BY_NAME.put("logging-otlp", "opentelemetry-exporter-logging-otlp");
EXPORTER_ARTIFACT_ID_BY_NAME.put("otlp", "opentelemetry-exporter-otlp");
- EXPORTER_ARTIFACT_ID_BY_NAME.put("zipkin", "opentelemetry-exporter-zipkin");
}
// Visible for testing
diff --git a/sdk-extensions/autoconfigure/src/test/java/io/opentelemetry/sdk/autoconfigure/SpanExporterConfigurationTest.java b/sdk-extensions/autoconfigure/src/test/java/io/opentelemetry/sdk/autoconfigure/SpanExporterConfigurationTest.java
index 3ac7ce6c269..79c848db2d7 100644
--- a/sdk-extensions/autoconfigure/src/test/java/io/opentelemetry/sdk/autoconfigure/SpanExporterConfigurationTest.java
+++ b/sdk-extensions/autoconfigure/src/test/java/io/opentelemetry/sdk/autoconfigure/SpanExporterConfigurationTest.java
@@ -45,11 +45,6 @@ void configureExporter_KnownSpiExportersNotOnClasspath() {
.hasMessage(
"otel.traces.exporter set to \"otlp\" but opentelemetry-exporter-otlp"
+ " not found on classpath. Make sure to add it as a dependency.");
- assertThatThrownBy(() -> configureExporter("zipkin", spiExportersManager))
- .isInstanceOf(ConfigurationException.class)
- .hasMessage(
- "otel.traces.exporter set to \"zipkin\" but opentelemetry-exporter-zipkin"
- + " not found on classpath. Make sure to add it as a dependency.");
// Unrecognized exporter
assertThatThrownBy(() -> configureExporter("foo", spiExportersManager))
diff --git a/sdk-extensions/autoconfigure/src/testFullConfig/java/io/opentelemetry/sdk/autoconfigure/ConfigurableSpanExporterTest.java b/sdk-extensions/autoconfigure/src/testFullConfig/java/io/opentelemetry/sdk/autoconfigure/ConfigurableSpanExporterTest.java
index d09dd4ce0d5..aeea76a4d87 100644
--- a/sdk-extensions/autoconfigure/src/testFullConfig/java/io/opentelemetry/sdk/autoconfigure/ConfigurableSpanExporterTest.java
+++ b/sdk-extensions/autoconfigure/src/testFullConfig/java/io/opentelemetry/sdk/autoconfigure/ConfigurableSpanExporterTest.java
@@ -13,7 +13,6 @@
import io.opentelemetry.exporter.logging.LoggingSpanExporter;
import io.opentelemetry.exporter.otlp.internal.OtlpSpanExporterProvider;
import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter;
-import io.opentelemetry.exporter.zipkin.ZipkinSpanExporter;
import io.opentelemetry.internal.testing.CleanupExtension;
import io.opentelemetry.sdk.autoconfigure.internal.NamedSpiManager;
import io.opentelemetry.sdk.autoconfigure.internal.SpiHelper;
@@ -164,14 +163,14 @@ void configureSpanProcessors_simpleSpanProcessor() {
@Test
void configureSpanProcessors_batchSpanProcessor() {
- String exporterName = "zipkin";
+ String exporterName = "noop";
List Static global providers are obfuscated when they are returned from the API to prevent users
* from casting them to their SDK specific implementation. For example, we do not want users to
- * use patterns like {@code (SdkMeterProvider) openTelemetry.getMeterProvider()}.
+ * use patterns like {@code (SdkLoggerProvider) openTelemetry.getLogsBridge()}.
*/
@ThreadSafe
// Visible for testing
diff --git a/sdk/common/src/jmh/java/io/opentelemetry/sdk/common/internal/AttributesMapBenchmark.java b/sdk/common/src/jmh/java/io/opentelemetry/sdk/common/internal/AttributesMapBenchmark.java
new file mode 100644
index 00000000000..e0baa45e405
--- /dev/null
+++ b/sdk/common/src/jmh/java/io/opentelemetry/sdk/common/internal/AttributesMapBenchmark.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright The OpenTelemetry Authors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package io.opentelemetry.sdk.common.internal;
+
+import static io.opentelemetry.api.common.AttributeKey.booleanKey;
+import static io.opentelemetry.api.common.AttributeKey.stringKey;
+
+import io.opentelemetry.api.common.AttributeKey;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Fork;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.OutputTimeUnit;
+import org.openjdk.jmh.annotations.Param;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.Warmup;
+import org.openjdk.jmh.infra.Blackhole;
+
+/**
+ * Microbenchmark for {@link AttributesMap}. Parametrized by number of attributes.
+ *
+ * Write scenarios:
+ *
+ * Read scenarios (run on a pre-filled map of {@code numAttributes} unique string entries):
+ *
+ * The map holds N string-typed entries; boolean keys for the same names locate each entry by
+ * name but fail the type check. Isolates the cost of a name-hit / type-miss lookup.
+ */
+ @Benchmark
+ public void getTypeMiss(Blackhole bh) {
+ for (int i = 0; i < numAttributes; i++) {
+ bh.consume(filledMap.get(boolKeys.get(i)));
+ }
+ }
+
+ /** Full iteration over all entries via {@code forEach}. */
+ @Benchmark
+ public void forEachAll(Blackhole bh) {
+ filledMap.forEach((k, v) -> bh.consume(v));
+ }
+
+ /**
+ * Combined write + read cycle: fill a fresh map with N unique string keys, then iterate all
+ * entries once. Models the dominant production path: N puts during span building, followed by one
+ * forEach at export time.
+ */
+ @Benchmark
+ public void putThenForEach(Blackhole bh) {
+ AttributesMap map = AttributesMap.create(CAPACITY, Integer.MAX_VALUE);
+ for (int i = 0; i < numAttributes; i++) {
+ map.put(stringKeys.get(i), values.get(i));
+ }
+ map.forEach((k, v) -> bh.consume(v));
+ }
+}
diff --git a/sdk/common/src/main/java/io/opentelemetry/sdk/common/internal/AttributesMap.java b/sdk/common/src/main/java/io/opentelemetry/sdk/common/internal/AttributesMap.java
index 0ddf9599752..2f66aef39b2 100644
--- a/sdk/common/src/main/java/io/opentelemetry/sdk/common/internal/AttributesMap.java
+++ b/sdk/common/src/main/java/io/opentelemetry/sdk/common/internal/AttributesMap.java
@@ -8,7 +8,9 @@
import io.opentelemetry.api.common.AttributeKey;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.common.AttributesBuilder;
+import java.util.Arrays;
import java.util.Collections;
+import java.util.ConcurrentModificationException;
import java.util.HashMap;
import java.util.Map;
import java.util.function.BiConsumer;
@@ -18,28 +20,82 @@
* A map with a fixed capacity that drops attributes when the map gets full, and which truncates
* string and array string attribute values to the {@link #lengthLimit}.
*
- * WARNING: In order to reduce memory allocation, this class extends {@link HashMap} when it
- * would be more appropriate to delegate. The problem with extending is that we don't enforce that
- * all {@link HashMap} methods for reading / writing data conform to the configured attribute
- * limits. Therefore, it's easy to accidentally call something like {@link Map#putAll(Map)} and
- * bypass the restrictions (see #7135). Callers MUST
- * take care to only call methods from {@link AttributesMap}, and not {@link HashMap}.
+ * Keyed internally by attribute name, so that attributes with the same name but different types
+ * are treated as the same key (last-value-wins), consistent with the OpenTelemetry specification.
+ *
+ * Backed by parallel arrays and an open-addressing {@code int[]} hash table (linear probing,
+ * load factor ≤ 0.5). Avoids per-entry object allocation; {@code forEach} is a tight sequential
+ * array loop with no pointer chasing.
+ *
+ * Not thread-safe. Callers sharing an instance across threads must externally
+ * synchronize. Concurrent mutation is undefined behavior and may throw {@link
+ * ArrayIndexOutOfBoundsException} as readers observe the parallel arrays and hash table in
+ * inconsistent states. {@link #forEach}'s {@link ConcurrentModificationException} on structural
+ * modification is a same-thread misuse detector, not a synchronization primitive.
*
* This class is internal and is hence not for public use. Its APIs are unstable and can change
* at any time.
*/
-public final class AttributesMap extends HashMap Using 0 lets {@code new int[n]} (JVM zero-initialization) serve as the initial fill,
+ * eliminating explicit {@code Arrays.fill} calls. Occupied slots store {@code entryIndex + 1} so
+ * that entry index 0 is distinguishable from EMPTY.
+ */
+ private static final int EMPTY = 0;
- private final long capacity;
+ private final int capacity;
private final int lengthLimit;
private int totalAddedValues = 0;
+ private int size = 0;
+
+ /**
+ * Open-addressing hash table: {@code hashTable[slot]} = index into entry arrays, or {@link
+ * #EMPTY}. Length is always a power of 2 and ≥ 2× the entry array length (load factor ≤ 0.5).
+ */
+ private int[] hashTable;
+
+ /** Cached {@code hashTable.length - 1}; kept in sync with {@link #hashTable}. */
+ private int mask;
+
+ /**
+ * Parallel entry arrays. For entry {@code i} (in insertion order):
+ *
+ * All three are reallocated together in {@link #grow}; entry positions never change.
+ */
+ private String[] entryNames;
+
+ private AttributeKey>[] entryKeys;
+ private Object[] entryValues;
+
+ /**
+ * Incremented on every mutation that changes observable state (insert or overwrite). Snapshotted
+ * by {@link #forEach} to detect same-thread structural modification during iteration.
+ */
+ private int modCount = 0;
private AttributesMap(long capacity, int lengthLimit) {
- this.capacity = capacity;
+ this.capacity = (int) Math.min(capacity, Integer.MAX_VALUE);
this.lengthLimit = lengthLimit;
+ int init = (int) Math.min(capacity, 16L);
+ entryNames = new String[init];
+ entryKeys = new AttributeKey>[init];
+ entryValues = new Object[init];
+ hashTable = new int[tableSizeFor(init)]; // JVM zero-init == EMPTY
+ mask = hashTable.length - 1;
}
/**
@@ -55,18 +111,45 @@ public static AttributesMap create(long capacity, int lengthLimit) {
/**
* Add the attribute key value pair, applying capacity and length limits. Callers MUST ensure the
* {@code value} type matches the type required by {@code key}.
+ *
+ * If an attribute with the same string key name already exists (regardless of type), it is
+ * overwritten — last-value-wins, consistent with the OTel spec.
*/
- @Override
@Nullable
public Object put(AttributeKey> key, @Nullable Object value) {
if (value == null) {
return null;
}
totalAddedValues++;
- if (size() >= capacity && !containsKey(key)) {
+ String name = key.getKey();
+ int slot = findSlot(name);
+ int stored = hashTable[slot];
+ if (stored == EMPTY && size >= capacity) {
+ // Drop new entry per spec. totalAddedValues++ above captures the drop for
+ // getTotalAddedValues() / downstream drop-count metrics.
return null;
}
- return super.put(key, AttributeUtil.applyAttributeLengthLimit(value, lengthLimit));
+ Object limitedValue = AttributeUtil.applyAttributeLengthLimit(value, lengthLimit);
+ int idx;
+ Object old;
+ if (stored == EMPTY) {
+ if (size == entryNames.length) {
+ grow();
+ slot = findSlot(name); // grow() rebuilt hashTable
+ }
+ idx = size;
+ entryNames[idx] = name;
+ hashTable[slot] = idx + 1;
+ size++;
+ old = null;
+ } else {
+ idx = stored - 1;
+ old = entryValues[idx];
+ }
+ modCount++;
+ entryKeys[idx] = key;
+ entryValues[idx] = limitedValue;
+ return old;
}
/** Generic overload of {@link #put(AttributeKey, Object)}. */
@@ -83,17 +166,34 @@ public int getTotalAddedValues() {
@Override
@Nullable
public See:
- * https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/datamodel.md#summary
+ * https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/data-model.md#summary
*
* Note: This is called "DoubleSummary" to reflect which primitives are used to record it,
* however "Summary" is the equivalent OTLP type.
diff --git a/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/samplers/Sampler.java b/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/samplers/Sampler.java
index 17837cab691..3f67b495b22 100644
--- a/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/samplers/Sampler.java
+++ b/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/samplers/Sampler.java
@@ -129,6 +129,7 @@ SamplingResult shouldSample(
* This method is called when the {@code SdkTracerProvider} is shut down.
*
* @return a {@link CompletableResultCode} which is completed when shutdown is finished.
+ * @since 1.65.0
*/
default CompletableResultCode shutdown() {
return CompletableResultCode.ofSuccess();
diff --git a/sdk/trace/src/test/java/io/opentelemetry/sdk/trace/SdkSpanBuilderTest.java b/sdk/trace/src/test/java/io/opentelemetry/sdk/trace/SdkSpanBuilderTest.java
index 2a69ade6702..b8f662e2791 100644
--- a/sdk/trace/src/test/java/io/opentelemetry/sdk/trace/SdkSpanBuilderTest.java
+++ b/sdk/trace/src/test/java/io/opentelemetry/sdk/trace/SdkSpanBuilderTest.java
@@ -1172,4 +1172,25 @@ void doNotCrash() {
})
.doesNotThrowAnyException();
}
+
+ @Test
+ void setAttribute_sameKeyDifferentType_lastValueWins() {
+ // Regression test for https://github.com/open-telemetry/opentelemetry-java/issues/7897
+ // Setting the same string key with different types must overwrite, not accumulate.
+ SdkSpan span =
+ (SdkSpan)
+ sdkTracer
+ .spanBuilder("test")
+ .setAttribute("key", "string_value")
+ .setAttribute("key", false)
+ .startSpan();
+ try {
+ Attributes attributes = span.toSpanData().getAttributes();
+ assertThat(attributes.size()).isEqualTo(1);
+ assertThat(attributes.get(booleanKey("key"))).isEqualTo(false);
+ assertThat(attributes.get(stringKey("key"))).isNull();
+ } finally {
+ span.end();
+ }
+ }
}
diff --git a/settings.gradle.kts b/settings.gradle.kts
index d6120e3b32b..593d6e29cb4 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -4,7 +4,7 @@ pluginManagement {
id("com.gradle.develocity") version "4.5.0"
id("de.undercouch.download") version "5.7.0"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
- id("org.graalvm.buildtools.native") version "1.1.6"
+ id("org.graalvm.buildtools.native") version "1.1.7"
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
}
}
@@ -47,7 +47,6 @@ include(":exporters:otlp:common")
include(":exporters:otlp:profiles")
include(":exporters:otlp:testing-internal")
include(":exporters:prometheus")
-include(":exporters:zipkin")
include(":integration-tests")
include(":integration-tests:otlp")
include(":integration-tests:tracecontext")
diff --git a/version.gradle.kts b/version.gradle.kts
index a084a0ff5be..87658fef864 100644
--- a/version.gradle.kts
+++ b/version.gradle.kts
@@ -2,7 +2,7 @@ val snapshot = true
val apidiffBaselineVersion = "1.64.0"
allprojects {
- var ver = "1.65.0"
+ var ver = "1.66.0"
val release = findProperty("otel.release")
if (release != null) {
ver += "-" + release
+ *
+ *
+ *
+ *
+ */
+@BenchmarkMode(Mode.AverageTime)
+@OutputTimeUnit(TimeUnit.NANOSECONDS)
+@Warmup(iterations = 5, time = 200, timeUnit = TimeUnit.MILLISECONDS)
+@Measurement(iterations = 10, time = 200, timeUnit = TimeUnit.MILLISECONDS)
+@Fork(2)
+@State(Scope.Thread)
+public class AttributesMapBenchmark {
+
+ // Default SpanLimits attribute count limit.
+ private static final int CAPACITY = 128;
+
+ @Param({"4", "16", "20", "32", "128"})
+ int numAttributes;
+
+ private List
+ *
+ *
+ *