Description
The real OTLP receiver regression clears its map before Collect and accepts any subsequent export. A periodic export already in flight can satisfy the assertions with stale data and mask per-collection process-start capture.
Acceptance Criteria
- #1 Assertions use only OTLP gauge data collected after the corresponding Collect returned, retaining every existing assertion.
- #2 A temporary Collect-time process-start mutation fails the hardened regression for timestamp instability; failure evidence is captured and production code restored.
- #3 go test ./internal/collectors/selfobs -run TestProcessStartRealExport -count=30 passes on the restored candidate.
- #4 Final diff changes only the receiver regression and this task; just check passes and CodeRabbit completes with all files reviewed and no critical or major findings.
- #5 Remain In Progress pending composed gate and root-authorized landing after the sibling prerequisite.
Definition of Done
- #1 just check (fmt-check, lint, vet, test, tidy-check, build, vuln)
- #2 just ci before a change that touches the Dockerfile, goreleaser or the image (adds snapshot + image)
- #3 Every new signal or attribute name declared in internal/semconv and listed in docs/signals.md
Implementation Plan
- Fence received process-start and build-info gauge points by a timestamp captured after Collect returns. 2. Prove rejection of Collect-time capture with a temporary production mutation and restore it. 3. Run 30 real receiver iterations, just check and CodeRabbit; commit the owned candidate without pushing, leaving composed acceptance to root.
Implementation Notes
Receiver now fences gauge datapoint TimeUnixNano at a timestamp captured under the receiver mutex after Collect returns, clearing previously received metrics at that same boundary. Every original assertion remains. A temporary Collect-time process-start mutation failed with process start not near initialization and at or before Stats construction (exit 1); only that mutation was restored, leaving no production diff. Evidence: /tmp/cf2otel-th-evidence/mutation.log. Restored real OTLP receiver regression passed 30 iterations: /tmp/cf2otel-th-evidence/receiver-30.log. just check passed: /tmp/cf2otel-th-evidence/gate.log. First-pass candidate stays In Progress and will be committed without push; composed gate, sibling prerequisite landing, root-authorized changed-base validation, private-identifier scan and exact-SHA CI remain pending.
CodeRabbit was run once on the final test candidate with –base origin/main. It reached reviewing but exceeded the 600-second process deadline without a complete event or findings summary: /tmp/cf2otel-th-evidence/coderabbit.log. Review coverage is unconfirmed; classified as review-service infrastructure timeout, not an implementation finding. No push is authorized on this first pass, and full review remains a blocker before eventual landing.
Repair round 1 attempt accounting: retained original first-Collect mutation failure in /tmp/cf2otel-th-evidence/mutation.log. Added one scratch mutation preserving package-init value on first Collect per Stats and using supplied Collect time on subsequent calls; exact diff and command/full HEAD are in /tmp/cf2otel-th-evidence/round1-later-mutation.diff and /tmp/cf2otel-th-evidence/round1-later-mutation.log. The first assertExport passed; the second failed after 1.22 seconds at process_start_delivery_test.go:135 for timestamp outside initialization bounds (exit 1). This proves later-collection instability is detected, but does not reach the subsequent equality comparison: the retained per-export initialization assertion rejects the changed timestamp first. No test was changed or weakened. Restored only the scratch mutation; full HEAD and empty diff attestations are in /tmp/cf2otel-th-evidence/round1-before.sha, /tmp/cf2otel-th-evidence/round1-before.diff and /tmp/cf2otel-th-evidence/round1-clean-receiver-30.log. Clean committed c4471500ee0fb736883c1bd910c5a9544835a081 passed the 30-iteration receiver command and just check: /tmp/cf2otel-th-evidence/round1-clean-receiver-30.log and /tmp/cf2otel-th-evidence/round1-committed-gate.log. CodeRabbit attempt 1 timed out at 600 seconds; the sole authorized retry ran under caffeinate -i with a 3600-second deadline and completed with findings=0, explicitly reviewing both owned files: /tmp/cf2otel-th-evidence/round1-coderabbit.log. No rebase or push; still In Progress. This notes-only delta is deliberately uncommitted so tested HEAD identity remains unchanged pending root review.
Finalization authorized by root after repaired-evidence review PASS with no blockers. Root attests prerequisite landed as 39ce00770f67cc33618cb83f6094b5a90d257504, exact-SHA CI run 37557644402 ci-success success, and composed gate passed. The In Progress hold is discharged. Original assertions all retained; second-Collect bounds rejection accepted as later-instability proof. DoD applicability: no Dockerfile, goreleaser or image change, so just ci is not required; no new signal or attribute, so semconv/catalogue changes are not required. CodeRabbit source review completed with zero findings and both files covered; this finalization is tracker-only and requires no duplicate review. Landing evidence will be recorded externally at /tmp/cf2otel-th-evidence/landing-identity.log, /tmp/cf2otel-th-evidence/landing-receiver-30.log, /tmp/cf2otel-th-evidence/landing-gate.log, /tmp/cf2otel-th-evidence/landing-pushscan.log and /tmp/cf2otel-th-evidence/landing-ci-view.json; these are planned evidence destinations, not assertions of future results.
Final Summary
Hardened real OTLP receiver regression with a post-Collect gauge timestamp fence, retaining every assertion and introducing no production change. First-Collect and later-Collect mutations both failed and were precisely restored: /tmp/cf2otel-th-evidence/mutation.log and /tmp/cf2otel-th-evidence/round1-later-mutation.log; exact scratch diff: /tmp/cf2otel-th-evidence/round1-later-mutation.diff. Clean committed candidate passed count30 and just check: /tmp/cf2otel-th-evidence/round1-clean-receiver-30.log and /tmp/cf2otel-th-evidence/round1-committed-gate.log. One CodeRabbit infrastructure timeout followed by one authorized bounded retry; retry completed with zero findings and all owned files reviewed: /tmp/cf2otel-th-evidence/round1-coderabbit.log. Root accepted repaired evidence and composed gate, released the sibling prerequisite hold, and authorized serial landing. Final Done readback: /tmp/cf2otel-th-evidence/landing-task-final.log.