Ship error messages with telemetry failure events#92
Merged
Conversation
Failure events sent to the Datadog logs intake now carry the reserved error.message attribute alongside error.kind: the clean CLIError message (or str(exc) for unexpected exceptions), capped at 500 chars. Stack traces are still omitted, and a bare typer.Exit failure stays kind-only. https://claude.ai/code/session_0139pycafLLahbQiHsjP8kKX
alexkroman
enabled auto-merge (squash)
June 12, 2026 01:42
The Reliability & Errors group gains a "Top error messages" toplist (grouped by @error.message) and a "Recent errors" log stream with the message column, matching the error.message attribute failure events now ship. The header note no longer claims messages are omitted. https://claude.ai/code/session_0139pycafLLahbQiHsjP8kKX
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.
Summary
Enhance telemetry to include error messages with failure events, enabling better error tracking and grouping in Datadog while maintaining privacy safeguards.
Changes
error_messageparameter tobuild_event()and_safe_dispatch()to carry the user-facing error message with failure telemetry events_ERROR_MESSAGE_MAX_CHARS = 500limit to bound payload size and prevent upstream message bodies from inflating the eventtrack()context manager to extract and pass error messages from:CLIError.messagefor CLI errorsstr(exc)for unexpected exceptionstyper.Exit(no message available)error.messagefieldImplementation Details
The error message is stored in the reserved
error.messagefield (alongsideerror.kind), which Datadog Error Tracking uses for issue grouping and display. The 500-character cap balances providing actionable context for debugging while preventing payload bloat if an upstream error embeds a full response body. Stack traces remain omitted to preserve the privacy-first design of the telemetry system.https://claude.ai/code/session_0139pycafLLahbQiHsjP8kKX