PostHog / PostHog/posthog

Normalize trace/span IDs to lowercase hex for W3C Trace Context spec compliance

Open
#46,440 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
6h 51m
Merged PRs (30d)
232

Description

Feature request

Is your feature request related to a problem?

PostHog currently stores trace and span IDs as uppercase hex (e.g., 5A5222C6...), while the W3C Trace Context specification requires lowercase hex format (e.g., 5a5222c6...).

This creates a correlation problem when using PostHog alongside spec-compliant observability backends like Axiom, OpenTelemetry collectors, or other tracing systems that follow the W3C standard.

Describe the solution you'd like

Normalize trace IDs to lowercase please.

Describe alternatives you've considered

n/a

Additional context

https://posthog.com/questions/posthog-showing-double-encoded-trace-id-and-span-id-in-logs

Debug info
- [x] PostHog Cloud, Debug information: [please copy/paste from https://us.posthog.com/settings/project-details#variables]
- [ ] PostHog Hobby self-hosted with `docker compose`, version/commit: [please provide]
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by locating the code paths that create or serialize PostHog trace and span IDs, then compare their output with the W3C Trace Context requirements. Done means emitted IDs use lowercase hexadecimal and remain correlatable with spec-compliant tracing backends.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.