Statsig

Send logs and metrics to Statsig using the OpenTelemetry Protocol (OTLP) HTTP exporter.

Statsig is a feature management platform that enables teams to deploy and manage features safely with built-in observability. Integrate your telemetry with Statsig to correlate feature flag behavior with system performance and user experience metrics.

Supported Telemetry Types

Telemetry Type
Supported

Traces

Metrics

Logs

Prerequisites

Before configuring the Statsig (OTLP) destination, ensure you have:

  • A Statsig account with OTLP receiver configured

  • Your Statsig API Key (from Settings > Keys & Environments in your Statsig Console)

  • The Statsig OTLP endpoint URL

  • Network connectivity from your Bindplane agent to Statsig's OTLP receiver

  • At least logs or metrics enabled in your telemetry pipeline

For help with Statsig setup and OTLP configuration, see the Statsig documentation.

Configuration

Basic Configuration

The minimum configuration requires the endpoint URL and API Key for authentication.

Parameters:

Parameter
Type
Default
Description
Required

Endpoint URL

String

https://api.statsig.com/otlp

OTLP endpoint URL for Statsig ingestion

Yes

API Key

String

-

API Key for authenticating with Statsig

Yes


Advanced Configuration

Compression

Control how telemetry is compressed before transmission.

Parameter
Type
Default
Description
Required

Compression

Selector

gzip

Compression algorithm to use for telemetry batches

Yes

Supported Compression Algorithms:

  • gzip (default): High compression ratio with good performance

  • none: No compression (use only for low-latency requirements or already-compressed connections)

General Settings

Settings for controlling log processing and timeout behavior.

Parameter
Type
Default
Description
Required

Drop Raw Copy

Boolean

true

Drop the raw copy of the log record stored in log.record.original

No

Timeout

Integer

30

Timeout in seconds for sending batches to Statsig

Yes

Retry and Queuing

This destination supports the following retry and queuing settings:

Parameter
Type
Default
Description

Enable Retry on Failure

Boolean

true

Enable retry on failure

Initial Interval

Integer

5

Initial retry interval in seconds

Max Interval

Integer

30

Maximum retry interval in seconds

Max Elapsed Time

Integer

300

Maximum total retry time in seconds

Enable Sending Queue

Boolean

true

Enable sending queue for buffering

Number of Consumers

Integer

10

Number of queue consumers

Queue Size

Integer

5000

Maximum queue size in batches

Enable Persistent Queuing

Boolean

true

Enable persistent disk-based queuing

Persistent Queue Directory

String

${OIQ_OTEL_COLLECTOR_HOME}/storage

Directory for persistent queue storage

Synchronize Persistent Queue to Disk

Boolean

false

Synchronize persistent queue to disk for data integrity

For more information, see Retry and Queuing Configuration.

Examples

Basic Configuration (Logs and Metrics)

This example configures the destination to send logs and metrics to Statsig.

apiVersion: bindplane.observiq.com/v1
kind: Destination
metadata:
  id: statsig
  name: Statsig
spec:
  type: statsig
  parameters:
    - name: endpoint_url
      value: 'https://api.statsig.com/otlp'
    - name: api_key
      value: 'your-api-key-here'

Metrics Only with Compression

This example configures the destination to send only metrics with optimized compression.

apiVersion: bindplane.observiq.com/v1
kind: Destination
metadata:
  id: statsig-metrics
  name: Statsig (Metrics)
spec:
  type: statsig
  parameters:
    - name: endpoint_url
      value: 'https://api.statsig.com/otlp'
    - name: api_key
      value: 'your-api-key-here'
    - name: compression
      value: 'gzip'
    - name: drop_raw_copy
      value: true
    - name: timeout
      value: 30

High-Volume Configuration with Persistent Queuing

This example demonstrates a configuration optimized for high-volume telemetry with data durability.

apiVersion: bindplane.observiq.com/v1
kind: Destination
metadata:
  id: statsig-production
  name: Statsig (Production)
spec:
  type: statsig
  parameters:
    - name: endpoint_url
      value: 'https://api.statsig.com/otlp'
    - name: api_key
      value: 'your-api-key-here'
    - name: compression
      value: 'gzip'
    - name: drop_raw_copy
      value: true
    - name: timeout
      value: 30
    - name: retry_on_failure_enabled
      value: true
    - name: retry_on_failure_initial_interval
      value: 5
    - name: retry_on_failure_max_interval
      value: 30
    - name: retry_on_failure_max_elapsed_time
      value: 300
    - name: sending_queue_enabled
      value: true
    - name: sending_queue_num_consumers
      value: 10
    - name: sending_queue_queue_size
      value: 5000
    - name: persistent_queue_enabled
      value: true
    - name: persistent_queue_fsync
      value: true

Low-Latency Configuration

This example demonstrates a configuration optimized for low-latency telemetry delivery without compression overhead.

apiVersion: bindplane.observiq.com/v1
kind: Destination
metadata:
  id: statsig-low-latency
  name: Statsig (Low Latency)
spec:
  type: statsig
  parameters:
    - name: endpoint_url
      value: 'https://api.statsig.com/otlp'
    - name: api_key
      value: 'your-api-key-here'
    - name: compression
      value: 'none'
    - name: timeout
      value: 15
    - name: sending_queue_enabled
      value: true
    - name: sending_queue_queue_size
      value: 2000
    - name: sending_queue_num_consumers
      value: 5

