-
-
Notifications
You must be signed in to change notification settings - Fork 10
feat: add posthog log drain adapter #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Thank you for following the naming conventions! 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new PostHog log drain adapter to evlog, along with supporting package exports, tests, and documentation so users can route wide events into PostHog via the evlog:drain hook.
Changes:
- Added a PostHog adapter (
createPostHogDrain,sendToPostHog,sendBatchToPostHog,toPostHogEvent) with runtime/env configuration support. - Exposed the adapter as
evlog/posthogvia build + package export wiring, and added a comprehensive Vitest suite. - Extended docs and the playground app to include PostHog adapter guidance and a drain test endpoint/UI entry.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/evlog/test/adapters/posthog.test.ts | Adds unit tests for PostHog event mapping and HTTP batching/timeout behavior. |
| packages/evlog/src/adapters/posthog.ts | Implements the PostHog drain adapter and PostHog Batch API sender. |
| packages/evlog/package.json | Exposes evlog/posthog via exports and typesVersions. |
| packages/evlog/build.config.ts | Adds the PostHog adapter entrypoint to the build outputs. |
| apps/playground/server/plugins/evlog-drain.ts | Adds commented example wiring for the PostHog drain in the playground. |
| apps/playground/server/api/test/drain.get.ts | Adds an endpoint to emit a wide event intended to exercise drain adapters. |
| apps/playground/app/config/tests.config.ts | Adds a “Drains” test card to trigger the new drain test endpoint. |
| apps/docs/content/3.adapters/5.custom.md | Links the new PostHog adapter from the custom adapters page. |
| apps/docs/content/3.adapters/4.posthog.md | New documentation page describing installation/configuration/usage for PostHog. |
| apps/docs/content/3.adapters/3.otlp.md | Adds “Next steps” link to the PostHog adapter docs. |
| apps/docs/content/3.adapters/2.axiom.md | Adds “Next steps” link to the PostHog adapter docs. |
| apps/docs/content/3.adapters/1.overview.md | Adds PostHog to the adapters overview page and env var examples. |
| AGENTS.md | Documents the new adapter entrypoint and minimal setup instructions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This pull request introduces first-class support for PostHog as a log drain adapter in the
evlogobservability framework. It adds the PostHog adapter implementation, documentation, and integration points throughout the codebase and docs. This enables users to send server-side logs and wide events to PostHog for product analytics, session replay correlation, and advanced querying.