[improve][build] Upgrade OpenTelemetry to latest (java 1.62.0, instrumentation 2.28.1, semconv 1.41.1)#25906
Merged
Merged
Conversation
…mentation 2.28.1, semconv 1.41.1) ### Motivation Keep the OpenTelemetry dependencies current and consistent. PR apache#25779 bumped the stable `opentelemetry` BOM from 1.61.0 to 1.62.0 but did not update the `opentelemetry-alpha` version ref, leaving it at 1.61.0-alpha — a mismatch between the stable and alpha BOMs. This change aligns the alpha version number with the stable release and upgrades the remaining OpenTelemetry components to their latest releases. ### Modifications - `opentelemetry-alpha`: 1.61.0-alpha -> 1.62.0-alpha (aligns with the stable `opentelemetry` 1.62.0 that PR apache#25779 left it behind on) - `opentelemetry-instrumentation`: 2.27.0 -> 2.28.1 (and the matching `-alpha`) - `opentelemetry-semconv`: 1.41.0 -> 1.41.1 - `opentelemetry-gcp-resources`: 1.48.0-alpha -> 1.57.0-alpha - Updated the bundled-jar versions in the `distribution/server` and `distribution/shell` `LICENSE.bin.txt` files to match the upgraded artifacts. Assisted-by: Claude Code (Opus 4.8)
nodece
approved these changes
May 31, 2026
dao-jun
approved these changes
Jun 1, 2026
…us exporter OpenTelemetry 1.62.0 contains a breaking change: the Prometheus exporter's default server host changed from `0.0.0.0` to `localhost`. Pulsar configures the Prometheus exporter purely through OpenTelemetry autoconfiguration and never set the host explicitly, so after upgrading the exporter it would bind to `localhost` only, making the metrics endpoint unreachable from outside the local host (e.g. another container or a remote Prometheus scraper). This surfaced as a failure of OpenTelemetrySanityTest.testOpenTelemetryMetricsPrometheusExport (Connection reset when scraping the exporter across the container boundary). Restore the previous behavior by supplying `otel.exporter.prometheus.host` with a default value of `0.0.0.0` through the SDK builder's properties supplier. As a default it is still overridden by an explicit OTEL_EXPORTER_PROMETHEUS_HOST environment variable / otel.exporter.prometheus.host system property, mirroring the existing `otel.sdk.disabled` default handling. Added OpenTelemetryServiceTest.testPrometheusExporterDefaultsToAllInterfacesHost; the existing Prometheus test connects via localhost and therefore could not catch the regression. Assisted-by: Claude Code (Opus 4.8)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Keep the OpenTelemetry dependencies current and consistent.
PR #25779 ("Bump opentelemetry from 1.61.0 to 1.62.0") bumped the stable
opentelemetryBOM version ref from 1.61.0 to 1.62.0, but it did not update the separateopentelemetry-alphaversion ref, leaving it at1.61.0-alpha. As a result the stable BOM (1.62.0) and the alpha BOM (1.61.0-alpha) were out of sync. This PR aligns the alpha version number with the stable release and upgrades the remaining OpenTelemetry components to their latest releases.Modifications
Version catalog (
gradle/libs.versions.toml):opentelemetry1.62.01.62.0(already latest)opentelemetry-alpha1.61.0-alpha1.62.0-alpha(aligned with stable; PR #25779 had left it behind)opentelemetry-instrumentation2.27.02.28.1opentelemetry-instrumentation-alpha2.27.0-alpha2.28.1-alphaopentelemetry-semconv1.41.01.41.1opentelemetry-gcp-resources1.48.0-alpha1.57.0-alphaDistribution license files — updated bundled-jar versions to match the upgraded artifacts:
distribution/server/src/assemble/LICENSE.bin.txt:api-incubatorandexporter-prometheus→1.62.0-alpha; the four instrumentation modules →2.28.1/2.28.1-alpha;semconv→1.41.1;gcp-resources→1.57.0-alpha.distribution/shell/src/assemble/LICENSE.bin.txt:api-incubator→1.62.0-alpha.Preserve Prometheus exporter behavior (backward compatibility):
0.0.0.0tolocalhost. Pulsar configures the Prometheus exporter purely via OpenTelemetry autoconfiguration and never set the host, so after the upgrade the metrics endpoint would bind tolocalhostonly and become unreachable from outside the local host (e.g. another container or a remote Prometheus scraper).OpenTelemetryServicenow suppliesotel.exporter.prometheus.host=0.0.0.0as a default, restoring the previous behavior. It remains overridable via the standardOTEL_EXPORTER_PROMETHEUS_HOSTenvironment variable /otel.exporter.prometheus.hostsystem property.Verifying this change
This change is a dependency upgrade verified as follows:
./gradlew :pulsar-opentelemetry:dependenciesresolves with the expected version set (no conflicts);:pulsar-opentelemetry:compileJava/compileTestJavabuild cleanly against the upgraded instrumentation API../gradlew checkBinaryLicensepasses for both the server and shell distributions, confirming theLICENSE.bin.txtfiles match the actually bundled jars. (com.google.cloud.opentelemetry:detector-resources-support:0.36.0remains bundled — it is pulled transitively viaorg.apache.bookkeeper:stream-storage-java-client, not bygcp-resources— so its license entry is kept.)OpenTelemetryServiceTest#testPrometheusExporterDefaultsToAllInterfacesHostfor the Prometheus host default.OpenTelemetrySanityTestintegration test (bothtestOpenTelemetryMetricsOtlpExportandtestOpenTelemetryMetricsPrometheusExport) against a locally built distribution image — both pass with the fix.Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes