On this page

Ingesting Open Telemetry Data

Instrument Statsig server SDKs with OpenTelemetry to capture spans, metrics, and logs for SDK initialization, evaluation, and event logging.

Setting up OTEL can be complex. If you have questions, contact us on Slack.

How OpenTelemetry integration works

This guide walks you through setting up the OpenTelemetry Collector in your Kubernetes environment and configuring it to send telemetry data to Statsig using the official otlphttp exporter.


✅ Prerequisites

  • A running Kubernetes cluster (e.g., GKE, EKS, Minikube, etc.)
  • Helm installed, or another mechanism to apply helm charts to your cluster, like ArgoCD
  • API Access to a Statsig project with a Server SDK Secret Key
  • Optional: kubectl configured and connected to the cluster, for validating and debugging setup

1. Setup OpenTelemetry Collector on Kubernetes

The recommended setup follows the official OpenTelemetry Kubernetes guide to install the OpenTelemetry Collector in both DaemonSet and Deployment modes using the official Helm chart. Tested values.yaml files for both deployment modes are available in Step 3.

📘 Official Guide:

OpenTelemetry Collector for Kubernetes – Getting Started

Why both?

  • DaemonSet Collector: Runs one instance per node to collect host-level telemetry (e.g., logs, pod and node metrics).
  • Deployment Collector: Runs one instance per cluster to gather telemetry related to the cluster as a whole.
Configure at least the receivers below for a useful Statsig-powered observability platform for your Kubernetes workloads. The setup uses Presets from the official chart and customizes some components, as shown in the sample values files in Step 3.

2. Configure exporting telemetry to Statsig with OTLP HTTP Exporter

Statsig supports receiving OTLP-formatted, JSON-encoded telemetry at the endpoint https://api.statsig.com/otlp. The OpenTelemetry Collector supports sending telemetry to the Statsig endpoint using the official otlphttp exporter.

Authentication

Requests are authenticated using the request header statsig-api-key and a valid SDK Server Secret key generated from console.statsig.com (under Settings > Keys & Environments). Keep your secret key secure using a Kubernetes Secret management provider and make it available to the OpenTelemetry collector pod’s environment.

Example Exporter Config

yaml
exporters:
  otlphttp:
    endpoint: https://api.statsig.com/otlp
    encoding: json
    headers:
      statsig-api-key: ${env:STATSIG_SERVER_SDK_SECRET}

3. Example Helm Chart Values for a quick and correct setup

The following two complete and tested values.yaml configurations work with the OpenTelemetry Helm charts:

🔗 Deployment Collector

👉 values-gateway.yaml

🔗 DaemonSet Collector

👉 values-agent.yaml

Use them with the Helm chart version 0.75.1 like this:

yaml
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm repo update

# Install Deployment Collector
helm install otel-deployment open-telemetry/opentelemetry-collector \
  --version 0.75.1 \
  -f values-gateway.yaml -n otel --create-namespace

# Install DaemonSet Collector
helm install otel-daemonset open-telemetry/opentelemetry-collector \
  --version 0.75.1 \
  -f values-agent.yaml -n otel

4. Verify the Setup

Check that all pods are running:

bash
kubectl get pods -n otel

Check logs for a specific collector pod and confirm no errors are reported:

bash
kubectl logs -n otel $pod_name

5. Explore

Explore your logs and metrics at console.statsig.com using the Logs Explorer and Metrics Explorer products under Analytics in the sidebar.

🔗 Resources

Was this helpful?