Skip to content

fix: read tracing headers by default in v1 integrations (port of #1061) - #1107

Merged
eli-r-ph merged 2 commits into
v1from
v1-tracing-headers-default-on
Oct 22, 2026
Merged

eli-r-ph merged 2 commits into
v1from
v1-tracing-headers-default-on

Conversation

@eli-r-ph

@eli-r-ph eli-r-ph commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

v1 never received #1061, so 8.0 would still ignore the X-PostHog-Distinct-Id and X-PostHog-Session-Id headers unless enabled.
That silently breaks backend-to-frontend session linking for apps upgrading from 7.67 or earlier, or from 7.71+.
All v1 SDKs now read these headers by default once the middleware is installed, with an off switch, matching the tracing-header spec and the other server SDKs. Go counterpart: PostHog/posthog-go#386.

  • Ports fix(integrations): align tracing-header capture across frameworks #1061 from main unchanged (cherry-pick of 780cba9): Django, Flask and ASGI read the headers by default; capture_tracing_headers and POSTHOG_MW_CAPTURE_TRACING_HEADERS turn it off; the trust_* names stay as deprecated aliases.
  • One test assertion is adapted for v1: a generated distinct ID turns person processing off with an event option, which beats the legacy $process_person_profile property, so the test checks the option.
  • The 8.0 migration guide gets a "Tracing headers" section and a checklist line for apps on 7.68 to 7.70.

💚 How did you test it?

  • The port is line-for-line identical to 780cba9; the second commit holds every v1 difference.
  • pytest posthog/test passes with the test extra, including the 236 integration tests.
  • ruff format --check flags posthog/test/mcp/test_features_m4.py, which this PR does not touch and is unchanged from v1.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

🤖 Agent context

Autonomy: Human-driven (agent-assisted). Written with Claude Code (claude-opus-5-5) after a fleet decision to keep tracing headers on by default.

🤖 Generated with Claude Code

@eli-r-ph
eli-r-ph requested a review from a team as a code owner October 22, 2026 17:04
@eli-r-ph eli-r-ph self-assigned this Oct 22, 2026
dustinbyrne and others added 2 commits October 22, 2026 10:33
v1 turns person processing off for a generated distinct ID with an event
option, which beats the legacy property, so the ported test checks the
derived option. The 8.0 migration guide notes the default and the off
switch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eli-r-ph
eli-r-ph force-pushed the v1-tracing-headers-default-on branch from 8354240 to eadf5a3 Compare October 22, 2026 17:37
@eli-r-ph
eli-r-ph merged commit f18160c into v1 Oct 22, 2026
40 checks passed
@eli-r-ph
eli-r-ph deleted the v1-tracing-headers-default-on branch October 22, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants