Skip to content

feat: add PostHog Logs drain via OTLP#79

Merged
HugoRCD merged 3 commits intomainfrom
EVL-77
Feb 14, 2026
Merged

feat: add PostHog Logs drain via OTLP#79
HugoRCD merged 3 commits intomainfrom
EVL-77

Conversation

@HugoRCD
Copy link
Owner

@HugoRCD HugoRCD commented Feb 14, 2026

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.

@HugoRCD HugoRCD self-assigned this Feb 14, 2026
@HugoRCD HugoRCD requested a review from Copilot February 14, 2026 16:33
@vercel
Copy link

vercel bot commented Feb 14, 2026

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

Project Deployment Actions Updated (UTC)
evlog-docs Ready Ready Preview, Comment, Open in v0 Feb 14, 2026 4:38pm

@github-actions
Copy link
Contributor

github-actions bot commented Feb 14, 2026

Thank you for following the naming conventions! 🙏

Copy link
Contributor

Copilot AI left a 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 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.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 14, 2026

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

commit: 7fb4cb6

@HugoRCD HugoRCD merged commit 4e18166 into main Feb 14, 2026
12 checks passed
@HugoRCD HugoRCD deleted the EVL-77 branch February 14, 2026 16:39
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