feat(sync): stamp connector identity on sync/dotc1z spans + c1z size metric #910
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 318 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.345
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #910"
general
weight: 0.35
arreyder
Why
Sync and dotc1z spans already exist (
syncer.Sync,syncer.SyncResources/Grants/Entitlements,C1File.Vacuum/Cleanup/finalize, …) but carry no connector identity, so a single connector's sync/c1z work can't be filtered per-connector in APM. In a recent incident a connector's sync silently looped + VACUUMed for days and was only findable via CPU profile labels — the spans were useless for it. This closes that gap and adds the c1z-size signal that loop would have surfaced immediately.What
uotel.SyncIdentity— context-propagated{tenant_id, connector_id, catalog_id, catalog_name}. Attribute keys match the platform'spprof.Dolabels, so spans and CPU profiles line up on the same dimensions.sync.WithSyncIdentity(...)option —Sync()injects identity into the run context, so every descendant span (sync and dotc1z, via the threaded ctx) gets stamped. Explicit option wins; otherwise inherits whatever the caller already set on ctx.C1File.Vacuum/Cleanup/finalize/saveC1z.syncParallel): one span per batch withsync.op/sync.action_count/sync.worker_count. The per-action work already starts its ownStartWithLinkroot, so this stays a handful of spans per sync — traces do not grow with resource/grant count.C1File.Vacuumrecordsc1z.vacuum.{size_before,size_after,reclaimed}_bytes.c1z_size_bytesgauge (phase=vacuum|finalize), taggedcatalog_nameonly —connector_idis too high-cardinality for a metric and is already on the spans for per-connector drill-down.Trace-length safety
No new per-item spans. Identity stamping is attributes on existing spans; the only new span is one bounded summary per fan-out batch. The existing
StartWithLink(new-root-linked-to-parent) pattern is preserved throughout.Wiring
Identity flows by context value, so this lights up once the platform caller sets it (the
ductone/c1sync activity already computestenant_id/connector_id/catalog_id/catalog_namefor itspprof.Dolabels — a follow-up passes the same values viaWithSyncIdentityafter this SDK release). Until then the changes are inert no-ops.Test
pkg/uotel/identity_test.go(Attrs/IsZero/context round-trip).go build+go vetclean (incl.-tags=baton_lambda_support);pkg/uotel,pkg/dotc1z,pkg/synctests pass.🤖 Generated with Claude Code