← Back to Pull requests

feat(aiobotocore): data streams monitoring for SQS, SNS and Kinesis #21994

Closed
unknown closed this pull request without merging on Nov 25, 2026 22:47 UTC
View on GitHub
unknown unknown commented on Nov 20, 2026 19:09 UTC
Author

Description

aiobotocore (and aioboto3) calls to SQS, SNS and Kinesis produced spans but no Data Streams Monitoring checkpoints, and wrote no pathway context into messages. Pathways broke at every aiobotocore hop.

With DSM enabled, the aiobotocore wrapper now dispatches the same core events botocore does around SendMessage(Batch), ReceiveMessage, Publish(Batch), PutRecord(s) and GetRecords. It reuses botocore's injectors and DSM handlers unchanged; Kinesis GetRecords dispatch moves into dispatch_received_records, shared by both. GetRecords calls that name no stream are skipped.

The DSM processor now keeps the current pathway in a ContextVar instead of a thread-local. Concurrent asyncio tasks on one thread no longer share a pathway (this also affects aiokafka); threads behave as before.

Testing

  • New tests/contrib/aiobotocore/test_dsm.py (moto): SQS, SNS → SQS and Kinesis out → in linkage; concurrent tasks keep their own pathway (fails on the thread-local version); DSM off leaves messages unchanged.

  • aiobotocore suite on latest and 1.0; aiokafka, kafka and kombu suites pass.

  • End to end against a real agent with LocalStack: aiobotocore, aioboto3 and boto3 apps chained both ways link on every hop.
  • Risks

    With DSM on, aiobotocore adds the _datadog SQS/SNS attribute and rewrites JSON Kinesis data, as botocore does.

    🤖 Generated with Claude Code

    Diff: 177 lines (+132 / -45) across 2 files Reviewer: wconti27 Review duration: 7417m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.35) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.35 · 177 lines diff across 2 files
    0.35
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.310
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #21994"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 35.4% (MEDIUM) · Higher = larger blast radius
    35.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14% · Safe to merge
    14%