Skip to content

♻️ Simplify PostHog telemetry configuration - #91

Merged
Vivekyy merged 1 commit into
mainfrom
Vivekyy/posthog-env-vars
Jul 30, 2026
Merged

♻️ Simplify PostHog telemetry configuration#91
Vivekyy merged 1 commit into
mainfrom
Vivekyy/posthog-env-vars

Conversation

@Vivekyy

@Vivekyy Vivekyy commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Removes the legacy POSTHOG_API_KEY fallback so runtime telemetry accepts POSTHOG_PROJECT_TOKEN or the release-embedded project token.

Keeps built-in host values empty unless a release explicitly configures POSTHOG_HOST, while preserving the US endpoint as the runtime default.

Adds Rudder-tagged integration coverage for supported tokens, rejected legacy keys, and release host generation.

Validation: npm run check:agent-layout, npm run typecheck, npm test (30 passing), and npm run build.


Open in Stage

Greptile Summary

Simplifies PostHog telemetry configuration.

  • Removes support for the legacy POSTHOG_API_KEY runtime fallback.
  • Leaves release-embedded hosts empty when no explicit host is configured and preserves the US runtime fallback.
  • Adds integration coverage for project tokens, rejected legacy keys, and generated release-host behavior.

Confidence Score: 4/5

The PR appears safe to merge, with only non-blocking telemetry documentation drift to address.

Runtime and release behavior are consistently covered, but two repository configuration references still instruct maintainers to use the removed POSTHOG_API_KEY fallback.

Files Needing Attention: src/telemetry.ts and the telemetry almanac references

Important Files Changed

Filename Overview
src/telemetry.ts Removes the legacy token fallback while preserving embedded-token and runtime-host fallback behavior; related configuration references remain stale.
.github/workflows/publish.yml Embeds an empty release host when POSTHOG_HOST is unset, allowing the bundled runtime fallback to select the US endpoint.
src/telemetry-build-config.ts Changes the source-build host default to empty while keeping source-build telemetry disabled through the empty token.
test/prompt-hook.test.ts Covers supported project-token telemetry, intentional rejection of the legacy API key, and release-embedded configuration.
test/plugin-package.test.ts Adds static coverage for release host generation and the retained runtime default.

Fix All in Cursor Fix All in Conductor

Reviews (1): Last reviewed commit: "♻️ Simplify PostHog telemetry configurat..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Co-authored-by: Codex Agent <codex@openai.com>
@ghost

ghost commented Jul 30, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 3 individual chapters for you:

Title
1 Simplify PostHog configuration and remove legacy fallback
2 Update release workflow for explicit host configuration
3 Verify telemetry configuration and legacy key rejection
Open in Stage

Chapters generated by Stage for commit 18946c2 on Jul 30, 2026 2:54pm UTC.

@github-actions

Copy link
Copy Markdown

📦 No plugin release on merge

The plugin package, tag, and GitHub Release already exist for 0.1.3.
Bump package.json to release a new plugin version.

Comment thread src/telemetry.ts
Comment on lines 12 to +13
const POSTHOG_PROJECT_TOKEN =
process.env.POSTHOG_PROJECT_TOKEN ||
process.env.POSTHOG_API_KEY ||
BUILT_IN_POSTHOG_PROJECT_TOKEN;
process.env.POSTHOG_PROJECT_TOKEN || BUILT_IN_POSTHOG_PROJECT_TOKEN;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Legacy token documentation is stale

The token selection no longer reads POSTHOG_API_KEY, but the telemetry configuration references still document it as a supported fallback. Maintainers following those references will configure a key that leaves telemetry disabled, so the affected almanac pages should be updated alongside this change.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Cursor Fix in Conductor

@Vivekyy
Vivekyy merged commit 7b4d9da into main Jul 30, 2026
4 checks passed
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