Repository navigation
feat(error-tracking): add ambient trace IDs to exceptions - #228
pauldambra wants to merge 1 commit into
Conversation
Generated-By: PostHog Desktop Task-Id: 5681be44-4986-48db-b140-1bda88f75f96
posthog-elixir Compliance ReportDate: 2026-10-16T11:31:33.384636+00:00
|
| Test | Status | Duration |
|---|---|---|
| Format Validation.Event Has Required Fields | ✅ | 610ms |
| Format Validation.Event Has Uuid | ✅ | 611ms |
| Format Validation.Event Has Lib Properties | ✅ | 611ms |
| Format Validation.Distinct Id Is String | ✅ | 611ms |
| Format Validation.Token Is Present | ✅ | 611ms |
| Format Validation.Custom Properties Preserved | ✅ | 611ms |
| Format Validation.Event Has Timestamp | ✅ | 611ms |
| Format Validation.Non Utc Event Timestamp Is Converted To Utc | ❌ | 610ms |
| Retry Behavior.Retries On 503 | ✅ | 5616ms |
| Retry Behavior.Does Not Retry On 400 | ✅ | 2614ms |
| Retry Behavior.Does Not Retry On 401 | ✅ | 2613ms |
| Retry Behavior.Respects Retry After Header | ✅ | 5616ms |
| Retry Behavior.Implements Backoff | ✅ | 15627ms |
| Retry Behavior.Retries On 500 | ✅ | 5616ms |
| Retry Behavior.Retries On 502 | ✅ | 5615ms |
| Retry Behavior.Retries On 504 | ✅ | 5617ms |
| Retry Behavior.Max Retries Respected | ✅ | 15627ms |
| Deduplication.Generates Unique Uuids | ✅ | 622ms |
| Deduplication.Preserves Uuid On Retry | ✅ | 5616ms |
| Deduplication.Preserves Uuid And Timestamp On Retry | ✅ | 10621ms |
| Deduplication.Preserves Uuid And Timestamp On Batch Retry | ✅ | 5618ms |
| Deduplication.No Duplicate Events In Batch | ✅ | 616ms |
| Deduplication.Different Events Have Different Uuids | ✅ | 614ms |
| Compression.Sends Gzip When Enabled | ✅ | 611ms |
| Batch Format.Uses Proper Batch Structure | ✅ | 610ms |
| Batch Format.Flush With No Events Sends Nothing | ✅ | 607ms |
| Batch Format.Multiple Events Batched Together | ✅ | 615ms |
| Error Handling.Does Not Retry On 403 | ✅ | 2612ms |
| Error Handling.Does Not Retry On 413 | ✅ | 2614ms |
| Error Handling.Retries On 408 | ✅ | 5616ms |
Failures
format_validation.non_utc_event_timestamp_is_converted_to_utc
Event 0 field 'timestamp' instant '2026-10-16T11:29:49.295141Z' != expected '2025-01-02T03:04:05Z'
Feature_Flags Tests
View Details
| Test | Status | Duration |
|---|---|---|
| Request Payload.Request With Person Properties Device Id | ✅ | 10ms |
| Request Payload.Flags Request Uses V2 Query Param | ✅ | 6ms |
| Request Payload.Flags Request Hits Flags Path Not Decide | ✅ | 7ms |
| Request Payload.Flags Request Omits Authorization Header | ✅ | 7ms |
| Request Payload.Token In Flags Body Matches Init | ✅ | 6ms |
| Request Payload.Groups Round Trip | ✅ | 7ms |
| Request Payload.Groups Default To Empty Object | ❌ | 6ms |
| Request Payload.Disable Geoip False Propagates As Geoip Disable False | ✅ | 7ms |
| Request Payload.Disable Geoip Omitted Defaults To False | ❌ | 6ms |
| Request Payload.Flag Keys To Evaluate Contains Only Requested Key | ✅ | 6ms |
| Request Lifecycle.No Flags Request On Init Alone | ✅ | 4ms |
| Request Lifecycle.No Flags Request On Normal Capture | ✅ | 608ms |
| Request Lifecycle.Two Flag Calls Produce Two Remote Requests | ✅ | 12ms |
| Request Lifecycle.Mock Response Value Is Returned To Caller | ❌ | 7ms |
| Retry Behavior.Retries Flags On 502 | ❌ | 309ms |
| Retry Behavior.Retries Flags On 504 | ❌ | 311ms |
| Side Effect Events.Get Feature Flag Captures Feature Flag Called Event | ❌ | 611ms |
Failures
request_payload.groups_default_to_empty_object
Field 'groups' not found in /flags request body at path 'groups'. Available keys: ['distinct_id', 'api_key', 'flag_keys_to_evaluate']
request_payload.disable_geoip_omitted_defaults_to_false
Field 'geoip_disable' not found in /flags request body at path 'geoip_disable'. Available keys: ['distinct_id', 'api_key', 'flag_keys_to_evaluate']
request_lifecycle.mock_response_value_is_returned_to_caller
Last action result missing field 'value'. Keys: ['error', 'success']
retry_behavior.retries_flags_on_502
Last action result missing field 'value'. Keys: ['error', 'success']
retry_behavior.retries_flags_on_504
Last action result missing field 'value'. Keys: ['error', 'success']
side_effect_events.get_feature_flag_captures_feature_flag_called_event
Expected 1 events with name '$feature_flag_called', got 0
|
Note 🤖 Automated comment by QA Swarm - not written by a human Verdict: APPROVE (round 1 @ 9307250)No actionable defect found in the exception trace change. Key findingsThe Logger entry path reads ambient context before capture. Caller and request trace properties keep priority, including atom and string keys. Valid unsampled spans retain fixed-width lowercase IDs. Missing or failing context does not stop exception capture. ConvergenceThis round is dry. The simplify pass proposed no change. No review threads require action. The SDK spec agreement remains a merge hold. Reviewer summariesThe independent router reviewed the full diff and surrounding merge paths. It reported low danger and high confidence, with no further delegation required. The CI checks pass. Seven advisory compliance failures match documented adapter limits and flag response fixture differences. This review does not certify full SDK compliance. Automated by QA Swarm - not a human review |
[Robot] Draft prepared with Codex.
💡 Motivation and Context
Developers need to find the backend trace for an error captured by the Elixir Logger handler.
$trace_idand$span_idfrom a valid active OpenTelemetry span before the handler queues the exception.This draft implements the proposed exception trace contract and waits for agreement there before merge.
💚 How did you test it?
mix test,mix format --check-formatted,mix credo --strict, andmix posthog.public_api --check.📝 Checklist
If releasing new changes
sampo addto generate a changeset fileAdded
.sampo/changesets/ambient-exception-trace-context.mddirectly using the documented Sampo format. The Sampo CLI is not installed.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Codex (gpt-6) used shell commands, Mix, Git, and the GitHub CLI. Skills: writing-tests, writing-code-comments, writing-user-facing-copy, and writing-pr-descriptions. Human review is required.
Created with PostHog Desktop