Repository navigation
feat(django): add request context to OpenTelemetry spans - #1070
Open
pauldambra wants to merge 3 commits into
Open
pauldambra wants to merge 3 commits into
pauldambra wants to merge 3 commits into
Conversation
Contributor
posthog-python Compliance ReportDate: 2026-10-17T14:13:50.114285+00:00 ✅ All Tests Passed!121/121 tests passed Capture_V1 Tests✅ 95/95 tests passed View Details
Capture_Ai Tests✅ 5/5 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
Feature_Flags_Local_Evaluation Tests✅ 4/4 tests passed View Details
|
This was referenced Oct 16, 2026
pauldambra
added this pull request to stack #1076
October 17, 2026 08:57
3 of 5 tasks
Generated-By: PostHog Desktop Task-Id: 5681be44-4986-48db-b140-1bda88f75f96
Generated-By: PostHog Desktop Task-Id: 5681be44-4986-48db-b140-1bda88f75f96
Generated-By: PostHog Desktop Task-Id: 5681be44-4986-48db-b140-1bda88f75f96
pauldambra
force-pushed
the
posthog/django-otel-span-context
branch
from
October 17, 2026 14:08
54e93c0 to
0cdbf2c
Compare
Member
Author
|
Note 🤖 Automated comment by QA Swarm — not written by a human Verdict: ✅ APPROVE (round 1 @ 0cdbf2c)No remaining actionable finding in the reviewed change. The rebase retains the reviewed bridge and current header settings. Capacity, identity, and ended-scope checks remain covered. Key findings
ConvergenceNo remaining duplicate finding. Reviewer summaries
Automated by QA Swarm. Human review is required. |
This branch has not been deployed
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.
[Robot] Prepared with PostHog Desktop.
💡 Motivation and Context
Django users need to link backend spans to the browser session that caused a request. Event context and native PostHog spans already use request IDs, but application-owned OpenTelemetry spans do not.
PostHogContextSpanProcessorto the application's existing provider. Child spans keep the request IDs captured when they start.Public API additions:
posthog.integrations.otel.PostHogContextSpanProcessorandenrich_current_span().Related specification work: SDK span context tracking and the shared span bridge contract. This uses the native trace attribute names
sessionIdandposthogDistinctId.💚 How did you test it?
📝 Checklist
If releasing new changes
sampo addto generate a changeset fileAdded a changeset in the documented Sampo format.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Codex (GPT-6) used shell tools and GitHub CLI. Model
gpt-6-astrareviewed the SDK and fixed the attribute-capacity and inherited-context cases. The change uses the application's existing provider and an explicit processor for child spans. Django also updates a request span that is already active. Human review is required.Created with PostHog Desktop