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 theAIC_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.
- 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.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
Performance
Voice Activity Detection
Audio Quality
Deployment Examples
- Grafana
- Datadog
- New Relic
- OTel Collector
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, andmodel.id. - If your collector is unreachable, export attempts for that interval fail and are dropped by the OTel exporter. Audio processing continues.
Troubleshooting
Metrics are not appearing in my backend
Metrics are not appearing in my backend
- Verify that
AIC_SDK_OTEL_ENABLE=1is set in the environment where the SDK runs. - Confirm
OTEL_EXPORTER_OTLP_ENDPOINTpoints to a reachable OTLP endpoint. - Check firewall rules and network connectivity between your application and the collector.
How often are metrics exported?
How often are metrics exported?
Metrics are exported according to the
export_interval_ms field on AicOtelConfig (default: 60s when set to 0).What is the exporter timeout?
What is the exporter timeout?
The export timeout is controlled by
OTEL_METRIC_EXPORT_TIMEOUT (default: 30s).