Hogflare is warehouse-native product analytics and session replay for Cloudflare. A Worker receives PostHog SDK traffic and maintains persons, groups, and flags. Events and person history land in the project's Iceberg tables. The reviewer UI uses R2 SQL for recordings and a native SQLCtx/DuckDB service for charts and error investigations.
It is built for teams that want PostHog-compatible analytics primitives in their own Cloudflare lakehouse, without operating the full PostHog stack.
- SDK capture through the legacy endpoints and the capture v1 analytics and AI event endpoints. See SDK compatibility for versions and limits.
- Stateful persons and groups:
$set,$set_once,$unset, aliasing, group properties, group slots, and append-only person snapshots - Feature flags and remote config with a reviewer interface for evaluating drafts, publishing changes, and restoring revisions
- Error tracking with an issues inbox, occurrence stacks, release-specific source maps, replay links, and issue status
- Product analytics with event and property filters, period comparisons, shareable saved insights, and drill-down to contributing sessions
- Session replay: PostHog recording ingestion and playback plus an R2 SQL-backed explorer for sessions, event search, funnels, friction signals, and person journeys
- Warehouse output: event rows and person snapshots in R2 Data Catalog-backed Iceberg/Parquet tables
- Cloudflare-native enrichment: IP, geo, colo, ASN, and related request metadata
- Backfill importer for existing PostHog persons, groups, and historical events
Hogflare includes semantic model definitions over the R2/Iceberg tables so teams can query product analytics directly from DuckDB, R2 SQL, or BI tooling:
- Core facts:
events,sessions,pageviews,activity_days,error_events,error_issues - Identity and profiles:
persons,person_profiles,identity_links - Product analytics:
first_event_retention,attribution,groups - Reusable metrics: identification rate, pageviews per session, events per user, grouped event rate, day 1/7/30 retention, bounce rate, engagement rate, attribution rate, identity links per profile, captured exceptions, affected users and sessions, and issue counts by status
Hogflare is not a full PostHog clone. It does not try to ship PostHog's complete app surface, plugin system, cohort engine, or ClickHouse-backed query layer. The focus is PostHog SDK compatibility, product analytics data ownership, error tracking, replay review, and a practical semantic layer on Cloudflare-managed storage.
- Deployment: Cloudflare Pipeline setup, Wrangler config, secrets, deployment, verification, local fake pipeline, and cleanup.
- Product Analytics: dashboard routes, warehouse configuration, semantic queries, and incremental pre-aggregation.
- Saved insights and feature flags describe the project-scoped reviewer workflows.
- Error tracking covers issue triage, affected sessions, and resolving occurrences. Source maps explains how to associate a release's minified frames with its source.
- Data lifecycle covers retention, person erasure, and verification of remaining Iceberg files.
- Deployment qualification includes the capture-to-chart canary and separate ordinary-event and recording workloads.
- Session Replay: replay ingestion, explorer UI, API routes, filters, and local demo commands.
- PostHog Compatibility: SDK setup, endpoint behavior, error tracking, persons, groups, feature flags, signing, and enrichment.
- Import Existing PostHog Data: host-side backfill importer for existing PostHog projects.
- Data Model: event and person row shapes plus DuckDB/R2 SQL query examples.
models/: semantic model definitions for events, sessions, pageviews, persons, identity, groups, attribution, retention, error tracking, and shared metrics.
flowchart TB
SDKs["PostHog SDKs"]
Importer["PostHog Importer"]
SDKs -->|"ingest"| Worker
SDKs -->|"flags/decide"| Worker
Importer -->|"backfill"| EventsPipeline
Importer -->|"person snapshots"| PersonsPipeline
subgraph CF["Cloudflare Workers"]
Worker["Hogflare Worker"]
subgraph DOs["Durable Objects"]
PersonsDO["Persons DO"]
PersonIdDO["PersonID DO<br/>(seq counter)"]
GroupsDO["Groups DO"]
end
Worker <-.->|"read/write"| PersonsDO
Worker <-.->|"read/write"| GroupsDO
PersonsDO -.-> PersonIdDO
end
Worker -->|"events"| EventsPipeline["Events Pipeline"]
Worker -->|"person snapshots"| PersonsPipeline["Persons Pipeline"]
EventsPipeline --> EventsR2["R2 Data Catalog<br/>events table"]
PersonsPipeline --> PersonsR2["R2 Data Catalog<br/>persons table"]
WebUI["Authenticated reviewer UI"] --> Worker
Worker -->|"replay queries"| EventsR2
Worker -->|"authenticated analytics and issue queries"| Query["Native query service · SQLCtx / DuckDB"]
Query --> EventsR2
Query --> PersonsR2
Models["Semantic Models<br/>models/*.yml"] --> EventsR2
Models --> PersonsR2
Consumers["DuckDB / R2 SQL / BI"] --> Models
PostHog is a nice-to-use web and product analytics platform. Self-hosting PostHog is prohibitively complex, so most users rely on the cloud offering. Hogflare is for cost-conscious data teams and businesses that want product analytics, session replay, feature flags, identity resolution, and modeled warehouse data in infrastructure they control.
A hobby deployment of PostHog includes postgres, redis, redis7, clickhouse, zookeeper, kafka, worker, web, plugins, proxy, objectstorage, seaweedfs, asyncmigrationscheck, temporal, elasticsearch, temporal-admin-tools, temporal-ui, temporal-django-worker, cyclotron-janitor, capture, replay-capture, property-defs-rs, livestream, feature-flags, and cymbal.
PostHog does much more than Hogflare, but many teams do not need to run PostHog's entire application stack to get useful web and product analytics, error tracking, and session replay. Hogflare keeps the SDK integration familiar while making Cloudflare Pipelines, R2 Data Catalog, and Iceberg the system of record.
The repo includes a local replay fixture that makes the explorer usable without Cloudflare credentials:
REPLAY_DEMO_PORT=4666 bun scripts/replay_demo_stub.mjsAPP_ADDR=127.0.0.1:4567 \
POSTHOG_API_KEY=phc_demo \
HOGFLARE_ALLOW_LOCAL_REVIEW=1 \
CLOUDFLARE_PIPELINE_ENDPOINT=http://127.0.0.1:4666/ \
HOGFLARE_REPLAY_ACCOUNT_ID=demo-account \
HOGFLARE_REPLAY_BUCKET=demo-bucket \
HOGFLARE_REPLAY_R2_SQL_TOKEN=demo-token \
HOGFLARE_REPLAY_R2_SQL_ENDPOINT=http://127.0.0.1:4666/ \
HOGFLARE_REPLAY_EVENTS_TABLE=default.hogflare_events \
HOGFLARE_REPLAY_QUERY_LIMIT=500 \
cargo run --bin hogflareOpen:
http://127.0.0.1:4567/replay?api_key=phc_demo&distinct_id=replay-user&limit=100&session_id=demo-session-1&at_ms=1500

