Skip to main content

Overview

Core SDK 0.24.0 can export operational metrics through OpenTelemetry (OTel) to your collector. Use them alongside application logs to investigate processing time, usage and audio conditions. Metrics alone do not establish audio quality or authorization.
This export is separate from product telemetry sent to ai-coustics.

What is OpenTelemetry?

OpenTelemetry is a vendor-neutral, open-source framework for collecting metrics, traces and logs. Its collector forwards data to your observability backend. The ai-coustics SDK exports metrics only through this pipeline.

Configuration

Set AIC_SDK_OTEL_ENABLE=1 and the OpenTelemetry endpoint variables in your runtime environment, then restart the service. No integration code changes are required.
The SDK exports metrics using the OpenTelemetry Protocol (OTLP) over HTTP with Protobuf encoding. It registers all instruments under:
  • Service name: aic-sdk
  • Meter name: aic_usage
OTel metrics export requires a native SDK build; WebAssembly is unsupported.
The api.key attribute is a SHA-256 hash of the credential identifier used by the session. It is not the raw SDK key or bearer token. Hashes and session IDs can still correlate activity: restrict access, avoid personal data in custom session IDs and apply your retention policy.

Environment variables

Set export_interval_ms on the AicOtelConfig passed to aic_processor_create. A value of 0 uses the default of 60,000 ms.
See the OTLP exporter configuration for standard endpoint and header settings. The SDK uses its own per-instance export interval; do not assume every generic OpenTelemetry SDK variable applies.

Use OpenTelemetry with Pipecat

The Pipecat quickstart uses pipecat-ai==1.11.0 with aic-sdk==3.1.0 (core SDK 0.23.0). Its AICFilter reads the native SDK’s environment configuration when it creates a processor. The same environment configuration applies to AICQuailVADAnalyzer when it creates its voice activity detection (VAD) session.

Set the bot’s environment

Start the local collector in a separate terminal. In the terminal that runs bot.py, activate your Pipecat environment and set:
Keep the AIC_SDK_LICENSE setup from the quickstart. To use a .env file instead, add these lines to the file next to bot.py:
Load .env with Pipecat’s python-dotenv dependency. Add this before the Pipecat imports and filter/VAD creation in bot.py:
Reuse the quickstart’s Path import. With override=False, process variables take precedence over .env. Keep credential files out of version control. Restart the bot, connect the local client and send audio.

Point to your collector

Replace http://127.0.0.1:4318 with the address the bot process can reach. Use the collector’s OTLP/HTTP Protobuf receiver, usually port 4318, rather than gRPC on 4317. The exporter appends /v1/metrics to OTEL_EXPORTER_OTLP_ENDPOINT. For a collector that provides a complete metrics URL, set this instead:
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT overrides the general endpoint without adding a path; unset it to use the general endpoint again. Supply authentication through OTEL_EXPORTER_OTLP_HEADERS or its metrics-specific override, OTEL_EXPORTER_OTLP_METRICS_HEADERS. Store credentials in a secret manager. In Docker or Kubernetes, 127.0.0.1 reaches the bot’s network namespace. For a separate collector container or pod, use a reachable service address, such as http://otel-collector:4318, and bind its receiver to the appropriate interface. Inject the variables into the bot container, not just the host.

Verify receipt

With the client connected, process audio and leave the session running through the default 60-second export interval. In the collector output, look for service.name: aic-sdk, meter aic_usage, the selected model.id and a positive usage.processed value. Send more audio in the same session and confirm that the total increases. Also check the quickstart’s initialization and processing-error signals: audible passthrough alone does not prove that enhancement activated. Pipecat 1.11.0’s filter and VAD analyzer do not expose an otel_config parameter. They use the native SDK’s default interval; OTEL_METRIC_EXPORT_INTERVAL does not change it. The per-processor OtelConfig example below is for direct SDK integrations. These are native SDK metrics. Pipecat’s tracing setup and pipeline metrics flags configure separate instrumentation and are not required to enable this export. If no metrics arrive, check the bot’s effective environment, endpoint path, collector metrics pipeline and network routing before changing audio settings.

Session attributes

Filter and group observations with these attributes:

Metrics reference

Usage

Cumulative session totals exported as gauges in core SDK 0.24.0. Account for new sessions and resets when calculating rates; do not treat these as monotonic counter instruments.

Audio configuration

Gauges reflecting the audio stream configuration for the session. These describe the configured stream; observations are produced when audio is processed.

Processor state

Gauges reflecting the current state of the audio processor.

Additional metrics

Keep the experimental. prefix when querying these metrics in core SDK 0.23.0 and 0.24.0.

Performance

Voice activity detection

Audio quality

Deployment examples

Verify with a local collector

Install the OpenTelemetry Collector and ensure otelcol is on your path. Save the following as otel-collector-config.yaml. This example accepts metrics only from the local host and prints them for inspection.
Start the collector in one terminal:
In the terminal that runs your existing native SDK integration, set:
Run the SDK quickstart with a valid credential and a non-silent input file. Keep the instance alive through an export interval, or finish with the binding’s normal session teardown. For a shorter diagnostic interval in Python 3.2.0, pass this optional configuration when constructing the processor:
After processing, check the collector for service.name: aic-sdk, meter aic_usage, the configured model.id and session totals in usage.processed. For production, replace the debug exporter with your backend’s supported exporter and configure transport security and authentication. Keep collector credentials in your secret manager. In containers, localhost refers to the container itself; use a reachable collector address and bind the receiver appropriately for your network.

Runtime behavior

  • Native sessions share a telemetry executor, while each enabled session has its own metrics pipeline and exporter in core SDK 0.24.0.
  • Observations include session.id, api.key, sdk.version and model.id. Per-session identifiers can create high cardinality; plan aggregation and retention in the collector.
  • An unreachable customer collector causes metrics export failures, independently of SDK authorization and usage reporting. Do not treat the exporter as a durable event log or rely on every interval arriving.
  • Offline-license behavior can differ from online sessions. Verify metric availability for your exact entitlement before depending on it operationally.

Operational diagnostics

Do not log audio or credentials to diagnose these signals. Use a controlled fixture and the troubleshooting guide.

Troubleshooting

  1. Verify AIC_SDK_OTEL_ENABLE=1 before instance creation, and check for a per-instance configuration that overrides it.
  2. Confirm a native build is in use. WebAssembly does not export these metrics.
  3. Process audio; an idle initialized instance is not sufficient.
  4. Check that the collector accepts OTLP/HTTP Protobuf and that its metrics pipeline includes the receiver.
  5. Check container routing, endpoint paths, authentication and firewall rules. Keep the session alive for the configured export interval.
Set export_interval_ms on AicOtelConfig or the binding’s equivalent. A value of 0 selects the default of 60,000 ms. Use a shorter interval for a bounded diagnostic run, then evaluate export overhead before adopting it in production.
Do not rely on OTEL_METRIC_EXPORT_TIMEOUT to bound SDK exports: the SDK manages them directly without a periodic metric reader. Test failure and shutdown timing with your release and collector.