Skip to content

Fix opentelemetry example: bump javaagent for JDK 25 compatibility - #208

Open
Croway wants to merge 1 commit into
apache:mainfrom
Croway:fix-opentelemetry-jdk25
Open

Fix opentelemetry example: bump javaagent for JDK 25 compatibility#208
Croway wants to merge 1 commit into
apache:mainfrom
Croway:fix-opentelemetry-jdk25

Conversation

@Croway

@Croway Croway commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The opentelemetry example's 4 booking modules (CarBooking, FlightBooking, HotelBooking, TripBooking) pinned opentelemetry-javaagent to 1.25.1 (mid-2023), duplicated across each module's pom. That version silently fails to attach on JDK 25 (InaccessibleObjectException), so no spans reach Jaeger with no obvious startup error - it only worked when re-run on JDK 17.
  • Bumped the agent to 2.19.0, matching the version already proven working in this repo's observability-services and rest-cxf-opentelemetry examples, and centralized the property in the opentelemetry parent pom instead of duplicating it 4 times.
  • The newer agent also changed its default OTLP export protocol from gRPC (port 4317) to HTTP/protobuf (port 4318). The docker-compose stack's otel-collector service already listens on 4318 but didn't publish it to the host, so exposed that port too.

Test plan

  • mvn install builds all 4 modules on JDK 25, agent 2.19.0 downloaded/copied
  • Booted the full example on JDK 25 against the real docker-compose stack (Kafka, Jaeger, OTel Collector, Prometheus)
  • Sync (/camel/bookTrip) and async/Kafka (/camel/asyncBookTrip) requests both return 200
  • Jaeger shows full distributed traces (27 spans sync, 45 spans async) spanning all 4 services
  • Prometheus scrapes are up for all 4 services and Camel exchange metrics are populated

The pinned opentelemetry-javaagent 1.25.1 (mid-2023, duplicated across
the 4 booking module poms) silently fails to attach on JDK 25
(InaccessibleObjectException), so no spans reach Jaeger with no
obvious startup error. Bump to 2.19.0, already proven working in the
observability-services and rest-cxf-opentelemetry examples in this
repo, and centralize the property in the opentelemetry parent pom.

The newer agent also defaults its OTLP exporter to HTTP/protobuf
(port 4318) instead of gRPC (4317), so expose 4318 on the
otel-collector service in the docker-compose stack - the collector
already listens on it, it just wasn't published to the host.

Verified end-to-end on JDK 25 against the real docker-compose stack:
sync and async bookTrip requests return 200, full distributed traces
(27 and 45 spans) land in Jaeger across all 4 services, and Camel
exchange metrics are scraped by Prometheus.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wgr7MBBqUbNGG6xrH6ybWq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant