Skip to main content
This is an experimental feature. The API and available metrics may change in future SDK versions. Please reach out to ai-coustics support if you want to use or provide feedback on this functionality.

Overview

The ai-coustics SDK can export operational metrics via OpenTelemetry (OTel), giving you full visibility into audio processing performance, usage, and quality in your own infrastructure.
These metrics are exported to your own observability backend. They are entirely separate from the product telemetry the SDK sends to ai-coustics.

What is OpenTelemetry?

OpenTelemetry is a vendor-neutral, open-source observability framework. It provides a standardized way to collect and export telemetry data (metrics, traces, and logs) from your applications. All major observability platforms support OTel natively, including Grafana, Datadog, New Relic, Honeycomb, and many others. The ai-coustics SDK currently exposes metrics only. Traces and logs are not emitted.

Configuration

To activate the OTel metrics pipeline, set the AIC_SDK_OTEL_ENABLE environment variable to 1. The SDK uses the standard OpenTelemetry environment variables for endpoint configuration. No code changes are required in your SDK integration. Set the variables in your runtime environment and restart your service.
The SDK exports metrics using the OTLP/HTTP protocol with Protobuf encoding. It registers all instruments under:
  • Service name: aic-sdk
  • Meter name: aic_usage
OTel metrics export is not available on WASM targets. It is only supported on native (non-WASM) builds of the SDK.
The api.key attribute attached to every metric observation is a SHA-256 hash of your API key, not the raw key itself. It is safe to store in your telemetry backend.

Environment Variables

The metric export interval is configured per-processor via the export_interval_ms field on AicOtelConfig, passed to aic_processor_create. Set it to 0 to use the default of 60 000 ms.
For a full list of supported environment variables, see the OpenTelemetry SDK Environment Variables specification.

Session Attributes

Every metric observation includes the following attributes, allowing you to filter and group by session, API key, SDK version, or model.

Metrics Reference

Usage

Cumulative counters tracking how much audio has been processed.

Audio Configuration

Gauges reflecting the audio stream configuration for the session. These values are set once during initialization.

Processor State

Gauges reflecting the current state of the audio processor.

Experimental Metrics

Experimental metrics are prefixed with experimental. and may change or be removed in future SDK versions. Do not build critical alerting on these without pinning your SDK version.

Performance

Voice Activity Detection

Audio Quality

Deployment Examples

Point the SDK at a Grafana Alloy instance or an OpenTelemetry Collector that forwards to Grafana Mimir.

Runtime Behavior

  • The OTel pipeline is process-wide: concurrent SDK sessions share one exporter pipeline.
  • Metric observations remain session-specific via attributes such as session.id, api.key, sdk.version, and model.id.
  • If your collector is unreachable, export attempts for that interval fail and are dropped by the OTel exporter. Audio processing continues.

Troubleshooting

  1. Verify that AIC_SDK_OTEL_ENABLE=1 is set in the environment where the SDK runs.
  2. Confirm OTEL_EXPORTER_OTLP_ENDPOINT points to a reachable OTLP endpoint.
  3. Check firewall rules and network connectivity between your application and the collector.
Metrics are exported according to the export_interval_ms field on AicOtelConfig (default: 60s when set to 0).
The export timeout is controlled by OTEL_METRIC_EXPORT_TIMEOUT (default: 30s).