fix(telemetry): rebuild remote metric scalar attributes - #406
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe collector now rebuilds allowlisted Better Stack metric attributes from scalar values. A Docker-backed regression checks both receiver pipelines, and CI runs matching collector privacy tests. ChangesRemote metric privacy
Sequence Diagram(s)sequenceDiagram
participant OtlpReceiver
participant Collector
participant BetterStackExporter
OtlpReceiver->>Collector: Send metrics
Collector->>Collector: Apply transform/contract_metrics
Collector->>Collector: Apply transform/remote_metric_scalars
opt Gateway pipeline
Collector->>Collector: Apply transform/remote_queue_identity
end
Collector->>BetterStackExporter: Export processed metrics
Suggested reviewers: Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The metric privacy regression is selected by the pinned collector privacy CI step. No actionable merge risk is established by the supplied evidence. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
The base branch was changed.
# Conflicts: # .github/workflows/ci.yml
Collector 0.119 scalar lookups read the first protobuf attribute with a given key, but
keep_keysretains later duplicates. Raw OTLP tests reproduce duplicate strings and nested payloads surviving the existing remote metric allowlist.Rebuild remote resource and point maps after the existing exact per-metric pruning. Each allowed resource retains one string; each allowed point key retains its first scalar value. Clear scratch state per resource/point, omit missing or non-scalar values, and preserve collector-authored identity. Local Prometheus processing, metric names, values, histogram buckets, timestamps, temporality and producer domain policies remain unchanged.
The Docker regression runs the actual rendered 0.119 pipeline through both receivers. It covers allowed-first/hostile-second duplicates, reversed service claims, nested-first values, resource/point conflicts and missing optional fields across successive points. Both metric cases and both existing trace cases pass. Ruff, workflow syntax and diff checks pass. CI runs the runtime cases. A sibling sweep identified candidate key-pruning statements; the runtime tests establish the specific resource and datapoint defect fixed here.
This PR changes only metric processing, its contract/documentation and its regression/CI coverage. It reuses the pinned collector helpers from #402.
Summary by CodeRabbit
Bug Fixes
Documentation