feat(observability): unify metrics with deco-cx/deco semconv contract#289
Open
nicacioliveira wants to merge 2 commits into
Open
feat(observability): unify metrics with deco-cx/deco semconv contract#289nicacioliveira wants to merge 2 commits into
nicacioliveira wants to merge 2 commits into
Conversation
Align @decocms/start telemetry with the deco-cx/deco framework so both land on the same series/labels in ClickHouse (no collisions): - Durations normalized to SECONDS at the source (was ms; the old "convert in the collector" note is gone — we normalize at origin). http.server / http.client / loader / resolve durations all divide by 1000 at record time. - HTTP server attributes -> OTel semconv: method -> http.request.method, route_pattern -> http.route, status -> http.response.status_code. Proprietary extras moved under deco.* (deco.http.status_class / .outcome / .region, deco.cache.decision / .layer). - Cache: the two counters deco.cache.hits / deco.cache.misses collapse into a single deco.cache.lookups counter dimensioned by deco.cache.result — matches deco-cx/deco and removes the deco.cache.hits name+semantics collision. - Loader labels namespaced under deco.* (deco.loader.name, deco.cache.result). Caller API (RequestMetricLabels field names) is unchanged — only emitted keys change. Tests updated; typecheck + observability suite green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…status Per the semconv-first decision: no canonical cache metric exists, so follow the OTel semconv pattern (nfs.server.repcache.requests + .status) and the prefer- attributes-over-metrics guidance. Replace the two hits/misses counters with a single deco.cache.requests counter dimensioned by deco.cache.status. Same key on span + metric. Matches deco-cx/deco. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
igoramf
approved these changes
Jun 26, 2026
hugo-ccabral
approved these changes
Jun 26, 2026
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.
What
Align
@decocms/start(tanstack) telemetry with thedeco-cx/decoframework so both frameworks emit the same metric names, units, and attribute keys — required before mixing their data in the shared ClickStackotel_*tables.Changes
ms).http.server.request.duration,http.client.request.duration,deco.loader.duration,deco.cms.resolve.durationnow divide by 1000 at record time. Removed the "convert in the collector/query layer" stance — we normalize at origin (matches deco).method→http.request.method,route_pattern→http.route,status→http.response.status_code. Proprietary extras namespaced:deco.http.status_class/.outcome/.region,deco.cache.decision/.layer.deco.cache.hits+deco.cache.misses→ singledeco.cache.lookupscounter dimensioned bydeco.cache.result. This both unifies with deco-cx/deco and removes adeco.cache.hitsname-with-different-semantics collision (deco counted all lookups; tanstack counted only hits).deco.*(deco.loader.name,deco.cache.result).Compatibility
RequestMetricLabelskeeps its input field names (route_pattern,cache_decision,cache_layer); only the emitted attribute keys changed. No call sites needed edits.npm run typecheckclean;observability.test.ts14/14 green.Companion to
deco-cx/deco#1211anddeco-cx/apps#1625. Part of the HyperDX → ClickStack migration; conforms to the sharedOBSERVABILITY_CONVENTIONScontract.🤖 Generated with Claude Code
Summary by cubic
Unifies
@decocms/starttelemetry withdeco-cx/decosemantic conventions so both emit identical metric names, units, and attributes in ClickStackotel_*tables. Durations now record in seconds and HTTP labels use OTel keys; caller API stays the same.Refactors
http.server,http.client, loader, and CMS resolve durations in seconds.http.request.method,http.route,http.response.status_code; move extras underdeco.*(e.g.,deco.http.status_class,deco.cache.decision,deco.http.region).deco.loader.name,deco.cache.result,deco.cache.layer,deco.cache.profile.Bug Fixes
deco.cache.hits/deco.cache.misseswith a singledeco.cache.requestscounter dimensioned bydeco.cache.statusto remove a naming collision and matchdeco-cx/deco.Written for commit be66958. Summary will update on new commits.