fix(deploy): give production telemetry a real version and environment - #140
Conversation
Verifying phase 1 on the server turned up what the code change alone had missed. The exporter warning is gone — four minutes after deploying 88c35cc both services reported zero `Failed to publish metrics`, where before it was one per service per minute — but neither ORGMEMORY_SERVICE_VERSION nor ORGMEMORY_DEPLOYMENT_ENVIRONMENT was set on the containers. So the resource attributes added in that change fell back to their local defaults, and production reported deployment.environment.name=local. A collector would have labelled the production deployment as a developer's laptop. That is worse than the attribute being absent, because absent is visibly missing while wrong looks like data. deploy.sh now pins ORGMEMORY_SERVICE_VERSION to the released commit in the same rewrite that pins the image tags. They are written together deliberately: a service.version that lags the running image is worse than none at all, and the only way to guarantee they agree is to derive both from the same value in the same place. The function is renamed from replace_image_references to pin_release_values, since it no longer only handles images. The production compose sets the environment explicitly rather than deriving it from the active Spring profile, so the value a collector sees is readable in the file that deploys it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 11 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
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 |
Found by verifying phase 1 on the server instead of stopping at "the tests pass".
The good news first
The exporter warning is gone. Four minutes after
88c35ccdeployed to ZM:Before this, each service logged that once a minute.
ProviderLoggingBoundaryVerifieralso passed against the real configuration rather than only under test — the applications started and reported healthy.What the check found
Neither
ORGMEMORY_SERVICE_VERSIONnorORGMEMORY_DEPLOYMENT_ENVIRONMENTwas set on the containers:So the resource attributes I added in #138 fell back to their local defaults, and production was reporting
deployment.environment.name=local. A collector would have labelled the production deployment as a developer's laptop.That is worse than the attribute being absent. Absent is visibly missing; wrong looks like data.
The fix
deploy.shpinsORGMEMORY_SERVICE_VERSIONto the released commit in the same rewrite that pins the image tags. They are written together deliberately — aservice.versionthat lags the running image is worse than none at all, and the only way to guarantee they agree is to derive both from the same value in the same place. The function is renamedreplace_image_references→pin_release_valuessince it no longer only handles images.The production compose sets the environment explicitly rather than deriving it from the Spring profile, so the value a collector sees is readable in the file that deploys it.
Verification
bash -non the script; the compose merge-key expansion checked by parsing the file and reading the resolvedapiandworkerenvironments, since these values arrive through a YAML anchor and a silent anchor mistake would look exactly like the bug being fixed. Both resolve toproduction.The next deployment is what proves the version pin end to end; that is stated in the plan rather than claimed here.
🤖 Generated with Claude Code