Skip to content

chore: upgrade posthog-go to v2 - #1279

Merged
eli-r-ph merged 2 commits into
mainfrom
chore/posthog-go-v2
Nov 23, 2026
Merged

eli-r-ph merged 2 commits into
mainfrom
chore/posthog-go-v2

Conversation

@eli-r-ph

@eli-r-ph eli-r-ph commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

duckgres sends its product events (query_*, warehouse_*) with posthog-go 1.16. posthog-go v2 sends them through PostHog's v1 capture API.

Changes

  • Moves to github.com/posthog/posthog-go/v2 v2.1.1. Only the import path changes; NewWithConfig, Enqueue(Capture), Groups.Set with a string value, and Close work as before.
  • Requires klauspost/compress v1.20.3. posthog-go v2.1.1 asks only for v1.17.11, which has GO-2026-6865 (a panic on two-block frames, fixed in v1.20.2). govulncheck now reports the same findings as main, none from this change.
  • Events post to /i/v1/analytics/events with the org as distinct id and organization group, as today.
  • Queue behavior changes, in the direction Tracker already documents ("must never block"):
    • 1.16 queued 2,500 messages and blocked Capture when that queue was full.
    • v2 queues 10,000 and drops the newest event with ErrQueueFull instead of blocking. Capture already logs that error at debug and moves on.
  • Default batch size drops from 250 to 100 events per request. Flush interval (5s) and the other defaults are unchanged.

How did you test this code?

  • go build ./..., go vet and go test for internal/analytics and internal/cliboot pass.
  • A throwaway test, not committed, ran NewPostHogTracker and Capture against a local server. Both events reached /i/v1/analytics/events: one with distinct id org-a and $groups {organization: org-a}, one as standalone with no group.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Test Impact Plan

Deterministic summary of how this PR changes tests, CI runners, and coverage-risk signals.

Summary

Area Added Changed Deleted
Test files 0 1 0
E2E/journey files 0 0 0
Workflow files 0 0 0

Signals

  • Test cases: +0 / -0
  • Assertions: +0 / -0
  • Skips or known failures added: 0
  • Workflow continue-on-error added: 0
  • Workflow path filters added: 0
  • Test commands removed from justfile: 0
  • E2E/journey retry lines added: 0

Coverage risk: neutral or increased

No coverage-reduction warnings detected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eli-r-ph
eli-r-ph marked this pull request as ready for review November 21, 2026 02:57
@eli-r-ph eli-r-ph self-assigned this Nov 21, 2026
@eli-r-ph
eli-r-ph requested review from a team November 21, 2026 02:57
@eli-r-ph
eli-r-ph merged commit e0f0e42 into main Nov 23, 2026
30 checks passed
@eli-r-ph
eli-r-ph deleted the chore/posthog-go-v2 branch November 23, 2026 17:46
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.

2 participants