Configuration Tips

API Key Management

  • API keys are found in your Statsig Console under Settings > Keys & Environments

  • Keep API keys secure; use environment variables or secret management systems

  • Store credentials in a secure location and never commit them to version control

  • Rotate API keys periodically according to your security policy

  • Use key restrictions and permissions to limit access to only necessary resources

Endpoint Configuration

  • Default endpoint: https://api.statsig.com/otlp

  • Use the correct endpoint for your Statsig deployment (cloud, on-premises, or custom)

  • Verify endpoint URL is accessible from your Bindplane agent

  • Test connectivity before production deployment

Compression Selection

  • Use gzip (default) for most deployments to reduce bandwidth usage

  • Use none only if you have specific low-latency requirements

  • Compression reduces network bandwidth at the cost of CPU usage on the collector

  • Monitor network metrics to determine optimal compression settings

Feature Flag Correlation

  • Correlate metrics and logs with Statsig feature flags using attribute mapping

  • Include feature flag state in log records using processors

  • Tag metrics with feature flag dimensions for advanced analysis in Statsig

Monitoring Telemetry Flow

  • View logs and metrics in Statsig Console under Logs Explorer and Metrics Explorer

  • Monitor telemetry ingestion rates to track collection health

  • Set up alerts for telemetry ingestion failures or anomalies

  • Use Statsig's built-in dashboards to visualize observability data

Security Best Practices

  • Store API keys securely using environment variables or secret management systems

  • Regularly rotate API keys per your security policy

  • Use Statsig's principle of least privilege for key permissions

  • Monitor key usage for suspicious activity

  • Never share API keys outside your organization

  • Use TLS for all connections to Statsig endpoints

Performance Tuning

  • Increase Queue Size for high-volume telemetry collection

  • Adjust Number of Consumers based on available CPU and network bandwidth

  • Enable Persistent Queuing for mission-critical telemetry

  • Enable Synchronize Persistent Queue to Disk in critical environments for data durability

  • Monitor queue depth to identify capacity issues before they occur


Troubleshooting

Connection Refused or Timeout

Symptoms: Telemetry is not being sent; connection timeout errors in logs.

Solutions:

  1. Verify the endpoint URL is correct and accessible

  2. Test network connectivity: curl -I https://api.statsig.com/otlp

  3. Verify firewall rules allow outbound HTTPS traffic to Statsig

  4. Check DNS resolution for Statsig endpoint

  5. Verify internet connectivity from your Bindplane agent

Authentication Failures

Symptoms: "401 Unauthorized" or authentication errors in logs.

Solutions:

  1. Verify the API key is correct and valid

  2. Check that the API key hasn't been revoked or expired

  3. Ensure the API key has appropriate permissions for OTLP ingestion

  4. Verify the API key is correctly configured in the destination parameters

  5. Check Statsig Console for API key status and permissions

  6. Try regenerating the API key in Statsig Console if issues persist

Telemetry Not Appearing

Symptoms: Telemetry is sent but doesn't appear in Statsig or queries fail.

Solutions:

  1. Verify logs and metrics are being generated by your sources

  2. Check that telemetry is being routed to the Statsig destination

  3. Verify both logs and metrics are configured for ingestion in Statsig

  4. Check Statsig Console > Logs Explorer and Metrics Explorer for data arrival

  5. Ensure telemetry contains required fields and proper formatting

  6. Review Statsig ingestion logs for parsing or validation errors

High Queue Depth

Symptoms: Sending queue is consistently full; telemetry may be dropped if persistent queuing is disabled.

Solutions:

  1. Verify Statsig endpoint is accessible and responding

  2. Check network latency and bandwidth to Statsig

  3. Increase Queue Size to buffer more telemetry

  4. Increase Number of Consumers to process batches faster

  5. Enable Persistent Queuing to prevent data loss during outages

  6. Monitor telemetry volume and consider sampling if consistently over capacity

Performance Issues

Symptoms: High CPU or memory usage; slow telemetry ingestion; delays in data arrival.

Solutions:

  1. Monitor Bindplane agent CPU and memory usage

  2. Consider reducing telemetry volume at the source (sampling, filtering)

  3. Disable compression (set to none) if CPU is the bottleneck

  4. Verify network connectivity and bandwidth to Statsig

  5. Adjust Number of Consumers based on available resources

  6. Disable Synchronize Persistent Queue to Disk if enabled (unless data integrity is critical)

Data Loss

Symptoms: Telemetry is dropped after restarts or network outages.

Solutions:

  1. Enable Persistent Queuing to survive service restarts

  2. Verify persistent queue directory exists and has write permissions

  3. Monitor queue size to ensure it's not overflowing

  4. Enable Retry on Failure to handle transient failures

  5. Check available disk space for persistent queue storage

  6. For critical environments, enable Synchronize Persistent Queue to Disk

  7. Review Bindplane logs for exporter errors or capacity issues

API Key Issues

Symptoms: Frequent authentication failures or unpredictable failures.

Solutions:

  1. Regenerate the API key in Statsig Console

  2. Update the destination configuration with the new API key

  3. Verify the new API key immediately after creation

  4. Check API key rotation policies and schedule regular updates

  5. Review Statsig Console audit logs for key usage and changes

  6. Ensure no rate limiting issues from API key


Last updated

Was this helpful?