On this page

Monitoring the SDK

Monitor Statsig SDK health from the Statsig console, including initialization success rate, evaluation latency, network errors, and version adoption.

This latest release of structured logging and metrics is available for the Python SDK only. Want it in another? Reach out in the Support Slack.

SDK metrics

Some Statsig SDKs provide built-in metrics to help you monitor performance and impact on your application. The specific implementation varies by programming language. Refer to the documentation for the language-specific SDK interface.

Metric interface methods

The following interface methods are provided by the Statsig SDK to track various metrics:

  • Initialization (init): Called on SDK initialization. Allows you to initialize your observability client (such as StatsD or OpenTelemetry), preparing the SDK to send metrics and logs to the chosen observability tool.
  • Shutdown (shutdown): Called on SDK shutdown. Allows you to perform any actions to ensure a graceful shutdown of the observability client, such as ensuring that pending metrics or logs are sent before the SDK stops.
  • Counter: Tracks occurrences of specific events.
  • Gauge: Records point-in-time values, such as the number of active connections or other metrics that don’t accumulate over time.
  • Distribution: Tracks distributions of numerical data over time, such as latency or response times.
  • Should Enable High Cardinality Tags: Called for high cardinality tags. Allows you to define whether certain high cardinality tags (which can generate large data volumes) should be enabled for detailed tracking. By default, Statsig disables all high cardinality tags.

List of metrics

The SDK provides the following primary metrics:

  • Statsig prefixes all metrics with statsig.sdk., for example, the full initialization metric name in your integration is statsig.sdk.initialization.
  • While sdk_exceptions_count metric captures all exceptions, certain errors (e.g., temporary network connectivity issues or timeouts) occasionally occur and generally don't indicate a problem. Use this metric to identify unexpected or persistent issues that may require investigation.
  • Tags marked with * (such as lcut and prev_lcut) are high cardinality tags.

Metric tags

High cardinality tags can generate large data dimensions when enabled. Statsig disables these tags by default, but you can enable them through the Should Enable High Cardinality Tags method on the observability client interface. High cardinality tags include:

  • lcut: The last configuration update timestamp.
  • prev_lcut: The previous configuration update timestamp.

Metric Tags:

  • source: The source of the configuration update, such as network/bootstrap/datastore.
  • source_api: The API endpoint used to fetch the configuration update.
  • success: Indicates whether the initialization was successful.
  • store_populated: Indicates whether the configuration store was populated.

Was this helpful?