Harden local telemetry export: routes, span logs, schema, manifest#990
Open
EhabY wants to merge 1 commit into
Open
Harden local telemetry export: routes, span logs, schema, manifest#990EhabY wants to merge 1 commit into
EhabY wants to merge 1 commit into
Conversation
1d897e9 to
738d19a
Compare
3e01527 to
8671eeb
Compare
Follow-up hardening on top of the Coder telemetry export command (#953): - Surface a non-blocking warning when the pre-export flush does not fully succeed, so a successful-looking export no longer hides missing events. - Add a self-describing manifest.json to OTLP/JSON exports: manifest and telemetry schema versions, date range, source file and event counts, and per-signal record counts. - Make JSON exports cancellable and reject non-file save destinations. - Version telemetry rows with schema_version and export span logs as linked OTLP log records. - Harden HTTP route normalization for telemetry. - Assert the exporter resource carries per-event provenance, tighten comments, and remove em-dashes from comments and test names.
8671eeb to
6f54d99
Compare
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
Hardening pass on the local telemetry export path, following the audit in #953 / #903.
Stacked on top of
feat/issue-903-export-telemetry(PR #953) — please review/merge that first; this PR targets that branch, notmain.Changes
#3Route/cardinality guardrailsnormalizeRoute(): strips query+fragment, collapses UUID/integer segments to{id}, keeps curated templates, and buckets unknown routes to the first 3 segments +{*}. Applied to HTTP and websocket route telemetry.#4OTLP span-log routingSpan.log()/Span.logError()events export as OTLP log records linked to their parent span (traceId/spanId) instead of zero-duration spans. Timed spans (those with a frameworkresult) still route to traces.#9Schema versioningschema_version(CURRENT_TELEMETRY_SCHEMA_VERSION = 1), required in the Zod schema and stamped at emit time.#6/#7Flush reportingflush()returns a structuredFlushStatus; the sink rejects on a write failure, so a failed pre-export flush surfaces a non-blocking warning that the export may be missing the latest events.#8OTLP manifestmanifest.jsondescribing the export: format, telemetry + manifest schema versions, date range, source-file count, source-event count, and per-signal record counts.#10/#11Cancellation + save destinationAbortSignal(mirrors the OTLP writer); export rejects non-filesave destinations with a clear error.#5OTLP provenanceDeliberately not included (with rationale)
#1command activation — no-op. The^1.105engine auto-generatesonCommand:*activation for contributed commands, socoder.exportTelemetryalready activates from a cold session.#2privacy confirmation modal — dropped. The export logs no path/contents, and the existingcoder support bundleexports more-sensitive data with no modal.coder support bundle(which redacts specific keys rather than flagging categories), low signal (deployment URL and machine id appear on nearly every event), and not a standard manifest concern.Testing
pnpm test(1880 passing, 1 skipped),pnpm typecheck,pnpm lint,pnpm format:checkall green. Unit tests cover route normalization, span-log routing, schema version, flush-failure surfacing, manifest contents, JSON cancellation, non-file save URIs, and OTLP provenance.Closes #983.
🤖 Generated by Coder Agents.