Skip to content

Rewrite the recommendation service in Spring Boot 4 - #3966

Open
adityareddy-dev wants to merge 1 commit into
open-telemetry:mainfrom
adityareddy-dev:recommendation-spring-boot-4
Open

Rewrite the recommendation service in Spring Boot 4#3966
adityareddy-dev wants to merge 1 commit into
open-telemetry:mainfrom
adityareddy-dev:recommendation-spring-boot-4

Conversation

@adityareddy-dev

@adityareddy-dev adityareddy-dev commented Sep 10, 2026

Copy link
Copy Markdown

Changes

  • Replace the Python recommendation service with a Java service built on Spring Boot 4.1 and Spring gRPC, as discussed in Add micrometer spring boot 4 demo tracing app #1368. Same gRPC contract, same recommendationCacheFailure behaviour, same attribute and metric names from the telemetry schema.
  • Telemetry comes from Micrometer instead of the Java agent: gRPC spans from the Spring gRPC observation interceptors, the get_product_list span and its demo.* attributes through Micrometer Tracing, the counter through the MeterRegistry, logs through the OpenTelemetry Logback appender, all exported over OTLP/HTTP from the standard OTEL_* environment variables that Spring Boot maps itself.
  • Two known differences from the Python version: the gRPC span attributes are Micrometer's (rpc.method, rpc.service, grpc.status_code) rather than the OTel semconv set, and there are no otel_sdk_* self-observability metrics, so the service drops off that dashboard. The cache-leak memory growth shows on a new "JVM services (Memory)" panel in the demo dashboard.
  • The frontend sends product ids as one repeated element per character (its API route hands the comma-joined query string to the gRPC client as an array). The Python undid that with a join and a split; the Java does the same, with a comment and a test that sends ids the way the frontend does.
  • Tested with the module's unit tests and the full compose stack with the new image: recommendations never include the product being viewed, Jaeger shows frontend to recommendation to product-catalog with the demo attributes, counter and JVM metrics in Prometheus, logs with trace ids in OpenSearch, test/telemetry passes for the service. Docs page and helm chart env (collector HTTP port, Python variables removed) are follow-ups.

Merge Requirements

For new features contributions, please make sure you have completed the following
essential items:

  • CHANGELOG.md updated to document new feature additions
  • Appropriate documentation updates in the docs
  • Appropriate Helm chart updates in the helm-charts

Maintainers will not merge until the above have been completed. If you're unsure
which docs need to be changed ping the
@open-telemetry/demo-approvers.

- Replace the Python recommendation service with a Java service built on
  Spring Boot 4.1 and Spring gRPC.
- Telemetry comes from Micrometer instead of the Java agent.
- gRPC server and client spans through the auto-configured observation
  interceptors, the get_product_list span and its demo.* attributes through
  Micrometer Tracing, the demo.recommendation.requests counter through the
  MeterRegistry, and logs through the OpenTelemetry Logback appender.
- All three signals go to the collector over OTLP/HTTP, configured from the
  standard OTEL_* environment variables that Spring Boot maps itself.
- The gRPC contract, the recommendationCacheFailure feature flag behaviour
  and the telemetry schema are unchanged.

Refs open-telemetry#1368

Assisted-by: Claude Code
@github-actions github-actions Bot added the helm-update-required Requires an update to the Helm chart when released label Sep 10, 2026
@github-actions

Copy link
Copy Markdown

Welcome, contributor! Thank you for your contribution to opentelemetry-demo.

Important reminders:

  • Read our Contributing Guidelines.
  • Sign the CLA if you haven't already.
  • Follow the OpenTelemetry Generative AI policy: disclose any AI use in your contribution, and communicate (PR descriptions, review replies) in your own words rather than AI-generated text.
  • Give reviewers at least a few days before pinging them for feedback.
  • If you need help with general setup, development process, or contributor etiquette, ask in #opentelemetry-new-contributors.

@adityareddy-dev

Copy link
Copy Markdown
Author

Ready for review. The helm chart change is open as a draft at open-telemetry/opentelemetry-helm-charts#2398, to be merged only after a demo release with this service. The docs page for opentelemetry.io I will send separately.

@Kielek

Kielek commented Sep 11, 2026

Copy link
Copy Markdown
Member

I have some doubts. Demo already have 2 java services. I do not think that we should rewrite additional one to this langauge.

@julianocosta89

Copy link
Copy Markdown
Member

I have some doubts. Demo already have 2 java services. I do not think that we should rewrite additional one to this langauge.

@Kielek we have 4 services in Python.
Spring is widely used in the industry and not part of the Demo.

We currently have only Ad that is Java Java.
Fraud detection is Kotlin, still JVM, but slightly different.

With this new service we can introduce some other ways to instrument Java code, as we have on the docs: https://opentelemetry.io/docs/languages/java/instrumentation/#instrumentation-categories

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

helm-update-required Requires an update to the Helm chart when released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants