From 7a09d8e6d130e061e2d75fe24bbb4a3559603938 Mon Sep 17 00:00:00 2001 From: "ask-bonk[bot]" Date: Mon, 27 Jul 2026 01:42:15 +0000 Subject: [PATCH 1/2] Add Statsig OTel destination for Workers Co-authored-by: irvinebroque --- .../exporting-opentelemetry-data/index.mdx | 1 + .../exporting-opentelemetry-data/statsig.mdx | 104 ++++++++++++++++++ .../workers/observability/traces/index.mdx | 4 +- 3 files changed, 107 insertions(+), 2 deletions(-) create mode 100644 src/content/docs/workers/observability/exporting-opentelemetry-data/statsig.mdx diff --git a/src/content/docs/workers/observability/exporting-opentelemetry-data/index.mdx b/src/content/docs/workers/observability/exporting-opentelemetry-data/index.mdx index 07967834bd2..e48df9f029a 100644 --- a/src/content/docs/workers/observability/exporting-opentelemetry-data/index.mdx +++ b/src/content/docs/workers/observability/exporting-opentelemetry-data/index.mdx @@ -33,6 +33,7 @@ Below are common OTLP endpoint formats for popular observability providers. Refe | [**Axiom**](/workers/observability/exporting-opentelemetry-data/axiom/) | `https://api.axiom.co/v1/traces` | `https://api.axiom.co/v1/logs` | | [**Sentry**](/workers/observability/exporting-opentelemetry-data/sentry/) | `https://{HOST}/api/{PROJECT_ID}/integration/otlp/v1/traces` | `https://{HOST}/api/{PROJECT_ID}/integration/otlp/v1/logs` | | [**PostHog**](/workers/observability/exporting-opentelemetry-data/posthog/) | Not supported | `https://{REGION}.i.posthog.com/i/v1/logs` | +| [**Statsig**](/workers/observability/exporting-opentelemetry-data/statsig/) | `https://api.statsig.com/otlp/v1/traces` | `https://api.statsig.com/otlp/v1/logs` | | [**Datadog**](https://docs.datadoghq.com/opentelemetry/setup/otlp_ingest/managed_platforms/) | `https://cloudflare.integrations.otlp.{DD_SITE}/v1/traces` | `https://cloudflare.integrations.otlp.{DD_SITE}/v1/logs` | | [**New Relic**](https://docs.newrelic.com/docs/opentelemetry/best-practices/opentelemetry-otlp/) | `https://otlp.nr-data.net/v1/traces` | `https://otlp.nr-data.net/v1/logs` | | [**Splunk Observability**](https://dev.splunk.com/observability/reference/api/ingest_data/latest) | `https://ingest.{REALM}.signalfx.com/v2/trace/otlp` | N/A | diff --git a/src/content/docs/workers/observability/exporting-opentelemetry-data/statsig.mdx b/src/content/docs/workers/observability/exporting-opentelemetry-data/statsig.mdx new file mode 100644 index 00000000000..a998a62dc3e --- /dev/null +++ b/src/content/docs/workers/observability/exporting-opentelemetry-data/statsig.mdx @@ -0,0 +1,104 @@ +--- +pcx_content_type: how-to +title: Export to Statsig +description: Send OpenTelemetry traces and logs from Cloudflare Workers to Statsig. +sidebar: + order: 7 +products: + - workers +--- + +import {WranglerConfig} from "~/components"; + +Statsig is an observability and experimentation platform that helps you understand application performance and user behavior. By exporting your Cloudflare Workers application telemetry to Statsig, you can: + +- Visualize traces to understand request flows and identify performance bottlenecks +- Query and analyze logs with rich filtering and aggregation +- Set up alerts and dashboards to monitor your Workers + +This guide will walk you through configuring your Cloudflare Worker application to export OpenTelemetry-compliant traces and logs to Statsig. + +## Prerequisites + +Before you begin, ensure you have: + +- An active [Statsig account](https://console.statsig.com/signup) (free tier available) +- A deployed Worker that you want to monitor + +## Step 1: Get your Statsig Server SDK Secret + +1. Log in to your [Statsig console](https://console.statsig.com/) +2. Navigate to the **Project Settings** page +3. Under **Keys & Environments**, find your environment or create a new one +4. Copy the **Server SDK Secret** - this is used to authenticate OTLP requests + +The secret will look something like: `secret-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` + +## Step 2: Configure Cloudflare destinations + +Now you'll create destinations in the Cloudflare dashboard that point to Statsig. + +### Statsig OTLP endpoints + +Statsig provides separate OTLP endpoints for traces and logs: + +- **Traces**: `https://api.statsig.com/otlp/v1/traces` +- **Logs**: `https://api.statsig.com/otlp/v1/logs` + +### Configure trace destination + +1. Navigate to your Cloudflare account's [Workers Observability](https://dash.cloudflare.com/?to=/:account/workers-and-pages/observability/pipelines) section +2. Click **Add destination** +3. Configure your trace destination: + - **Destination Name**: `statsig-traces` (or any descriptive name) + - **Destination Type**: Select **Traces** + - **OTLP Endpoint**: `https://api.statsig.com/otlp/v1/traces` + - **Custom Headers**: Add the authentication header: + - Header name: `statsig-api-key` + - Header value: Your Statsig Server SDK Secret (e.g., `secret-xxxxx...`) +4. Click **Save** + +### Configure logs destination + +Repeat the process for logs: + +1. Click **Add destination** again +2. Configure your logs destination: + - **Destination Name**: `statsig-logs` (or any descriptive name) + - **Destination Type**: Select **Logs** + - **OTLP Endpoint**: `https://api.statsig.com/otlp/v1/logs` + - **Custom Headers**: Add the authentication header: + - Header name: `statsig-api-key` + - Header value: Your Statsig Server SDK Secret (same as above) +3. Click **Save** + +## Step 3: Configure your Worker + +With your destinations created in the Cloudflare dashboard, update your Worker's configuration to enable telemetry export. + + + +```json +{ + "observability": { + "traces": { + "enabled": true, + // Must match the destination name in the dashboard + "destinations": ["statsig-traces"] + }, + "logs": { + "enabled": true, + // Must match the destination name in the dashboard + "destinations": ["statsig-logs"] + } + } +} +``` + + + +After updating your configuration, deploy your Worker for the changes to take effect. + +:::note +It may take a few minutes after deployment for data to appear in Statsig. +::: diff --git a/src/content/docs/workers/observability/traces/index.mdx b/src/content/docs/workers/observability/traces/index.mdx index 1503a0db215..6627c2ed890 100644 --- a/src/content/docs/workers/observability/traces/index.mdx +++ b/src/content/docs/workers/observability/traces/index.mdx @@ -64,8 +64,8 @@ You can configure tracing by setting `observability.traces.enabled = true` in yo ### Exporting OpenTelemetry traces to a 3rd party destination Workers tracing follows [OpenTelemetry (OTel) standards](https://opentelemetry.io/). This makes it compatible with popular observability platforms, -such as [Honeycomb](/workers/observability/exporting-opentelemetry-data/honeycomb/), [Grafana Cloud](/workers/observability/exporting-opentelemetry-data/grafana-cloud/), and -[Axiom](/workers/observability/exporting-opentelemetry-data/axiom/), while requiring zero development effort from you. If your observability provider has an available OpenTelemetry endpoint, you can export traces (and logs)! +such as [Honeycomb](/workers/observability/exporting-opentelemetry-data/honeycomb/), [Grafana Cloud](/workers/observability/exporting-opentelemetry-data/grafana-cloud/), +[Axiom](/workers/observability/exporting-opentelemetry-data/axiom/), and [Statsig](/workers/observability/exporting-opentelemetry-data/statsig/), while requiring zero development effort from you. If your observability provider has an available OpenTelemetry endpoint, you can export traces (and logs)! You can also set `persist: false` to export traces to your destination without persisting them in the Cloudflare dashboard. This allows you to use a third-party observability provider as your sole traces destination. From 10ab903971c8f87af9d606ae1ebbdefcf4e35c7b Mon Sep 17 00:00:00 2001 From: Brendan Irvine-Broque Date: Sat, 5 Sep 2026 09:38:11 -0700 Subject: [PATCH 2/2] [Workers] Limit Statsig docs to destinations table --- .../exporting-opentelemetry-data/index.mdx | 2 +- .../exporting-opentelemetry-data/statsig.mdx | 104 ------------------ .../workers/observability/traces/index.mdx | 4 +- 3 files changed, 3 insertions(+), 107 deletions(-) delete mode 100644 src/content/docs/workers/observability/exporting-opentelemetry-data/statsig.mdx diff --git a/src/content/docs/workers/observability/exporting-opentelemetry-data/index.mdx b/src/content/docs/workers/observability/exporting-opentelemetry-data/index.mdx index e48df9f029a..c44abb9751b 100644 --- a/src/content/docs/workers/observability/exporting-opentelemetry-data/index.mdx +++ b/src/content/docs/workers/observability/exporting-opentelemetry-data/index.mdx @@ -33,7 +33,7 @@ Below are common OTLP endpoint formats for popular observability providers. Refe | [**Axiom**](/workers/observability/exporting-opentelemetry-data/axiom/) | `https://api.axiom.co/v1/traces` | `https://api.axiom.co/v1/logs` | | [**Sentry**](/workers/observability/exporting-opentelemetry-data/sentry/) | `https://{HOST}/api/{PROJECT_ID}/integration/otlp/v1/traces` | `https://{HOST}/api/{PROJECT_ID}/integration/otlp/v1/logs` | | [**PostHog**](/workers/observability/exporting-opentelemetry-data/posthog/) | Not supported | `https://{REGION}.i.posthog.com/i/v1/logs` | -| [**Statsig**](/workers/observability/exporting-opentelemetry-data/statsig/) | `https://api.statsig.com/otlp/v1/traces` | `https://api.statsig.com/otlp/v1/logs` | +| [**Statsig**](https://docs.statsig.com/infra-analytics/getting-started) | `https://api.statsig.com/otlp/v1/traces` | `https://api.statsig.com/otlp/v1/logs` | | [**Datadog**](https://docs.datadoghq.com/opentelemetry/setup/otlp_ingest/managed_platforms/) | `https://cloudflare.integrations.otlp.{DD_SITE}/v1/traces` | `https://cloudflare.integrations.otlp.{DD_SITE}/v1/logs` | | [**New Relic**](https://docs.newrelic.com/docs/opentelemetry/best-practices/opentelemetry-otlp/) | `https://otlp.nr-data.net/v1/traces` | `https://otlp.nr-data.net/v1/logs` | | [**Splunk Observability**](https://dev.splunk.com/observability/reference/api/ingest_data/latest) | `https://ingest.{REALM}.signalfx.com/v2/trace/otlp` | N/A | diff --git a/src/content/docs/workers/observability/exporting-opentelemetry-data/statsig.mdx b/src/content/docs/workers/observability/exporting-opentelemetry-data/statsig.mdx deleted file mode 100644 index a998a62dc3e..00000000000 --- a/src/content/docs/workers/observability/exporting-opentelemetry-data/statsig.mdx +++ /dev/null @@ -1,104 +0,0 @@ ---- -pcx_content_type: how-to -title: Export to Statsig -description: Send OpenTelemetry traces and logs from Cloudflare Workers to Statsig. -sidebar: - order: 7 -products: - - workers ---- - -import {WranglerConfig} from "~/components"; - -Statsig is an observability and experimentation platform that helps you understand application performance and user behavior. By exporting your Cloudflare Workers application telemetry to Statsig, you can: - -- Visualize traces to understand request flows and identify performance bottlenecks -- Query and analyze logs with rich filtering and aggregation -- Set up alerts and dashboards to monitor your Workers - -This guide will walk you through configuring your Cloudflare Worker application to export OpenTelemetry-compliant traces and logs to Statsig. - -## Prerequisites - -Before you begin, ensure you have: - -- An active [Statsig account](https://console.statsig.com/signup) (free tier available) -- A deployed Worker that you want to monitor - -## Step 1: Get your Statsig Server SDK Secret - -1. Log in to your [Statsig console](https://console.statsig.com/) -2. Navigate to the **Project Settings** page -3. Under **Keys & Environments**, find your environment or create a new one -4. Copy the **Server SDK Secret** - this is used to authenticate OTLP requests - -The secret will look something like: `secret-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` - -## Step 2: Configure Cloudflare destinations - -Now you'll create destinations in the Cloudflare dashboard that point to Statsig. - -### Statsig OTLP endpoints - -Statsig provides separate OTLP endpoints for traces and logs: - -- **Traces**: `https://api.statsig.com/otlp/v1/traces` -- **Logs**: `https://api.statsig.com/otlp/v1/logs` - -### Configure trace destination - -1. Navigate to your Cloudflare account's [Workers Observability](https://dash.cloudflare.com/?to=/:account/workers-and-pages/observability/pipelines) section -2. Click **Add destination** -3. Configure your trace destination: - - **Destination Name**: `statsig-traces` (or any descriptive name) - - **Destination Type**: Select **Traces** - - **OTLP Endpoint**: `https://api.statsig.com/otlp/v1/traces` - - **Custom Headers**: Add the authentication header: - - Header name: `statsig-api-key` - - Header value: Your Statsig Server SDK Secret (e.g., `secret-xxxxx...`) -4. Click **Save** - -### Configure logs destination - -Repeat the process for logs: - -1. Click **Add destination** again -2. Configure your logs destination: - - **Destination Name**: `statsig-logs` (or any descriptive name) - - **Destination Type**: Select **Logs** - - **OTLP Endpoint**: `https://api.statsig.com/otlp/v1/logs` - - **Custom Headers**: Add the authentication header: - - Header name: `statsig-api-key` - - Header value: Your Statsig Server SDK Secret (same as above) -3. Click **Save** - -## Step 3: Configure your Worker - -With your destinations created in the Cloudflare dashboard, update your Worker's configuration to enable telemetry export. - - - -```json -{ - "observability": { - "traces": { - "enabled": true, - // Must match the destination name in the dashboard - "destinations": ["statsig-traces"] - }, - "logs": { - "enabled": true, - // Must match the destination name in the dashboard - "destinations": ["statsig-logs"] - } - } -} -``` - - - -After updating your configuration, deploy your Worker for the changes to take effect. - -:::note -It may take a few minutes after deployment for data to appear in Statsig. -::: diff --git a/src/content/docs/workers/observability/traces/index.mdx b/src/content/docs/workers/observability/traces/index.mdx index 6627c2ed890..1503a0db215 100644 --- a/src/content/docs/workers/observability/traces/index.mdx +++ b/src/content/docs/workers/observability/traces/index.mdx @@ -64,8 +64,8 @@ You can configure tracing by setting `observability.traces.enabled = true` in yo ### Exporting OpenTelemetry traces to a 3rd party destination Workers tracing follows [OpenTelemetry (OTel) standards](https://opentelemetry.io/). This makes it compatible with popular observability platforms, -such as [Honeycomb](/workers/observability/exporting-opentelemetry-data/honeycomb/), [Grafana Cloud](/workers/observability/exporting-opentelemetry-data/grafana-cloud/), -[Axiom](/workers/observability/exporting-opentelemetry-data/axiom/), and [Statsig](/workers/observability/exporting-opentelemetry-data/statsig/), while requiring zero development effort from you. If your observability provider has an available OpenTelemetry endpoint, you can export traces (and logs)! +such as [Honeycomb](/workers/observability/exporting-opentelemetry-data/honeycomb/), [Grafana Cloud](/workers/observability/exporting-opentelemetry-data/grafana-cloud/), and +[Axiom](/workers/observability/exporting-opentelemetry-data/axiom/), while requiring zero development effort from you. If your observability provider has an available OpenTelemetry endpoint, you can export traces (and logs)! You can also set `persist: false` to export traces to your destination without persisting them in the Cloudflare dashboard. This allows you to use a third-party observability provider as your sole traces destination.