Export to PostHog

Last updated Oct 2, 2026 PostHog provides product analytics, logs, and error tracking. Export Cloudflare logs to correlate them with sessions and events.

PostHog logs view with attributes expanded and a timeline view at the top

This guide configures PostHog to receive Cloudflare logs.

Prerequisites

Before you begin, you need:

1. Get your PostHog project API key

  1. Log in to your PostHog account ↗︎.
  2. Go to Project settings ↗︎.
  3. Find Project API key in the project details.
  4. Copy the project API key.

The project API key starts with phc_.

2. Select your PostHog endpoint

PostHog uses different endpoints for each data region:

Region Logs endpoint
US (default) https://us.i.posthog.com/i/v1/logs
EU https://eu.i.posthog.com/i/v1/logs

Find your region in your PostHog project settings. Your PostHog URL also contains us or eu.

3. Configure a Cloudflare Observability destination

Caution

PostHog accepts logs through its OpenTelemetry Protocol (OTLP) endpoint. It does not accept traces through OTLP.

  1. In the Cloudflare dashboard, go to Observability > Destinations. Go to OpenTelemetry ↗
  2. Select Add destination.
  3. Configure the destination:
  4. Destination name: posthog-logs
  5. Destination type: Logs
  6. OTLP endpoint: Your PostHog regional logs endpoint
  7. Custom header name: Authorization
  8. Custom header value: Bearer <YOUR_PROJECT_API_KEY>
  9. Select Save.

Cloudflare destination configuration for PostHog logs with destination name, type selection, OTLP endpoint, and custom headers

4. Enable export

Creating a destination does not start exporting logs. To export Workers Logs, configure OpenTelemetry export for your Worker. PostHog does not support Workers Traces or Cloudflare Traces through OTLP.

5. View logs in PostHog

  1. Log in to your PostHog account ↗︎.
  2. Go to Logs.
  3. Review exported severity levels, timestamps, and attributes.

You can filter logs by severity, time range, attributes, and keywords.

Troubleshooting

Logs do not appear in PostHog

  1. Verify that the API key starts with phc_.
  2. Confirm that the endpoint matches your PostHog region.
  3. Check the destination status in the Cloudflare dashboard.
  4. Check whether sampling excludes the expected logs.

Fix authentication errors

Confirm that the Authorization value includes the Bearer prefix. Also verify that the project API key remains active.

Alternatively, add the token to the endpoint query string: https://us.i.posthog.com/i/v1/logs?token=<YOUR_PROJECT_API_KEY>.

Was this helpful?

YesNo

On this page

Export to PostHog - 图3Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/observability/export/opentelemetry/posthog/#page","headline":"Export to PostHog","description":"Send Cloudflare logs to PostHog with OpenTelemetry.","url":"https://developers.cloudflare.com/observability/export/opentelemetry/posthog/","inLanguage":"en","image":"https://developers.cloudflare.com/observability/export/opentelemetry/posthog/og.png?v=b04f19c37d80595b","dateModified":"2026-10-02","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Send Cloudflare traces and logs to Sentry with OpenTelemetry. title: Export to Sentry image: https://developers.cloudflare.com/observability/export/opentelemetry/sentry/og.png?v=247022c35dd41725


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/observability/llms.txt
Use this file to discover all available pages before exploring further.