Conversation
Drops the 73-LOC JamjetCloudConfiguration and the jamjet-cloud-sdk
dependency in favor of Spring Boot's standard OTLP tracing autoconfig.
The workaround was needed because:
1. jamjet-cloud-spring-boot-starter:0.2.0 hard-references LangChain4j
classes, forcing langchain4j-core onto a Spring-AI-only classpath.
2. JamjetObservationHandler.supportsContext was called with a null
context name, so the handler never matched.
Both are sidestepped by using OTLP instead of the SDK observation
handler. With jamjet-cloud PR #16 (OTLP/protobuf intake) deployed to
api.jamjet.dev, the demo now wires observability through:
Spring AI 1.0 emits Micrometer Observations
-> micrometer-tracing-bridge-otel converts to OTel spans
-> opentelemetry-exporter-otlp ships OTLP/HTTP-protobuf
-> JamJet's /v1/otlp/v1/traces
All wiring is in application.yml:
management:
tracing:
sampling:
probability: 1.0
otlp:
tracing:
endpoint: ${JAMJET_API_URL:https://api.jamjet.dev}/v1/otlp/v1/traces
headers:
Authorization: "Bearer ${JAMJET_API_KEY}"
What changed:
- pom.xml: remove jamjet-cloud-sdk + micrometer-observation; add
micrometer-tracing-bridge-otel + opentelemetry-exporter-otlp
- application.yml: drop jamjet.cloud.* block, add management.otlp.tracing.*
- Delete src/main/java/.../cloud/JamjetCloudConfiguration.java
- DemoIntegrationTest: override OTLP endpoint to localhost:1 and supply
a placeholder bearer token so Spring's property resolver doesn't trip
on unresolved ${JAMJET_API_KEY} during tests
- README + .env.example: reflect the OTLP-based wiring
Verified:
- mvnw clean compile clean (Java 21 release)
- mvnw test -Dtest=PreflightCheckTest: 5/5 pass
- mvnw spring-boot:run: app starts on :8080, all autoconfig wires up,
PreflightCheck fails on Engram (expected without docker)
- DemoIntegrationTest needs Docker (testcontainers); CI will run it
📝 WalkthroughWalkthroughThe demo application is refactored to use Spring Boot's standard OTLP tracing infrastructure instead of the JamJet Cloud SDK. Dependencies shift to Micrometer's OTel bridge and OTLP exporter, configuration moves from custom ChangesObservability Architecture Refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@examples/spring-ai-engram-cloud-demo/README.md`:
- Line 104: Update the README table entry for management.otlp.tracing.endpoint
to match the application.yml default by including the fallback value; change the
displayed expression to include the fallback :https://api.jamjet.dev so it
mirrors the config's JAMJET_API_URL fallback used in application.yml and avoids
implying JAMJET_API_URL is mandatory.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 721a08a1-853f-4415-a7b0-95079d70e9a8
📒 Files selected for processing (6)
examples/spring-ai-engram-cloud-demo/.env.exampleexamples/spring-ai-engram-cloud-demo/README.mdexamples/spring-ai-engram-cloud-demo/pom.xmlexamples/spring-ai-engram-cloud-demo/src/main/java/dev/jamjet/demo/springaiengram/cloud/JamjetCloudConfiguration.javaexamples/spring-ai-engram-cloud-demo/src/main/resources/application.ymlexamples/spring-ai-engram-cloud-demo/src/test/java/dev/jamjet/demo/springaiengram/DemoIntegrationTest.java
💤 Files with no reviewable changes (1)
- examples/spring-ai-engram-cloud-demo/src/main/java/dev/jamjet/demo/springaiengram/cloud/JamjetCloudConfiguration.java
| | `spring.ai.openai.chat.options.model` | `gpt-4o-mini` | OpenAI model for chat | | ||
| | `jamjet.cloud.api-key` | `${JAMJET_API_KEY}` | JamJet Cloud project key | | ||
| | `jamjet.cloud.api-url` | `https://api.jamjet.dev` | JamJet Cloud ingest endpoint | | ||
| | `management.otlp.tracing.endpoint` | `${JAMJET_API_URL}/v1/otlp/v1/traces` | OTLP intake URL — defaults to JamJet's hosted intake | |
There was a problem hiding this comment.
Align README default endpoint expression with actual config default.
Line 104 omits the fallback (:https://api.jamjet.dev) that exists in application.yml, so readers may assume JAMJET_API_URL is mandatory.
Suggested doc fix
-| `management.otlp.tracing.endpoint` | `${JAMJET_API_URL}/v1/otlp/v1/traces` | OTLP intake URL — defaults to JamJet's hosted intake |
+| `management.otlp.tracing.endpoint` | `${JAMJET_API_URL:https://api.jamjet.dev}/v1/otlp/v1/traces` | OTLP intake URL — defaults to JamJet's hosted intake |📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| | `management.otlp.tracing.endpoint` | `${JAMJET_API_URL}/v1/otlp/v1/traces` | OTLP intake URL — defaults to JamJet's hosted intake | | |
| | `management.otlp.tracing.endpoint` | `${JAMJET_API_URL:https://api.jamjet.dev}/v1/otlp/v1/traces` | OTLP intake URL — defaults to JamJet's hosted intake | |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@examples/spring-ai-engram-cloud-demo/README.md` at line 104, Update the
README table entry for management.otlp.tracing.endpoint to match the
application.yml default by including the fallback value; change the displayed
expression to include the fallback :https://api.jamjet.dev so it mirrors the
config's JAMJET_API_URL fallback used in application.yml and avoids implying
JAMJET_API_URL is mandatory.
Summary
Replaces the 73-LOC
JamjetCloudConfigurationworkaround with stock Spring Boot OTLP tracing. Now that jamjet-cloud PR #16 ships OTLP/protobuf intake toapi.jamjet.dev, the demo can use the standard Spring Boot tracing autoconfig — no JamJet SDK on the classpath, no@Configuration, no observation handler.Why the workaround existed
jamjet-cloud-spring-boot-starter:0.2.0had two problems that made it unsuitable for a Spring-AI-only demo:langchain4j-coreonto the classpath of every Spring AI app.JamjetObservationHandler.supportsContextwas called by Micrometer with the context name still null, so the handler never selected itself for Spring AI observations.The workaround sidestepped both by skipping the starter, configuring
JamjetClouddirectly, and registering a context-class-filtered observation handler manually. That's now ~all unnecessary.What changed
pom.xmldev.jamjet:jamjet-cloud-sdk+io.micrometer:micrometer-observation; addio.micrometer:micrometer-tracing-bridge-otel+io.opentelemetry:opentelemetry-exporter-otlpsrc/main/resources/application.ymljamjet.cloud.*block, addmanagement.otlp.tracing.*block pointing at${JAMJET_API_URL}/v1/otlp/v1/traceswithAuthorization: Bearer ${JAMJET_API_KEY}src/main/java/.../cloud/JamjetCloudConfiguration.javasrc/test/java/.../DemoIntegrationTest.javalocalhost:1+ supply placeholder bearer in tests so Spring property resolver doesn't trip on unresolved${JAMJET_API_KEY}README.md+.env.exampleNet diff: +42, −99.
How observability flows now
No JamJet-specific code in the demo — observability is pure
application.yml.Test plan
mvnw clean compile— clean build (release 21)mvnw test -Dtest=PreflightCheckTest— 5/5 passmvnw spring-boot:run— app starts on :8080 in 1.3s, all autoconfig wires up cleanly (Tomcat, Engram, Spring AI, OTLP), PreflightCheck fails on Engram health check as expected without dockerDemoIntegrationTestruns in Docker-enabled runnercloud.jamjet.dev/dashboard/graphtaggedservice.name=spring-ai-engram-cloud-demoFollowups
jamjet-cloud-spring-boot-starterships a Spring-AI-friendly variant (no LangChain4j hard ref + fixed observation handler), this demo can swap back to the starter for an even shorter pom — though "stock OTLP" is genuinely simpler and has no JamJet-specific class on the classpath, so we may stay on this approachexamples/kotlin-koog-engram-cloud-demo) still uses a customJamjetOtlpJsonSpanExporter(~100 LOC). With protobuf intake live, it can drop the custom marshaler in favor of the stock OTel exporter — separate PRSummary by CodeRabbit
Chores
Documentation