Skip to content

feat(posthog): accept semanticConventions in logs mode - #975

Merged
HugoRCD merged 1 commit into
v3from
EVL-728/posthog-semantic-conventions
Nov 2, 2026
Merged

HugoRCD merged 1 commit into
v3from
EVL-728/posthog-semantic-conventions

Conversation

@evlogai

@evlogai evlogai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Written by an AI agent on behalf of @HugoRCD. @HugoRCD has reviewed it.

Closes EVL-728

Summary

PostHog logs mode now accepts semanticConventions, like HyperDX and Sazabi. The default is true, the v3 OTLP default, so users who do not set it see no change. To keep the 2.x record, set both options. Events mode (/batch/) does not use OTLP and is unchanged.

Usage

createPostHogDrain({ recordShape: 'json', semanticConventions: false })

Changes

  • PostHogConfig.semanticConventions?: boolean, documented like the HyperDX option, listed in POSTHOG_FIELDS, and forwarded by toOTLPConfig.
  • Tests in packages/evlog/test/adapters/posthog.test.ts: the default request matches the shared OTLP request; false drops the semantic-convention names; recordShape: 'json' with false gives the 2.x record; the same options work through createPostHogDrain. Three of the new tests fail on the previous adapter.
  • Docs: the PostHog page has a config row and a keep-2.x snippet; the v3 migration guide ("Compact output by default") lists both PostHog options.
  • Changeset: evlog minor.

Checks

  • pnpm run lint and pnpm run typecheck: pass.
  • packages/evlog vitest run on this branch: 122 files, 2370 tests, pass.
  • The first full run had three unrelated failures (two in test/bin.test.ts, one in test/nuxt/auto-import-types.test.ts) and a port conflict on :3000 from a local docs dev server I had left running. After stopping that server, the full run passed. The three tests also pass when run alone on both the v3 base (25177b44) and this branch. I did not establish why they failed in the first full run.

Rendered change (docs)

Before: production page, the "Choose a record shape" section with the existing compact callout (no keep-2.x paragraph yet).

Before: production PostHog page

After: this branch, local docs build, the new keep-2.x paragraph and snippet.

After: keep-2.x paragraph on the PostHog page

The two frames are not anchored on the same text, because production has no keep-2.x paragraph to match. The change is an addition, so the after frame is the one that matters. The local frame also shows different word spacing from production, which I did not investigate.

ELI5

PostHog's adapter gets the same switch that HyperDX and Sazabi already have. By default it works the way the new version works. Someone who wants the old output can turn off one setting and keep the old output shape. The docs now show how.

PostHog logs mode now forwards semanticConventions to the shared OTLP encoder, like HyperDX and Sazabi. The default stays true (the v3 OTLP default). recordShape: 'json' with semanticConventions: false keeps the 2.x record. Events mode is unchanged.
@vercel

vercel Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
evi Ready Ready Preview Nov 2, 2026 3:50pm UTC
evlog-docs Ready Ready Preview, v0 Nov 2, 2026 3:50pm UTC
evlog-render-lab Ready Ready Preview Nov 2, 2026 3:50pm UTC
evlog-telemetry Ready Ready Preview Nov 2, 2026 3:50pm UTC
just-use-evlog Ready Ready Preview Nov 2, 2026 3:50pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 87d298df-7f58-45fd-ac6f-552f5bc02fba

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@pkg-pr-new

pkg-pr-new Bot commented Nov 2, 2026

Copy link
Copy Markdown
@evlog/cli

npm i https://pkg.pr.new/@evlog/cli@975

evlog

npm i https://pkg.pr.new/evlog@975

@evlog/nuxthub

npm i https://pkg.pr.new/@evlog/nuxthub@975

@evlog/signals

npm i https://pkg.pr.new/@evlog/signals@975

@evlog/telemetry

npm i https://pkg.pr.new/@evlog/telemetry@975

commit: 2ca5d77

@HugoRCD
HugoRCD merged commit 0d8a0b3 into v3 Nov 2, 2026
21 checks passed
@HugoRCD
HugoRCD deleted the EVL-728/posthog-semantic-conventions branch November 2, 2026 16:20

This branch was successfully deployed

5 active deployments
Preview – evlog-docs — 2ca5d77a Deployed Nov 2, 2026 by vercel[bot]
Preview – evlog-telemetry — 2ca5d77a Deployed Nov 2, 2026 by vercel[bot]
Preview – evi — 2ca5d77a Deployed Nov 2, 2026 by vercel[bot]
Preview – evlog-render-lab — 2ca5d77a Deployed Nov 2, 2026 by vercel[bot]
Preview – just-use-evlog — 2ca5d77a Deployed Nov 2, 2026 by vercel[bot]
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.

1 participant