Skip to main content

Overview

OpenSRE stores your PostHog project credentials for REST API access (project metadata and correlation during investigations). Configure with opensre integrations setup posthog or POSTHOG_* environment variables. This REST integration does not register investigation tools. For agent tools during investigations (analytics, feature flags, HogQL), use PostHog (MCP).

Prerequisites

  • A PostHog account (US, EU, or self-hosted)
  • Your PostHog project ID
  • A personal API key with read access to that project — see PostHog personal API keys

Setup

Option 1: Interactive CLI

Or run the onboarding wizard and select PostHog under Observability. You will be prompted for:
  • Project ID — from PostHog project settings
  • Personal API key (phx_...) — Personal API keys with read access
  • API base URL — defaults to US SaaS (https://us.i.posthog.com); use https://eu.i.posthog.com for EU
On success, credentials are saved to your integration store and synced to .env.

Option 2: Environment variables

Credentials

Get the project ID from PostHog project settings. Create a personal API key (phx_...) with read access — see PostHog personal API keys.

Investigation tools

This REST integration does not register investigation tools. For agent tools during investigations (analytics, feature flags, HogQL), use PostHog (MCP).

Verify

A successful check prints PostHog validated. For the MCP integration, use opensre integrations verify posthog_mcp instead.

Troubleshooting

Security

  • Use a dedicated personal API key with the minimum read permissions needed
  • Store credentials in environment variables or a secret manager — not in source code
  • Rotate keys periodically