Skip to content

feat: add Plug tracing header context#104

Merged
dustinbyrne merged 2 commits intomainfrom
feat/plug-tracing-headers
Apr 29, 2026
Merged

feat: add Plug tracing header context#104
dustinbyrne merged 2 commits intomainfrom
feat/plug-tracing-headers

Conversation

@dustinbyrne
Copy link
Copy Markdown
Contributor

@dustinbyrne dustinbyrne commented Apr 27, 2026

💡 Motivation and Context

Propagate PostHog browser tracing context through the Elixir Plug integration so backend events and exception captures can be associated with the frontend distinct ID and session.

💚 How did you test it?

  • mix test test/posthog/integrations/plug_test.exs
  • mix test
  • Manual temporary ExUnit check for tracing headers flowing into normal capture and Bandit exception capture

📝 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

  • Ran sampo add to generate a changeset file
  • Added the release label to the PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

posthog-elixir Compliance Report

Date: 2026-04-28 17:20:19 UTC
Duration: 211ms

⚠️ Some Tests Failed

0/1 tests passed, 1 failed


Feature_Flags Tests

⚠️ 0/1 tests passed, 1 failed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id 7ms

Failures

request_payload.request_with_person_properties_device_id

404, message='Not Found', url='http://sdk-adapter:8080/get_feature_flag'

Comment on lines +39 to +40
@max_header_value_length 1000
@control_chars_regex ~r/[\x{00}-\x{1F}\x{7F}-\x{9F}]/u
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are derived from how we're currently sanitizing tracing headers in Django

@dustinbyrne dustinbyrne merged commit 43cbfcc into main Apr 29, 2026
21 checks passed
@dustinbyrne dustinbyrne deleted the feat/plug-tracing-headers branch April 29, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants