Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Thank you for following the naming conventions! 🙏 |
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request introduces PostHog Logs support via OTLP, enabling structured log ingestion into PostHog's dedicated Logs product. The implementation adds a new drain function that wraps the existing OTLP adapter with PostHog-specific endpoint configuration and authentication, while maintaining the same configuration resolution patterns as other adapters.
Changes:
- Added
createPostHogLogsDrain()function in the PostHog adapter for sending logs via OTLP format - Added comprehensive test coverage for the new drain function including configuration, batching, error handling, and environment variable resolution
- Updated documentation to explain PostHog Logs vs Events and provide usage examples
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/evlog/src/adapters/posthog.ts | Implements createPostHogLogsDrain() that wraps OTLP with PostHog endpoint and Bearer token authentication |
| packages/evlog/test/adapters/posthog.test.ts | Adds 18 comprehensive test cases covering endpoint construction, auth headers, OTLP format validation, batching, env vars, and error handling |
| apps/playground/server/plugins/evlog-drain.ts | Enables the new PostHog Logs drain in the playground for testing |
| apps/docs/content/3.adapters/4.posthog.md | Documents PostHog Logs integration with configuration options, comparison to Events, and usage examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for sending logs to PostHog using the OpenTelemetry (OTLP) log format, in addition to the existing PostHog Events integration. The main addition is the new
createPostHogLogsDrain()function, which enables structured log ingestion into PostHog's dedicated Logs product. The documentation, implementation, and tests have all been updated to reflect this new capability.