Repository navigation
feat: add optional application span context processor - #229
Conversation
Generated-By: PostHog Desktop Task-Id: 5681be44-4986-48db-b140-1bda88f75f96
posthog-elixir Compliance ReportDate: 2026-10-23T16:53:21.690668+00:00
|
| Test | Status | Duration |
|---|---|---|
| Format Validation.Event Has Required Fields | ✅ | 610ms |
| Format Validation.Event Has Uuid | ✅ | 610ms |
| Format Validation.Event Has Lib Properties | ✅ | 610ms |
| Format Validation.Distinct Id Is String | ✅ | 610ms |
| Format Validation.Token Is Present | ✅ | 610ms |
| Format Validation.Custom Properties Preserved | ✅ | 610ms |
| Format Validation.Event Has Timestamp | ✅ | 610ms |
| Format Validation.Non Utc Event Timestamp Is Converted To Utc | ❌ | 610ms |
| Retry Behavior.Retries On 503 | ✅ | 5615ms |
| Retry Behavior.Does Not Retry On 400 | ✅ | 2613ms |
| Retry Behavior.Does Not Retry On 401 | ✅ | 2613ms |
| Retry Behavior.Respects Retry After Header | ✅ | 5616ms |
| Retry Behavior.Implements Backoff | ✅ | 15625ms |
| Retry Behavior.Retries On 500 | ✅ | 5616ms |
| Retry Behavior.Retries On 502 | ✅ | 5615ms |
| Retry Behavior.Retries On 504 | ✅ | 5613ms |
| Retry Behavior.Max Retries Respected | ✅ | 15620ms |
| Deduplication.Generates Unique Uuids | ✅ | 623ms |
| Deduplication.Preserves Uuid On Retry | ✅ | 5615ms |
| 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 | ✅ | 610ms |
| Batch Format.Uses Proper Batch Structure | ✅ | 609ms |
| Batch Format.Flush With No Events Sends Nothing | ✅ | 607ms |
| Batch Format.Multiple Events Batched Together | ✅ | 615ms |
| Error Handling.Does Not Retry On 403 | ✅ | 2613ms |
| Error Handling.Does Not Retry On 413 | ✅ | 2613ms |
| Error Handling.Retries On 408 | ✅ | 5616ms |
Failures
format_validation.non_utc_event_timestamp_is_converted_to_utc
Event 0 field 'timestamp' instant '2026-10-23T16:51:37.607641Z' != expected '2025-01-02T03:04:05Z'
Feature_Flags Tests
View Details
| Test | Status | Duration |
|---|---|---|
| Request Payload.Request With Person Properties Device Id | ✅ | 9ms |
| Request Payload.Flags Request Uses V2 Query Param | ✅ | 8ms |
| 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 | ✅ | 7ms |
| Request Payload.Groups Round Trip | ✅ | 8ms |
| Request Payload.Groups Default To Empty Object | ❌ | 8ms |
| Request Payload.Disable Geoip False Propagates As Geoip Disable False | ✅ | 8ms |
| Request Payload.Disable Geoip Omitted Defaults To False | ❌ | 7ms |
| Request Payload.Flag Keys To Evaluate Contains Only Requested Key | ✅ | 8ms |
| Request Lifecycle.No Flags Request On Init Alone | ✅ | 3ms |
| Request Lifecycle.No Flags Request On Normal Capture | ✅ | 610ms |
| Request Lifecycle.Two Flag Calls Produce Two Remote Requests | ✅ | 11ms |
| Request Lifecycle.Mock Response Value Is Returned To Caller | ❌ | 7ms |
| Retry Behavior.Retries Flags On 502 | ❌ | 311ms |
| Retry Behavior.Retries Flags On 504 | ❌ | 311ms |
| Side Effect Events.Get Feature Flag Captures Feature Flag Called Event | ❌ | 610ms |
Failures
request_payload.groups_default_to_empty_object
Field 'groups' not found in /flags request body at path 'groups'. Available keys: ['api_key', 'distinct_id', '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: ['api_key', 'distinct_id', '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
Generated-By: PostHog Desktop Task-Id: 5681be44-4986-48db-b140-1bda88f75f96
|
Note 🤖 Automated comment by QA Swarm — not written by a human Verdict: ✅ APPROVE (privacy round @ db01483)
ChecksFull suite (646), format, credo, and warnings-as-errors pass. An independent review accepted the change. Optional follow-up: cache the enabled flag to avoid copying the config map per span. Earlier roundsVerdict: ✅ APPROVE (round 1 @ d5f79fe)No remaining actionable finding in the reviewed change. Process context and the Cowboy initial-header path were checked. Bandit, LiveView, and new-process transfer are outside the verified scope. Key findings
ConvergenceNo remaining duplicate finding. Reviewer summaries
Automated by QA Swarm. Human review is required. This comment does not approve a merge or release. |
Generated-By: PostHog Desktop Task-Id: bfd18848-e498-4352-a58a-b9ba85de4198
main declared opentelemetry_api for tests only, but the optional opentelemetry dependency needs it in every environment. Generated-By: PostHog Desktop Task-Id: e73c8b25-9501-4f04-9fd8-e82415e1f9f9
[Robot] Prepared with PostHog Desktop on behalf of @pauldambra.
💡 Motivation and Context
Elixir users need application spans to carry the person and session IDs from the request. Phoenix can start its Cowboy request span before endpoint plugs run.
PostHog.OpenTelemetry.ContextSpanProcessor. Apps register it before their existing export processors. It adds missingsessionIdandposthogDistinctIdattributes from the current process context.The supported request path was tested with Phoenix and Cowboy. Without initial captured headers, an earlier span stays unchanged. Bandit request tracing and LiveView process propagation remain unverified. Context follows the existing process lifetime; tasks need explicit transfer, and reused processes need explicit cleanup.
Tracks sdk-specs#128 and the proposed span contract. Official setup docs are prepared in posthog.com#21313, held until release.
💚 How did you test it?
📝 Checklist
If releasing new changes
sampo addto generate a changeset fileThe changeset uses the documented Sampo format and
hex/posthogpackage key. It was written without the CLI.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
GPT-6 (Codex) wrote the implementation with PostHog Desktop. Separate Plug and Phoenix audits used public SDK records and real HTTP requests. Independent SDK review by gpt-6-astra found no remaining material defect. The bridge uses no private span storage access.
Created with PostHog Desktop