diff --git a/.github/repository-settings.md b/.github/repository-settings.md index 874eebfab7a..79d583584b1 100644 --- a/.github/repository-settings.md +++ b/.github/repository-settings.md @@ -71,9 +71,5 @@ Same settings as above for `main`, except: * `GPG_PASSWORD` - stored in OpenTelemetry-Java 1Password * `GPG_PRIVATE_KEY` - stored in OpenTelemetry-Java 1Password -* `DEVELOCITY_ACCESS_KEY` - owned by [@jack-berg](https://github.com/jack-berg) - * Generated at https://ge.opentelemetry.io > My settings > Access keys - * format of env var is `ge.opentelemetry.io=`, - see [docs](https://docs.gradle.com/enterprise/gradle-plugin/#via_environment_variable) * `SONATYPE_KEY` - owned by [@jack-berg](https://github.com/jack-berg) * `SONATYPE_USER` - owned by [@jack-berg](https://github.com/jack-berg) diff --git a/.github/workflows/benchmark-tags.yml b/.github/workflows/benchmark-tags.yml index 9953fef010a..5831c0f9819 100644 --- a/.github/workflows/benchmark-tags.yml +++ b/.github/workflows/benchmark-tags.yml @@ -54,8 +54,6 @@ jobs: uses: gradle/actions/setup-gradle@v4 - name: Run jmh run: ./gradlew jmhJar - env: - GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - name: Run Benchmark run: | diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 7a8160dbca7..1f026b2c654 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -24,8 +24,6 @@ jobs: uses: gradle/actions/setup-gradle@v4 - name: Run jmh run: ./gradlew jmhJar - env: - GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - name: Run Benchmark run: | diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7a4430a67e..7244872f30f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,7 +75,6 @@ jobs: "-Porg.gradle.java.installations.paths=${{ steps.setup-java-test.outputs.path }}" "-Porg.gradle.java.installations.auto-download=false" env: - GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} # JMH-based tests run only if this environment variable is set to true RUN_JMH_BASED_TESTS: ${{ matrix.jmh-based-tests }} @@ -97,7 +96,7 @@ jobs: exit 1 fi - - uses: codecov/codecov-action@v4 + - uses: codecov/codecov-action@v5 if: ${{ matrix.coverage }} env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml index a268b37d019..9959faf2be1 100644 --- a/.github/workflows/gradle-wrapper-validation.yml +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -13,4 +13,4 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: gradle/actions/wrapper-validation@v4.1.0 + - uses: gradle/actions/wrapper-validation@v4.2.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index bef5be2c39b..518d78c4063 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,65 @@ # Changelog -## Unreleased +## Version 1.45.0 (2024-12-06) + +### API + +* Add convenience method `setAttribute(Attribute, int)` to SpanBuilder (matching the existing + convenience method in Span) + ([#6884](https://github.com/open-telemetry/opentelemetry-java/pull/6884)) +* Extends TextMapGetter with experimental GetAll() method, implement usage in W3CBaggagePropagator + ([#6852](https://github.com/open-telemetry/opentelemetry-java/pull/6852)) + +### SDK + +#### Traces + +* Add synchronization to SimpleSpanProcessor to ensure thread-safe export of spans + ([#6885](https://github.com/open-telemetry/opentelemetry-java/pull/6885)) + +#### Metrics + +* Lazily initialize ReservoirCells + ([#6851](https://github.com/open-telemetry/opentelemetry-java/pull/6851)) + +#### Logs + +* Add synchronization to SimpleLogRecordProcessor to ensure thread-safe export of logs + ([#6885](https://github.com/open-telemetry/opentelemetry-java/pull/6885)) + +#### Exporters + +* OTLP: Update opentelementry-proto to 1.4 + ([#6906](https://github.com/open-telemetry/opentelemetry-java/pull/6906)) +* OTLP: Rename internal Marshaler#writeJsonToGenerator method to allow jackson runtimeOnly dependency + ([#6896](https://github.com/open-telemetry/opentelemetry-java/pull/6896)) +* OTLP: Fix repeated string serialization for JSON. + ([#6888](https://github.com/open-telemetry/opentelemetry-java/pull/6888)) +* OTLP: Fix missing unsafe available check + ([#6920](https://github.com/open-telemetry/opentelemetry-java/pull/6920)) + +#### Extensions + +* Declarative config: Don't require empty objects when referencing custom components + ([#6891](https://github.com/open-telemetry/opentelemetry-java/pull/6891)) + +### Tooling + +* Add javadoc boilerplate internal comment v2 for experimental classes + ([#6886](https://github.com/open-telemetry/opentelemetry-java/pull/6886)) +* Update develocity configuration + ([#6903](https://github.com/open-telemetry/opentelemetry-java/pull/6903)) + +## Version 1.44.1 (2024-11-10) + +### SDK + +#### Traces + +* Fix regression in event attributes + ([#6865](https://github.com/open-telemetry/opentelemetry-java/pull/6865)) + +## Version 1.44.0 (2024-11-08) ### API diff --git a/README.md b/README.md index 3503236b277..633be605b34 100644 --- a/README.md +++ b/README.md @@ -4,180 +4,169 @@ [![Maven Central][maven-image]][maven-url] [![Reproducible Builds](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/jvm-repo-rebuild/reproducible-central/master/content/io/opentelemetry/java/badge.json)](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/io/opentelemetry/java/README.md) -## Project Status +`opentelemetry-java` is the home of the Java implementation of the OpenTelemetry API for recording +telemetry, and SDK for managing telemetry recorded by the API. -See [Java status on OpenTelemetry.io][otel-java-status]. +See [opentelemetry.io Java Documentation](https://opentelemetry.io/docs/languages/java/intro/) for: -## Getting Started +* An overview of the OpenTelemetry Java ecosystem and key repositories +* Detailed documentation on the components published from this repository +* Review of instrumentation ecosystem, including OpenTelemetry Java agent +* End-to-end working code examples +* And more -If you are looking for an all-in-one, easy-to-install **auto-instrumentation -javaagent**, see [opentelemetry-java-instrumentation][]. +## Requirements -If you are looking for **examples** on how to use the OpenTelemetry API to -write your own **manual instrumentation**, or how to set up the OpenTelemetry -Java SDK, see [Manual instrumentation][]. Fully-functional examples -are available in [opentelemetry-java-examples][]. +Unless otherwise noted, all published artifacts support Java 8 or higher. +See [language version compatibility](VERSIONING.md#language-version-compatibility) for complete +details. -If you are looking for generated classes for -the [OpenTelemetry semantic conventions][opentelemetry-semantic-conventions], -see [semantic-conventions-java][opentelemetry-semantic-conventions-java]. +**Android Disclaimer:** For compatibility +reasons, [library desugaring](https://developer.android.com/studio/write/java8-support#library-desugaring) +must be enabled. -For a general overview of OpenTelemetry, visit [opentelemetry.io][]. +See [contributing](#contributing) for details on building this project locally. -Would you like to get involved with the project? Read our [contributing guide](CONTRIBUTING.md). We welcome -contributions! +## Releases -## Contacting us +Releases are published to maven central. We +publish [minor releases monthly](RELEASING.md#release-cadence) +and [patch releases as needed](RELEASING.md#preparing-a-new-patch-release). -We hold regular meetings. See details at [community page](https://github.com/open-telemetry/community#java-sdk). +See [releases](https://github.com/open-telemetry/opentelemetry-java/releases) for a listing of +released versions and notes (see also [changelog](CHANGELOG.md)). -We use [GitHub Discussions](https://github.com/open-telemetry/opentelemetry-java/discussions) -for support or general questions. Feel free to drop us a line. +## Artifacts -We are also present in the [`#otel-java`](https://cloud-native.slack.com/archives/C014L2KCTE3) channel in the [CNCF slack](https://slack.cncf.io/). -Please join us for more informal discussions. +The artifacts published by this repository are summarized below in tables, organized in collapsible +sections by topic. -To report a bug, or request a new feature, -please [open an issue](https://github.com/open-telemetry/opentelemetry-java/issues/new/choose). +As discussed in [compatibility](#compatibility), artifact versions must be kept in sync, for which +we strongly recommend [using one of our BOMs][dependencies-and-boms]. -## Overview +
+ Bill of Materials (BOMs) -OpenTelemetry is the merging of OpenCensus and OpenTracing into a single project. +A bill of materials (or BOM) helps sync dependency versions of related artifacts. -This project contains the following top level components: +| Component | Description | Artifact ID | Version | Javadoc | +|----------------------------------------------|----------------------------------------|---------------------------|-------------------------------------------------------------|---------| +| [Bill of Materials (BOM)](./bom) | Bill of materials for stable artifacts | `opentelemetry-bom` | 1.44.1 | N/A | +| [Alpha Bill of Materials (BOM)](./bom-alpha) | Bill of materials for alpha artifacts | `opentelemetry-bom-alpha` | 1.44.1-alpha | N/A | +
-* [OpenTelemetry API](api/): - * [stable apis](api/all) including `Tracer`, `Span`, `SpanContext`, `Meter`, and `Baggage`. - * [context api](context/) The OpenTelemetry Context implementation. - * [incubating apis](api/incubator) incubating APIs, including `Events`. -* [extensions](extensions/) define additional API extensions not part of the core API, including propagators. -* [sdk](sdk/) defines the implementation of the OpenTelemetry API. -* [exporters](exporters/) trace, metric, and log exporters for the SDK. -* [sdk-extensions](sdk-extensions/) defines additional SDK extensions, which are not part of the core SDK. -* [OpenTracing shim](opentracing-shim/) defines a bridge layer from OpenTracing to the OpenTelemetry API. -* [OpenCensus shim](opencensus-shim/) defines a bridge layer from OpenCensus to the OpenTelemetry API. +
+ API -This project publishes a lot of artifacts, listed in [releases](#releases). -[`opentelemetry-bom`](https://mvnrepository.com/artifact/io.opentelemetry/opentelemetry-bom) (BOM = -Bill of Materials) is provided to assist with synchronizing versions of -dependencies. [`opentelemetry-bom-alpha`](https://mvnrepository.com/artifact/io.opentelemetry/opentelemetry-bom-alpha) -provides the same function for unstable artifacts. See [published releases](#published-releases) for -instructions on using the BOMs. +The OpenTelemetry API for recording telemetry. -We would love to hear from the larger community: please provide feedback proactively. +| Component | Description | Artifact ID | Version | Javadoc | +|-----------------------------------|--------------------------------------------------------------------------------------|-------------------------------|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [API](./api/all) | OpenTelemetry API, including metrics, traces, baggage, context | `opentelemetry-api` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-api.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-api) | +| [API Incubator](./api/incubator) | API incubator, including pass through propagator, and extended tracer, and Event API | `opentelemetry-api-incubator` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-api-incubator.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-api-incubator) | +| [Context API](./context) | OpenTelemetry context API | `opentelemetry-context` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-context.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-context) | +
-## Requirements +
+ API Extensions -Unless otherwise noted, all published artifacts support Java 8 or higher. -See [language version compatibility](VERSIONING.md#language-version-compatibility) for complete -details. +Extensions to the OpenTelemetry API. -**Android Disclaimer:** For compatibility -reasons, [library desugaring](https://developer.android.com/studio/write/java8-support#library-desugaring) -must be enabled. +| Component | Description | Artifact ID | Version | Javadoc | +|---------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------|-------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [Kotlin Extension](./extensions/kotlin) | Context extension for coroutines | `opentelemetry-extension-kotlin` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-extension-kotlin.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-extension-kotlin) | +| [Trace Propagators Extension](./extensions/trace-propagators) | Trace propagators, including B3, Jaeger, OT Trace | `opentelemetry-extension-trace-propagators` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-extension-trace-propagators.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-extension-trace-propagators) | +
-See [CONTRIBUTING.md](./CONTRIBUTING.md) for additional instructions for building this project for -development. +
+ SDK -### Note about extensions +The OpenTelemetry SDK for managing telemetry producing by the API. -Both API and SDK extensions consist of various additional components which are excluded from the core artifacts -to keep them from growing too large. +| Component | Description | Artifact ID | Version | Javadoc | +|------------------------------|--------------------------------------------------------|-----------------------------|---------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [SDK](./sdk/all) | OpenTelemetry SDK, including metrics, traces, and logs | `opentelemetry-sdk` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk) | +| [Metrics SDK](./sdk/metrics) | OpenTelemetry metrics SDK | `opentelemetry-sdk-metrics` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk-metrics.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-metrics) | +| [Trace SDK](./sdk/trace) | OpenTelemetry trace SDK | `opentelemetry-sdk-trace` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk-trace.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-trace) | +| [Log SDK](./sdk/logs) | OpenTelemetry log SDK | `opentelemetry-sdk-logs` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk-logs.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-logs) | +| [SDK Common](./sdk/common) | Shared SDK components | `opentelemetry-sdk-common` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk-common.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-common) | +| [SDK Testing](./sdk/testing) | Components for testing OpenTelemetry instrumentation | `opentelemetry-sdk-testing` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk-testing.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-testing) | +
-We still aim to provide the same level of quality and guarantee for them as for the core components. -Please don't hesitate to use them if you find them useful. +
+ SDK Exporters -## Project setup and contributing +SDK exporters for shipping traces, metrics, and logs out of process. -Please refer to the [contribution guide](CONTRIBUTING.md) on how to set up for development and contribute! +| Component | Description | Artifact ID | Version | Javadoc | +|-----------------------------------------------------------------------|------------------------------------------------------------------------------|------------------------------------------------------|-------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [OTLP Exporters](./exporters/otlp/all) | OTLP gRPC & HTTP exporters, including traces, metrics, and logs | `opentelemetry-exporter-otlp` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-otlp.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-otlp) | +| [OTLP Logging Exporters](./exporters/logging-otlp) | Logging exporters in OTLP JSON encoding, including traces, metrics, and logs | `opentelemetry-exporter-logging-otlp` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-logging-otlp.svg)](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.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-otlp-common.svg)](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.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-logging.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-logging) | +| [Zipkin Exporter](./exporters/zipkin) | Zipkin trace exporter | `opentelemetry-exporter-zipkin` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-zipkin.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-zipkin) | +| [Prometheus Exporter](./exporters/prometheus) | Prometheus metric exporter | `opentelemetry-exporter-prometheus` | 1.44.1-alpha | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-prometheus.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-prometheus) | +| [Exporter Common](./exporters/common) | Shared exporter components (internal) | `opentelemetry-exporter-common` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-common.svg)](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.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-sender-okhttp.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-sender-okhttp) | +| [JDK Sender](./exporters/sender/jdk) | Java 11+ native HttpClient implementation of HttpSender (internal) | `opentelemetry-exporter-sender-jdk` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-sender-jdk.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-sender-jdk) | | +| [gRPC ManagedChannel Sender](./exporters/sender/grpc-managed-channel) | gRPC ManagedChannel implementation of GrpcSender (internal) | `opentelemetry-exporter-sender-grpc-managed-channel` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-sender-grpc-managed-channel.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-sender-grpc-managed-channel) | | +
+ +
+ SDK Extensions + +Extensions to the OpenTelemetry SDK. -## Published Releases +| Component | Description | Artifact ID | Version | Javadoc | +|-------------------------------------------------------------------------------|------------------------------------------------------------------------------------|-----------------------------------------------------|-------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [SDK Autoconfigure](./sdk-extensions/autoconfigure) | Autoconfigure OpenTelemetry SDK from env vars, system properties, and SPI | `opentelemetry-sdk-extension-autoconfigure` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk-extension-autoconfigure.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-extension-autoconfigure) | +| [SDK Autoconfigure SPI](./sdk-extensions/autoconfigure-spi) | Service Provider Interface (SPI) definitions for autoconfigure | `opentelemetry-sdk-extension-autoconfigure-spi` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk-extension-autoconfigure-spi.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-extension-autoconfigure-spi) | +| [SDK Jaeger Remote Sampler Extension](./sdk-extensions/jaeger-remote-sampler) | Sampler which obtains sampling configuration from remote Jaeger server | `opentelemetry-sdk-extension-jaeger-remote-sampler` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk-extension-jaeger-remote-sampler.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-extension-jaeger-remote-sampler) | +| [SDK Incubator](./sdk-extensions/incubator) | SDK incubator, including YAML based view configuration, LeakDetectingSpanProcessor | `opentelemetry-sdk-extension-incubator` | 1.44.1-alpha | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk-extension-incubator.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-extension-incubator) | +
-Published releases are available on maven central. We strongly recommend using our published BOM to keep all -dependency versions in sync. +
+ Shims -### Maven +Shims for bridging data from one observability library to another. -```xml - - - - - io.opentelemetry - opentelemetry-bom - 1.43.0 - pom - import - - - - - - io.opentelemetry - opentelemetry-api - - - -``` +| Component | Description | Artifact ID | Version | Javadoc | +|----------------------------------------|--------------------------------------------------------------|----------------------------------|-------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [OpenCensus Shim](./opencensus-shim) | Bridge opencensus metrics into the OpenTelemetry metrics SDK | `opentelemetry-opencensus-shim` | 1.44.1-alpha | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-opencensus-shim.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-opencensus-shim) | +| [OpenTracing Shim](./opentracing-shim) | Bridge opentracing spans into the OpenTelemetry trace API | `opentelemetry-opentracing-shim` | 1.44.1 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-opentracing-shim.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-opentracing-shim) | +
-### Gradle +## Dependencies -```groovy -dependencies { - implementation platform("io.opentelemetry:opentelemetry-bom:1.43.0") - implementation('io.opentelemetry:opentelemetry-api') -} -``` +To take a dependency, [include a BOM][dependencies-and-boms] and specify the dependency as follows, +replacing `{{artifact-id}}` with the value from the "Artifact ID" column +from [artifacts](#artifacts): -Note that if you want to use any artifacts that have not fully stabilized yet (such as the [prometheus exporter](https://github.com/open-telemetry/opentelemetry-java/tree/main/exporters/prometheus), then you will need to add an entry for the Alpha BOM as well, e.g. +
+ Gradle ```groovy -dependencies { - implementation platform("io.opentelemetry:opentelemetry-bom:1.43.0") - implementation platform('io.opentelemetry:opentelemetry-bom-alpha:1.43.0-alpha') - - implementation('io.opentelemetry:opentelemetry-api') - implementation('io.opentelemetry:opentelemetry-exporter-prometheus') - implementation('io.opentelemetry:opentelemetry-sdk-extension-autoconfigure') -} + implementation('io.opentelemetry:{{artifact-id}}') ``` +
-## Snapshots - -Snapshots based out the `main` branch are available for `opentelemetry-api`, `opentelemetry-sdk` and the rest of the artifacts. -We strongly recommend using our published BOM to keep all dependency versions in sync. - -### Maven +
+ Maven ```xml - - - - oss.sonatype.org-snapshot - https://oss.sonatype.org/content/repositories/snapshots - - - - - - io.opentelemetry - opentelemetry-bom - 1.44.0-SNAPSHOT - pom - import - - - - - - io.opentelemetry - opentelemetry-api - - - + + io.opentelemetry + {{artifact-id}} + ``` +
-### Gradle +### Snapshots + +Snapshots of the `main` branch are available as follows: + +
+ Gradle ```groovy repositories { @@ -185,115 +174,81 @@ repositories { } dependencies { - implementation platform("io.opentelemetry:opentelemetry-bom:1.44.0-SNAPSHOT") + implementation platform("io.opentelemetry:opentelemetry-bom:1.45.0-SNAPSHOT") implementation('io.opentelemetry:opentelemetry-api') } ``` +
-Libraries will usually only need `opentelemetry-api`, while applications -will want to use the `opentelemetry-sdk` module which contains our standard implementation -of the APIs. - -## Gradle composite builds - -For opentelemetry-java developers that need to test the latest source code with another -project, composite builds can be used as an alternative to `publishToMavenLocal`. This -requires some setup which is explained [here](CONTRIBUTING.md#composing-builds). - -## Releases - -See the [VERSIONING.md](VERSIONING.md) document for our policies for releases and compatibility -guarantees. - -Check out information about the [latest release](https://github.com/open-telemetry/opentelemetry-java/releases). - -See the project [milestones](https://github.com/open-telemetry/opentelemetry-java/milestones) -for details on upcoming releases. The dates and features described in issues -and milestones are estimates, and subject to change. - -The following tables describe the artifacts published by this project. To take a dependency, follow -the instructions in [Published Released](#published-releases) to include the BOM, and specify the -dependency as follows, replacing `{{artifact-id}}` with the value from the "Artifact ID" column: +
+ Maven ```xml - - io.opentelemetry - {{artifact-id}} - -``` - -```groovy - implementation('io.opentelemetry:{{artifact-id}}') + + + + oss.sonatype.org-snapshot + https://oss.sonatype.org/content/repositories/snapshots + + + + + + io.opentelemetry + opentelemetry-bom + 1.45.0-SNAPSHOT + pom + import + + + + + + io.opentelemetry + opentelemetry-api + + + ``` +
-### Bill of Material +## Compatibility -| Component | Description | Artifact ID | Version | Javadoc | -|----------------------------------------------|----------------------------------------|---------------------------|-------------------------------------------------------------|---------| -| [Bill of Materials (BOM)](./bom) | Bill of materials for stable artifacts | `opentelemetry-bom` | 1.43.0 | N/A | -| [Alpha Bill of Materials (BOM)](./bom-alpha) | Bill of materials for alpha artifacts | `opentelemetry-bom-alpha` | 1.43.0-alpha | N/A | +Artifacts from this repository follow semantic versioning. -### API - - -| Component | Description | Artifact ID | Version | Javadoc | -|-----------------------------------|--------------------------------------------------------------------------------------|-------------------------------|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| [API](./api/all) | OpenTelemetry API, including metrics, traces, baggage, context | `opentelemetry-api` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-api.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-api) | -| [API Incubator](./api/incubator) | API incubator, including pass through propagator, and extended tracer, and Event API | `opentelemetry-api-incubator` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-api-incubator.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-api-incubator) | -| [Context API](./context) | OpenTelemetry context API | `opentelemetry-context` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-context.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-context) | +Stable artifacts (i.e. artifacts without `-alpha` version suffix) come with strong backwards +compatibility guarantees for public APIs. -### API Extensions +Artifacts may depend on other artifacts from this repository, and may depend on internal APIs (i.e. +non-public APIs) which are subject to change across minor versions. Therefore, it's critical to keep +artifact versions in sync in order to avoid possible runtime exceptions. We strongly +recommend [using one of our BOMs][dependencies-and-boms] to assist in keeping artifacts in sync. -| Component | Description | Artifact ID | Version | Javadoc | -|---------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------|-------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| [Kotlin Extension](./extensions/kotlin) | Context extension for coroutines | `opentelemetry-extension-kotlin` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-extension-kotlin.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-extension-kotlin) | -| [Trace Propagators Extension](./extensions/trace-propagators) | Trace propagators, including B3, Jaeger, OT Trace | `opentelemetry-extension-trace-propagators` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-extension-trace-propagators.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-extension-trace-propagators) | +See the [VERSIONING.md](VERSIONING.md) for complete details on compatibility policy. -### SDK +## Contacting us -| Component | Description | Artifact ID | Version | Javadoc | -|------------------------------|--------------------------------------------------------|-----------------------------|---------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| [SDK](./sdk/all) | OpenTelemetry SDK, including metrics, traces, and logs | `opentelemetry-sdk` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk) | -| [Metrics SDK](./sdk/metrics) | OpenTelemetry metrics SDK | `opentelemetry-sdk-metrics` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk-metrics.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-metrics) | -| [Trace SDK](./sdk/trace) | OpenTelemetry trace SDK | `opentelemetry-sdk-trace` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk-trace.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-trace) | -| [Log SDK](./sdk/logs) | OpenTelemetry log SDK | `opentelemetry-sdk-logs` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk-logs.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-logs) | -| [SDK Common](./sdk/common) | Shared SDK components | `opentelemetry-sdk-common` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk-common.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-common) | -| [SDK Testing](./sdk/testing) | Components for testing OpenTelemetry instrumentation | `opentelemetry-sdk-testing` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk-testing.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-testing) | +We hold regular meetings. See details at [community page](https://github.com/open-telemetry/community#java-sdk). -### SDK Exporters +To report a bug, or request a new feature, +please [open an issue](https://github.com/open-telemetry/opentelemetry-java/issues/new/choose). -| Component | Description | Artifact ID | Version | Javadoc | -|-----------------------------------------------------------------------|------------------------------------------------------------------------------|------------------------------------------------------|-------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| [OTLP Exporters](./exporters/otlp/all) | OTLP gRPC & HTTP exporters, including traces, metrics, and logs | `opentelemetry-exporter-otlp` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-otlp.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-otlp) | -| [OTLP Logging Exporters](./exporters/logging-otlp) | Logging exporters in OTLP JSON encoding, including traces, metrics, and logs | `opentelemetry-exporter-logging-otlp` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-logging-otlp.svg)](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.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-otlp-common.svg)](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.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-logging.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-logging) | -| [Zipkin Exporter](./exporters/zipkin) | Zipkin trace exporter | `opentelemetry-exporter-zipkin` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-zipkin.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-zipkin) | -| [Prometheus Exporter](./exporters/prometheus) | Prometheus metric exporter | `opentelemetry-exporter-prometheus` | 1.43.0-alpha | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-prometheus.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-prometheus) | -| [Exporter Common](./exporters/common) | Shared exporter components (internal) | `opentelemetry-exporter-common` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-common.svg)](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.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-sender-okhttp.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-sender-okhttp) | -| [JDK Sender](./exporters/sender/jdk) | Java 11+ native HttpClient implementation of HttpSender (internal) | `opentelemetry-exporter-sender-jdk` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-sender-jdk.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-sender-jdk) | | -| [gRPC ManagedChannel Sender](./exporters/sender/grpc-managed-channel) | gRPC ManagedChannel implementation of GrpcSender (internal) | `opentelemetry-exporter-sender-grpc-managed-channel` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-sender-grpc-managed-channel.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-sender-grpc-managed-channel) | | - -### SDK Extensions +We use [GitHub Discussions](https://github.com/open-telemetry/opentelemetry-java/discussions) +for support or general questions. Feel free to drop us a line. -| Component | Description | Artifact ID | Version | Javadoc | -|-------------------------------------------------------------------------------|------------------------------------------------------------------------------------|-----------------------------------------------------|-------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| [SDK Autoconfigure](./sdk-extensions/autoconfigure) | Autoconfigure OpenTelemetry SDK from env vars, system properties, and SPI | `opentelemetry-sdk-extension-autoconfigure` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk-extension-autoconfigure.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-extension-autoconfigure) | -| [SDK Autoconfigure SPI](./sdk-extensions/autoconfigure-spi) | Service Provider Interface (SPI) definitions for autoconfigure | `opentelemetry-sdk-extension-autoconfigure-spi` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk-extension-autoconfigure-spi.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-extension-autoconfigure-spi) | -| [SDK Jaeger Remote Sampler Extension](./sdk-extensions/jaeger-remote-sampler) | Sampler which obtains sampling configuration from remote Jaeger server | `opentelemetry-sdk-extension-jaeger-remote-sampler` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk-extension-jaeger-remote-sampler.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-extension-jaeger-remote-sampler) | -| [SDK Incubator](./sdk-extensions/incubator) | SDK incubator, including YAML based view configuration, LeakDetectingSpanProcessor | `opentelemetry-sdk-extension-incubator` | 1.43.0-alpha | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk-extension-incubator.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-extension-incubator) | +We are also present in the [`#otel-java`](https://cloud-native.slack.com/archives/C014L2KCTE3) channel in the [CNCF slack](https://slack.cncf.io/). +Please join us for more informal discussions. -### Shims +## Contributing -| Component | Description | Artifact ID | Version | Javadoc | -|----------------------------------------|--------------------------------------------------------------|----------------------------------|-------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| [OpenCensus Shim](./opencensus-shim) | Bridge opencensus metrics into the OpenTelemetry metrics SDK | `opentelemetry-opencensus-shim` | 1.43.0-alpha | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-opencensus-shim.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-opencensus-shim) | -| [OpenTracing Shim](./opentracing-shim) | Bridge opentracing spans into the OpenTelemetry trace API | `opentelemetry-opentracing-shim` | 1.43.0 | [![Javadocs](https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-opentracing-shim.svg)](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-opentracing-shim) | +See [CONTRIBUTING.md](CONTRIBUTING.md) for: -## Contributing +* Details on building locally +* Project scope +* Keys to successful PRs +* Guide to using gradle composite builds -See [CONTRIBUTING.md](CONTRIBUTING.md) +### Code owners Triagers: @@ -335,12 +290,6 @@ Made with [contrib.rocks](https://contrib.rocks). [ci-url]: https://github.com/open-telemetry/opentelemetry-java/actions?query=workflow%3ABuild+branch%3Amain [codecov-image]: https://codecov.io/gh/open-telemetry/opentelemetry-java/branch/main/graph/badge.svg [codecov-url]: https://app.codecov.io/gh/open-telemetry/opentelemetry-java/branch/main/ -[Manual instrumentation]: https://opentelemetry.io/docs/java/manual_instrumentation/ +[dependencies-and-boms]: https://opentelemetry.io/docs/languages/java/intro/#dependencies-and-boms [maven-image]: https://maven-badges.herokuapp.com/maven-central/io.opentelemetry/opentelemetry-api/badge.svg [maven-url]: https://maven-badges.herokuapp.com/maven-central/io.opentelemetry/opentelemetry-api -[opentelemetry-java-instrumentation]: https://github.com/open-telemetry/opentelemetry-java-instrumentation -[opentelemetry-java-examples]: https://github.com/open-telemetry/opentelemetry-java-examples -[opentelemetry-semantic-conventions]: https://opentelemetry.io/docs/specs/semconv/ -[opentelemetry-semantic-conventions-java]: https://github.com/open-telemetry/semantic-conventions-java -[opentelemetry.io]: https://opentelemetry.io -[otel-java-status]: https://opentelemetry.io/docs/instrumentation/java/#status-and-releases diff --git a/api/all/src/main/java/io/opentelemetry/api/baggage/propagation/W3CBaggagePropagator.java b/api/all/src/main/java/io/opentelemetry/api/baggage/propagation/W3CBaggagePropagator.java index 150be6e4fdd..e03f8e9078f 100644 --- a/api/all/src/main/java/io/opentelemetry/api/baggage/propagation/W3CBaggagePropagator.java +++ b/api/all/src/main/java/io/opentelemetry/api/baggage/propagation/W3CBaggagePropagator.java @@ -16,7 +16,9 @@ import io.opentelemetry.context.propagation.TextMapGetter; import io.opentelemetry.context.propagation.TextMapPropagator; import io.opentelemetry.context.propagation.TextMapSetter; +import io.opentelemetry.context.propagation.internal.ExtendedTextMapGetter; import java.util.Collection; +import java.util.Iterator; import java.util.List; import javax.annotation.Nullable; @@ -95,6 +97,14 @@ public Context extract(Context context, @Nullable C carrier, TextMapGetter) getter); + } + return extractSingle(context, carrier, getter); + } + + private static Context extractSingle( + Context context, @Nullable C carrier, TextMapGetter getter) { String baggageHeader = getter.get(carrier, FIELD); if (baggageHeader == null) { return context; @@ -112,6 +122,33 @@ public Context extract(Context context, @Nullable C carrier, TextMapGetter Context extractMulti( + Context context, @Nullable C carrier, ExtendedTextMapGetter getter) { + Iterator baggageHeaders = getter.getAll(carrier, FIELD); + if (baggageHeaders == null) { + return context; + } + + boolean extracted = false; + BaggageBuilder baggageBuilder = Baggage.builder(); + + while (baggageHeaders.hasNext()) { + String header = baggageHeaders.next(); + if (header.isEmpty()) { + continue; + } + + try { + extractEntries(header, baggageBuilder); + extracted = true; + } catch (RuntimeException expected) { + // invalid baggage header, continue + } + } + + return extracted ? context.with(baggageBuilder.build()) : context; + } + private static void extractEntries(String baggageHeader, BaggageBuilder baggageBuilder) { new Parser(baggageHeader).parseInto(baggageBuilder); } diff --git a/api/all/src/main/java/io/opentelemetry/api/trace/SpanBuilder.java b/api/all/src/main/java/io/opentelemetry/api/trace/SpanBuilder.java index 3b1726933a8..c8727dd8471 100644 --- a/api/all/src/main/java/io/opentelemetry/api/trace/SpanBuilder.java +++ b/api/all/src/main/java/io/opentelemetry/api/trace/SpanBuilder.java @@ -238,6 +238,19 @@ public interface SpanBuilder { */ SpanBuilder setAttribute(AttributeKey key, T value); + /** + * Sets an attribute to the newly created {@code Span}. If {@code SpanBuilder} previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param key the key for this attribute. + * @param value the value for this attribute. + * @return this. + * @since 1.45.0 + */ + default SpanBuilder setAttribute(AttributeKey key, int value) { + return setAttribute(key, (long) value); + } + /** * Sets attributes to the {@link SpanBuilder}. If the {@link SpanBuilder} previously contained a * mapping for any of the keys, the old values are replaced by the specified values. diff --git a/api/all/src/test/java/io/opentelemetry/api/baggage/propagation/W3CBaggagePropagatorTest.java b/api/all/src/test/java/io/opentelemetry/api/baggage/propagation/W3CBaggagePropagatorTest.java index e775ed04f1e..fb0c342affc 100644 --- a/api/all/src/test/java/io/opentelemetry/api/baggage/propagation/W3CBaggagePropagatorTest.java +++ b/api/all/src/test/java/io/opentelemetry/api/baggage/propagation/W3CBaggagePropagatorTest.java @@ -8,14 +8,18 @@ import static java.util.Collections.singletonMap; import static org.assertj.core.api.Assertions.assertThat; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import io.opentelemetry.api.baggage.Baggage; import io.opentelemetry.api.baggage.BaggageEntryMetadata; import io.opentelemetry.context.Context; import io.opentelemetry.context.propagation.TextMapGetter; +import io.opentelemetry.context.propagation.internal.ExtendedTextMapGetter; import java.util.Collections; import java.util.HashMap; +import java.util.Iterator; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; import javax.annotation.Nullable; import org.junit.jupiter.api.Test; @@ -36,6 +40,28 @@ public String get(Map carrier, String key) { } }; + private static final ExtendedTextMapGetter>> multiGetter = + new ExtendedTextMapGetter>>() { + @Override + public Iterable keys(Map> carrier) { + return carrier.keySet(); + } + + @Nullable + @Override + public String get(Map> carrier, String key) { + return carrier.getOrDefault(key, Collections.emptyList()).stream() + .findFirst() + .orElse(null); + } + + @Override + public Iterator getAll(Map> carrier, String key) { + List values = carrier.get(key); + return values == null ? Collections.emptyIterator() : values.iterator(); + } + }; + @Test void fields() { assertThat(W3CBaggagePropagator.getInstance().fields()).containsExactly("baggage"); @@ -421,6 +447,101 @@ void extract_nullGetter() { .isSameAs(context); } + @Test + void extract_multiple_headers() { + W3CBaggagePropagator propagator = W3CBaggagePropagator.getInstance(); + + Context result = + propagator.extract( + Context.root(), + ImmutableMap.of("baggage", ImmutableList.of("k1=v1", "k2=v2")), + multiGetter); + + Baggage expectedBaggage = Baggage.builder().put("k1", "v1").put("k2", "v2").build(); + assertThat(Baggage.fromContext(result)).isEqualTo(expectedBaggage); + } + + @Test + void extract_multiple_headers_duplicate_key() { + W3CBaggagePropagator propagator = W3CBaggagePropagator.getInstance(); + + Context result = + propagator.extract( + Context.root(), + ImmutableMap.of("baggage", ImmutableList.of("k1=v1", "k1=v2")), + multiGetter); + + Baggage expectedBaggage = Baggage.builder().put("k1", "v2").build(); + assertThat(Baggage.fromContext(result)).isEqualTo(expectedBaggage); + } + + @Test + void extract_multiple_headers_mixed_duplicates_non_duplicates() { + W3CBaggagePropagator propagator = W3CBaggagePropagator.getInstance(); + + Context result = + propagator.extract( + Context.root(), + ImmutableMap.of("baggage", ImmutableList.of("k1=v1,k2=v0", "k2=v2,k3=v3")), + multiGetter); + + Baggage expectedBaggage = + Baggage.builder().put("k1", "v1").put("k2", "v2").put("k3", "v3").build(); + assertThat(Baggage.fromContext(result)).isEqualTo(expectedBaggage); + } + + @Test + void extract_multiple_headers_all_empty() { + W3CBaggagePropagator propagator = W3CBaggagePropagator.getInstance(); + + Context result = + propagator.extract( + Context.root(), ImmutableMap.of("baggage", ImmutableList.of("", "")), multiGetter); + + Baggage expectedBaggage = Baggage.builder().build(); + assertThat(Baggage.fromContext(result)).isEqualTo(expectedBaggage); + } + + @Test + void extract_multiple_headers_some_empty() { + W3CBaggagePropagator propagator = W3CBaggagePropagator.getInstance(); + + Context result = + propagator.extract( + Context.root(), ImmutableMap.of("baggage", ImmutableList.of("", "k=v")), multiGetter); + + Baggage expectedBaggage = Baggage.builder().put("k", "v").build(); + assertThat(Baggage.fromContext(result)).isEqualTo(expectedBaggage); + } + + @Test + void extract_multiple_headers_all_invalid() { + W3CBaggagePropagator propagator = W3CBaggagePropagator.getInstance(); + + Context result = + propagator.extract( + Context.root(), + ImmutableMap.of("baggage", ImmutableList.of("!@#$%^", "key=va%lue")), + multiGetter); + + Baggage expectedBaggage = Baggage.builder().build(); + assertThat(Baggage.fromContext(result)).isEqualTo(expectedBaggage); + } + + @Test + void extract_multiple_headers_some_invalid() { + W3CBaggagePropagator propagator = W3CBaggagePropagator.getInstance(); + + Context result = + propagator.extract( + Context.root(), + ImmutableMap.of("baggage", ImmutableList.of("k1=v1", "key=va%lue", "k2=v2")), + multiGetter); + + Baggage expectedBaggage = Baggage.builder().put("k1", "v1").put("k2", "v2").build(); + assertThat(Baggage.fromContext(result)).isEqualTo(expectedBaggage); + } + @Test void inject_noBaggage() { W3CBaggagePropagator propagator = W3CBaggagePropagator.getInstance(); diff --git a/api/testing-internal/src/main/java/io/opentelemetry/api/testing/internal/AbstractDefaultTracerTest.java b/api/testing-internal/src/main/java/io/opentelemetry/api/testing/internal/AbstractDefaultTracerTest.java index c90b7da21d9..c03f877f8a6 100644 --- a/api/testing-internal/src/main/java/io/opentelemetry/api/testing/internal/AbstractDefaultTracerTest.java +++ b/api/testing-internal/src/main/java/io/opentelemetry/api/testing/internal/AbstractDefaultTracerTest.java @@ -5,6 +5,7 @@ package io.opentelemetry.api.testing.internal; +import static io.opentelemetry.api.common.AttributeKey.longKey; import static io.opentelemetry.api.common.AttributeKey.stringKey; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatCode; @@ -155,6 +156,7 @@ void doNotCrash_NoopImplementation() { spanBuilder.setStartTimestamp(12345L, TimeUnit.NANOSECONDS); spanBuilder.setStartTimestamp(Instant.EPOCH); spanBuilder.setStartTimestamp(null); + spanBuilder.setAttribute(longKey("MyLongAttributeKey"), 123); assertThat(spanBuilder.startSpan().getSpanContext().isValid()).isFalse(); }) .doesNotThrowAnyException(); diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 21eb3cecc4b..3d90314dceb 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -65,9 +65,9 @@ dependencies { implementation("me.champeau.jmh:jmh-gradle-plugin:0.7.2") implementation("net.ltgt.gradle:gradle-errorprone-plugin:4.1.0") implementation("net.ltgt.gradle:gradle-nullaway-plugin:2.1.0") - implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.21") - implementation("org.owasp:dependency-check-gradle:11.1.0") - implementation("ru.vyarus:gradle-animalsniffer-plugin:1.7.1") + implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.0") + implementation("org.owasp:dependency-check-gradle:11.1.1") + implementation("ru.vyarus:gradle-animalsniffer-plugin:1.7.2") } // We can't apply conventions to this build so include important ones such as the Java compilation diff --git a/buildSrc/src/main/kotlin/otel.japicmp-conventions.gradle.kts b/buildSrc/src/main/kotlin/otel.japicmp-conventions.gradle.kts index 08dc25cfebc..e9a0ff0b408 100644 --- a/buildSrc/src/main/kotlin/otel.japicmp-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/otel.japicmp-conventions.gradle.kts @@ -181,7 +181,13 @@ if (!project.hasProperty("otel.release") && !project.name.startsWith("bom")) { // this is needed so that we only consider the current artifact, and not dependencies ignoreMissingClasses.set(true) - packageExcludes.addAll("*.internal", "*.internal.*", "io.opentelemetry.internal.shaded.jctools.*") + packageExcludes.addAll( + "*.internal", + "*.internal.*", + "io.opentelemetry.internal.shaded.jctools.*", + // Temporarily suppress warnings from public generated classes from :sdk-extensions:jaeger-remote-sampler + "io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2" + ) val baseVersionString = if (apiBaseVersion == null) "latest" else baselineVersion txtOutputFile.set( apiNewVersion?.let { file("$rootDir/docs/apidiffs/${apiNewVersion}_vs_$baselineVersion/${base.archivesName.get()}.txt") } diff --git a/buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts b/buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts index 8d75dc8e36b..3fbc9cb1daa 100644 --- a/buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts @@ -42,7 +42,7 @@ java { checkstyle { configDirectory.set(file("$rootDir/buildscripts/")) - toolVersion = "10.20.1" + toolVersion = "10.20.2" isIgnoreFailures = false configProperties["rootDir"] = rootDir } @@ -134,12 +134,6 @@ tasks { breakIterator(true) addBooleanOption("html5", true) - - // TODO (trask) revisit to see if url is fixed - // currently broken because https://docs.oracle.com/javase/8/docs/api/element-list is missing - // and redirects - // links("https://docs.oracle.com/javase/8/docs/api/") - addBooleanOption("Xdoclint:all,-missing", true) } } @@ -243,6 +237,7 @@ testing { compileOnly("com.google.auto.value:auto-value-annotations") compileOnly("com.google.errorprone:error_prone_annotations") compileOnly("com.google.code.findbugs:jsr305") + compileOnly("com.google.code.findbugs:annotations") implementation("org.junit.jupiter:junit-jupiter-api") implementation("org.junit.jupiter:junit-jupiter-params") diff --git a/context/src/main/java/io/opentelemetry/context/propagation/internal/ExtendedTextMapGetter.java b/context/src/main/java/io/opentelemetry/context/propagation/internal/ExtendedTextMapGetter.java new file mode 100644 index 00000000000..d64604757db --- /dev/null +++ b/context/src/main/java/io/opentelemetry/context/propagation/internal/ExtendedTextMapGetter.java @@ -0,0 +1,44 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.context.propagation.internal; + +import io.opentelemetry.context.propagation.TextMapGetter; +import java.util.Collections; +import java.util.Iterator; +import javax.annotation.Nullable; + +/** + * Extends {@link TextMapGetter} to return possibly multiple values for a given key. + * + *

This class is internal and experimental. Its APIs are unstable and can change at any time. Its + * APIs (or a version of them) may be promoted to the public stable API in the future, but no + * guarantees are made. + * + * @param carrier of propagation fields, such as an http request. + */ +public interface ExtendedTextMapGetter extends TextMapGetter { + /** + * If implemented, returns all values for a given {@code key} in order, or returns an empty list. + * + *

The default method returns the first value of the given propagation {@code key} as a + * singleton list, or returns an empty list. + * + *

This class is internal and is hence not for public use. Its APIs are unstable and can change + * at any time. + * + * @param carrier carrier of propagation fields, such as an http request. + * @param key the key of the field. + * @return all values for a given {@code key} in order, or returns an empty list. Default method + * wraps {@code get()} as an {@link Iterator}. + */ + default Iterator getAll(@Nullable C carrier, String key) { + String first = get(carrier, key); + if (first == null) { + return Collections.emptyIterator(); + } + return Collections.singleton(first).iterator(); + } +} diff --git a/context/src/test/java/io/opentelemetry/context/propagation/internal/ExtendedTextMapGetterTest.java b/context/src/test/java/io/opentelemetry/context/propagation/internal/ExtendedTextMapGetterTest.java new file mode 100644 index 00000000000..f8c35ea2ed9 --- /dev/null +++ b/context/src/test/java/io/opentelemetry/context/propagation/internal/ExtendedTextMapGetterTest.java @@ -0,0 +1,70 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.context.propagation.internal; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; + +import com.google.common.collect.ImmutableList; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import javax.annotation.Nullable; +import org.junit.jupiter.api.Test; + +class ExtendedTextMapGetterTest { + + final ExtendedTextMapGetter nullGet = + new ExtendedTextMapGetter() { + @Override + public Iterable keys(Void carrier) { + return ImmutableList.of("key"); + } + + @Nullable + @Override + public String get(@Nullable Void carrier, String key) { + return null; + } + }; + + final ExtendedTextMapGetter nonNullGet = + new ExtendedTextMapGetter() { + @Override + public Iterable keys(Void carrier) { + return ImmutableList.of("key"); + } + + @Override + public String get(@Nullable Void carrier, String key) { + return "123"; + } + }; + + @Test + void extendedTextMapGetterdefaultMethod_returnsEmpty() { + Iterator result = nullGet.getAll(null, "key"); + assertThat(result).isNotNull(); + List values = iterToList(result); + assertThat(values).isEqualTo(Collections.emptyList()); + } + + @Test + void extendedTextMapGetterdefaultMethod_returnsSingleVal() { + Iterator result = nonNullGet.getAll(null, "key"); + assertThat(result).isNotNull(); + List values = iterToList(result); + assertThat(values).isEqualTo(Collections.singletonList("123")); + } + + private static List iterToList(Iterator iter) { + List list = new ArrayList<>(); + while (iter.hasNext()) { + list.add(iter.next()); + } + return list; + } +} diff --git a/custom-checks/src/main/java/io/opentelemetry/gradle/customchecks/OtelInternalJavadoc.java b/custom-checks/src/main/java/io/opentelemetry/gradle/customchecks/OtelInternalJavadoc.java index 3ac6b964dac..0cc97d45abc 100644 --- a/custom-checks/src/main/java/io/opentelemetry/gradle/customchecks/OtelInternalJavadoc.java +++ b/custom-checks/src/main/java/io/opentelemetry/gradle/customchecks/OtelInternalJavadoc.java @@ -21,8 +21,10 @@ @BugPattern( summary = - "This public internal class doesn't end with the javadoc disclaimer: \"" - + OtelInternalJavadoc.EXPECTED_INTERNAL_COMMENT + "This public internal class doesn't end with any of the applicable javadoc disclaimers: \"" + + OtelInternalJavadoc.EXPECTED_INTERNAL_COMMENT_V1 + + "\", or \"" + + OtelInternalJavadoc.EXPECTED_INTERNAL_COMMENT_V2 + "\"", severity = WARNING) public class OtelInternalJavadoc extends BugChecker implements BugChecker.ClassTreeMatcher { @@ -31,17 +33,24 @@ public class OtelInternalJavadoc extends BugChecker implements BugChecker.ClassT private static final Pattern INTERNAL_PACKAGE_PATTERN = Pattern.compile("\\binternal\\b"); - static final String EXPECTED_INTERNAL_COMMENT = + static final String EXPECTED_INTERNAL_COMMENT_V1 = "This class is internal and is hence not for public use." + " Its APIs are unstable and can change at any time."; + static final String EXPECTED_INTERNAL_COMMENT_V2 = + "This class is internal and experimental. Its APIs are unstable and can change at any time." + + " Its APIs (or a version of them) may be promoted to the public stable API in the" + + " future, but no guarantees are made."; + @Override public Description matchClass(ClassTree tree, VisitorState state) { if (!isPublic(tree) || !isInternal(state) || tree.getSimpleName().toString().endsWith("Test")) { return Description.NO_MATCH; } String javadoc = getJavadoc(state); - if (javadoc != null && javadoc.contains(EXPECTED_INTERNAL_COMMENT)) { + if (javadoc != null + && (javadoc.contains(EXPECTED_INTERNAL_COMMENT_V1) + || javadoc.contains(EXPECTED_INTERNAL_COMMENT_V2))) { return Description.NO_MATCH; } return describeMatch(tree); diff --git a/custom-checks/src/test/resources/io/opentelemetry/gradle/customchecks/internal/InternalJavadocPositiveCases.java b/custom-checks/src/test/resources/io/opentelemetry/gradle/customchecks/internal/InternalJavadocPositiveCases.java index dc36e5ef636..f7a3042e4d6 100644 --- a/custom-checks/src/test/resources/io/opentelemetry/gradle/customchecks/internal/InternalJavadocPositiveCases.java +++ b/custom-checks/src/test/resources/io/opentelemetry/gradle/customchecks/internal/InternalJavadocPositiveCases.java @@ -5,13 +5,13 @@ package io.opentelemetry.gradle.customchecks.internal; -// BUG: Diagnostic contains: doesn't end with the javadoc disclaimer +// BUG: Diagnostic contains: doesn't end with any of the applicable javadoc disclaimers public class InternalJavadocPositiveCases { - // BUG: Diagnostic contains: doesn't end with the javadoc disclaimer + // BUG: Diagnostic contains: doesn't end with any of the applicable javadoc disclaimers public static class One {} /** Doesn't have the disclaimer. */ - // BUG: Diagnostic contains: doesn't end with the javadoc disclaimer + // BUG: Diagnostic contains: doesn't end with any of the applicable javadoc disclaimers public static class Two {} } diff --git a/dependencyManagement/build.gradle.kts b/dependencyManagement/build.gradle.kts index 5d89c61c083..11e38dffdfc 100644 --- a/dependencyManagement/build.gradle.kts +++ b/dependencyManagement/build.gradle.kts @@ -8,30 +8,31 @@ val dependencyVersions = hashMapOf() rootProject.extra["versions"] = dependencyVersions val DEPENDENCY_BOMS = listOf( - "com.fasterxml.jackson:jackson-bom:2.18.1", + "com.fasterxml.jackson:jackson-bom:2.18.2", "com.google.guava:guava-bom:33.3.1-jre", - "com.google.protobuf:protobuf-bom:3.25.5", - "com.linecorp.armeria:armeria-bom:1.30.1", + "com.google.protobuf:protobuf-bom:4.29.1", + "com.linecorp.armeria:armeria-bom:1.31.2", "com.squareup.okhttp3:okhttp-bom:4.12.0", "com.squareup.okio:okio-bom:3.9.1", // applies to transitive dependencies of okhttp - "io.grpc:grpc-bom:1.68.1", - "io.netty:netty-bom:4.1.114.Final", + "io.grpc:grpc-bom:1.68.2", + "io.netty:netty-bom:4.1.115.Final", "io.zipkin.brave:brave-bom:6.0.3", "io.zipkin.reporter2:zipkin-reporter-bom:3.4.2", "org.assertj:assertj-bom:3.26.3", "org.junit:junit-bom:5.11.3", - "org.testcontainers:testcontainers-bom:1.20.3", + "org.testcontainers:testcontainers-bom:1.20.4", "org.snakeyaml:snakeyaml-engine:2.8" ) val autoValueVersion = "1.11.0" -val errorProneVersion = "2.35.1" +val errorProneVersion = "2.36.0" val jmhVersion = "1.37" // Mockito 5.x.x requires Java 11 https://github.com/mockito/mockito/releases/tag/v5.0.0 val mockitoVersion = "4.11.0" val slf4jVersion = "2.0.16" val opencensusVersion = "0.31.1" val prometheusClientVersion = "0.16.0" +val prometheusServerVersion = "1.3.4" val DEPENDENCIES = listOf( "com.google.auto.value:auto-value:${autoValueVersion}", @@ -52,12 +53,15 @@ val DEPENDENCIES = listOf( "org.slf4j:slf4j-simple:${slf4jVersion}", "org.slf4j:jul-to-slf4j:${slf4jVersion}", "io.prometheus:prometheus-metrics-shaded-protobuf:1.3.1", + "io.prometheus:prometheus-metrics-exporter-httpserver:${prometheusServerVersion}", + "io.prometheus:prometheus-metrics-exposition-formats:${prometheusServerVersion}", "io.prometheus:simpleclient:${prometheusClientVersion}", "io.prometheus:simpleclient_common:${prometheusClientVersion}", "io.prometheus:simpleclient_httpserver:${prometheusClientVersion}", "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.48.0", + "com.google.api.grpc:proto-google-common-protos:2.49.0", + "com.google.code.findbugs:annotations:3.0.1", "com.google.code.findbugs:jsr305:3.0.2", "com.google.guava:guava-beta-checker:1.0", "com.sun.net.httpserver:http:20070405", @@ -69,12 +73,11 @@ val DEPENDENCIES = listOf( "io.jaegertracing:jaeger-client:1.8.1", "io.opentelemetry.contrib:opentelemetry-aws-xray-propagator:1.39.0-alpha", "io.opentelemetry.semconv:opentelemetry-semconv-incubating:1.28.0-alpha", - "io.opentelemetry.proto:opentelemetry-proto:1.3.2-alpha", + "io.opentelemetry.proto:opentelemetry-proto:1.4.0-alpha", "io.opentracing:opentracing-api:0.33.0", "io.opentracing:opentracing-noop:0.33.0", - "io.prometheus:prometheus-metrics-exporter-httpserver:1.3.3", "junit:junit:4.13.2", - "nl.jqno.equalsverifier:equalsverifier:3.17.3", + "nl.jqno.equalsverifier:equalsverifier:3.17.4", "org.awaitility:awaitility:4.2.2", "org.bouncycastle:bcpkix-jdk15on:1.70", "org.codehaus.mojo:animal-sniffer-annotations:1.24", diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-api.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-api.txt new file mode 100644 index 00000000000..9e70186c29f --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-api.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-api-1.44.0.jar against opentelemetry-api-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-context.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-context.txt new file mode 100644 index 00000000000..a0b2417ea3d --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-context.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-context-1.44.0.jar against opentelemetry-context-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-common.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-common.txt new file mode 100644 index 00000000000..c33ced08682 --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-common.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-exporter-common-1.44.0.jar against opentelemetry-exporter-common-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-logging-otlp.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-logging-otlp.txt new file mode 100644 index 00000000000..3384b7a6a8f --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-logging-otlp.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-exporter-logging-otlp-1.44.0.jar against opentelemetry-exporter-logging-otlp-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-logging.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-logging.txt new file mode 100644 index 00000000000..e0995445a2d --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-logging.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-exporter-logging-1.44.0.jar against opentelemetry-exporter-logging-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-otlp-common.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-otlp-common.txt new file mode 100644 index 00000000000..d5f44a6ee30 --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-otlp-common.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-exporter-otlp-common-1.44.0.jar against opentelemetry-exporter-otlp-common-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-otlp.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-otlp.txt new file mode 100644 index 00000000000..6b9b06b34dc --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-otlp.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-exporter-otlp-1.44.0.jar against opentelemetry-exporter-otlp-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-sender-grpc-managed-channel.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-sender-grpc-managed-channel.txt new file mode 100644 index 00000000000..da2b18615cf --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-sender-grpc-managed-channel.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-exporter-sender-grpc-managed-channel-1.44.0.jar against opentelemetry-exporter-sender-grpc-managed-channel-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-sender-jdk.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-sender-jdk.txt new file mode 100644 index 00000000000..fcd6cdf22e2 --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-sender-jdk.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-exporter-sender-jdk-1.44.0.jar against opentelemetry-exporter-sender-jdk-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-sender-okhttp.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-sender-okhttp.txt new file mode 100644 index 00000000000..884e240ae22 --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-sender-okhttp.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-exporter-sender-okhttp-1.44.0.jar against opentelemetry-exporter-sender-okhttp-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-zipkin.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-zipkin.txt new file mode 100644 index 00000000000..b2241eeb636 --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-exporter-zipkin.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-exporter-zipkin-1.44.0.jar against opentelemetry-exporter-zipkin-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-extension-kotlin.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-extension-kotlin.txt new file mode 100644 index 00000000000..8044b8f8eec --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-extension-kotlin.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-extension-kotlin-1.44.0.jar against opentelemetry-extension-kotlin-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-extension-trace-propagators.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-extension-trace-propagators.txt new file mode 100644 index 00000000000..da2fff0fb55 --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-extension-trace-propagators.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-extension-trace-propagators-1.44.0.jar against opentelemetry-extension-trace-propagators-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-opentracing-shim.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-opentracing-shim.txt new file mode 100644 index 00000000000..5a3e21de838 --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-opentracing-shim.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-opentracing-shim-1.44.0.jar against opentelemetry-opentracing-shim-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-common.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-common.txt new file mode 100644 index 00000000000..5ae9baeb962 --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-common.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-sdk-common-1.44.0.jar against opentelemetry-sdk-common-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-extension-autoconfigure-spi.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-extension-autoconfigure-spi.txt new file mode 100644 index 00000000000..2a9f6dfbf2b --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-extension-autoconfigure-spi.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-sdk-extension-autoconfigure-spi-1.44.0.jar against opentelemetry-sdk-extension-autoconfigure-spi-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-extension-autoconfigure.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-extension-autoconfigure.txt new file mode 100644 index 00000000000..227dd95136c --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-extension-autoconfigure.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-sdk-extension-autoconfigure-1.44.0.jar against opentelemetry-sdk-extension-autoconfigure-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-extension-jaeger-remote-sampler.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-extension-jaeger-remote-sampler.txt new file mode 100644 index 00000000000..a35f25ac548 --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-extension-jaeger-remote-sampler.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-sdk-extension-jaeger-remote-sampler-1.44.0.jar against opentelemetry-sdk-extension-jaeger-remote-sampler-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-logs.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-logs.txt new file mode 100644 index 00000000000..8605a4468ed --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-logs.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-sdk-logs-1.44.0.jar against opentelemetry-sdk-logs-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-metrics.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-metrics.txt new file mode 100644 index 00000000000..985d2734842 --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-metrics.txt @@ -0,0 +1,16 @@ +Comparing source compatibility of opentelemetry-sdk-metrics-1.44.0.jar against opentelemetry-sdk-metrics-1.43.0.jar ++++ NEW INTERFACE: PUBLIC(+) ABSTRACT(+) io.opentelemetry.sdk.metrics.export.CardinalityLimitSelector (not serializable) + +++ CLASS FILE FORMAT VERSION: 52.0 <- n.a. + +++ NEW SUPERCLASS: java.lang.Object + +++ NEW METHOD: PUBLIC(+) STATIC(+) io.opentelemetry.sdk.metrics.export.CardinalityLimitSelector defaultCardinalityLimitSelector() + +++ NEW METHOD: PUBLIC(+) ABSTRACT(+) int getCardinalityLimit(io.opentelemetry.sdk.metrics.InstrumentType) + +++ NEW ANNOTATION: java.lang.FunctionalInterface +*** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder (not serializable) + === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 + +++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder registerMetricReader(io.opentelemetry.sdk.metrics.export.MetricReader, io.opentelemetry.sdk.metrics.export.CardinalityLimitSelector) +*** MODIFIED CLASS: PUBLIC ABSTRACT io.opentelemetry.sdk.metrics.View (not serializable) + === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 + *** MODIFIED METHOD: PUBLIC (<- PACKAGE_PROTECTED) ABSTRACT int getCardinalityLimit() +*** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.sdk.metrics.ViewBuilder (not serializable) + === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 + *** MODIFIED METHOD: PUBLIC (<- PACKAGE_PROTECTED) io.opentelemetry.sdk.metrics.ViewBuilder setCardinalityLimit(int) diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-testing.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-testing.txt new file mode 100644 index 00000000000..8042c5e1b2d --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-testing.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-sdk-testing-1.44.0.jar against opentelemetry-sdk-testing-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-trace.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-trace.txt new file mode 100644 index 00000000000..452716a43f3 --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk-trace.txt @@ -0,0 +1,7 @@ +Comparing source compatibility of opentelemetry-sdk-trace-1.44.0.jar against opentelemetry-sdk-trace-1.43.0.jar ++++ NEW INTERFACE: PUBLIC(+) ABSTRACT(+) io.opentelemetry.sdk.trace.data.ExceptionEventData (not serializable) + +++ CLASS FILE FORMAT VERSION: 52.0 <- n.a. + +++ NEW INTERFACE: io.opentelemetry.sdk.trace.data.EventData + +++ NEW SUPERCLASS: java.lang.Object + +++ NEW METHOD: PUBLIC(+) STATIC(+) io.opentelemetry.sdk.trace.data.ExceptionEventData create(long, java.lang.Throwable, io.opentelemetry.api.common.Attributes, int) + +++ NEW METHOD: PUBLIC(+) ABSTRACT(+) java.lang.Throwable getException() diff --git a/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk.txt b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk.txt new file mode 100644 index 00000000000..333f8c4f5b0 --- /dev/null +++ b/docs/apidiffs/1.44.0_vs_1.43.0/opentelemetry-sdk.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-sdk-1.44.0.jar against opentelemetry-sdk-1.43.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-api.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-api.txt new file mode 100644 index 00000000000..227cbe9a7d7 --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-api.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-api-1.44.1.jar against opentelemetry-api-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-context.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-context.txt new file mode 100644 index 00000000000..1ba6fac89b4 --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-context.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-context-1.44.1.jar against opentelemetry-context-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-common.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-common.txt new file mode 100644 index 00000000000..f17cdd1ef90 --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-common.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-exporter-common-1.44.1.jar against opentelemetry-exporter-common-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-logging-otlp.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-logging-otlp.txt new file mode 100644 index 00000000000..8b093eaf0aa --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-logging-otlp.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-exporter-logging-otlp-1.44.1.jar against opentelemetry-exporter-logging-otlp-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-logging.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-logging.txt new file mode 100644 index 00000000000..c60e2be2842 --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-logging.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-exporter-logging-1.44.1.jar against opentelemetry-exporter-logging-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-otlp-common.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-otlp-common.txt new file mode 100644 index 00000000000..75bc9a388e8 --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-otlp-common.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-exporter-otlp-common-1.44.1.jar against opentelemetry-exporter-otlp-common-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-otlp.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-otlp.txt new file mode 100644 index 00000000000..c6b8d754b79 --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-otlp.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-exporter-otlp-1.44.1.jar against opentelemetry-exporter-otlp-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-sender-grpc-managed-channel.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-sender-grpc-managed-channel.txt new file mode 100644 index 00000000000..50b886238aa --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-sender-grpc-managed-channel.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-exporter-sender-grpc-managed-channel-1.44.1.jar against opentelemetry-exporter-sender-grpc-managed-channel-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-sender-jdk.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-sender-jdk.txt new file mode 100644 index 00000000000..33c42b914c4 --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-sender-jdk.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-exporter-sender-jdk-1.44.1.jar against opentelemetry-exporter-sender-jdk-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-sender-okhttp.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-sender-okhttp.txt new file mode 100644 index 00000000000..9f2ab4ddafb --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-sender-okhttp.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-exporter-sender-okhttp-1.44.1.jar against opentelemetry-exporter-sender-okhttp-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-zipkin.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-zipkin.txt new file mode 100644 index 00000000000..29340d90453 --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-exporter-zipkin.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-exporter-zipkin-1.44.1.jar against opentelemetry-exporter-zipkin-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-extension-kotlin.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-extension-kotlin.txt new file mode 100644 index 00000000000..467a926a409 --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-extension-kotlin.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-extension-kotlin-1.44.1.jar against opentelemetry-extension-kotlin-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-extension-trace-propagators.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-extension-trace-propagators.txt new file mode 100644 index 00000000000..bfcd1605834 --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-extension-trace-propagators.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-extension-trace-propagators-1.44.1.jar against opentelemetry-extension-trace-propagators-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-opentracing-shim.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-opentracing-shim.txt new file mode 100644 index 00000000000..c553192aca9 --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-opentracing-shim.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-opentracing-shim-1.44.1.jar against opentelemetry-opentracing-shim-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-common.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-common.txt new file mode 100644 index 00000000000..d07f1dadeb8 --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-common.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-sdk-common-1.44.1.jar against opentelemetry-sdk-common-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-extension-autoconfigure-spi.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-extension-autoconfigure-spi.txt new file mode 100644 index 00000000000..37aa938da9b --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-extension-autoconfigure-spi.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-sdk-extension-autoconfigure-spi-1.44.1.jar against opentelemetry-sdk-extension-autoconfigure-spi-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-extension-autoconfigure.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-extension-autoconfigure.txt new file mode 100644 index 00000000000..750b0e2c27f --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-extension-autoconfigure.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-sdk-extension-autoconfigure-1.44.1.jar against opentelemetry-sdk-extension-autoconfigure-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-extension-jaeger-remote-sampler.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-extension-jaeger-remote-sampler.txt new file mode 100644 index 00000000000..0643d17dfbb --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-extension-jaeger-remote-sampler.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-sdk-extension-jaeger-remote-sampler-1.44.1.jar against opentelemetry-sdk-extension-jaeger-remote-sampler-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-logs.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-logs.txt new file mode 100644 index 00000000000..26b4f4b3e5f --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-logs.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-sdk-logs-1.44.1.jar against opentelemetry-sdk-logs-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-metrics.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-metrics.txt new file mode 100644 index 00000000000..5031b75f9f6 --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-metrics.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-sdk-metrics-1.44.1.jar against opentelemetry-sdk-metrics-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-testing.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-testing.txt new file mode 100644 index 00000000000..b3c59ff77fd --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-testing.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-sdk-testing-1.44.1.jar against opentelemetry-sdk-testing-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-trace.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-trace.txt new file mode 100644 index 00000000000..2feb43d5d6b --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk-trace.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-sdk-trace-1.44.1.jar against opentelemetry-sdk-trace-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk.txt b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk.txt new file mode 100644 index 00000000000..37868ac312f --- /dev/null +++ b/docs/apidiffs/1.44.1_vs_1.44.0/opentelemetry-sdk.txt @@ -0,0 +1,2 @@ +Comparing source compatibility of opentelemetry-sdk-1.44.1.jar against opentelemetry-sdk-1.44.0.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-api.txt b/docs/apidiffs/current_vs_latest/opentelemetry-api.txt index 22b25875a3a..4bc9a878f22 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-api.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-api.txt @@ -1,2 +1,4 @@ -Comparing source compatibility of opentelemetry-api-1.44.0-SNAPSHOT.jar against opentelemetry-api-1.43.0.jar -No changes. \ No newline at end of file +Comparing source compatibility of opentelemetry-api-1.45.0-SNAPSHOT.jar against opentelemetry-api-1.44.1.jar +*** MODIFIED INTERFACE: PUBLIC ABSTRACT io.opentelemetry.api.trace.SpanBuilder (not serializable) + === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 + +++ NEW METHOD: PUBLIC(+) io.opentelemetry.api.trace.SpanBuilder setAttribute(io.opentelemetry.api.common.AttributeKey, int) diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-context.txt b/docs/apidiffs/current_vs_latest/opentelemetry-context.txt index cac847ecf2e..6dfe94027f0 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.44.0-SNAPSHOT.jar against opentelemetry-context-1.43.0.jar +Comparing source compatibility of opentelemetry-context-1.45.0-SNAPSHOT.jar against opentelemetry-context-1.44.1.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 27662633e4a..8692bd40f0d 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.44.0-SNAPSHOT.jar against opentelemetry-exporter-common-1.43.0.jar +Comparing source compatibility of opentelemetry-exporter-common-1.45.0-SNAPSHOT.jar against opentelemetry-exporter-common-1.44.1.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 f4eb50807c8..53e3a232b55 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.44.0-SNAPSHOT.jar against opentelemetry-exporter-logging-otlp-1.43.0.jar +Comparing source compatibility of opentelemetry-exporter-logging-otlp-1.45.0-SNAPSHOT.jar against opentelemetry-exporter-logging-otlp-1.44.1.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 19151b77a28..c4c1a7bb9e5 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.44.0-SNAPSHOT.jar against opentelemetry-exporter-logging-1.43.0.jar +Comparing source compatibility of opentelemetry-exporter-logging-1.45.0-SNAPSHOT.jar against opentelemetry-exporter-logging-1.44.1.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 cfc37ac9e71..190cf34e311 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.44.0-SNAPSHOT.jar against opentelemetry-exporter-otlp-common-1.43.0.jar +Comparing source compatibility of opentelemetry-exporter-otlp-common-1.45.0-SNAPSHOT.jar against opentelemetry-exporter-otlp-common-1.44.1.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 dff93d3af84..8f73054e163 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.44.0-SNAPSHOT.jar against opentelemetry-exporter-otlp-1.43.0.jar +Comparing source compatibility of opentelemetry-exporter-otlp-1.45.0-SNAPSHOT.jar against opentelemetry-exporter-otlp-1.44.1.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 1dd4bb6cf92..5eefbf7d6c1 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.44.0-SNAPSHOT.jar against opentelemetry-exporter-sender-grpc-managed-channel-1.43.0.jar +Comparing source compatibility of opentelemetry-exporter-sender-grpc-managed-channel-1.45.0-SNAPSHOT.jar against opentelemetry-exporter-sender-grpc-managed-channel-1.44.1.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 9ec3d17ba48..34a695b7df2 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.44.0-SNAPSHOT.jar against opentelemetry-exporter-sender-jdk-1.43.0.jar +Comparing source compatibility of opentelemetry-exporter-sender-jdk-1.45.0-SNAPSHOT.jar against opentelemetry-exporter-sender-jdk-1.44.1.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 5569153a8e9..89f989f8f99 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.44.0-SNAPSHOT.jar against opentelemetry-exporter-sender-okhttp-1.43.0.jar +Comparing source compatibility of opentelemetry-exporter-sender-okhttp-1.45.0-SNAPSHOT.jar against opentelemetry-exporter-sender-okhttp-1.44.1.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 index 692173ab320..3a9ad3b76f1 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-exporter-zipkin.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-exporter-zipkin.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-exporter-zipkin-1.44.0-SNAPSHOT.jar against opentelemetry-exporter-zipkin-1.43.0.jar +Comparing source compatibility of opentelemetry-exporter-zipkin-1.45.0-SNAPSHOT.jar against opentelemetry-exporter-zipkin-1.44.1.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 ba6ef24dc0c..589f2bff4a7 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.44.0-SNAPSHOT.jar against opentelemetry-extension-kotlin-1.43.0.jar +Comparing source compatibility of opentelemetry-extension-kotlin-1.45.0-SNAPSHOT.jar against opentelemetry-extension-kotlin-1.44.1.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 13c133ff51c..4de33099a46 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.44.0-SNAPSHOT.jar against opentelemetry-extension-trace-propagators-1.43.0.jar +Comparing source compatibility of opentelemetry-extension-trace-propagators-1.45.0-SNAPSHOT.jar against opentelemetry-extension-trace-propagators-1.44.1.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 f99d150208f..f45d2f75a1d 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.44.0-SNAPSHOT.jar against opentelemetry-opentracing-shim-1.43.0.jar +Comparing source compatibility of opentelemetry-opentracing-shim-1.45.0-SNAPSHOT.jar against opentelemetry-opentracing-shim-1.44.1.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 7c5dcaabee9..9c5036c7232 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.44.0-SNAPSHOT.jar against opentelemetry-sdk-common-1.43.0.jar +Comparing source compatibility of opentelemetry-sdk-common-1.45.0-SNAPSHOT.jar against opentelemetry-sdk-common-1.44.1.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 6dc02f3d53f..9c9a827fdf4 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.44.0-SNAPSHOT.jar against opentelemetry-sdk-extension-autoconfigure-spi-1.43.0.jar +Comparing source compatibility of opentelemetry-sdk-extension-autoconfigure-spi-1.45.0-SNAPSHOT.jar against opentelemetry-sdk-extension-autoconfigure-spi-1.44.1.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 b7251779550..aa2ec5b1d26 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.44.0-SNAPSHOT.jar against opentelemetry-sdk-extension-autoconfigure-1.43.0.jar +Comparing source compatibility of opentelemetry-sdk-extension-autoconfigure-1.45.0-SNAPSHOT.jar against opentelemetry-sdk-extension-autoconfigure-1.44.1.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 2afdbaa513d..e61102f3a81 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,2 +1,2 @@ -Comparing source compatibility of opentelemetry-sdk-extension-jaeger-remote-sampler-1.44.0-SNAPSHOT.jar against opentelemetry-sdk-extension-jaeger-remote-sampler-1.43.0.jar +Comparing source compatibility of opentelemetry-sdk-extension-jaeger-remote-sampler-1.45.0-SNAPSHOT.jar against opentelemetry-sdk-extension-jaeger-remote-sampler-1.44.1.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-logs.txt b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-logs.txt index 47e56fdd20f..3c2b9fb4e3a 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.44.0-SNAPSHOT.jar against opentelemetry-sdk-logs-1.43.0.jar +Comparing source compatibility of opentelemetry-sdk-logs-1.45.0-SNAPSHOT.jar against opentelemetry-sdk-logs-1.44.1.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 aaa00f2eefb..ef08400bb94 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-metrics.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-metrics.txt @@ -1,16 +1,2 @@ -Comparing source compatibility of opentelemetry-sdk-metrics-1.44.0-SNAPSHOT.jar against opentelemetry-sdk-metrics-1.43.0.jar -+++ NEW INTERFACE: PUBLIC(+) ABSTRACT(+) io.opentelemetry.sdk.metrics.export.CardinalityLimitSelector (not serializable) - +++ CLASS FILE FORMAT VERSION: 52.0 <- n.a. - +++ NEW SUPERCLASS: java.lang.Object - +++ NEW METHOD: PUBLIC(+) STATIC(+) io.opentelemetry.sdk.metrics.export.CardinalityLimitSelector defaultCardinalityLimitSelector() - +++ NEW METHOD: PUBLIC(+) ABSTRACT(+) int getCardinalityLimit(io.opentelemetry.sdk.metrics.InstrumentType) - +++ NEW ANNOTATION: java.lang.FunctionalInterface -*** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder (not serializable) - === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 - +++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder registerMetricReader(io.opentelemetry.sdk.metrics.export.MetricReader, io.opentelemetry.sdk.metrics.export.CardinalityLimitSelector) -*** MODIFIED CLASS: PUBLIC ABSTRACT io.opentelemetry.sdk.metrics.View (not serializable) - === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 - *** MODIFIED METHOD: PUBLIC (<- PACKAGE_PROTECTED) ABSTRACT int getCardinalityLimit() -*** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.sdk.metrics.ViewBuilder (not serializable) - === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 - *** MODIFIED METHOD: PUBLIC (<- PACKAGE_PROTECTED) io.opentelemetry.sdk.metrics.ViewBuilder setCardinalityLimit(int) +Comparing source compatibility of opentelemetry-sdk-metrics-1.45.0-SNAPSHOT.jar against opentelemetry-sdk-metrics-1.44.1.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-testing.txt b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-testing.txt index ecf7cf7c9ef..b04bcd8ff85 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.44.0-SNAPSHOT.jar against opentelemetry-sdk-testing-1.43.0.jar +Comparing source compatibility of opentelemetry-sdk-testing-1.45.0-SNAPSHOT.jar against opentelemetry-sdk-testing-1.44.1.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 c6fd7e61bcd..5e83a4987a7 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-trace.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-trace.txt @@ -1,7 +1,2 @@ -Comparing source compatibility of opentelemetry-sdk-trace-1.44.0-SNAPSHOT.jar against opentelemetry-sdk-trace-1.43.0.jar -+++ NEW INTERFACE: PUBLIC(+) ABSTRACT(+) io.opentelemetry.sdk.trace.data.ExceptionEventData (not serializable) - +++ CLASS FILE FORMAT VERSION: 52.0 <- n.a. - +++ NEW INTERFACE: io.opentelemetry.sdk.trace.data.EventData - +++ NEW SUPERCLASS: java.lang.Object - +++ NEW METHOD: PUBLIC(+) STATIC(+) io.opentelemetry.sdk.trace.data.ExceptionEventData create(long, java.lang.Throwable, io.opentelemetry.api.common.Attributes, int) - +++ NEW METHOD: PUBLIC(+) ABSTRACT(+) java.lang.Throwable getException() +Comparing source compatibility of opentelemetry-sdk-trace-1.45.0-SNAPSHOT.jar against opentelemetry-sdk-trace-1.44.1.jar +No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-sdk.txt b/docs/apidiffs/current_vs_latest/opentelemetry-sdk.txt index 59adccb88e8..8ff004b24a4 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.44.0-SNAPSHOT.jar against opentelemetry-sdk-1.43.0.jar +Comparing source compatibility of opentelemetry-sdk-1.45.0-SNAPSHOT.jar against opentelemetry-sdk-1.44.1.jar No changes. \ No newline at end of file diff --git a/exporters/common/build.gradle.kts b/exporters/common/build.gradle.kts index f311510f83d..bbca8bc416a 100644 --- a/exporters/common/build.gradle.kts +++ b/exporters/common/build.gradle.kts @@ -67,6 +67,9 @@ testing { } } } + suites { + register("testWithoutUnsafe") {} + } } tasks { diff --git a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/JsonSerializer.java b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/JsonSerializer.java index 680220b5e3e..6170e1925d2 100644 --- a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/JsonSerializer.java +++ b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/JsonSerializer.java @@ -122,6 +122,22 @@ public void writeString( generator.writeString(string); } + @Override + public void writeRepeatedString(ProtoFieldInfo field, byte[][] utf8Bytes) throws IOException { + generator.writeArrayFieldStart(field.getJsonName()); + for (byte[] value : utf8Bytes) { + // Marshalers encoded String into UTF-8 bytes to optimize for binary serialization where + // we are able to avoid the encoding process happening twice, one for size computation and one + // for actual writing. JsonGenerator actually has a writeUTF8String that would be able to + // accept + // this, but it only works when writing to an OutputStream, but not to a String like we do for + // writing to logs. It's wasteful to take a String, convert it to bytes, and convert back to + // the same String but we can see if this can be improved in the future. + generator.writeString(new String(value, StandardCharsets.UTF_8)); + } + generator.writeEndArray(); + } + @Override public void writeBytes(ProtoFieldInfo field, byte[] value) throws IOException { generator.writeBinaryField(field.getJsonName(), value); diff --git a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/Marshaler.java b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/Marshaler.java index 6201481c024..e942673da13 100644 --- a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/Marshaler.java +++ b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/Marshaler.java @@ -32,7 +32,10 @@ public final void writeJsonTo(OutputStream output) throws IOException { } /** Marshals into the {@link JsonGenerator} in proto JSON format. */ - public final void writeJsonTo(JsonGenerator output) throws IOException { + // Intentionally not overloading writeJsonTo(OutputStream) in order to avoid compilation + // dependency on jackson when using writeJsonTo(OutputStream). See: + // https://github.com/open-telemetry/opentelemetry-java-contrib/pull/1551#discussion_r1849064365 + public final void writeJsonToGenerator(JsonGenerator output) throws IOException { try (JsonSerializer serializer = new JsonSerializer(output)) { serializer.writeMessageValue(this); } diff --git a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/MarshalerUtil.java b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/MarshalerUtil.java index d7f6d44c871..78e8bf71be1 100644 --- a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/MarshalerUtil.java +++ b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/MarshalerUtil.java @@ -110,6 +110,16 @@ private static int sizeRepeatedFixed64(ProtoFieldInfo field, int numValues) { return size; } + /** Returns the size of a repeated string field. */ + @SuppressWarnings("AvoidObjectArrays") + public static int sizeRepeatedString(ProtoFieldInfo field, byte[][] utf8Bytes) { + int size = 0; + for (byte[] i : utf8Bytes) { + size += MarshalerUtil.sizeBytes(field, i); + } + return size; + } + /** * Returns the size of a repeated uint64 field. * @@ -215,6 +225,26 @@ public static int sizeRepeatedInt64(ProtoFieldInfo field, List values) { return field.getTagSize() + CodedOutputStream.computeUInt32SizeNoTag(payloadSize) + payloadSize; } + /** + * Returns the size of a repeated int32 field. + * + *

Packed repeated fields contain the tag, an integer representing the incoming payload size, + * and an actual payload of repeated varints. + */ + public static int sizeRepeatedInt32(ProtoFieldInfo field, List values) { + if (values.isEmpty()) { + return 0; + } + + int payloadSize = 0; + for (int v : values) { + payloadSize += CodedOutputStream.computeInt32SizeNoTag(v); + } + + // tag size + payload indicator size + actual payload size + return field.getTagSize() + CodedOutputStream.computeUInt32SizeNoTag(payloadSize) + payloadSize; + } + /** Returns the size of a repeated double field. */ public static int sizeRepeatedDouble(ProtoFieldInfo field, List values) { // Same as fixed64. @@ -300,6 +330,19 @@ public static int sizeInt32(ProtoFieldInfo field, int message) { return field.getTagSize() + CodedOutputStream.computeInt32SizeNoTag(message); } + /** Returns the size of an optional int32 field. */ + public static int sizeInt32Optional(ProtoFieldInfo field, int message) { + return field.getTagSize() + CodedOutputStream.computeInt32SizeNoTag(message); + } + + /** Returns the size of an optional int32 field. */ + public static int sizeInt32Optional(ProtoFieldInfo field, @Nullable Integer message) { + if (message == null) { + return 0; + } + return sizeInt32Optional(field, (int) message); + } + /** Returns the size of a double field. */ public static int sizeDouble(ProtoFieldInfo field, double value) { if (value == 0D) { diff --git a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/ProtoSerializer.java b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/ProtoSerializer.java index 62f4a175982..694cec8b2b9 100644 --- a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/ProtoSerializer.java +++ b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/ProtoSerializer.java @@ -163,6 +163,13 @@ public void writeString( StatelessMarshalerUtil.writeUtf8(output, string, utf8Length, context); } + @Override + public void writeRepeatedString(ProtoFieldInfo field, byte[][] utf8Bytes) throws IOException { + for (byte[] value : utf8Bytes) { + writeString(field, value); + } + } + @Override public void writeBytes(ProtoFieldInfo field, byte[] value) throws IOException { output.writeUInt32NoTag(field.getTag()); diff --git a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/Serializer.java b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/Serializer.java index e7970d57491..a19091fa73d 100644 --- a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/Serializer.java +++ b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/Serializer.java @@ -122,7 +122,7 @@ public void serializeSInt32(ProtoFieldInfo field, int value) throws IOException protected abstract void writeSInt32(ProtoFieldInfo info, int value) throws IOException; - /** Serializes a protobuf {@code uint32} field. */ + /** Serializes a protobuf {@code int32} field. */ public void serializeInt32(ProtoFieldInfo field, int value) throws IOException { if (value == 0) { return; @@ -130,6 +130,19 @@ public void serializeInt32(ProtoFieldInfo field, int value) throws IOException { writeint32(field, value); } + /** Serializes a protobuf {@code int32} field. */ + public void serializeInt32Optional(ProtoFieldInfo field, int value) throws IOException { + writeint32(field, value); + } + + /** Serializes a protobuf {@code int32} field. */ + public void serializeInt32Optional(ProtoFieldInfo field, @Nullable Integer value) + throws IOException { + if (value != null) { + serializeInt32Optional(field, (int) value); + } + } + protected abstract void writeint32(ProtoFieldInfo field, int value) throws IOException; /** Serializes a protobuf {@code int64} field. */ @@ -220,6 +233,18 @@ public void serializeString(ProtoFieldInfo field, byte[] utf8Bytes) throws IOExc writeString(field, utf8Bytes); } + /** + * Serializes a protobuf {@code repeated string} field. {@code utf8Bytes} is the UTF8 encoded + * bytes of the strings to serialize. + */ + @SuppressWarnings("AvoidObjectArrays") + public void serializeRepeatedString(ProtoFieldInfo field, byte[][] utf8Bytes) throws IOException { + if (utf8Bytes.length == 0) { + return; + } + writeRepeatedString(field, utf8Bytes); + } + /** * Serializes a protobuf {@code string} field. {@code string} is the value to be serialized and * {@code utf8Length} is the length of the string after it is encoded in UTF8. This method reads @@ -246,6 +271,11 @@ public abstract void writeString( ProtoFieldInfo field, String string, int utf8Length, MarshalerContext context) throws IOException; + /** Writes a protobuf {@code repeated string} field, even if it matches the default value. */ + @SuppressWarnings("AvoidObjectArrays") + public abstract void writeRepeatedString(ProtoFieldInfo field, byte[][] utf8Bytes) + throws IOException; + /** Serializes a protobuf {@code bytes} field. */ public void serializeBytes(ProtoFieldInfo field, byte[] value) throws IOException { if (value.length == 0) { @@ -323,6 +353,25 @@ protected abstract void writeStartRepeatedVarint(ProtoFieldInfo field, int paylo protected abstract void writeEndRepeatedVarint() throws IOException; + /** Serializes a {@code repeated int32} field. */ + public void serializeRepeatedInt32(ProtoFieldInfo field, List values) + throws IOException { + if (values.isEmpty()) { + return; + } + + int payloadSize = 0; + for (int v : values) { + payloadSize += CodedOutputStream.computeInt32SizeNoTag(v); + } + + writeStartRepeatedVarint(field, payloadSize); + for (int value : values) { + writeUInt64Value(value); + } + writeEndRepeatedVarint(); + } + /** Serializes a {@code repeated fixed64} field. */ public void serializeRepeatedFixed64(ProtoFieldInfo field, List values) throws IOException { if (values.isEmpty()) { diff --git a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/UnsafeString.java b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/UnsafeString.java index c581e7525fb..309b005fd49 100644 --- a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/UnsafeString.java +++ b/exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/UnsafeString.java @@ -10,7 +10,8 @@ class UnsafeString { private static final long valueOffset = getStringFieldOffset("value", byte[].class); private static final long coderOffset = getStringFieldOffset("coder", byte.class); - private static final int byteArrayBaseOffset = UnsafeAccess.arrayBaseOffset(byte[].class); + private static final int byteArrayBaseOffset = + UnsafeAccess.isAvailable() ? UnsafeAccess.arrayBaseOffset(byte[].class) : -1; private static final boolean available = valueOffset != -1 && coderOffset != -1; static boolean isAvailable() { diff --git a/exporters/common/src/testWithoutUnsafe/java/io/opentelemetry/exporter/internal/marshal/StatelessMarshalerUtilTest.java b/exporters/common/src/testWithoutUnsafe/java/io/opentelemetry/exporter/internal/marshal/StatelessMarshalerUtilTest.java new file mode 100644 index 00000000000..8ff3ec2e04d --- /dev/null +++ b/exporters/common/src/testWithoutUnsafe/java/io/opentelemetry/exporter/internal/marshal/StatelessMarshalerUtilTest.java @@ -0,0 +1,101 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.exporter.internal.marshal; + +import static io.opentelemetry.exporter.internal.marshal.StatelessMarshalerUtil.getUtf8Size; +import static io.opentelemetry.exporter.internal.marshal.StatelessMarshalerUtil.writeUtf8; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import org.junit.jupiter.api.Test; + +class StatelessMarshalerUtilTest { + + // Simulate running in an environment without sun.misc.Unsafe e.g. when running a modular + // application. To use sun.misc.Unsafe in modular application user would need to add dependency to + // jdk.unsupported module or use --add-modules jdk.unsupported. Here we use a custom child first + // class loader that does not delegate loading sun.misc classes to make sun.misc.Unsafe + // unavailable. + @Test + void encodeUtf8WithoutUnsafe() throws Exception { + ClassLoader testClassLoader = + new ClassLoader(this.getClass().getClassLoader()) { + @Override + protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException { + // don't allow loading sun.misc classes + if (name.startsWith("sun.misc")) { + throw new ClassNotFoundException(name); + } + // load io.opentelemetry in the custom loader + if (name.startsWith("io.opentelemetry")) { + synchronized (this) { + Class clazz = findLoadedClass(name); + if (clazz != null) { + return clazz; + } + try (InputStream inputStream = + getParent().getResourceAsStream(name.replace(".", "/") + ".class")) { + if (inputStream != null) { + byte[] bytes = readBytes(inputStream); + // we don't bother to define packages or provide protection domain + return defineClass(name, bytes, 0, bytes.length); + } + } catch (IOException exception) { + throw new ClassNotFoundException(name, exception); + } + } + } + return super.loadClass(name, resolve); + } + }; + + // load test class in the custom loader and run the test + Class testClass = testClassLoader.loadClass(this.getClass().getName() + "$TestClass"); + assertThat(testClass.getClassLoader()).isEqualTo(testClassLoader); + Runnable test = (Runnable) testClass.getConstructor().newInstance(); + test.run(); + } + + private static byte[] readBytes(InputStream inputStream) throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + byte[] buffer = new byte[1024]; + + int readCount; + while ((readCount = inputStream.read(buffer, 0, buffer.length)) != -1) { + out.write(buffer, 0, readCount); + } + return out.toByteArray(); + } + + @SuppressWarnings("unused") + public static class TestClass implements Runnable { + + @Override + public void run() { + // verify that unsafe can't be found + assertThatThrownBy(() -> Class.forName("sun.misc.Unsafe")) + .isInstanceOf(ClassNotFoundException.class); + // test the methods that use unsafe + assertThat(getUtf8Size("a", true)).isEqualTo(1); + assertThat(testUtf8("a", 0)).isEqualTo("a"); + } + + static String testUtf8(String string, int utf8Length) { + try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { + CodedOutputStream codedOutputStream = CodedOutputStream.newInstance(outputStream); + writeUtf8(codedOutputStream, string, utf8Length, true); + codedOutputStream.flush(); + return new String(outputStream.toByteArray(), StandardCharsets.UTF_8); + } catch (Exception exception) { + throw new IllegalArgumentException(exception); + } + } + } +} diff --git a/exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/internal/writer/LoggerJsonWriter.java b/exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/internal/writer/LoggerJsonWriter.java index 1286e116f03..a95c5e0d2c1 100644 --- a/exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/internal/writer/LoggerJsonWriter.java +++ b/exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/internal/writer/LoggerJsonWriter.java @@ -33,7 +33,7 @@ public LoggerJsonWriter(Logger logger, String type) { public CompletableResultCode write(Marshaler exportRequest) { SegmentedStringWriter sw = new SegmentedStringWriter(JSON_FACTORY._getBufferRecycler()); try (JsonGenerator gen = JsonUtil.create(sw)) { - exportRequest.writeJsonTo(gen); + exportRequest.writeJsonToGenerator(gen); } catch (IOException e) { logger.log(Level.WARNING, "Unable to write OTLP JSON " + type, e); return CompletableResultCode.ofFailure(); diff --git a/exporters/logging-otlp/src/test/java/io/opentelemetry/exporter/logging/otlp/internal/writer/LoggerJsonWriterTest.java b/exporters/logging-otlp/src/test/java/io/opentelemetry/exporter/logging/otlp/internal/writer/LoggerJsonWriterTest.java index 8cba4ef9707..0810f3c7510 100644 --- a/exporters/logging-otlp/src/test/java/io/opentelemetry/exporter/logging/otlp/internal/writer/LoggerJsonWriterTest.java +++ b/exporters/logging-otlp/src/test/java/io/opentelemetry/exporter/logging/otlp/internal/writer/LoggerJsonWriterTest.java @@ -32,7 +32,9 @@ void testToString() { @Test void error() throws IOException { Marshaler marshaler = mock(Marshaler.class); - Mockito.doThrow(new IOException("test")).when(marshaler).writeJsonTo(any(JsonGenerator.class)); + Mockito.doThrow(new IOException("test")) + .when(marshaler) + .writeJsonToGenerator(any(JsonGenerator.class)); Logger logger = Logger.getLogger(LoggerJsonWriter.class.getName()); diff --git a/exporters/otlp/common/build.gradle.kts b/exporters/otlp/common/build.gradle.kts index 67b3f86aa89..99b054f3d5e 100644 --- a/exporters/otlp/common/build.gradle.kts +++ b/exporters/otlp/common/build.gradle.kts @@ -29,6 +29,7 @@ dependencies { testImplementation("com.fasterxml.jackson.core:jackson-databind") testImplementation("com.google.protobuf:protobuf-java-util") + testImplementation("com.google.guava:guava") testImplementation("io.opentelemetry.proto:opentelemetry-proto") jmhImplementation(project(":sdk:testing")) @@ -42,7 +43,7 @@ wire { "opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest", "opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest", "opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest", - "opentelemetry.proto.collector.profiles.v1experimental.ExportProfilesServiceRequest" + "opentelemetry.proto.collector.profiles.v1development.ExportProfilesServiceRequest" ) custom { diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableAttributeUnitData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableAttributeUnitData.java index 60255827102..ee3e54aa177 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableAttributeUnitData.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableAttributeUnitData.java @@ -25,8 +25,8 @@ public abstract class ImmutableAttributeUnitData implements AttributeUnitData { * * @return a new AttributeUnitData mapping the given key to the given unit. */ - public static AttributeUnitData create(long attributeKey, long unitIndex) { - return new AutoValue_ImmutableAttributeUnitData(attributeKey, unitIndex); + public static AttributeUnitData create(int attributeKeyStringIndex, int unitStringIndex) { + return new AutoValue_ImmutableAttributeUnitData(attributeKeyStringIndex, unitStringIndex); } ImmutableAttributeUnitData() {} diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableFunctionData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableFunctionData.java index 30de9f2927c..cd0c12e901c 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableFunctionData.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableFunctionData.java @@ -25,9 +25,9 @@ public abstract class ImmutableFunctionData implements FunctionData { * @return a new FunctionData describing the given function characteristics. */ public static FunctionData create( - long nameIndex, long systemNameIndex, long filenameIndex, long startLine) { + int nameStringIndex, int systemNameStringIndex, int filenameStringIndex, long startLine) { return new AutoValue_ImmutableFunctionData( - nameIndex, systemNameIndex, filenameIndex, startLine); + nameStringIndex, systemNameStringIndex, filenameStringIndex, startLine); } ImmutableFunctionData() {} diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLabelData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLabelData.java deleted file mode 100644 index 77797fee92c..00000000000 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLabelData.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * SPDX-License-Identifier: Apache-2.0 - */ - -package io.opentelemetry.exporter.otlp.internal.data; - -import com.google.auto.value.AutoValue; -import io.opentelemetry.exporter.otlp.profiles.LabelData; -import javax.annotation.concurrent.Immutable; - -/** - * Auto value implementation of {@link LabelData}, which provides additional context for a sample. - * - *

This class is internal and is hence not for public use. Its APIs are unstable and can change - * at any time. - */ -@Immutable -@AutoValue -public abstract class ImmutableLabelData implements LabelData { - - /** - * Returns a new LabelData describing the given context for a sample. - * - * @return a new LabelData describing the given context for a sample. - */ - public static LabelData create(long keyIndex, long strIndex, long num, long numUnitIndex) { - return new AutoValue_ImmutableLabelData(keyIndex, strIndex, num, numUnitIndex); - } - - ImmutableLabelData() {} -} diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLineData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLineData.java index e5c5d673d23..e0eebeaff60 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLineData.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLineData.java @@ -25,7 +25,7 @@ public abstract class ImmutableLineData implements LineData { * * @return a new LineData describing the given details a specific line in a source code. */ - public static LineData create(long functionIndex, long line, long column) { + public static LineData create(int functionIndex, long line, long column) { return new AutoValue_ImmutableLineData(functionIndex, line, column); } diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLocationData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLocationData.java index 13554152dcd..56792a30478 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLocationData.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLocationData.java @@ -28,14 +28,13 @@ public abstract class ImmutableLocationData implements LocationData { * @return a new LocationData describing the given function and line table information. */ public static LocationData create( - long mappingIndex, + Integer mappingIndex, long address, List lines, boolean folded, - int typeIndex, - List attributes) { + List attributeIndices) { return new AutoValue_ImmutableLocationData( - mappingIndex, address, lines, folded, typeIndex, attributes); + mappingIndex, address, lines, folded, attributeIndices); } ImmutableLocationData() {} diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableMappingData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableMappingData.java index da020967adb..a1f4c07843c 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableMappingData.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableMappingData.java @@ -6,7 +6,6 @@ package io.opentelemetry.exporter.otlp.internal.data; import com.google.auto.value.AutoValue; -import io.opentelemetry.exporter.otlp.profiles.BuildIdKind; import io.opentelemetry.exporter.otlp.profiles.MappingData; import java.util.List; import javax.annotation.concurrent.Immutable; @@ -32,10 +31,8 @@ public static MappingData create( long memoryStart, long memoryLimit, long fileOffset, - long filenameIndex, - long buildIdIndex, - BuildIdKind buildIdKind, - List attributeIndices, + int filenameStringIndex, + List attributeIndices, boolean hasFunctions, boolean hasFilenames, boolean hasLineNumbers, @@ -44,9 +41,7 @@ public static MappingData create( memoryStart, memoryLimit, fileOffset, - filenameIndex, - buildIdIndex, - buildIdKind, + filenameStringIndex, attributeIndices, hasFunctions, hasFilenames, diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableProfileContainerData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableProfileContainerData.java deleted file mode 100644 index e6449c88e10..00000000000 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableProfileContainerData.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * SPDX-License-Identifier: Apache-2.0 - */ - -package io.opentelemetry.exporter.otlp.internal.data; - -import com.google.auto.value.AutoValue; -import io.opentelemetry.api.common.Attributes; -import io.opentelemetry.exporter.otlp.profiles.ProfileContainerData; -import io.opentelemetry.exporter.otlp.profiles.ProfileData; -import io.opentelemetry.sdk.common.InstrumentationScopeInfo; -import io.opentelemetry.sdk.resources.Resource; -import java.nio.ByteBuffer; -import javax.annotation.Nullable; -import javax.annotation.concurrent.Immutable; - -/** - * Auto value implementation of {@link ProfileContainerData}, which represents a single profile. - * - *

This class is internal and is hence not for public use. Its APIs are unstable and can change - * at any time. - */ -@Immutable -@AutoValue -public abstract class ImmutableProfileContainerData implements ProfileContainerData { - - /** - * Returns a new ProfileContainerData representing the given profile information. - * - * @return a new ProfileContainerData representing the given profile information. - */ - @SuppressWarnings("TooManyParameters") - public static ProfileContainerData create( - Resource resource, - InstrumentationScopeInfo instrumentationScopeInfo, - String profileId, - long startEpochNanos, - long endEpochNanos, - Attributes attributes, - int totalAttributeCount, - @Nullable String originalPayloadFormat, - ByteBuffer originalPayload, - ProfileData profile) { - return new AutoValue_ImmutableProfileContainerData( - resource, - instrumentationScopeInfo, - profileId, - startEpochNanos, - endEpochNanos, - attributes, - totalAttributeCount, - originalPayloadFormat, - originalPayload, - profile); - } - - ImmutableProfileContainerData() {} - - public ByteBuffer getOriginalPayloadReadOnly() { - return getOriginalPayload().asReadOnlyBuffer(); - } -} diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableProfileData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableProfileData.java index 717084d320a..b44b7f67834 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableProfileData.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableProfileData.java @@ -15,6 +15,9 @@ import io.opentelemetry.exporter.otlp.profiles.ProfileData; import io.opentelemetry.exporter.otlp.profiles.SampleData; import io.opentelemetry.exporter.otlp.profiles.ValueTypeData; +import io.opentelemetry.sdk.common.InstrumentationScopeInfo; +import io.opentelemetry.sdk.resources.Resource; +import java.nio.ByteBuffer; import java.util.List; import javax.annotation.concurrent.Immutable; @@ -37,43 +40,53 @@ public abstract class ImmutableProfileData implements ProfileData { */ @SuppressWarnings("TooManyParameters") public static ProfileData create( + Resource resource, + InstrumentationScopeInfo instrumentationScopeInfo, List sampleTypes, List samples, - List mappings, - List locations, - List locationIndices, - List functions, - Attributes attributes, + List mappingTable, + List locationTable, + List locationIndices, + List functionTable, + Attributes attributeTable, List attributeUnits, - List links, + List linkTable, List stringTable, - long dropFrames, - long keepFrames, long timeNanos, long durationNanos, ValueTypeData periodType, long period, - List comment, - long defaultSampleType) { + List commentStrindices, + int defaultSampleTypeStringIndex, + String profileId, + Attributes attributes, + int droppedAttributesCount, + String originalPayloadFormat, + ByteBuffer originalPayload) { return new AutoValue_ImmutableProfileData( + resource, + instrumentationScopeInfo, sampleTypes, samples, - mappings, - locations, + mappingTable, + locationTable, locationIndices, - functions, - attributes, + functionTable, + attributeTable, attributeUnits, - links, + linkTable, stringTable, - dropFrames, - keepFrames, timeNanos, durationNanos, periodType, period, - comment, - defaultSampleType); + commentStrindices, + defaultSampleTypeStringIndex, + profileId, + attributes, + droppedAttributesCount, + originalPayloadFormat, + originalPayload); } ImmutableProfileData() {} diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableSampleData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableSampleData.java index 6d121146e52..c0b3deac55b 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableSampleData.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableSampleData.java @@ -27,21 +27,14 @@ public abstract class ImmutableSampleData implements SampleData { * @return a new SampleData representing the given program context. */ public static SampleData create( - long locationsStartIndex, - long locationsLength, - int stacktraceIdIndex, + int locationsStartIndex, + int locationsLength, List values, - List attributes, - long link, + List attributeIndices, + Integer linkIndex, List timestamps) { return new AutoValue_ImmutableSampleData( - locationsStartIndex, - locationsLength, - stacktraceIdIndex, - values, - attributes, - link, - timestamps); + locationsStartIndex, locationsLength, values, attributeIndices, linkIndex, timestamps); } ImmutableSampleData() {} diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableValueTypeData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableValueTypeData.java index 3d6ff8c4281..9928403f3a2 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableValueTypeData.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableValueTypeData.java @@ -27,8 +27,9 @@ public abstract class ImmutableValueTypeData implements ValueTypeData { * @return a new ValueTypeData describing the given type and unit characteristics. */ public static ValueTypeData create( - long type, long unit, AggregationTemporality aggregationTemporality) { - return new AutoValue_ImmutableValueTypeData(type, unit, aggregationTemporality); + int typeStringIndex, int unitStringIndex, AggregationTemporality aggregationTemporality) { + return new AutoValue_ImmutableValueTypeData( + typeStringIndex, unitStringIndex, aggregationTemporality); } ImmutableValueTypeData() {} diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/AggregationTemporality.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/AggregationTemporality.java index 4586a4652b1..fc3d47196a6 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/AggregationTemporality.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/AggregationTemporality.java @@ -9,7 +9,7 @@ * Specifies the method of aggregating metric values. * *

TODO: This is intentionally not the same as metrics/AggregationTemporality. For profiles.proto - * 'v1experimental' version, this class is considered distinct from the pre-exiting + * 'v1development' version, this class is considered distinct from the pre-exiting * AggregationTemporality in metrics.proto. As the profiles.proto stabilises, they may be refactored * into a version in common.proto. Meanwhile the Java class structure reflects the .proto structure * in making distinct entities. @@ -19,7 +19,7 @@ * @see * "https://github.com/open-telemetry/opentelemetry-proto/blob/v1.3.0/opentelemetry/proto/metrics/v1/metrics.proto#L261" * @see - * "https://github.com/open-telemetry/opentelemetry-proto/blob/v1.3.0/opentelemetry/proto/profiles/v1experimental/pprofextended.proto#L147" + * "https://github.com/open-telemetry/opentelemetry-proto/blob/v1.3.0/opentelemetry/proto/profiles/v1development/profiles.proto#L147" * @see "https://github.com/open-telemetry/opentelemetry-proto/issues/547" * @see "https://github.com/open-telemetry/opentelemetry-proto/pull/534#discussion_r1552403726" * @see "profiles.proto::AggregationTemporality" diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/AttributeUnitData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/AttributeUnitData.java index 47f2403cbd4..1b5bbd54c6c 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/AttributeUnitData.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/AttributeUnitData.java @@ -10,14 +10,14 @@ /** * Represents a mapping between Attribute Keys and Units. * - * @see "pprofextended.proto::AttributeUnit" + * @see "profiles.proto::AttributeUnit" */ @Immutable public interface AttributeUnitData { /** Index into string table. */ - long getAttributeKey(); + int getAttributeKeyStringIndex(); /** Index into string table. */ - long getUnitIndex(); + int getUnitIndexStringIndex(); } diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/AttributeUnitMarshaler.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/AttributeUnitMarshaler.java index d3831b78ba5..311a0d1c33d 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/AttributeUnitMarshaler.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/AttributeUnitMarshaler.java @@ -8,7 +8,7 @@ import io.opentelemetry.exporter.internal.marshal.MarshalerUtil; import io.opentelemetry.exporter.internal.marshal.MarshalerWithSize; import io.opentelemetry.exporter.internal.marshal.Serializer; -import io.opentelemetry.proto.profiles.v1experimental.internal.AttributeUnit; +import io.opentelemetry.proto.profiles.v1development.internal.AttributeUnit; import java.io.IOException; import java.util.List; import java.util.function.Consumer; @@ -17,12 +17,13 @@ final class AttributeUnitMarshaler extends MarshalerWithSize { private static final AttributeUnitMarshaler[] EMPTY_REPEATED = new AttributeUnitMarshaler[0]; - private final long attributeKey; - private final long unitIndex; + private final int attributeKeyStringIndex; + private final int unitStringIndex; static AttributeUnitMarshaler create(AttributeUnitData attributeUnitData) { return new AttributeUnitMarshaler( - attributeUnitData.getAttributeKey(), attributeUnitData.getUnitIndex()); + attributeUnitData.getAttributeKeyStringIndex(), + attributeUnitData.getUnitIndexStringIndex()); } static AttributeUnitMarshaler[] createRepeated(List items) { @@ -44,23 +45,23 @@ public void accept(AttributeUnitData attributeUnitData) { return attributeUnitMarshalers; } - private AttributeUnitMarshaler(long attributeKey, long unitIndex) { - super(calculateSize(attributeKey, unitIndex)); - this.attributeKey = attributeKey; - this.unitIndex = unitIndex; + private AttributeUnitMarshaler(int attributeKeyStringIndex, int unitStringIndex) { + super(calculateSize(attributeKeyStringIndex, unitStringIndex)); + this.attributeKeyStringIndex = attributeKeyStringIndex; + this.unitStringIndex = unitStringIndex; } @Override protected void writeTo(Serializer output) throws IOException { - output.serializeInt64(AttributeUnit.ATTRIBUTE_KEY, attributeKey); - output.serializeInt64(AttributeUnit.UNIT, unitIndex); + output.serializeInt32(AttributeUnit.ATTRIBUTE_KEY_STRINDEX, attributeKeyStringIndex); + output.serializeInt32(AttributeUnit.UNIT_STRINDEX, unitStringIndex); } - private static int calculateSize(long attributeKey, long unitIndex) { + private static int calculateSize(int attributeKeyStringIndex, int unitStringIndex) { int size; size = 0; - size += MarshalerUtil.sizeInt64(AttributeUnit.ATTRIBUTE_KEY, attributeKey); - size += MarshalerUtil.sizeInt64(AttributeUnit.UNIT, unitIndex); + size += MarshalerUtil.sizeInt32(AttributeUnit.ATTRIBUTE_KEY_STRINDEX, attributeKeyStringIndex); + size += MarshalerUtil.sizeInt32(AttributeUnit.UNIT_STRINDEX, unitStringIndex); return size; } } diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/BuildIdKind.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/BuildIdKind.java deleted file mode 100644 index 9852b623aed..00000000000 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/BuildIdKind.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * SPDX-License-Identifier: Apache-2.0 - */ - -package io.opentelemetry.exporter.otlp.profiles; - -/** - * Indicates the semantics of the build_id field. - * - * @see "pprofextended.proto::BuildIdKind" - */ -public enum BuildIdKind { - - /** Linker-generated build ID, stored in the ELF binary notes. */ - LINKER, - - /** Build ID based on the content hash of the binary. */ - BINARY_HASH; -} diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/FunctionData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/FunctionData.java index 3f246ce4a02..e50ba846907 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/FunctionData.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/FunctionData.java @@ -10,22 +10,22 @@ /** * Describes a function. * - * @see "pprofextended.proto::Function" + * @see "profiles.proto::Function" */ @Immutable public interface FunctionData { /** Name of the function, in human-readable form if available. Index into string table. */ - long getNameIndex(); + int getNameStringIndex(); /** * Name of the function, as identified by the system. For instance, it can be a C++ mangled name. * Index into string table. */ - long getSystemNameIndex(); + int getSystemNameStringIndex(); /** Source file containing the function. Index into string table. */ - long getFilenameIndex(); + int getFilenameStringIndex(); /** Line number in source file. */ long getStartLine(); diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/FunctionMarshaler.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/FunctionMarshaler.java index 7f2a522c95f..aea4071d380 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/FunctionMarshaler.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/FunctionMarshaler.java @@ -8,7 +8,7 @@ import io.opentelemetry.exporter.internal.marshal.MarshalerUtil; import io.opentelemetry.exporter.internal.marshal.MarshalerWithSize; import io.opentelemetry.exporter.internal.marshal.Serializer; -import io.opentelemetry.proto.profiles.v1experimental.internal.Function; +import io.opentelemetry.proto.profiles.v1development.internal.Function; import java.io.IOException; import java.util.List; import java.util.function.Consumer; @@ -17,16 +17,16 @@ final class FunctionMarshaler extends MarshalerWithSize { private static final FunctionMarshaler[] EMPTY_REPEATED = new FunctionMarshaler[0]; - private final long nameIndex; - private final long systemNameIndex; - private final long filenameIndex; + private final int nameStringIndex; + private final int systemNameStringIndex; + private final int filenameStringIndex; private final long startLine; static FunctionMarshaler create(FunctionData functionData) { return new FunctionMarshaler( - functionData.getNameIndex(), - functionData.getSystemNameIndex(), - functionData.getFilenameIndex(), + functionData.getNameStringIndex(), + functionData.getSystemNameStringIndex(), + functionData.getFilenameStringIndex(), functionData.getStartLine()); } @@ -50,28 +50,28 @@ public void accept(FunctionData functionData) { } private FunctionMarshaler( - long nameIndex, long systemNameIndex, long filenameIndex, long startLine) { - super(calculateSize(nameIndex, systemNameIndex, filenameIndex, startLine)); - this.nameIndex = nameIndex; - this.systemNameIndex = systemNameIndex; - this.filenameIndex = filenameIndex; + int nameStringIndex, int systemNameStringIndex, int filenameStringIndex, long startLine) { + super(calculateSize(nameStringIndex, systemNameStringIndex, filenameStringIndex, startLine)); + this.nameStringIndex = nameStringIndex; + this.systemNameStringIndex = systemNameStringIndex; + this.filenameStringIndex = filenameStringIndex; this.startLine = startLine; } @Override protected void writeTo(Serializer output) throws IOException { - output.serializeInt64(Function.NAME, nameIndex); - output.serializeInt64(Function.SYSTEM_NAME, systemNameIndex); - output.serializeInt64(Function.FILENAME, filenameIndex); + output.serializeInt32(Function.NAME_STRINDEX, nameStringIndex); + output.serializeInt32(Function.SYSTEM_NAME_STRINDEX, systemNameStringIndex); + output.serializeInt32(Function.FILENAME_STRINDEX, filenameStringIndex); output.serializeInt64(Function.START_LINE, startLine); } private static int calculateSize( - long nameIndex, long systemNameIndex, long filenameIndex, long startLine) { + int nameStringIndex, int systemNameStringIndex, int filenameStringIndex, long startLine) { int size = 0; - size += MarshalerUtil.sizeInt64(Function.NAME, nameIndex); - size += MarshalerUtil.sizeInt64(Function.SYSTEM_NAME, systemNameIndex); - size += MarshalerUtil.sizeInt64(Function.FILENAME, filenameIndex); + size += MarshalerUtil.sizeInt32(Function.NAME_STRINDEX, nameStringIndex); + size += MarshalerUtil.sizeInt32(Function.SYSTEM_NAME_STRINDEX, systemNameStringIndex); + size += MarshalerUtil.sizeInt32(Function.FILENAME_STRINDEX, filenameStringIndex); size += MarshalerUtil.sizeInt64(Function.START_LINE, startLine); return size; } diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/InstrumentationScopeProfilesMarshaler.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/InstrumentationScopeProfilesMarshaler.java index 63074ba15eb..8f7e2edea44 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/InstrumentationScopeProfilesMarshaler.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/InstrumentationScopeProfilesMarshaler.java @@ -9,40 +9,40 @@ import io.opentelemetry.exporter.internal.marshal.MarshalerWithSize; import io.opentelemetry.exporter.internal.marshal.Serializer; import io.opentelemetry.exporter.internal.otlp.InstrumentationScopeMarshaler; -import io.opentelemetry.proto.profiles.v1experimental.internal.ScopeProfiles; +import io.opentelemetry.proto.profiles.v1development.internal.ScopeProfiles; import java.io.IOException; import java.util.List; final class InstrumentationScopeProfilesMarshaler extends MarshalerWithSize { private final InstrumentationScopeMarshaler instrumentationScope; - private final List profileContainerMarshalers; + private final List profileMarshalers; private final byte[] schemaUrlUtf8; InstrumentationScopeProfilesMarshaler( InstrumentationScopeMarshaler instrumentationScope, byte[] schemaUrlUtf8, - List profileContainerMarshalers) { - super(calculateSize(instrumentationScope, schemaUrlUtf8, profileContainerMarshalers)); + List profileMarshalers) { + super(calculateSize(instrumentationScope, schemaUrlUtf8, profileMarshalers)); this.instrumentationScope = instrumentationScope; this.schemaUrlUtf8 = schemaUrlUtf8; - this.profileContainerMarshalers = profileContainerMarshalers; + this.profileMarshalers = profileMarshalers; } @Override public void writeTo(Serializer output) throws IOException { output.serializeMessage(ScopeProfiles.SCOPE, instrumentationScope); - output.serializeRepeatedMessage(ScopeProfiles.PROFILES, profileContainerMarshalers); + output.serializeRepeatedMessage(ScopeProfiles.PROFILES, profileMarshalers); output.serializeString(ScopeProfiles.SCHEMA_URL, schemaUrlUtf8); } private static int calculateSize( InstrumentationScopeMarshaler instrumentationScope, byte[] schemaUrlUtf8, - List profileContainerMarshalers) { + List profileMarshalers) { int size = 0; size += MarshalerUtil.sizeMessage(ScopeProfiles.SCOPE, instrumentationScope); - size += MarshalerUtil.sizeRepeatedMessage(ScopeProfiles.PROFILES, profileContainerMarshalers); + size += MarshalerUtil.sizeRepeatedMessage(ScopeProfiles.PROFILES, profileMarshalers); size += MarshalerUtil.sizeBytes(ScopeProfiles.SCHEMA_URL, schemaUrlUtf8); return size; } diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LabelData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LabelData.java deleted file mode 100644 index adc8787bae8..00000000000 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LabelData.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * SPDX-License-Identifier: Apache-2.0 - */ - -package io.opentelemetry.exporter.otlp.profiles; - -import javax.annotation.concurrent.Immutable; - -/** - * Provides additional context for a sample, such as thread ID or allocation size, with optional - * units. - * - * @see "pprofextended.proto::Label" - */ -@Immutable -public interface LabelData { - - /** Index into string table. */ - long getKeyIndex(); - - /** String value of the label data, if applicable. Index into string table */ - long getStrIndex(); - - /** Numeric value of the label data, if applicable. */ - long getNum(); - - /** - * Specifies the units of num, applicable only if num is present. Use arbitrary string (for - * example, "requests") as a custom count unit. - */ - long getNumUnitIndex(); -} diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LineData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LineData.java index b19e53cfa1e..7f5c4738ceb 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LineData.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LineData.java @@ -10,13 +10,13 @@ /** * Details a specific line in a source code, linked to a function. * - * @see "pprofextended.proto::Line" + * @see "profiles.proto::Line" */ @Immutable public interface LineData { /** The index of the corresponding Function for this line. Index into function table. */ - long getFunctionIndex(); + int getFunctionIndex(); /** Line number in source code. */ long getLine(); diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LineMarshaler.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LineMarshaler.java index d28aedfa5f9..2d3bf83a6c2 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LineMarshaler.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LineMarshaler.java @@ -8,7 +8,7 @@ import io.opentelemetry.exporter.internal.marshal.MarshalerUtil; import io.opentelemetry.exporter.internal.marshal.MarshalerWithSize; import io.opentelemetry.exporter.internal.marshal.Serializer; -import io.opentelemetry.proto.profiles.v1experimental.internal.Line; +import io.opentelemetry.proto.profiles.v1development.internal.Line; import java.io.IOException; import java.util.List; import java.util.function.Consumer; @@ -17,7 +17,7 @@ final class LineMarshaler extends MarshalerWithSize { private static final LineMarshaler[] EMPTY_REPEATED = new LineMarshaler[0]; - private final long functionIndex; + private final int functionIndex; private final long line; private final long column; @@ -44,7 +44,7 @@ public void accept(LineData lineData) { return lineMarshalers; } - private LineMarshaler(long functionIndex, long line, long column) { + private LineMarshaler(int functionIndex, long line, long column) { super(calculateSize(functionIndex, line, column)); this.functionIndex = functionIndex; this.line = line; @@ -53,14 +53,14 @@ private LineMarshaler(long functionIndex, long line, long column) { @Override protected void writeTo(Serializer output) throws IOException { - output.serializeUInt64(Line.FUNCTION_INDEX, functionIndex); + output.serializeInt32(Line.FUNCTION_INDEX, functionIndex); output.serializeInt64(Line.LINE, line); output.serializeInt64(Line.COLUMN, column); } - private static int calculateSize(long functionIndex, long line, long column) { + private static int calculateSize(int functionIndex, long line, long column) { int size = 0; - size += MarshalerUtil.sizeUInt64(Line.FUNCTION_INDEX, functionIndex); + size += MarshalerUtil.sizeInt32(Line.FUNCTION_INDEX, functionIndex); size += MarshalerUtil.sizeInt64(Line.LINE, line); size += MarshalerUtil.sizeInt64(Line.COLUMN, column); return size; diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LinkData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LinkData.java index dd76c9283b2..ea3c1e1d7b8 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LinkData.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LinkData.java @@ -10,7 +10,7 @@ /** * A connection from a profile Sample to a trace Span. * - * @see "pprofextended.proto::Link" + * @see "profiles.proto::Link" */ @Immutable public interface LinkData { diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LinkMarshaler.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LinkMarshaler.java index 13f489b32d7..ae41176a820 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LinkMarshaler.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LinkMarshaler.java @@ -11,7 +11,7 @@ import io.opentelemetry.exporter.internal.marshal.MarshalerUtil; import io.opentelemetry.exporter.internal.marshal.MarshalerWithSize; import io.opentelemetry.exporter.internal.marshal.Serializer; -import io.opentelemetry.proto.profiles.v1experimental.internal.Link; +import io.opentelemetry.proto.profiles.v1development.internal.Link; import java.io.IOException; import java.util.List; import java.util.function.Consumer; diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LocationData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LocationData.java index a36280cebd1..056e36c7026 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LocationData.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LocationData.java @@ -11,7 +11,7 @@ /** * Describes function and line table debug information. * - * @see "pprofextended.proto::Location" + * @see "profiles.proto::Location" */ @Immutable public interface LocationData { @@ -20,7 +20,7 @@ public interface LocationData { * The index of the corresponding profile.Mapping for this location. It can be unset if the * mapping is unknown or not applicable for this profile type. */ - long getMappingIndex(); + Integer getMappingIndex(); /** The instruction address for this location, if available. */ long getAddress(); @@ -37,9 +37,6 @@ public interface LocationData { */ boolean isFolded(); - /** Type of frame (e.g. kernel, native, python, hotspot, php). Index into string table. */ - int getTypeIndex(); - /** References to attributes in Profile.attribute_table. */ - List getAttributes(); + List getAttributes(); } diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LocationMarshaler.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LocationMarshaler.java index 1a62e13fa55..88e1d1a26a4 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LocationMarshaler.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LocationMarshaler.java @@ -8,21 +8,21 @@ import io.opentelemetry.exporter.internal.marshal.MarshalerUtil; import io.opentelemetry.exporter.internal.marshal.MarshalerWithSize; import io.opentelemetry.exporter.internal.marshal.Serializer; -import io.opentelemetry.proto.profiles.v1experimental.internal.Location; +import io.opentelemetry.proto.profiles.v1development.internal.Location; import java.io.IOException; import java.util.List; import java.util.function.Consumer; +import javax.annotation.Nullable; final class LocationMarshaler extends MarshalerWithSize { private static final LocationMarshaler[] EMPTY_REPEATED = new LocationMarshaler[0]; - private final long mappingIndex; + @Nullable private final Integer mappingIndex; private final long address; private final LineMarshaler[] lineMarshalers; private final boolean isFolded; - private final int typeIndex; - private final List attributes; + private final List attributeIndices; static LocationMarshaler create(LocationData locationData) { return new LocationMarshaler( @@ -30,7 +30,6 @@ static LocationMarshaler create(LocationData locationData) { locationData.getAddress(), LineMarshaler.createRepeated(locationData.getLines()), locationData.isFolded(), - locationData.getTypeIndex(), locationData.getAttributes()); } @@ -54,45 +53,40 @@ public void accept(LocationData locationData) { } private LocationMarshaler( - long mappingIndex, + @Nullable Integer mappingIndex, long address, LineMarshaler[] lineMarshalers, boolean isFolded, - int typeIndex, - List attributes) { - super(calculateSize(mappingIndex, address, lineMarshalers, isFolded, typeIndex, attributes)); + List attributeIndices) { + super(calculateSize(mappingIndex, address, lineMarshalers, isFolded, attributeIndices)); this.mappingIndex = mappingIndex; this.address = address; this.lineMarshalers = lineMarshalers; this.isFolded = isFolded; - this.typeIndex = typeIndex; - this.attributes = attributes; + this.attributeIndices = attributeIndices; } @Override protected void writeTo(Serializer output) throws IOException { - output.serializeUInt64(Location.MAPPING_INDEX, mappingIndex); + output.serializeInt32Optional(Location.MAPPING_INDEX, mappingIndex); output.serializeUInt64(Location.ADDRESS, address); output.serializeRepeatedMessage(Location.LINE, lineMarshalers); output.serializeBool(Location.IS_FOLDED, isFolded); - output.serializeUInt32(Location.TYPE_INDEX, typeIndex); - output.serializeRepeatedUInt64(Location.ATTRIBUTES, attributes); + output.serializeRepeatedInt32(Location.ATTRIBUTE_INDICES, attributeIndices); } private static int calculateSize( - long mappingIndex, + @Nullable Integer mappingIndex, long address, LineMarshaler[] lineMarshalers, boolean isFolded, - int typeIndex, - List attributes) { + List attributeIndices) { int size = 0; - size += MarshalerUtil.sizeUInt64(Location.MAPPING_INDEX, mappingIndex); + size += MarshalerUtil.sizeInt32Optional(Location.MAPPING_INDEX, mappingIndex); size += MarshalerUtil.sizeUInt64(Location.ADDRESS, address); size += MarshalerUtil.sizeRepeatedMessage(Location.LINE, lineMarshalers); size += MarshalerUtil.sizeBool(Location.IS_FOLDED, isFolded); - size += MarshalerUtil.sizeUInt32(Location.TYPE_INDEX, typeIndex); - size += MarshalerUtil.sizeRepeatedUInt64(Location.ATTRIBUTES, attributes); + size += MarshalerUtil.sizeRepeatedInt32(Location.ATTRIBUTE_INDICES, attributeIndices); return size; } } diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/MappingData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/MappingData.java index 2b5e14a0c91..1b365bc7ea0 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/MappingData.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/MappingData.java @@ -11,7 +11,7 @@ /** * Describes the mapping of a binary in memory. * - * @see "pprofextended.proto::Mapping" + * @see "profiles.proto::Mapping" */ @Immutable public interface MappingData { @@ -29,20 +29,10 @@ public interface MappingData { * The object this entry is loaded from. This can be a filename on disk for the main binary and * shared libraries, or virtual abstraction like "[vdso]". Index into the string table. */ - long getFilenameIndex(); - - /** - * Uniquely identifies a particular program version with high probability. e.g., for binaries - * generated by GNU tools, the contents of the .note.gnu.build-id field. Index into the string - * table. - */ - long getBuildIdIndex(); - - /** Specifies the kind of build id. See BuildIdKind enum for more details */ - BuildIdKind getBuildIdKind(); + int getFilenameStringIndex(); /** References to attributes in Profile.attribute_table. */ - List getAttributeIndices(); + List getAttributeIndices(); boolean hasFunctions(); diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/MappingMarshaler.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/MappingMarshaler.java index 9b1615137e9..6e39551540f 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/MappingMarshaler.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/MappingMarshaler.java @@ -7,10 +7,8 @@ import io.opentelemetry.exporter.internal.marshal.MarshalerUtil; import io.opentelemetry.exporter.internal.marshal.MarshalerWithSize; -import io.opentelemetry.exporter.internal.marshal.ProtoEnumInfo; import io.opentelemetry.exporter.internal.marshal.Serializer; -import io.opentelemetry.proto.profiles.v1experimental.internal.BuildIdKind; -import io.opentelemetry.proto.profiles.v1experimental.internal.Mapping; +import io.opentelemetry.proto.profiles.v1development.internal.Mapping; import java.io.IOException; import java.util.List; import java.util.function.Consumer; @@ -22,32 +20,19 @@ final class MappingMarshaler extends MarshalerWithSize { private final long memoryStart; private final long memoryLimit; private final long fileOffset; - private final long filenameIndex; - private final long buildIdIndex; - private final ProtoEnumInfo buildIdKind; - private final List attributeIndices; + private final int filenameIndex; + private final List attributeIndices; private final boolean hasFunctions; private final boolean hasFilenames; private final boolean hasLineNumbers; private final boolean hasInlineFrames; static MappingMarshaler create(MappingData mappingData) { - ProtoEnumInfo buildKind = BuildIdKind.BUILD_ID_LINKER; - switch (mappingData.getBuildIdKind()) { - case LINKER: - buildKind = BuildIdKind.BUILD_ID_LINKER; - break; - case BINARY_HASH: - buildKind = BuildIdKind.BUILD_ID_BINARY_HASH; - break; - } return new MappingMarshaler( mappingData.getMemoryStart(), mappingData.getMemoryLimit(), mappingData.getFileOffset(), - mappingData.getFilenameIndex(), - mappingData.getBuildIdIndex(), - buildKind, + mappingData.getFilenameStringIndex(), mappingData.getAttributeIndices(), mappingData.hasFunctions(), mappingData.hasFilenames(), @@ -78,10 +63,8 @@ private MappingMarshaler( long memoryStart, long memoryLimit, long fileOffset, - long filenameIndex, - long buildIdIndex, - ProtoEnumInfo buildIdKind, - List attributeIndices, + int filenameIndex, + List attributeIndices, boolean hasFunctions, boolean hasFilenames, boolean hasLineNumbers, @@ -92,8 +75,6 @@ private MappingMarshaler( memoryLimit, fileOffset, filenameIndex, - buildIdIndex, - buildIdKind, attributeIndices, hasFunctions, hasFilenames, @@ -103,8 +84,6 @@ private MappingMarshaler( this.memoryLimit = memoryLimit; this.fileOffset = fileOffset; this.filenameIndex = filenameIndex; - this.buildIdIndex = buildIdIndex; - this.buildIdKind = buildIdKind; this.attributeIndices = attributeIndices; this.hasFunctions = hasFunctions; this.hasFilenames = hasFilenames; @@ -117,10 +96,8 @@ protected void writeTo(Serializer output) throws IOException { output.serializeUInt64(Mapping.MEMORY_START, memoryStart); output.serializeUInt64(Mapping.MEMORY_LIMIT, memoryLimit); output.serializeUInt64(Mapping.FILE_OFFSET, fileOffset); - output.serializeInt64(Mapping.FILENAME, filenameIndex); - output.serializeInt64(Mapping.BUILD_ID, buildIdIndex); - output.serializeEnum(Mapping.BUILD_ID_KIND, buildIdKind); - output.serializeRepeatedUInt64(Mapping.ATTRIBUTES, attributeIndices); + output.serializeInt32(Mapping.FILENAME_STRINDEX, filenameIndex); + output.serializeRepeatedInt32(Mapping.ATTRIBUTE_INDICES, attributeIndices); output.serializeBool(Mapping.HAS_FUNCTIONS, hasFunctions); output.serializeBool(Mapping.HAS_FILENAMES, hasFilenames); output.serializeBool(Mapping.HAS_LINE_NUMBERS, hasLineNumbers); @@ -131,10 +108,8 @@ private static int calculateSize( long memoryStart, long memoryLimit, long fileOffset, - long filenameIndex, - long buildIdIndex, - ProtoEnumInfo buildIdKind, - List attributeIndices, + int filenameIndex, + List attributeIndices, boolean hasFunctions, boolean hasFilenames, boolean hasLineNumbers, @@ -143,10 +118,8 @@ private static int calculateSize( size += MarshalerUtil.sizeUInt64(Mapping.MEMORY_START, memoryStart); size += MarshalerUtil.sizeUInt64(Mapping.MEMORY_LIMIT, memoryLimit); size += MarshalerUtil.sizeUInt64(Mapping.FILE_OFFSET, fileOffset); - size += MarshalerUtil.sizeInt64(Mapping.FILENAME, filenameIndex); - size += MarshalerUtil.sizeInt64(Mapping.BUILD_ID, buildIdIndex); - size += MarshalerUtil.sizeEnum(Mapping.BUILD_ID_KIND, buildIdKind); - size += MarshalerUtil.sizeRepeatedUInt64(Mapping.ATTRIBUTES, attributeIndices); + size += MarshalerUtil.sizeInt32(Mapping.FILENAME_STRINDEX, filenameIndex); + size += MarshalerUtil.sizeRepeatedInt32(Mapping.ATTRIBUTE_INDICES, attributeIndices); size += MarshalerUtil.sizeBool(Mapping.HAS_FUNCTIONS, hasFunctions); size += MarshalerUtil.sizeBool(Mapping.HAS_FILENAMES, hasFilenames); size += MarshalerUtil.sizeBool(Mapping.HAS_LINE_NUMBERS, hasLineNumbers); diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfileContainerData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfileContainerData.java deleted file mode 100644 index f7e16f1ba0d..00000000000 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfileContainerData.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * SPDX-License-Identifier: Apache-2.0 - */ - -package io.opentelemetry.exporter.otlp.profiles; - -import io.opentelemetry.api.common.Attributes; -import io.opentelemetry.api.internal.OtelEncodingUtils; -import io.opentelemetry.sdk.common.InstrumentationScopeInfo; -import io.opentelemetry.sdk.resources.Resource; -import java.nio.ByteBuffer; -import javax.annotation.Nullable; -import javax.annotation.concurrent.Immutable; - -/** - * A ProfileContainer represents a single profile. It wraps pprof profile with OpenTelemetry - * specific metadata. - * - * @see "profiles.proto::ProfileContainer" - */ -@Immutable -public interface ProfileContainerData { - - /** Returns the resource of this profile. */ - Resource getResource(); - - /** Returns the instrumentation scope that generated this profile. */ - InstrumentationScopeInfo getInstrumentationScopeInfo(); - - /** - * Returns a globally unique identifier for a profile, as 32 character lowercase hex String. An ID - * with all zeroes is considered invalid. This field is required. - */ - String getProfileId(); - - /** - * Returns a globally unique identifier for a profile, as a 16 bytes array. An ID with all zeroes - * is considered invalid. This field is required. - */ - default byte[] getProfileIdBytes() { - return OtelEncodingUtils.bytesFromBase16(getProfileId(), 32); - } - - /** - * Returns the start time of the profile. Value is UNIX Epoch time in nanoseconds since 00:00:00 - * UTC on 1 January 1970. This field is semantically required and it is expected that end_time >= - * start_time. - */ - long getStartEpochNanos(); - - /** - * Returns the end time of the profile. Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC - * on 1 January 1970. This field is semantically required and it is expected that end_time >= - * start_time. - */ - long getEndEpochNanos(); - - /** - * Returns profile-wide attributes. Attribute keys MUST be unique (it is not allowed to have more - * than one attribute with the same key). - * - * @see - * "https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute" - */ - Attributes getAttributes(); - - /** - * Returns the total number of attributes that were recorded on this profile container. - * - *

This number may be larger than the number of attributes that are attached to this profile - * container, if the total number recorded was greater than the configured maximum value. - */ - int getTotalAttributeCount(); - - /** - * Returns the format of the original payload. Common values are defined in semantic conventions. - * [required if original_payload is present] - */ - @Nullable - String getOriginalPayloadFormat(); - - /** - * Returns the original payload, in a profiler-native format e.g. JFR. Optional. Default behavior - * should be to not include the original payload. If the original payload is in pprof format, it - * SHOULD not be included in this field. - */ - ByteBuffer getOriginalPayload(); - - /** Returns an extended pprof profile. Required, even when originalPayload is also present. */ - ProfileData getProfile(); -} diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfileContainerMarshaler.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfileContainerMarshaler.java deleted file mode 100644 index 984a18c94a9..00000000000 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfileContainerMarshaler.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * SPDX-License-Identifier: Apache-2.0 - */ - -package io.opentelemetry.exporter.otlp.profiles; - -import io.opentelemetry.exporter.internal.marshal.MarshalerUtil; -import io.opentelemetry.exporter.internal.marshal.MarshalerWithSize; -import io.opentelemetry.exporter.internal.marshal.Serializer; -import io.opentelemetry.exporter.internal.otlp.KeyValueMarshaler; -import io.opentelemetry.proto.profiles.v1experimental.internal.ProfileContainer; -import java.io.IOException; -import java.nio.ByteBuffer; - -final class ProfileContainerMarshaler extends MarshalerWithSize { - - private final byte[] profileId; - private final long startEpochNanos; - private final long endEpochNanos; - private final KeyValueMarshaler[] attributeMarshalers; - private final int droppedAttributesCount; - private final byte[] originalPayloadFormatUtf8; - private final ByteBuffer originalPayload; - private final ProfileMarshaler profileMarshaler; - - static ProfileContainerMarshaler create(ProfileContainerData profileContainerData) { - int droppedAttributesCount = - profileContainerData.getTotalAttributeCount() - profileContainerData.getAttributes().size(); - - ByteBuffer originalPayload = profileContainerData.getOriginalPayload(); - if (originalPayload == null) { - originalPayload = ByteBuffer.allocate(0); - } else { - originalPayload = originalPayload.duplicate().asReadOnlyBuffer(); - } - - return new ProfileContainerMarshaler( - profileContainerData.getProfileIdBytes(), - profileContainerData.getStartEpochNanos(), - profileContainerData.getEndEpochNanos(), - KeyValueMarshaler.createForAttributes(profileContainerData.getAttributes()), - droppedAttributesCount, - MarshalerUtil.toBytes(profileContainerData.getOriginalPayloadFormat()), - originalPayload, - ProfileMarshaler.create(profileContainerData.getProfile())); - } - - private ProfileContainerMarshaler( - byte[] profileId, - long startEpochNanos, - long endEpochNanos, - KeyValueMarshaler[] attributeMarshalers, - int droppedAttributesCount, - byte[] originalPayloadFormat, - ByteBuffer originalPayload, - ProfileMarshaler profileMarshaler) { - super( - calculateSize( - profileId, - startEpochNanos, - endEpochNanos, - attributeMarshalers, - droppedAttributesCount, - originalPayloadFormat, - originalPayload, - profileMarshaler)); - this.profileId = profileId; - this.startEpochNanos = startEpochNanos; - this.endEpochNanos = endEpochNanos; - this.attributeMarshalers = attributeMarshalers; - this.droppedAttributesCount = droppedAttributesCount; - this.originalPayloadFormatUtf8 = originalPayloadFormat; - this.originalPayload = originalPayload; - this.profileMarshaler = profileMarshaler; - } - - @Override - protected void writeTo(Serializer output) throws IOException { - output.serializeBytes(ProfileContainer.PROFILE_ID, profileId); - output.serializeFixed64(ProfileContainer.START_TIME_UNIX_NANO, startEpochNanos); - output.serializeFixed64(ProfileContainer.END_TIME_UNIX_NANO, endEpochNanos); - output.serializeRepeatedMessage(ProfileContainer.ATTRIBUTES, attributeMarshalers); - output.serializeUInt32(ProfileContainer.DROPPED_ATTRIBUTES_COUNT, droppedAttributesCount); - output.serializeString(ProfileContainer.ORIGINAL_PAYLOAD_FORMAT, originalPayloadFormatUtf8); - output.serializeByteBuffer(ProfileContainer.ORIGINAL_PAYLOAD, originalPayload); - output.serializeMessage(ProfileContainer.PROFILE, profileMarshaler); - } - - private static int calculateSize( - byte[] profileId, - long startEpochNanos, - long endEpochNanos, - KeyValueMarshaler[] attributeMarshalers, - int droppedAttributesCount, - byte[] originalPayloadFormat, - ByteBuffer originalPayload, - ProfileMarshaler profileMarshaler) { - int size; - size = 0; - size += MarshalerUtil.sizeBytes(ProfileContainer.PROFILE_ID, profileId); - size += MarshalerUtil.sizeFixed64(ProfileContainer.START_TIME_UNIX_NANO, startEpochNanos); - size += MarshalerUtil.sizeFixed64(ProfileContainer.END_TIME_UNIX_NANO, endEpochNanos); - size += MarshalerUtil.sizeRepeatedMessage(ProfileContainer.ATTRIBUTES, attributeMarshalers); - size += - MarshalerUtil.sizeUInt32(ProfileContainer.DROPPED_ATTRIBUTES_COUNT, droppedAttributesCount); - size += - MarshalerUtil.sizeBytes(ProfileContainer.ORIGINAL_PAYLOAD_FORMAT, originalPayloadFormat); - size += MarshalerUtil.sizeByteBuffer(ProfileContainer.ORIGINAL_PAYLOAD, originalPayload); - size += MarshalerUtil.sizeMessage(ProfileContainer.PROFILE, profileMarshaler); - return size; - } -} diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfileData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfileData.java index 63b26401de9..d6dd8709ed0 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfileData.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfileData.java @@ -6,18 +6,29 @@ package io.opentelemetry.exporter.otlp.profiles; import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.internal.OtelEncodingUtils; +import io.opentelemetry.sdk.common.InstrumentationScopeInfo; +import io.opentelemetry.sdk.resources.Resource; +import java.nio.ByteBuffer; import java.util.List; +import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; /** * Represents a complete profile, including sample types, samples, mappings to binaries, locations, * functions, string table, and additional metadata. * - * @see "pprofextended.proto::Profile" + * @see "profiles.proto::Profile" */ @Immutable public interface ProfileData { + /** Returns the resource of this profile. */ + Resource getResource(); + + /** Returns the instrumentation scope that generated this profile. */ + InstrumentationScopeInfo getInstrumentationScopeInfo(); + /** A description of the samples associated with each Sample.value. */ List getSampleTypes(); @@ -28,43 +39,31 @@ public interface ProfileData { * Mapping from address ranges to the image/binary/library mapped into that address range. * mapping[0] will be the main binary. */ - List getMappings(); + List getMappingTable(); /** Locations referenced by samples via location_indices. */ - List getLocations(); + List getLocationTable(); /** Array of locations referenced by samples. */ - List getLocationIndices(); + List getLocationIndices(); /** Functions referenced by locations. */ - List getFunctions(); + List getFunctionTable(); /** Lookup table for attributes. */ - Attributes getAttributes(); + Attributes getAttributeTable(); /** Represents a mapping between Attribute Keys and Units. */ List getAttributeUnits(); /** Lookup table for links. */ - List getLinks(); + List getLinkTable(); /** * A common table for strings referenced by various messages. string_table[0] must always be "". */ List getStringTable(); - /** - * Frames with Function.function_name fully matching the following regexp will be dropped from the - * samples, along with their successors. Index into string table. - */ - long getDropFrames(); - - /** - * Frames with Function.function_name fully matching the following regexp will be kept, even if - * matching drop_frames pattern. Index into string table. - */ - long getKeepFrames(); - /** Time of collection (UTC) represented as nanoseconds past the epoch. */ long getTimeNanos(); @@ -80,8 +79,53 @@ public interface ProfileData { long getPeriod(); /** Free-form text associated with the profile. Indices into string table. */ - List getComment(); + List getCommentStrIndices(); /** Type of the preferred sample. Index into the string table. */ - long getDefaultSampleType(); + int getDefaultSampleTypeStringIndex(); + + /** + * Returns a globally unique identifier for a profile, as 32 character lowercase hex String. An ID + * with all zeroes is considered invalid. This field is required. + */ + String getProfileId(); + + /** + * Returns a globally unique identifier for a profile, as a 16 bytes array. An ID with all zeroes + * is considered invalid. This field is required. + */ + default byte[] getProfileIdBytes() { + return OtelEncodingUtils.bytesFromBase16(getProfileId(), 32); + } + + /** + * Returns profile-wide attributes. Attribute keys MUST be unique (it is not allowed to have more + * than one attribute with the same key). + * + * @see + * "https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute" + */ + Attributes getAttributes(); + + /** + * Returns the total number of attributes that were recorded on this profile. + * + *

This number may be larger than the number of attributes that are attached to this profile, + * if the total number recorded was greater than the configured maximum value. + */ + int getTotalAttributeCount(); + + /** + * Returns the format of the original payload. Common values are defined in semantic conventions. + * [required if original_payload is present] + */ + @Nullable + String getOriginalPayloadFormat(); + + /** + * Returns the original payload, in a profiler-native format e.g. JFR. Optional. Default behavior + * should be to not include the original payload. If the original payload is in pprof format, it + * SHOULD not be included in this field. + */ + ByteBuffer getOriginalPayload(); } diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfileMarshaler.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfileMarshaler.java index 6553c598c1d..04ea86c3263 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfileMarshaler.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfileMarshaler.java @@ -9,8 +9,9 @@ import io.opentelemetry.exporter.internal.marshal.MarshalerWithSize; import io.opentelemetry.exporter.internal.marshal.Serializer; import io.opentelemetry.exporter.internal.otlp.KeyValueMarshaler; -import io.opentelemetry.proto.profiles.v1experimental.internal.Profile; +import io.opentelemetry.proto.profiles.v1development.internal.Profile; import java.io.IOException; +import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.List; @@ -18,22 +19,25 @@ final class ProfileMarshaler extends MarshalerWithSize { private final ValueTypeMarshaler[] sampleTypeMarshalers; private final SampleMarshaler[] sampleMarshalers; - private final MappingMarshaler[] mappingMarshalers; - private final LocationMarshaler[] locationMarshalers; - private final List locationIndices; - private final FunctionMarshaler[] functionMarshalers; - private final KeyValueMarshaler[] attributeMarshalers; + private final MappingMarshaler[] mappingTableMarshalers; + private final LocationMarshaler[] locationTableMarshalers; + private final List locationIndices; + private final FunctionMarshaler[] functionTableMarshalers; + private final KeyValueMarshaler[] attributeTableMarshalers; private final AttributeUnitMarshaler[] attributeUnitMarshalers; - private final LinkMarshaler[] linkMarshalers; + private final LinkMarshaler[] linkTableMarshalers; private final byte[][] stringTable; - private final long dropFrames; - private final long keepFrames; private final long timeNanos; private final long durationNanos; private final ValueTypeMarshaler periodTypeMarshaler; private final long period; - private final List comment; - private final long defaultSampleType; + private final List comment; + private final int defaultSampleType; + private final byte[] profileId; + private final KeyValueMarshaler[] attributeMarshalers; + private final int droppedAttributesCount; + private final byte[] originalPayloadFormatUtf8; + private final ByteBuffer originalPayload; static ProfileMarshaler create(ProfileData profileData) { @@ -41,16 +45,16 @@ static ProfileMarshaler create(ProfileData profileData) { ValueTypeMarshaler.createRepeated(profileData.getSampleTypes()); SampleMarshaler[] sampleMarshalers = SampleMarshaler.createRepeated(profileData.getSamples()); MappingMarshaler[] mappingMarshalers = - MappingMarshaler.createRepeated(profileData.getMappings()); + MappingMarshaler.createRepeated(profileData.getMappingTable()); LocationMarshaler[] locationMarshalers = - LocationMarshaler.createRepeated(profileData.getLocations()); + LocationMarshaler.createRepeated(profileData.getLocationTable()); FunctionMarshaler[] functionMarshalers = - FunctionMarshaler.createRepeated(profileData.getFunctions()); + FunctionMarshaler.createRepeated(profileData.getFunctionTable()); KeyValueMarshaler[] attributeMarshalers = KeyValueMarshaler.createForAttributes(profileData.getAttributes()); AttributeUnitMarshaler[] attributeUnitsMarshalers = AttributeUnitMarshaler.createRepeated(profileData.getAttributeUnits()); - LinkMarshaler[] linkMarshalers = LinkMarshaler.createRepeated(profileData.getLinks()); + LinkMarshaler[] linkMarshalers = LinkMarshaler.createRepeated(profileData.getLinkTable()); ValueTypeMarshaler periodTypeMarshaler = ValueTypeMarshaler.create(profileData.getPeriodType()); byte[][] convertedStrings = new byte[profileData.getStringTable().size()][]; @@ -58,6 +62,9 @@ static ProfileMarshaler create(ProfileData profileData) { convertedStrings[i] = profileData.getStringTable().get(i).getBytes(StandardCharsets.UTF_8); } + int droppedAttributesCount = + profileData.getTotalAttributeCount() - profileData.getAttributes().size(); + return new ProfileMarshaler( sampleTypeMarshalers, sampleMarshalers, @@ -69,97 +76,111 @@ static ProfileMarshaler create(ProfileData profileData) { attributeUnitsMarshalers, linkMarshalers, convertedStrings, - profileData.getDropFrames(), - profileData.getKeepFrames(), profileData.getTimeNanos(), profileData.getDurationNanos(), periodTypeMarshaler, profileData.getPeriod(), - profileData.getComment(), - profileData.getDefaultSampleType()); + profileData.getCommentStrIndices(), + profileData.getDefaultSampleTypeStringIndex(), + profileData.getProfileIdBytes(), + KeyValueMarshaler.createForAttributes(profileData.getAttributes()), + droppedAttributesCount, + MarshalerUtil.toBytes(profileData.getOriginalPayloadFormat()), + profileData.getOriginalPayload()); } private ProfileMarshaler( ValueTypeMarshaler[] sampleTypeMarshalers, SampleMarshaler[] sampleMarshalers, - MappingMarshaler[] mappingMarshalers, - LocationMarshaler[] locationMarshalers, - List locationIndices, - FunctionMarshaler[] functionMarshalers, - KeyValueMarshaler[] attributeMarshalers, + MappingMarshaler[] mappingTableMarshalers, + LocationMarshaler[] locationTableMarshalers, + List locationIndices, + FunctionMarshaler[] functionTableMarshalers, + KeyValueMarshaler[] attributeTableMarshalers, AttributeUnitMarshaler[] attributeUnitMarshalers, - LinkMarshaler[] linkMarshalers, + LinkMarshaler[] linkTableMarshalers, byte[][] stringTableUtf8, - long dropFrames, - long keepFrames, long timeNanos, long durationNanos, ValueTypeMarshaler periodTypeMarshaler, long period, - List comment, - long defaultSampleType) { + List comment, + int defaultSampleType, + byte[] profileId, + KeyValueMarshaler[] attributeMarshalers, + int droppedAttributesCount, + byte[] originalPayloadFormat, + ByteBuffer originalPayload) { super( calculateSize( sampleTypeMarshalers, sampleMarshalers, - mappingMarshalers, - locationMarshalers, + mappingTableMarshalers, + locationTableMarshalers, locationIndices, - functionMarshalers, - attributeMarshalers, + functionTableMarshalers, + attributeTableMarshalers, attributeUnitMarshalers, - linkMarshalers, + linkTableMarshalers, stringTableUtf8, - dropFrames, - keepFrames, timeNanos, durationNanos, periodTypeMarshaler, period, comment, - defaultSampleType)); + defaultSampleType, + profileId, + attributeMarshalers, + droppedAttributesCount, + originalPayloadFormat, + originalPayload)); this.sampleTypeMarshalers = sampleTypeMarshalers; this.sampleMarshalers = sampleMarshalers; - this.mappingMarshalers = mappingMarshalers; - this.locationMarshalers = locationMarshalers; + this.mappingTableMarshalers = mappingTableMarshalers; + this.locationTableMarshalers = locationTableMarshalers; this.locationIndices = locationIndices; - this.functionMarshalers = functionMarshalers; - this.attributeMarshalers = attributeMarshalers; + this.functionTableMarshalers = functionTableMarshalers; + this.attributeTableMarshalers = attributeTableMarshalers; this.attributeUnitMarshalers = attributeUnitMarshalers; - this.linkMarshalers = linkMarshalers; + this.linkTableMarshalers = linkTableMarshalers; this.stringTable = stringTableUtf8; - this.dropFrames = dropFrames; - this.keepFrames = keepFrames; this.timeNanos = timeNanos; this.durationNanos = durationNanos; this.periodTypeMarshaler = periodTypeMarshaler; this.period = period; this.comment = comment; this.defaultSampleType = defaultSampleType; + this.profileId = profileId; + this.attributeMarshalers = attributeMarshalers; + this.droppedAttributesCount = droppedAttributesCount; + this.originalPayloadFormatUtf8 = originalPayloadFormat; + this.originalPayload = originalPayload; } @Override protected void writeTo(Serializer output) throws IOException { output.serializeRepeatedMessage(Profile.SAMPLE_TYPE, sampleTypeMarshalers); output.serializeRepeatedMessage(Profile.SAMPLE, sampleMarshalers); - output.serializeRepeatedMessage(Profile.MAPPING, mappingMarshalers); - output.serializeRepeatedMessage(Profile.LOCATION, locationMarshalers); - output.serializeRepeatedInt64(Profile.LOCATION_INDICES, locationIndices); - output.serializeRepeatedMessage(Profile.FUNCTION, functionMarshalers); - output.serializeRepeatedMessage(Profile.ATTRIBUTE_TABLE, attributeMarshalers); + output.serializeRepeatedMessage(Profile.MAPPING_TABLE, mappingTableMarshalers); + output.serializeRepeatedMessage(Profile.LOCATION_TABLE, locationTableMarshalers); + output.serializeRepeatedInt32(Profile.LOCATION_INDICES, locationIndices); + output.serializeRepeatedMessage(Profile.FUNCTION_TABLE, functionTableMarshalers); + output.serializeRepeatedMessage(Profile.ATTRIBUTE_TABLE, attributeTableMarshalers); output.serializeRepeatedMessage(Profile.ATTRIBUTE_UNITS, attributeUnitMarshalers); - output.serializeRepeatedMessage(Profile.LINK_TABLE, linkMarshalers); - for (byte[] i : stringTable) { - output.serializeString(Profile.STRING_TABLE, i); - } - output.serializeInt64(Profile.DROP_FRAMES, dropFrames); - output.serializeInt64(Profile.KEEP_FRAMES, keepFrames); + output.serializeRepeatedMessage(Profile.LINK_TABLE, linkTableMarshalers); + output.serializeRepeatedString(Profile.STRING_TABLE, stringTable); output.serializeInt64(Profile.TIME_NANOS, timeNanos); output.serializeInt64(Profile.DURATION_NANOS, durationNanos); output.serializeMessage(Profile.PERIOD_TYPE, periodTypeMarshaler); output.serializeInt64(Profile.PERIOD, period); - output.serializeRepeatedInt64(Profile.COMMENT, comment); - output.serializeInt64(Profile.DEFAULT_SAMPLE_TYPE, defaultSampleType); + output.serializeRepeatedInt32(Profile.COMMENT_STRINDICES, comment); + output.serializeInt32(Profile.DEFAULT_SAMPLE_TYPE_STRINDEX, defaultSampleType); + + output.serializeBytes(Profile.PROFILE_ID, profileId); + output.serializeRepeatedMessage(Profile.ATTRIBUTES, attributeMarshalers); + output.serializeUInt32(Profile.DROPPED_ATTRIBUTES_COUNT, droppedAttributesCount); + output.serializeString(Profile.ORIGINAL_PAYLOAD_FORMAT, originalPayloadFormatUtf8); + output.serializeByteBuffer(Profile.ORIGINAL_PAYLOAD, originalPayload); } private static int calculateSize( @@ -167,42 +188,48 @@ private static int calculateSize( SampleMarshaler[] sampleMarshalers, MappingMarshaler[] mappingMarshalers, LocationMarshaler[] locationMarshalers, - List locationIndices, + List locationIndices, FunctionMarshaler[] functionMarshalers, - KeyValueMarshaler[] attributeMarshalers, + KeyValueMarshaler[] attributeTableMarshalers, AttributeUnitMarshaler[] attributeUnitMarshalers, LinkMarshaler[] linkMarshalers, byte[][] stringTable, - long dropFrames, - long keepFrames, long timeNanos, long durationNanos, ValueTypeMarshaler periodTypeMarshaler, long period, - List comment, - long defaultSampleType) { + List comment, + int defaultSampleType, + byte[] profileId, + KeyValueMarshaler[] attributeMarshalers, + int droppedAttributesCount, + byte[] originalPayloadFormat, + ByteBuffer originalPayload) { int size; size = 0; size += MarshalerUtil.sizeRepeatedMessage(Profile.SAMPLE_TYPE, sampleTypeMarshalers); size += MarshalerUtil.sizeRepeatedMessage(Profile.SAMPLE, sampleMarshalers); - size += MarshalerUtil.sizeRepeatedMessage(Profile.MAPPING, mappingMarshalers); - size += MarshalerUtil.sizeRepeatedMessage(Profile.LOCATION, locationMarshalers); - size += MarshalerUtil.sizeRepeatedInt64(Profile.LOCATION_INDICES, locationIndices); - size += MarshalerUtil.sizeRepeatedMessage(Profile.FUNCTION, functionMarshalers); - size += MarshalerUtil.sizeRepeatedMessage(Profile.ATTRIBUTE_TABLE, attributeMarshalers); + size += MarshalerUtil.sizeRepeatedMessage(Profile.MAPPING_TABLE, mappingMarshalers); + size += MarshalerUtil.sizeRepeatedMessage(Profile.LOCATION_TABLE, locationMarshalers); + size += MarshalerUtil.sizeRepeatedInt32(Profile.LOCATION_INDICES, locationIndices); + size += MarshalerUtil.sizeRepeatedMessage(Profile.FUNCTION_TABLE, functionMarshalers); + size += MarshalerUtil.sizeRepeatedMessage(Profile.ATTRIBUTE_TABLE, attributeTableMarshalers); size += MarshalerUtil.sizeRepeatedMessage(Profile.ATTRIBUTE_UNITS, attributeUnitMarshalers); size += MarshalerUtil.sizeRepeatedMessage(Profile.LINK_TABLE, linkMarshalers); - for (byte[] i : stringTable) { - size += MarshalerUtil.sizeBytes(Profile.STRING_TABLE, i); - } - size += MarshalerUtil.sizeInt64(Profile.DROP_FRAMES, dropFrames); - size += MarshalerUtil.sizeInt64(Profile.KEEP_FRAMES, keepFrames); + size += MarshalerUtil.sizeRepeatedString(Profile.STRING_TABLE, stringTable); size += MarshalerUtil.sizeInt64(Profile.TIME_NANOS, timeNanos); size += MarshalerUtil.sizeInt64(Profile.DURATION_NANOS, durationNanos); size += MarshalerUtil.sizeMessage(Profile.PERIOD_TYPE, periodTypeMarshaler); size += MarshalerUtil.sizeInt64(Profile.PERIOD, period); - size += MarshalerUtil.sizeRepeatedInt64(Profile.COMMENT, comment); - size += MarshalerUtil.sizeInt64(Profile.DEFAULT_SAMPLE_TYPE, defaultSampleType); + size += MarshalerUtil.sizeRepeatedInt32(Profile.COMMENT_STRINDICES, comment); + size += MarshalerUtil.sizeInt64(Profile.DEFAULT_SAMPLE_TYPE_STRINDEX, defaultSampleType); + + size += MarshalerUtil.sizeBytes(Profile.PROFILE_ID, profileId); + size += MarshalerUtil.sizeRepeatedMessage(Profile.ATTRIBUTES, attributeMarshalers); + size += MarshalerUtil.sizeInt32(Profile.DROPPED_ATTRIBUTES_COUNT, droppedAttributesCount); + size += MarshalerUtil.sizeBytes(Profile.ORIGINAL_PAYLOAD_FORMAT, originalPayloadFormat); + size += MarshalerUtil.sizeByteBuffer(Profile.ORIGINAL_PAYLOAD, originalPayload); + return size; } } diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfilesRequestMarshaler.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfilesRequestMarshaler.java index 1d341449a6c..3d57825899a 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfilesRequestMarshaler.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfilesRequestMarshaler.java @@ -10,13 +10,12 @@ import io.opentelemetry.exporter.internal.marshal.MarshalerWithSize; import io.opentelemetry.exporter.internal.marshal.ProtoFieldInfo; import io.opentelemetry.exporter.internal.marshal.Serializer; -import io.opentelemetry.proto.collector.profiles.v1experimental.internal.ExportProfilesServiceRequest; +import io.opentelemetry.proto.collector.profiles.v1development.internal.ExportProfilesServiceRequest; import java.io.IOException; import java.util.Collection; /** - * {@link Marshaler} to convert SDK {@link ProfileContainerData} to OTLP - * ExportProfilesServiceRequest. + * {@link Marshaler} to convert SDK {@link ProfileData} to OTLP ExportProfilesServiceRequest. * *

This class is internal and is hence not for public use. Its APIs are unstable and can change * at any time. @@ -30,11 +29,10 @@ public final class ProfilesRequestMarshaler extends MarshalerWithSize { /** * Returns a {@link ProfilesRequestMarshaler} that can be used to convert the provided {@link - * ProfileContainerData} into a serialized OTLP ExportProfilesServiceRequest. + * ProfileData} into a serialized OTLP ExportProfilesServiceRequest. */ - public static ProfilesRequestMarshaler create( - Collection profileContainerList) { - return new ProfilesRequestMarshaler(ResourceProfilesMarshaler.create(profileContainerList)); + public static ProfilesRequestMarshaler create(Collection profileList) { + return new ProfilesRequestMarshaler(ResourceProfilesMarshaler.create(profileList)); } private ProfilesRequestMarshaler(ResourceProfilesMarshaler[] resourceProfilesMarshalers) { diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ResourceProfilesMarshaler.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ResourceProfilesMarshaler.java index 4000ff5f373..442604cead2 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ResourceProfilesMarshaler.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ResourceProfilesMarshaler.java @@ -10,7 +10,7 @@ import io.opentelemetry.exporter.internal.marshal.Serializer; import io.opentelemetry.exporter.internal.otlp.InstrumentationScopeMarshaler; import io.opentelemetry.exporter.internal.otlp.ResourceMarshaler; -import io.opentelemetry.proto.profiles.v1experimental.internal.ResourceProfiles; +import io.opentelemetry.proto.profiles.v1development.internal.ResourceProfiles; import io.opentelemetry.sdk.common.InstrumentationScopeInfo; import io.opentelemetry.sdk.resources.Resource; import java.io.IOException; @@ -26,20 +26,20 @@ final class ResourceProfilesMarshaler extends MarshalerWithSize { /** Returns Marshalers of ResourceProfiles created by grouping the provided Profiles. */ @SuppressWarnings("AvoidObjectArrays") - static ResourceProfilesMarshaler[] create(Collection profiles) { - Map>> - resourceAndScopeMap = groupByResourceAndScope(profiles); + static ResourceProfilesMarshaler[] create(Collection profiles) { + Map>> resourceAndScopeMap = + groupByResourceAndScope(profiles); ResourceProfilesMarshaler[] resourceProfilesMarshalers = new ResourceProfilesMarshaler[resourceAndScopeMap.size()]; int posResource = 0; - for (Map.Entry>> entry : + for (Map.Entry>> entry : resourceAndScopeMap.entrySet()) { InstrumentationScopeProfilesMarshaler[] instrumentationLibrarySpansMarshalers = new InstrumentationScopeProfilesMarshaler[entry.getValue().size()]; int posInstrumentation = 0; - for (Map.Entry> entryIs : + for (Map.Entry> entryIs : entry.getValue().entrySet()) { instrumentationLibrarySpansMarshalers[posInstrumentation++] = new InstrumentationScopeProfilesMarshaler( @@ -89,12 +89,12 @@ private static int calculateSize( return size; } - private static Map>> - groupByResourceAndScope(Collection profiles) { + private static Map>> + groupByResourceAndScope(Collection profiles) { return MarshalerUtil.groupByResourceAndScope( profiles, - ProfileContainerData::getResource, - ProfileContainerData::getInstrumentationScopeInfo, - ProfileContainerMarshaler::create); + ProfileData::getResource, + ProfileData::getInstrumentationScopeInfo, + ProfileMarshaler::create); } } diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/SampleData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/SampleData.java index f5671511421..ef565b53f86 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/SampleData.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/SampleData.java @@ -13,7 +13,7 @@ * a stack trace, perhaps augmented with auxiliary information like the thread-id, some indicator of * a higher level request being handled etc. * - * @see "pprofextended.proto::Sample" + * @see "profiles.proto::Sample" */ @Immutable public interface SampleData { @@ -22,19 +22,13 @@ public interface SampleData { * locationsStartIndex along with locationsLength refers to a slice of locations in * Profile.location. Supersedes locationIndices. */ - long getLocationsStartIndex(); + int getLocationsStartIndex(); /** * locationsLength along with locationsStartIndex refers to a slice of locations in * Profile.location. locationIndices. */ - long getLocationsLength(); - - /** - * reference to a 128bit id that uniquely identifies this stacktrace, globally. Index into the - * string table. - */ - int getStacktraceIdIndex(); + int getLocationsLength(); /** * The type and unit of each value is defined by the corresponding entry in Profile.sample_type. @@ -42,10 +36,10 @@ public interface SampleData { List getValues(); /** References to attributes in Profile.attribute_table. */ - List getAttributes(); + List getAttributeIndices(); /** Reference to link in Profile.link_table. */ - long getLink(); + Integer getLinkIndex(); /** * Timestamps associated with Sample represented in ms. These timestamps are expected to fall diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/SampleMarshaler.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/SampleMarshaler.java index 0c9cd4ae71e..d6bb2c31c94 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/SampleMarshaler.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/SampleMarshaler.java @@ -8,21 +8,21 @@ import io.opentelemetry.exporter.internal.marshal.MarshalerUtil; import io.opentelemetry.exporter.internal.marshal.MarshalerWithSize; import io.opentelemetry.exporter.internal.marshal.Serializer; -import io.opentelemetry.proto.profiles.v1experimental.internal.Sample; +import io.opentelemetry.proto.profiles.v1development.internal.Sample; import java.io.IOException; import java.util.List; import java.util.function.Consumer; +import javax.annotation.Nullable; final class SampleMarshaler extends MarshalerWithSize { private static final SampleMarshaler[] EMPTY_REPEATED = new SampleMarshaler[0]; - private final long locationsStartIndex; - private final long locationsLength; - private final int stacktraceIdIndex; + private final int locationsStartIndex; + private final int locationsLength; private final List values; - private final List attributes; - private final long link; + private final List attributesIndices; + @Nullable private final Integer linkIndex; private final List timestamps; static SampleMarshaler create(SampleData sampleData) { @@ -30,10 +30,9 @@ static SampleMarshaler create(SampleData sampleData) { return new SampleMarshaler( sampleData.getLocationsStartIndex(), sampleData.getLocationsLength(), - sampleData.getStacktraceIdIndex(), sampleData.getValues(), - sampleData.getAttributes(), - sampleData.getLink(), + sampleData.getAttributeIndices(), + sampleData.getLinkIndex(), sampleData.getTimestamps()); } @@ -57,58 +56,52 @@ public void accept(SampleData sampleData) { } private SampleMarshaler( - long locationsStartIndex, - long locationsLength, - int stacktraceIdIndex, + int locationsStartIndex, + int locationsLength, List values, - List attributes, - long link, + List attributesIndices, + @Nullable Integer linkIndex, List timestamps) { super( calculateSize( locationsStartIndex, locationsLength, - stacktraceIdIndex, values, - attributes, - link, + attributesIndices, + linkIndex, timestamps)); this.locationsStartIndex = locationsStartIndex; this.locationsLength = locationsLength; - this.stacktraceIdIndex = stacktraceIdIndex; this.values = values; - this.attributes = attributes; - this.link = link; + this.attributesIndices = attributesIndices; + this.linkIndex = linkIndex; this.timestamps = timestamps; } @Override protected void writeTo(Serializer output) throws IOException { - output.serializeUInt64(Sample.LOCATIONS_START_INDEX, locationsStartIndex); - output.serializeUInt64(Sample.LOCATIONS_LENGTH, locationsLength); - output.serializeUInt32(Sample.STACKTRACE_ID_INDEX, stacktraceIdIndex); + output.serializeInt32(Sample.LOCATIONS_START_INDEX, locationsStartIndex); + output.serializeInt32(Sample.LOCATIONS_LENGTH, locationsLength); output.serializeRepeatedInt64(Sample.VALUE, values); - output.serializeRepeatedUInt64(Sample.ATTRIBUTES, attributes); - output.serializeUInt64(Sample.LINK, link); + output.serializeRepeatedInt32(Sample.ATTRIBUTE_INDICES, attributesIndices); + output.serializeInt32Optional(Sample.LINK_INDEX, linkIndex); output.serializeRepeatedUInt64(Sample.TIMESTAMPS_UNIX_NANO, timestamps); } private static int calculateSize( - long locationsStartIndex, - long locationsLength, - int stacktraceIdIndex, + int locationsStartIndex, + int locationsLength, List values, - List attributes, - long link, + List attributesIndices, + @Nullable Integer linkIndex, List timestamps) { int size; size = 0; - size += MarshalerUtil.sizeUInt64(Sample.LOCATIONS_START_INDEX, locationsStartIndex); - size += MarshalerUtil.sizeUInt64(Sample.LOCATIONS_LENGTH, locationsLength); - size += MarshalerUtil.sizeUInt32(Sample.STACKTRACE_ID_INDEX, stacktraceIdIndex); + size += MarshalerUtil.sizeInt32(Sample.LOCATIONS_START_INDEX, locationsStartIndex); + size += MarshalerUtil.sizeInt32(Sample.LOCATIONS_LENGTH, locationsLength); size += MarshalerUtil.sizeRepeatedInt64(Sample.VALUE, values); - size += MarshalerUtil.sizeRepeatedUInt64(Sample.ATTRIBUTES, attributes); - size += MarshalerUtil.sizeUInt64(Sample.LINK, link); + size += MarshalerUtil.sizeRepeatedInt32(Sample.ATTRIBUTE_INDICES, attributesIndices); + size += MarshalerUtil.sizeInt32Optional(Sample.LINK_INDEX, linkIndex); size += MarshalerUtil.sizeRepeatedUInt64(Sample.TIMESTAMPS_UNIX_NANO, timestamps); return size; } diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ValueTypeData.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ValueTypeData.java index 22c18787b32..10aac94b71a 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ValueTypeData.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ValueTypeData.java @@ -11,17 +11,17 @@ /** * ValueType describes the type and units of a value, with an optional aggregation temporality. * - * @see "pprofextended.proto::ValueType" + * @see "profiles.proto::ValueType" */ @Immutable public interface ValueTypeData { /** Index into string table. */ - long type(); + int getTypeStringIndex(); /** Index into string table. */ - long unit(); + int getUnitStringIndex(); @Nullable - AggregationTemporality aggregationTemporality(); + AggregationTemporality getAggregationTemporality(); } diff --git a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ValueTypeMarshaler.java b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ValueTypeMarshaler.java index e880b3dded9..a52621b119c 100644 --- a/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ValueTypeMarshaler.java +++ b/exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ValueTypeMarshaler.java @@ -9,8 +9,8 @@ import io.opentelemetry.exporter.internal.marshal.MarshalerWithSize; import io.opentelemetry.exporter.internal.marshal.ProtoEnumInfo; import io.opentelemetry.exporter.internal.marshal.Serializer; -import io.opentelemetry.proto.profiles.v1experimental.internal.AggregationTemporality; -import io.opentelemetry.proto.profiles.v1experimental.internal.ValueType; +import io.opentelemetry.proto.profiles.v1development.internal.AggregationTemporality; +import io.opentelemetry.proto.profiles.v1development.internal.ValueType; import java.io.IOException; import java.util.List; import java.util.function.Consumer; @@ -19,15 +19,15 @@ final class ValueTypeMarshaler extends MarshalerWithSize { private static final ValueTypeMarshaler[] EMPTY_REPEATED = new ValueTypeMarshaler[0]; - private final long type; - private final long unit; + private final int typeStringIndex; + private final int unitStringIndex; private final ProtoEnumInfo aggregationTemporality; static ValueTypeMarshaler create(ValueTypeData valueTypeData) { ProtoEnumInfo aggregationTemporality = AggregationTemporality.AGGREGATION_TEMPORALITY_UNSPECIFIED; - if (valueTypeData.aggregationTemporality() != null) { - switch (valueTypeData.aggregationTemporality()) { + if (valueTypeData.getAggregationTemporality() != null) { + switch (valueTypeData.getAggregationTemporality()) { case DELTA: aggregationTemporality = AggregationTemporality.AGGREGATION_TEMPORALITY_DELTA; break; @@ -37,7 +37,9 @@ static ValueTypeMarshaler create(ValueTypeData valueTypeData) { } } return new ValueTypeMarshaler( - valueTypeData.type(), valueTypeData.unit(), aggregationTemporality); + valueTypeData.getTypeStringIndex(), + valueTypeData.getUnitStringIndex(), + aggregationTemporality); } static ValueTypeMarshaler[] createRepeated(List items) { @@ -59,25 +61,27 @@ public void accept(ValueTypeData valueTypeData) { return valueTypeMarshalers; } - private ValueTypeMarshaler(long type, long unit, ProtoEnumInfo aggregationTemporality) { - super(calculateSize(type, unit, aggregationTemporality)); - this.type = type; - this.unit = unit; + private ValueTypeMarshaler( + int typeStringIndex, int unitStringIndex, ProtoEnumInfo aggregationTemporality) { + super(calculateSize(typeStringIndex, unitStringIndex, aggregationTemporality)); + this.typeStringIndex = typeStringIndex; + this.unitStringIndex = unitStringIndex; this.aggregationTemporality = aggregationTemporality; } @Override protected void writeTo(Serializer output) throws IOException { - output.serializeInt64(ValueType.TYPE, type); - output.serializeInt64(ValueType.UNIT, unit); + output.serializeInt64(ValueType.TYPE_STRINDEX, typeStringIndex); + output.serializeInt64(ValueType.UNIT_STRINDEX, unitStringIndex); output.serializeEnum(ValueType.AGGREGATION_TEMPORALITY, aggregationTemporality); } - private static int calculateSize(long type, long unit, ProtoEnumInfo aggregationTemporality) { + private static int calculateSize( + int typeStringIndex, int unitStringIndex, ProtoEnumInfo aggregationTemporality) { int size; size = 0; - size += MarshalerUtil.sizeInt64(ValueType.TYPE, type); - size += MarshalerUtil.sizeInt64(ValueType.UNIT, unit); + size += MarshalerUtil.sizeInt32(ValueType.TYPE_STRINDEX, typeStringIndex); + size += MarshalerUtil.sizeInt32(ValueType.UNIT_STRINDEX, unitStringIndex); size += MarshalerUtil.sizeEnum(ValueType.AGGREGATION_TEMPORALITY, aggregationTemporality); return size; } diff --git a/exporters/otlp/profiles/src/test/java/io/opentelemetry/exporter/otlp/profiles/ProfilesRequestMarshalerTest.java b/exporters/otlp/profiles/src/test/java/io/opentelemetry/exporter/otlp/profiles/ProfilesRequestMarshalerTest.java index 927c403da17..1046caeb557 100644 --- a/exporters/otlp/profiles/src/test/java/io/opentelemetry/exporter/otlp/profiles/ProfilesRequestMarshalerTest.java +++ b/exporters/otlp/profiles/src/test/java/io/opentelemetry/exporter/otlp/profiles/ProfilesRequestMarshalerTest.java @@ -19,23 +19,21 @@ import io.opentelemetry.exporter.otlp.internal.data.ImmutableLinkData; import io.opentelemetry.exporter.otlp.internal.data.ImmutableLocationData; import io.opentelemetry.exporter.otlp.internal.data.ImmutableMappingData; -import io.opentelemetry.exporter.otlp.internal.data.ImmutableProfileContainerData; import io.opentelemetry.exporter.otlp.internal.data.ImmutableProfileData; import io.opentelemetry.exporter.otlp.internal.data.ImmutableSampleData; import io.opentelemetry.exporter.otlp.internal.data.ImmutableValueTypeData; import io.opentelemetry.proto.common.v1.InstrumentationScope; -import io.opentelemetry.proto.profiles.v1experimental.AttributeUnit; -import io.opentelemetry.proto.profiles.v1experimental.Function; -import io.opentelemetry.proto.profiles.v1experimental.Line; -import io.opentelemetry.proto.profiles.v1experimental.Link; -import io.opentelemetry.proto.profiles.v1experimental.Location; -import io.opentelemetry.proto.profiles.v1experimental.Mapping; -import io.opentelemetry.proto.profiles.v1experimental.Profile; -import io.opentelemetry.proto.profiles.v1experimental.ProfileContainer; -import io.opentelemetry.proto.profiles.v1experimental.ResourceProfiles; -import io.opentelemetry.proto.profiles.v1experimental.Sample; -import io.opentelemetry.proto.profiles.v1experimental.ScopeProfiles; -import io.opentelemetry.proto.profiles.v1experimental.ValueType; +import io.opentelemetry.proto.profiles.v1development.AttributeUnit; +import io.opentelemetry.proto.profiles.v1development.Function; +import io.opentelemetry.proto.profiles.v1development.Line; +import io.opentelemetry.proto.profiles.v1development.Link; +import io.opentelemetry.proto.profiles.v1development.Location; +import io.opentelemetry.proto.profiles.v1development.Mapping; +import io.opentelemetry.proto.profiles.v1development.Profile; +import io.opentelemetry.proto.profiles.v1development.ResourceProfiles; +import io.opentelemetry.proto.profiles.v1development.Sample; +import io.opentelemetry.proto.profiles.v1development.ScopeProfiles; +import io.opentelemetry.proto.profiles.v1development.ValueType; import io.opentelemetry.sdk.common.InstrumentationScopeInfo; import io.opentelemetry.sdk.resources.Resource; import java.io.ByteArrayOutputStream; @@ -50,11 +48,11 @@ import org.junit.jupiter.api.Test; public class ProfilesRequestMarshalerTest { - @Test void compareAttributeUnitMarshaling() { AttributeUnitData input = ImmutableAttributeUnitData.create(1, 2); - AttributeUnit builderResult = AttributeUnit.newBuilder().setAttributeKey(1).setUnit(2).build(); + AttributeUnit builderResult = + AttributeUnit.newBuilder().setAttributeKeyStrindex(1).setUnitStrindex(2).build(); AttributeUnit roundTripResult = parse(AttributeUnit.getDefaultInstance(), AttributeUnitMarshaler.create(input)); @@ -65,7 +63,12 @@ void compareAttributeUnitMarshaling() { void compareFunctionMarshaling() { FunctionData input = ImmutableFunctionData.create(1, 2, 3, 4); Function builderResult = - Function.newBuilder().setName(1).setSystemName(2).setFilename(3).setStartLine(4).build(); + Function.newBuilder() + .setNameStrindex(1) + .setSystemNameStrindex(2) + .setFilenameStrindex(3) + .setStartLine(4) + .build(); Function roundTripResult = parse(Function.getDefaultInstance(), FunctionMarshaler.create(input)); @@ -99,14 +102,13 @@ void compareLinkMarshaling() { @Test void compareLocationMarshaling() { LocationData input = - ImmutableLocationData.create(1, 2, Collections.emptyList(), true, 3, listOf(5L, 6L)); + ImmutableLocationData.create(1, 2, Collections.emptyList(), true, listOf(4, 5)); Location builderResult = Location.newBuilder() .setMappingIndex(1) .setAddress(2) .setIsFolded(true) - .setTypeIndex(3) - .addAllAttributes(listOf(5L, 6L)) + .addAllAttributeIndices(listOf(4, 5)) .build(); Location roundTripResult = @@ -117,18 +119,14 @@ void compareLocationMarshaling() { @Test void compareMappingMarshaling() { MappingData input = - ImmutableMappingData.create( - 1, 2, 3, 4, 5, BuildIdKind.LINKER, listOf(6L, 7L), true, true, true, true); + ImmutableMappingData.create(1, 2, 3, 4, listOf(5, 6), true, true, true, true); Mapping builderResult = Mapping.newBuilder() .setMemoryStart(1) .setMemoryLimit(2) .setFileOffset(3) - .setFilename(4) - .setBuildId(5) - .setBuildIdKind( - io.opentelemetry.proto.profiles.v1experimental.BuildIdKind.BUILD_ID_LINKER) - .addAllAttributes(listOf(6L, 7L)) + .setFilenameStrindex(4) + .addAllAttributeIndices(listOf(5, 6)) .setHasFunctions(true) .setHasFilenames(true) .setHasLineNumbers(true) @@ -139,67 +137,58 @@ void compareMappingMarshaling() { assertThat(roundTripResult).isEqualTo(builderResult); } - @Test - void compareProfileContainerMarshaling() { - String profileId = "0123456789abcdef0123456789abcdef"; - ProfileContainerData input = - ImmutableProfileContainerData.create( - Resource.getDefault(), - InstrumentationScopeInfo.empty(), - profileId, - 1, - 2, - Attributes.empty(), - 3, - "format", - ByteBuffer.wrap(new byte[] {4, 5}), - sampleProfileData()); - - ProfileContainer builderResult = - ProfileContainer.newBuilder() - .setProfileId(ByteString.fromHex(profileId)) - .setStartTimeUnixNano(1) - .setEndTimeUnixNano(2) - .setDroppedAttributesCount(3) - .setOriginalPayloadFormat("format") - .setOriginalPayload(ByteString.copyFrom(new byte[] {4, 5})) - .setProfile(sampleProfileBuilder().build()) - .build(); - - ProfileContainer roundTripResult = - parse(ProfileContainer.getDefaultInstance(), ProfileContainerMarshaler.create(input)); - assertThat(roundTripResult).isEqualTo(builderResult); - } - @Test void compareResourceProfilesMarshaling() { String profileId = "0123456789abcdef0123456789abcdef"; - ProfileContainerData profileContainerData = - ImmutableProfileContainerData.create( + ProfileData profileContainerData = + ImmutableProfileData.create( Resource.create(Attributes.empty()), InstrumentationScopeInfo.create("testscope"), + Collections.emptyList(), + Collections.emptyList(), + Collections.emptyList(), + Collections.emptyList(), + listOf(1, 2), + Collections.emptyList(), + Attributes.empty(), + Collections.emptyList(), + Collections.emptyList(), + Collections.emptyList(), + 5L, + 6L, + ImmutableValueTypeData.create(1, 2, AggregationTemporality.CUMULATIVE), + 7L, + listOf(8, 9), + 0, profileId, - 1, - 2, Attributes.empty(), 3, "format", - ByteBuffer.wrap(new byte[] {4, 5}), - sampleProfileData()); + ByteBuffer.wrap(new byte[] {4, 5})); - Collection input = new ArrayList<>(); + Collection input = new ArrayList<>(); input.add(profileContainerData); - ProfileContainer profileContainer = - ProfileContainer.newBuilder() + Profile profileContainer = + Profile.newBuilder() .setProfileId(ByteString.fromHex(profileId)) - .setStartTimeUnixNano(1) - .setEndTimeUnixNano(2) .setDroppedAttributesCount(3) .setOriginalPayloadFormat("format") .setOriginalPayload(ByteString.copyFrom(new byte[] {4, 5})) - .setProfile(sampleProfileBuilder().build()) + .addAllLocationIndices(listOf(1, 2)) + .setTimeNanos(5) + .setDurationNanos(6) + .setPeriod(7) + .setPeriodType( + ValueType.newBuilder() + .setTypeStrindex(1) + .setUnitStrindex(2) + .setAggregationTemporality( + io.opentelemetry.proto.profiles.v1development.AggregationTemporality + .AGGREGATION_TEMPORALITY_CUMULATIVE) + .build()) + .addAllCommentStrindices(listOf(8, 9)) .build(); ResourceProfiles builderResult = @@ -216,30 +205,20 @@ void compareResourceProfilesMarshaling() { assertThat(marshalers.length).isEqualTo(1); ResourceProfiles roundTripResult = parse(ResourceProfiles.getDefaultInstance(), marshalers[0]); assertThat(roundTripResult).isEqualTo(builderResult); - // TODO - } - - @Test - void compareProfileMarshaling() { - ProfileData input = sampleProfileData(); - Profile builderResult = sampleProfileBuilder().build(); - Profile roundTripResult = parse(Profile.getDefaultInstance(), ProfileMarshaler.create(input)); - assertThat(roundTripResult).isEqualTo(builderResult); } @Test void compareSampleMarshaling() { SampleData input = - ImmutableSampleData.create(1, 2, 3, listOf(4L, 5L), listOf(6L, 7L), 8L, listOf(9L, 10L)); + ImmutableSampleData.create(1, 2, listOf(3L, 4L), listOf(5, 6), 7, listOf(8L, 9L)); Sample builderResult = Sample.newBuilder() .setLocationsStartIndex(1) .setLocationsLength(2) - .setStacktraceIdIndex(3) - .addAllValue(listOf(4L, 5L)) - .addAllAttributes(listOf(6L, 7L)) - .setLink(8) - .addAllTimestampsUnixNano(listOf(9L, 10L)) + .addAllValue(listOf(3L, 4L)) + .addAllAttributeIndices(listOf(5, 6)) + .setLinkIndex(7) + .addAllTimestampsUnixNano(listOf(8L, 9L)) .build(); Sample roundTripResult = parse(Sample.getDefaultInstance(), SampleMarshaler.create(input)); @@ -251,10 +230,10 @@ void compareValueTypeMarshaling() { ValueTypeData input = ImmutableValueTypeData.create(1, 2, AggregationTemporality.CUMULATIVE); ValueType builderResult = ValueType.newBuilder() - .setType(1) - .setUnit(2) + .setTypeStrindex(1) + .setUnitStrindex(2) .setAggregationTemporality( - io.opentelemetry.proto.profiles.v1experimental.AggregationTemporality + io.opentelemetry.proto.profiles.v1development.AggregationTemporality .AGGREGATION_TEMPORALITY_CUMULATIVE) .build(); @@ -263,50 +242,6 @@ void compareValueTypeMarshaling() { assertThat(roundTripResult).isEqualTo(builderResult); } - // twin of sampleProfileBuilder - private static ProfileData sampleProfileData() { - return ImmutableProfileData.create( - Collections.emptyList(), - Collections.emptyList(), - Collections.emptyList(), - Collections.emptyList(), - listOf(1L, 2L), - Collections.emptyList(), - Attributes.empty(), - Collections.emptyList(), - Collections.emptyList(), - Collections.emptyList(), - 3, - 4, - 5, - 6, - ImmutableValueTypeData.create(1, 2, AggregationTemporality.CUMULATIVE), - 7, - listOf(8L, 9L), - 10); - } - - // twin of sampleProfileData - private static Profile.Builder sampleProfileBuilder() { - return Profile.newBuilder() - .addAllLocationIndices(listOf(1L, 2L)) - .setDropFrames(3) - .setKeepFrames(4) - .setTimeNanos(5) - .setDurationNanos(6) - .setPeriod(7) - .setPeriodType( - ValueType.newBuilder() - .setType(1) - .setUnit(2) - .setAggregationTemporality( - io.opentelemetry.proto.profiles.v1experimental.AggregationTemporality - .AGGREGATION_TEMPORALITY_CUMULATIVE) - .build()) - .addAllComment(listOf(8L, 9L)) - .setDefaultSampleType(10); - } - private static List listOf(T a, T b) { ArrayList list = new ArrayList<>(); list.add(a); diff --git a/exporters/otlp/testing-internal/src/main/java/io/opentelemetry/exporter/otlp/testing/internal/AbstractGrpcTelemetryExporterTest.java b/exporters/otlp/testing-internal/src/main/java/io/opentelemetry/exporter/otlp/testing/internal/AbstractGrpcTelemetryExporterTest.java index 4dcacfb329b..1d7086c1c99 100644 --- a/exporters/otlp/testing-internal/src/main/java/io/opentelemetry/exporter/otlp/testing/internal/AbstractGrpcTelemetryExporterTest.java +++ b/exporters/otlp/testing-internal/src/main/java/io/opentelemetry/exporter/otlp/testing/internal/AbstractGrpcTelemetryExporterTest.java @@ -16,6 +16,7 @@ import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.Message; import com.linecorp.armeria.common.HttpRequest; +import com.linecorp.armeria.common.TlsKeyPair; import com.linecorp.armeria.common.grpc.protocol.ArmeriaStatusException; import com.linecorp.armeria.server.ServerBuilder; import com.linecorp.armeria.server.ServiceRequestContext; @@ -137,7 +138,7 @@ protected void configure(ServerBuilder sb) { sb.http(0); sb.https(0); - sb.tls(certificate.certificateFile(), certificate.privateKeyFile()); + sb.tls(TlsKeyPair.of(certificate.privateKey(), certificate.certificate())); sb.tlsCustomizer(ssl -> ssl.trustManager(clientCertificate.certificate())); sb.decorator(LoggingService.newDecorator()); } diff --git a/exporters/otlp/testing-internal/src/main/java/io/opentelemetry/exporter/otlp/testing/internal/AbstractHttpTelemetryExporterTest.java b/exporters/otlp/testing-internal/src/main/java/io/opentelemetry/exporter/otlp/testing/internal/AbstractHttpTelemetryExporterTest.java index 7f6bfff04b3..3b68738dbe2 100644 --- a/exporters/otlp/testing-internal/src/main/java/io/opentelemetry/exporter/otlp/testing/internal/AbstractHttpTelemetryExporterTest.java +++ b/exporters/otlp/testing-internal/src/main/java/io/opentelemetry/exporter/otlp/testing/internal/AbstractHttpTelemetryExporterTest.java @@ -19,6 +19,7 @@ import com.linecorp.armeria.common.HttpStatus; import com.linecorp.armeria.common.MediaType; import com.linecorp.armeria.common.RequestHeaders; +import com.linecorp.armeria.common.TlsKeyPair; import com.linecorp.armeria.server.HttpService; import com.linecorp.armeria.server.ServerBuilder; import com.linecorp.armeria.server.ServiceRequestContext; @@ -144,7 +145,7 @@ protected void configure(ServerBuilder sb) { sb.http(0); sb.https(0); - sb.tls(certificate.certificateFile(), certificate.privateKeyFile()); + sb.tls(TlsKeyPair.of(certificate.privateKey(), certificate.certificate())); sb.tlsCustomizer(ssl -> ssl.trustManager(clientCertificate.certificate())); sb.decorator(LoggingService.newDecorator()); } diff --git a/exporters/prometheus/build.gradle.kts b/exporters/prometheus/build.gradle.kts index 8fe244b3f3d..3b44fad2c56 100644 --- a/exporters/prometheus/build.gradle.kts +++ b/exporters/prometheus/build.gradle.kts @@ -20,6 +20,7 @@ dependencies { testImplementation(project(":sdk:testing")) testImplementation("io.opentelemetry.proto:opentelemetry-proto") testImplementation("io.prometheus:prometheus-metrics-shaded-protobuf") + testImplementation("io.prometheus:prometheus-metrics-exposition-formats") testImplementation("com.sun.net.httpserver:http") testImplementation("com.google.guava:guava") testImplementation("com.linecorp.armeria:armeria") diff --git a/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServerTest.java b/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServerTest.java index 382e661b5ab..7115ff8a2b3 100644 --- a/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServerTest.java +++ b/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServerTest.java @@ -42,7 +42,7 @@ import io.opentelemetry.sdk.resources.Resource; import io.prometheus.metrics.exporter.httpserver.HTTPServer; import io.prometheus.metrics.exporter.httpserver.MetricsHandler; -import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_28_2.Metrics; +import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_28_3.Metrics; import io.prometheus.metrics.model.registry.PrometheusRegistry; import io.prometheus.metrics.shaded.com_google_protobuf_4_28_3.TextFormat; import java.io.ByteArrayInputStream; diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fb602ee2af0..eb1a55be0e1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=31c55713e40233a8303827ceb42ca48a47267a0ad4bab9177123121e71524c26 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +distributionSha256Sum=f397b287023acdba1e9f6fc5ea72d22dd63669d59ed4a289a29b1a76eee151c6 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfiguration.java b/sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfiguration.java index e4004516b73..b8af0237188 100644 --- a/sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfiguration.java +++ b/sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfiguration.java @@ -21,6 +21,7 @@ import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Map; import java.util.logging.Logger; @@ -166,6 +167,9 @@ static StructuredConfigProperties toConfigProperties( Object model, ComponentLoader componentLoader) { Map configurationMap = MAPPER.convertValue(model, new TypeReference>() {}); + if (configurationMap == null) { + configurationMap = Collections.emptyMap(); + } return YamlStructuredConfigProperties.create(configurationMap, componentLoader); } diff --git a/sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfigurationCreateTest.java b/sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfigurationCreateTest.java index 1230ce73832..54f91614df7 100644 --- a/sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfigurationCreateTest.java +++ b/sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfigurationCreateTest.java @@ -130,4 +130,23 @@ void parseAndCreate_Exception_CleansUpPartials() { "Closing io.opentelemetry.exporter.otlp.http.logs.OtlpHttpLogRecordExporter"); logCapturer.assertContains("Closing io.opentelemetry.sdk.logs.export.BatchLogRecordProcessor"); } + + @Test + void parseAndCreate_EmptyComponentProviderConfig() { + String yaml = + "file_format: \"0.3\"\n" + + "logger_provider:\n" + + " processors:\n" + + " - test:\n" + + "tracer_provider:\n" + + " processors:\n" + + " - test:\n"; + + assertThatCode( + () -> + FileConfiguration.parseAndCreate( + new ByteArrayInputStream(yaml.getBytes(StandardCharsets.UTF_8)))) + .doesNotThrowAnyException(); + ; + } } diff --git a/sdk-extensions/jaeger-remote-sampler/src/test/java/io/opentelemetry/sdk/extension/trace/jaeger/sampler/JaegerRemoteSamplerTest.java b/sdk-extensions/jaeger-remote-sampler/src/test/java/io/opentelemetry/sdk/extension/trace/jaeger/sampler/JaegerRemoteSamplerTest.java index d1b16920e2e..7f81789c129 100644 --- a/sdk-extensions/jaeger-remote-sampler/src/test/java/io/opentelemetry/sdk/extension/trace/jaeger/sampler/JaegerRemoteSamplerTest.java +++ b/sdk-extensions/jaeger-remote-sampler/src/test/java/io/opentelemetry/sdk/extension/trace/jaeger/sampler/JaegerRemoteSamplerTest.java @@ -12,6 +12,7 @@ import static org.junit.jupiter.api.Named.named; import static org.junit.jupiter.params.provider.Arguments.arguments; +import com.linecorp.armeria.common.TlsKeyPair; import com.linecorp.armeria.common.grpc.protocol.ArmeriaStatusException; import com.linecorp.armeria.server.ServerBuilder; import com.linecorp.armeria.server.ServiceRequestContext; @@ -117,7 +118,7 @@ protected CompletionStage handleMessage( }); sb.http(0); sb.https(0); - sb.tls(certificate.certificateFile(), certificate.privateKeyFile()); + sb.tls(TlsKeyPair.of(certificate.privateKey(), certificate.certificate())); sb.tlsCustomizer( ssl -> { ssl.clientAuth(ClientAuth.OPTIONAL); diff --git a/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/export/SimpleLogRecordProcessor.java b/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/export/SimpleLogRecordProcessor.java index 5302212345e..cc75b50ae1f 100644 --- a/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/export/SimpleLogRecordProcessor.java +++ b/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/export/SimpleLogRecordProcessor.java @@ -41,6 +41,8 @@ public final class SimpleLogRecordProcessor implements LogRecordProcessor { Collections.newSetFromMap(new ConcurrentHashMap<>()); private final AtomicBoolean isShutdown = new AtomicBoolean(false); + private final Object exporterLock = new Object(); + /** * Returns a new {@link SimpleLogRecordProcessor} which exports logs to the {@link * LogRecordExporter} synchronously. @@ -64,7 +66,12 @@ private SimpleLogRecordProcessor(LogRecordExporter logRecordExporter) { public void onEmit(Context context, ReadWriteLogRecord logRecord) { try { List logs = Collections.singletonList(logRecord.toLogRecordData()); - CompletableResultCode result = logRecordExporter.export(logs); + CompletableResultCode result; + + synchronized (exporterLock) { + result = logRecordExporter.export(logs); + } + pendingExports.add(result); result.whenComplete( () -> { diff --git a/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/internal/LoggerConfig.java b/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/internal/LoggerConfig.java index 8fb0f7dac2e..00ffdc86b41 100644 --- a/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/internal/LoggerConfig.java +++ b/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/internal/LoggerConfig.java @@ -17,8 +17,9 @@ /** * A collection of configuration options which define the behavior of a {@link Logger}. * - *

This class is internal and is hence not for public use. Its APIs are unstable and can change - * at any time. + *

This class is internal and experimental. Its APIs are unstable and can change at any time. Its + * APIs (or a version of them) may be promoted to the public stable API in the future, but no + * guarantees are made. * * @see SdkLoggerProviderUtil#setLoggerConfigurator(SdkLoggerProviderBuilder, ScopeConfigurator) * @see SdkLoggerProviderUtil#addLoggerConfiguratorCondition(SdkLoggerProviderBuilder, Predicate, diff --git a/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/internal/SdkEventLoggerProvider.java b/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/internal/SdkEventLoggerProvider.java index 7a2972056a3..d198675f552 100644 --- a/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/internal/SdkEventLoggerProvider.java +++ b/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/internal/SdkEventLoggerProvider.java @@ -22,8 +22,9 @@ *

Delegates all calls to the configured {@link LoggerProvider}, and its {@link LoggerBuilder}s, * {@link Logger}s. * - *

This class is internal and is hence not for public use. Its APIs are unstable and can change - * at any time. + *

This class is internal and experimental. Its APIs are unstable and can change at any time. Its + * APIs (or a version of them) may be promoted to the public stable API in the future, but no + * guarantees are made. */ public final class SdkEventLoggerProvider implements EventLoggerProvider { diff --git a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/MeterConfig.java b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/MeterConfig.java index ededd6acdad..35981025071 100644 --- a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/MeterConfig.java +++ b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/MeterConfig.java @@ -17,8 +17,9 @@ /** * A collection of configuration options which define the behavior of a {@link Meter}. * - *

This class is internal and is hence not for public use. Its APIs are unstable and can change - * at any time. + *

This class is internal and experimental. Its APIs are unstable and can change at any time. Its + * APIs (or a version of them) may be promoted to the public stable API in the future, but no + * guarantees are made. * * @see SdkMeterProviderUtil#setMeterConfigurator(SdkMeterProviderBuilder, ScopeConfigurator) * @see SdkMeterProviderUtil#addMeterConfiguratorCondition(SdkMeterProviderBuilder, Predicate, diff --git a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/SdkMeterProviderUtil.java b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/SdkMeterProviderUtil.java index c559fc4c76f..1b203d9d9a2 100644 --- a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/SdkMeterProviderUtil.java +++ b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/SdkMeterProviderUtil.java @@ -21,8 +21,9 @@ * A collection of methods that allow use of experimental features prior to availability in public * APIs. * - *

This class is internal and is hence not for public use. Its APIs are unstable and can change - * at any time. + *

This class is internal and experimental. Its APIs are unstable and can change at any time. Its + * APIs (or a version of them) may be promoted to the public stable API in the future, but no + * guarantees are made. */ public final class SdkMeterProviderUtil { diff --git a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/exemplar/FixedSizeExemplarReservoir.java b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/exemplar/FixedSizeExemplarReservoir.java index 05dfdd1afd3..20254de5991 100644 --- a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/exemplar/FixedSizeExemplarReservoir.java +++ b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/exemplar/FixedSizeExemplarReservoir.java @@ -13,13 +13,16 @@ import java.util.Collections; import java.util.List; import java.util.function.BiFunction; +import javax.annotation.Nullable; /** Base for fixed-size reservoir sampling of Exemplars. */ abstract class FixedSizeExemplarReservoir implements ExemplarReservoir { - private final ReservoirCell[] storage; + @Nullable private ReservoirCell[] storage; private final ReservoirCellSelector reservoirCellSelector; private final BiFunction mapAndResetCell; + private final int size; + private final Clock clock; private volatile boolean hasMeasurements = false; /** Instantiates an exemplar reservoir of fixed size. */ @@ -28,16 +31,18 @@ abstract class FixedSizeExemplarReservoir implements Exe int size, ReservoirCellSelector reservoirCellSelector, BiFunction mapAndResetCell) { - this.storage = new ReservoirCell[size]; - for (int i = 0; i < size; ++i) { - this.storage[i] = new ReservoirCell(clock); - } + this.storage = null; // lazily initialize to avoid allocations + this.size = size; + this.clock = clock; this.reservoirCellSelector = reservoirCellSelector; this.mapAndResetCell = mapAndResetCell; } @Override public void offerLongMeasurement(long value, Attributes attributes, Context context) { + if (storage == null) { + storage = initStorage(); + } int bucket = reservoirCellSelector.reservoirCellIndexFor(storage, value, attributes, context); if (bucket != -1) { this.storage[bucket].recordLongMeasurement(value, attributes, context); @@ -47,6 +52,9 @@ public void offerLongMeasurement(long value, Attributes attributes, Context cont @Override public void offerDoubleMeasurement(double value, Attributes attributes, Context context) { + if (storage == null) { + storage = initStorage(); + } int bucket = reservoirCellSelector.reservoirCellIndexFor(storage, value, attributes, context); if (bucket != -1) { this.storage[bucket].recordDoubleMeasurement(value, attributes, context); @@ -54,9 +62,17 @@ public void offerDoubleMeasurement(double value, Attributes attributes, Context } } + private ReservoirCell[] initStorage() { + ReservoirCell[] storage = new ReservoirCell[this.size]; + for (int i = 0; i < size; ++i) { + storage[i] = new ReservoirCell(this.clock); + } + return storage; + } + @Override public List collectAndReset(Attributes pointAttributes) { - if (!hasMeasurements) { + if (!hasMeasurements || storage == null) { return Collections.emptyList(); } // Note: we are collecting exemplars from buckets piecemeal, but we diff --git a/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/SdkSpan.java b/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/SdkSpan.java index 0d2c9ab83fd..59eec41179f 100644 --- a/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/SdkSpan.java +++ b/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/SdkSpan.java @@ -445,8 +445,7 @@ public ReadWriteSpan setStatus(StatusCode statusCode, @Nullable String descripti @Override public ReadWriteSpan recordException(Throwable exception) { - Attributes attributes = this.getAttributes(); - recordException(exception, attributes); + recordException(exception, Attributes.empty()); return this; } diff --git a/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/SimpleSpanProcessor.java b/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/SimpleSpanProcessor.java index 68b197a4b5b..f543e25353e 100644 --- a/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/SimpleSpanProcessor.java +++ b/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/SimpleSpanProcessor.java @@ -41,6 +41,8 @@ public final class SimpleSpanProcessor implements SpanProcessor { Collections.newSetFromMap(new ConcurrentHashMap<>()); private final AtomicBoolean isShutdown = new AtomicBoolean(false); + private final Object exporterLock = new Object(); + /** * Returns a new {@link SimpleSpanProcessor} which exports spans to the {@link SpanExporter} * synchronously. @@ -86,7 +88,12 @@ public void onEnd(ReadableSpan span) { if (span != null && (exportUnsampledSpans || span.getSpanContext().isSampled())) { try { List spans = Collections.singletonList(span.toSpanData()); - CompletableResultCode result = spanExporter.export(spans); + CompletableResultCode result; + + synchronized (exporterLock) { + result = spanExporter.export(spans); + } + pendingExports.add(result); result.whenComplete( () -> { diff --git a/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/internal/SdkTracerProviderUtil.java b/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/internal/SdkTracerProviderUtil.java index 7d00f230dea..76111258a67 100644 --- a/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/internal/SdkTracerProviderUtil.java +++ b/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/internal/SdkTracerProviderUtil.java @@ -16,8 +16,9 @@ * A collection of methods that allow use of experimental features prior to availability in public * APIs. * - *

This class is internal and is hence not for public use. Its APIs are unstable and can change - * at any time. + *

This class is internal and experimental. Its APIs are unstable and can change at any time. Its + * APIs (or a version of them) may be promoted to the public stable API in the future, but no + * guarantees are made. */ public final class SdkTracerProviderUtil { diff --git a/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/internal/TracerConfig.java b/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/internal/TracerConfig.java index 535760cbfd4..4fa8c702b1c 100644 --- a/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/internal/TracerConfig.java +++ b/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/internal/TracerConfig.java @@ -17,8 +17,9 @@ /** * A collection of configuration options which define the behavior of a {@link Tracer}. * - *

This class is internal and is hence not for public use. Its APIs are unstable and can change - * at any time. + *

This class is internal and experimental. Its APIs are unstable and can change at any time. Its + * APIs (or a version of them) may be promoted to the public stable API in the future, but no + * guarantees are made. * * @see SdkTracerProviderUtil#setTracerConfigurator(SdkTracerProviderBuilder, ScopeConfigurator) * @see SdkTracerProviderUtil#addTracerConfiguratorCondition(SdkTracerProviderBuilder, Predicate, 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 461ed774cca..9c9ecdc7e9c 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 @@ -246,19 +246,21 @@ void setAttribute() { .setAttribute("long", 12345L) .setAttribute("double", .12345) .setAttribute("boolean", true) - .setAttribute(stringKey("stringAttribute"), "attrvalue"); + .setAttribute(stringKey("stringAttribute"), "attrvalue") + .setAttribute(longKey("longAttribute"), 123); SdkSpan span = (SdkSpan) spanBuilder.startSpan(); try { SpanData spanData = span.toSpanData(); Attributes attrs = spanData.getAttributes(); - assertThat(attrs.size()).isEqualTo(5); + assertThat(attrs.size()).isEqualTo(6); assertThat(attrs.get(stringKey("string"))).isEqualTo("value"); assertThat(attrs.get(longKey("long"))).isEqualTo(12345L); assertThat(attrs.get(doubleKey("double"))).isEqualTo(0.12345); assertThat(attrs.get(booleanKey("boolean"))).isEqualTo(true); assertThat(attrs.get(stringKey("stringAttribute"))).isEqualTo("attrvalue"); - assertThat(spanData.getTotalAttributeCount()).isEqualTo(5); + assertThat(attrs.get(longKey("longAttribute"))).isEqualTo(123); + assertThat(spanData.getTotalAttributeCount()).isEqualTo(6); } finally { span.end(); } diff --git a/sdk/trace/src/test/java/io/opentelemetry/sdk/trace/SdkSpanTest.java b/sdk/trace/src/test/java/io/opentelemetry/sdk/trace/SdkSpanTest.java index 7fbd86ef229..4b44607b1d6 100644 --- a/sdk/trace/src/test/java/io/opentelemetry/sdk/trace/SdkSpanTest.java +++ b/sdk/trace/src/test/java/io/opentelemetry/sdk/trace/SdkSpanTest.java @@ -878,6 +878,7 @@ void attributeLength() { assertThat(event.getAttributes().get(stringKey("exception.message"))).isEqualTo(strVal); assertThat(event.getAttributes().get(stringKey("exception.stacktrace")).length()) .isLessThanOrEqualTo(maxLength); + assertThat(event.getAttributes().size()).isEqualTo(3); } finally { span.end(); } @@ -1159,6 +1160,9 @@ void recordException() { testClock.advance(Duration.ofNanos(1000)); long timestamp = testClock.now(); + // make sure that span attributes don't leak down to the exception event + span.setAttribute("spankey", "val"); + span.recordException(exception); List events = span.toSpanData().getEvents(); @@ -1171,6 +1175,7 @@ void recordException() { assertThat(event.getAttributes().get(stringKey("exception.type"))) .isEqualTo(exception.getClass().getName()); assertThat(event.getAttributes().get(stringKey("exception.stacktrace"))).isEqualTo(stacktrace); + assertThat(event.getAttributes().size()).isEqualTo(3); assertThat(event) .isInstanceOfSatisfying( ExceptionEventData.class, @@ -1184,12 +1189,20 @@ void recordException_noMessage() { IllegalStateException exception = new IllegalStateException(); SdkSpan span = createTestRootSpan(); + StringWriter writer = new StringWriter(); + exception.printStackTrace(new PrintWriter(writer)); + String stacktrace = writer.toString(); + span.recordException(exception); List events = span.toSpanData().getEvents(); assertThat(events).hasSize(1); EventData event = events.get(0); assertThat(event.getAttributes().get(stringKey("exception.message"))).isNull(); + assertThat(event.getAttributes().get(stringKey("exception.type"))) + .isEqualTo("java.lang.IllegalStateException"); + assertThat(event.getAttributes().get(stringKey("exception.stacktrace"))).isEqualTo(stacktrace); + assertThat(event.getAttributes().size()).isEqualTo(2); } private static class InnerClassException extends Exception {} @@ -1199,6 +1212,10 @@ void recordException_innerClassException() { InnerClassException exception = new InnerClassException(); SdkSpan span = createTestRootSpan(); + StringWriter writer = new StringWriter(); + exception.printStackTrace(new PrintWriter(writer)); + String stacktrace = writer.toString(); + span.recordException(exception); List events = span.toSpanData().getEvents(); @@ -1206,6 +1223,8 @@ void recordException_innerClassException() { EventData event = events.get(0); assertThat(event.getAttributes().get(stringKey("exception.type"))) .isEqualTo("io.opentelemetry.sdk.trace.SdkSpanTest.InnerClassException"); + assertThat(event.getAttributes().get(stringKey("exception.stacktrace"))).isEqualTo(stacktrace); + assertThat(event.getAttributes().size()).isEqualTo(2); } @Test @@ -1220,6 +1239,9 @@ void recordException_additionalAttributes() { testClock.advance(Duration.ofNanos(1000)); long timestamp = testClock.now(); + // make sure that span attributes don't leak down to the exception event + span.setAttribute("spankey", "val"); + span.recordException( exception, Attributes.of( @@ -1240,6 +1262,7 @@ void recordException_additionalAttributes() { assertThat(event.getAttributes().get(stringKey("exception.type"))) .isEqualTo("java.lang.IllegalStateException"); assertThat(event.getAttributes().get(stringKey("exception.stacktrace"))).isEqualTo(stacktrace); + assertThat(event.getAttributes().size()).isEqualTo(4); assertThat(event) .isInstanceOfSatisfying( diff --git a/settings.gradle.kts b/settings.gradle.kts index 4edff174f84..4075a604a57 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,11 +1,11 @@ pluginManagement { plugins { id("com.gradleup.shadow") version "8.3.5" - id("com.gradle.develocity") version "3.18.1" + id("com.gradle.develocity") version "3.18.2" id("de.undercouch.download") version "5.6.0" id("org.jsonschema2pojo") version "1.2.2" id("io.github.gradle-nexus.publish-plugin") version "2.0.0" - id("org.graalvm.buildtools.native") version "0.10.3" + id("org.graalvm.buildtools.native") version "0.10.4" } } @@ -68,41 +68,10 @@ include(":sdk-extensions:jaeger-remote-sampler") include(":testing-internal") include(":animal-sniffer-signature") -val gradleEnterpriseServer = "https://ge.opentelemetry.io" -val isCI = System.getenv("CI") != null -val geAccessKey = System.getenv("GRADLE_ENTERPRISE_ACCESS_KEY") ?: "" - -// if GE access key is not given and we are in CI, then we publish to scans.gradle.com -val useScansGradleCom = isCI && geAccessKey.isEmpty() - -if (useScansGradleCom) { - develocity { - buildScan { - termsOfUseUrl.set("https://gradle.com/terms-of-service") - termsOfUseAgree.set("yes") - uploadInBackground.set(!isCI) - publishing.onlyIf { true } - - capture { - fileFingerprints.set(true) - } - } - } -} else { - develocity { - server = gradleEnterpriseServer - buildScan { - uploadInBackground.set(!isCI) - publishing.onlyIf { - it.isAuthenticated - } - - capture { - fileFingerprints.set(true) - } - - gradle.startParameter.projectProperties["testJavaVersion"]?.let { tag(it) } - gradle.startParameter.projectProperties["testJavaVM"]?.let { tag(it) } - } +develocity { + buildScan { + publishing.onlyIf { System.getenv("CI") != null } + termsOfUseUrl.set("https://gradle.com/help/legal-terms-of-use") + termsOfUseAgree.set("yes") } } diff --git a/version.gradle.kts b/version.gradle.kts index eb508c5fbc1..06df16c8d26 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -1,7 +1,7 @@ -val snapshot = true +val snapshot = false allprojects { - var ver = "1.44.0" + var ver = "1.45.0" val release = findProperty("otel.release") if (release != null) { ver += "-" + release