Skip to content

fix(aws): emit streaming STT usage metrics - #6653

Merged
davidzhao merged 3 commits into
livekit:mainfrom
swayamg20:fix/6650-aws-stt-usage-metrics
Aug 2, 2026
Merged

fix(aws): emit streaming STT usage metrics#6653
davidzhao merged 3 commits into
livekit:mainfrom
swayamg20:fix/6650-aws-stt-usage-metrics

Conversation

@swayamg20

@swayamg20 swayamg20 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Fixes #6650

Tracks audio duration after frames are successfully sent to AWS Transcribe and emits recognition usage metrics every five seconds, on segment flush, and when the input stream closes. This makes the standard metrics_collected callback receive streamed STTMetrics for aws.STT.

The credential-free tests cover periodic reporting, multi-frame aggregation during an explicit flush, finalizer reporting when the input channel closes, propagation to the public metrics event, and cleanup when the metrics channel has already closed during shutdown.

Tests:

  • PYTHONPATH="$PWD" uv run pytest tests/test_plugin_aws_stt.py --unit -q
  • make check

@swayamg20
swayamg20 requested a review from a team as a code owner July 31, 2026 16:20
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@davidzhao davidzhao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@davidzhao
davidzhao merged commit 94287fd into livekit:main Aug 2, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

livekit-plugins-aws Transcribe STTMetrics

2 participants