Ingesting Open Telemetry Logs and Metrics into Statsig
Setting up OTEL can be tricky, if you have any questions, feel free to reach out to us on slack!
Overview
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
Our recommend setup follows the official OpenTelemetry Kubernetes guide to install the OpenTelemetry Collector in both DaemonSet and Deployment modes, using the official Helm Chart. Note: You'll find well-tested and ready-to-use values.yaml
files for both deployments modes 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.
We recommend configuring these receivers at the minimum, for a useful observability platform for your kubernetes workloads powered by Statsig. We make use of the powerful Presets provided by the official chart, but also customize some components as can be seen in the sample values files in Step 3.
- Minimum for scraping logs:
- Minimum for scraping kubernetes metrics
- Minimum for metrics about Otel Collector itself
- OTLP Receiver for scraping internal metrics (alternatively scraped through prometheus receiver)
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 the scraped telemetry to the Statsig endpoint via the official otlphttp
exporter.
Authentication
Requests are authenticated using request header statsig-api-key
and a valid SDK Server Secret key generated from console.statsig.com (under Settings > Keys & Environments). It is recommended to keep your secret key secure with a Kubernetes Secret management provider and make it available to access securely from the open telemetry collector pod’s environment.
Example Exporter Config
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
We provide two complete and tested values.yaml
configurations for use with the OpenTelemetry Helm charts:
🔗 Deployment Collector
🔗 DaemonSet Collector
Use them with the Helm chart version 0.75.1
like this:
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:
kubectl get pods -n otel
Check logs for a specific collector pod and confirm there are errors reported:
kubectl logs -n otel $pod_name
5. Explore
Explore your Logs and Metrics at console.statsig.com with the Logs Explorer and Metrics Explorer products under Analytics on the sidebar menu 🙂