← Back to Pull requests

Add a2a operation metrics to otel semconv #651

Open
polchernikova-w opened this pull request with 1297 lines diff across 18 files
View on GitHub
polchernikova-w polchernikova-w commented on Oct 30, 2026 14:38 UTC
Author

Description

Adds operation metrics for the Agent2Agent (A2A) protocol, following the A2A
spans added in #195.

From metrics, this PR covers operation metrics only: duration and in-flight count of A2A
operations on the client and the server. Streaming metrics (events sent and
received per stream) and task-lifecycle metrics (task state transitions, time
spent in a state, task events) will follow in separate PRs.
It also adds a2a.operation.return_immediately to the A2A spans, so
spans and duration metrics share the same SendMessage attributes.

Part of #254 (#254 stays open for the remaining metrics).

Defines:

| Metric | Instrument | Unit |
| --- | --- | --- |
| a2a.client.operation.duration | Histogram | s |
| a2a.server.operation.duration | Histogram | s |
| a2a.client.operation.active | UpDownCounter | {operation} |
| a2a.server.operation.active | UpDownCounter | {operation} |

Metric attributes:

  • a2a.method.name (required) and a2a.protocol.version on all four metrics.

  • error.type and the new a2a.operation.return_immediately (SendMessage only) on the duration metrics, a2a.client and a2a.server spans and the a2a.http.server / a2a.grpc.server refinements.

  • server.address and server.port on client metrics.
  • The duration windows match the a2a.client and a2a.server spans:
    until the response is received or produced for non-streaming calls, and until
    the last stream event is consumed or sent for streaming calls, or until the operation
    ends with an error. Active operations use the same start and end points. When reported alongside an a2a.client span, the client duration SHOULD equal the span duration.

    error.type reuses the A2A error guidance from #195: the A2A error reason when
    available (for example TASK_NOT_FOUND), then the binding error code, then the
    exception name. To share it between spans and metrics, it moves into a new
    internal a2a.error.attributes group. The generated span docs are unchanged.

    New attributes

  • a2a.operation.return_immediately (boolean): maps to

  • SendMessageConfiguration.returnImmediately. A non-blocking SendMessage
    returns in milliseconds, while a blocking one waits for a terminal or
    interrupted task state, which can take minutes. Without this attribute,
    SendMessage duration percentiles mix the two kinds of call, and a span gives
    no indication why it is short or long. It is recorded on the duration metrics
    and on the A2A spans. It is conditionally required only when the value is
    true; when missing, the value is assumed to be false (the protocol default),
    following the pattern of messaging.destination.temporary and
    messaging.kafka.message.tombstone.

    Naming

    operation.duration (rather than request.duration) follows
    mcp.client.operation.duration / mcp.server.operation.duration in this
    repository. It measures the logical A2A operation, which can span several
    transport requests (retries) or a whole response stream. That keeps it separate
    from http..request.duration and the RPC transport metrics, which stay the
    source of truth for transport-level questions. A2A metrics can't be expressed by
    adding attributes to transport metrics, because A2A instrumentation can't add
    attributes to measurements recorded by HTTP or gRPC instrumentation. With
    JSON-RPC, every method also shares one route, and A2A errors often arrive with
    HTTP 200.

    Motivation

    User journey: incident triage and capacity planning for agent-to-agent
    traffic. These metrics answer:

  • Which A2A operations are slow or failing, per method, and with

  • which A2A error?
  • How long blocking and non-blocking SendMessage calls take, measured separately.

  • How many A2A operations are in flight on a client or server right now

  • (saturation, stuck streams)?

    Spans give per-call detail but are usually sampled. Metrics give unsampled
    rates, latency distributions, and saturation that dashboards and alerts depend on.

    Prior art:

  • MCP operation metrics in this repository (mcp..operation.duration).

  • The active_requests pattern in the HTTP conventions (http.server.active_requests).

  • The OpenTelemetry RPC metric conventions, applied here to the A2A protocol.

  • The metrics proposal in #254.
  • Prototype

    reference/scenarios/a2a-python/ (a2a-sdk[http-server]==1.0.3) now records
    all four metrics alongside the existing spans, using real SDK clients and server
    components:

  • Server: recorded in the SDK's JSON-RPC dispatcher (standalone and

  • HTTP-enriched servers) and REST GetTask handler, so both the JSONRPC and
    HTTP+JSON bindings are exercised. Timing runs from handler entry to response
    produced, or to the last event yielded for streams.
  • Client: SendMessage, SendStreamingMessage, and GetTask wrap real SDK

  • calls. Streaming duration ends after the last event is consumed.
  • Values:

  • - The protocol version comes from the Agent Card interface.
    - a2a.operation.return_immediately is set from the request's
    SendMessageConfiguration only when it is true. The scenario adds a
    non-blocking SendMessage call to cover it on the client and server spans
    and duration metrics.
    - error.type comes from the protocol error. On the client it comes from the
    SDK's A2A_ERROR_REASONS mapping.
  • Errors: a new client call fetches a missing task through the SDK client.

  • TASK_NOT_FOUND is recorded on a2a.client.operation.duration and on the
    a2a.client span, which also fills the client-span error.type gap left in
    #195. The server error cases cover JSON-RPC (HTTP 200) and HTTP+JSON (HTTP 404).
  • Instruments are created once at module level, and attributes are set inline

  • at each call site.

    Validation: make check-policies, make generate-all (no drift),
    make test-json-schemas, make package-dev, Ruff,
    uv run run-scenario a2a-python --strict (no findings), uv run update-reports
    (no drift), and a link check on the changed docs.

    cd reference
    uv run --frozen run-scenario a2a-python
    

    Checklist

  • Motivation section filled in above

  • Reference scenarios updated for affected libraries

  • Towncrier fragment added under changelog.d/<pr-number>.enhancement.md
  • See CONTRIBUTING.md.

    Diff: 1297 lines (+1064 / -233) across 18 files Reviewer: polchernikova-w Review duration: 52777m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.93) × (1 − Review Confidence (0.83)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.93 · 1297 lines diff across 18 files
    0.93
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.95 · 5 substantive comment(s)
    0.95
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    83%
    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.400
    Self Review self_review
    0.140
    Mass File Touch mass_file_touch
    0.080
    Real PR Conversation Timeline
    48 items
    linux-foundation-easycla[bot] linux-foundation-easycla[bot] commented on Oct 30, 2026 14:38 UTC
    Bot

    <a href="https://easycla.lfx.linuxfoundation.org/#/?version=2"><img src="https://s3.amazonaws.com/cla-project-logo-prod/cla-signed.svg?v=2" alt="CLA Signed" align="left" height="28" width="328" ></a><br >The committers listed above are authorized under a signed CLA.<ul><li>:white_check_mark: login: polchernikova-w / name: Palina Chernikava (d51b1f4a921ef0c0497dcd049daa7e6aa9c150b6)</li></ul>

    opentelemetry-pr-dashboard[bot] opentelemetry-pr-dashboard[bot] commented on Oct 30, 2026 14:42 UTC
    Bot

    <!-- pull-request-dashboard-status -->
    <!-- pull-request-dashboard-status-revision:24 -->

    Pull request dashboard status

    Waiting on reviewers · refreshed 2026-11-26 10:53 UTC

    Review the latest changes.

    <details>
    <summary>Status above doesn't look right?</summary>

    <br>

  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.

  • Should this be with the author? Comment /dashboard route:author to route it back.

  • Anything wrong — including the routing? Report it with what you expected; it helps us improve the dashboard.
  • </details>

    Copilot Copilot commented on code on Nov 02, 2026 10:03 UTC
    Code Review
    model/a2a/metrics.yaml:1
    @@ -0,0 +1,78 @@
    +file_format: definition/2
    +attribute_groups:
    +  - id: a2a.operation.metrics.attributes
    +    visibility: internal
    +    attributes:
    +      - ref: a2a.method.name
    +        requirement_level: required
    +      - ref: a2a.protocol.binding
    +        requirement_level:
    +          conditionally_required: If available.
    +      - ref: a2a.protocol.version
    +
    +  - id: a2a.operation.duration.metrics.attributes
    +    visibility: internal
    +    attributes:
    +      - ref_group: a2a.operation.metrics.attributes
    +      - ref_group: a2a.error.attributes
    +      - ref: a2a.operation.return_immediately
    +        requirement_level:
    +          conditionally_required: If `a2a.method.name` is `SendMessage`.
    +
    +metrics:
    +  - name: a2a.client.operation.duration
    +    requirement_level: recommended
    +    instrument: histogram
    +    unit: s
    +    brief: Duration of an A2A operation as observed by the client.

    Reference coverage leaves the other A2A scenario unchanged. reference/scenarios/adk_a2a/scenario.py:62-77 serves a real A2A application and calls an SDK client's send_message, but its committed telemetry contains none of the four new A2A operation metrics. Extend that scenario at the client/server SDK boundaries as well, using its request and Agent Card values, and refresh its telemetry and reports so coverage includes the ADK-backed integration.

    Copilot Copilot commented on code on Nov 02, 2026 10:03 UTC
    Code Review
    reference/scenarios/a2a-python/scenario.py:1
    @@ -321,9 +382,27 @@ async def run_message_send_reference(card: a2a_types.AgentCard) -> str:
             span_attrs["server.address"] = host
         if port is not None:
             span_attrs["server.port"] = port
    +    metric_attrs = {
    +        "a2a.method.name": method,
    +        "a2a.protocol.binding": interface.protocol_binding,
    +        "a2a.protocol.version": interface.protocol_version,
    +        "server.address": host,
    +        "server.port": port,
    +    }
         with _reference_tracer.start_as_current_span(method, kind=SpanKind.CLIENT, attributes=span_attrs) as span:
    +        _client_active.add(1, metric_attrs)
    +        start = time.perf_counter()
             async with await _create_a2a_client(card, streaming=False) as client:

    The client duration and active-operation interval include client construction and cleanup, exceeding the request-to-response or last-consumed-event boundaries in model/a2a/metrics.yaml:29-31. Create the client outside the operation span and metrics, and finish recording inside its context, including catching the expected GetTask error there. Apply the same change to the streaming call at line 451 and the successful and failed GetTask calls at lines 512 and 551.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 02, 2026 10:03 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🟡 Changes recommended

    Client metrics include construction and cleanup outside the defined operation boundaries, and the ADK-backed A2A scenario lacks coverage for all four new operation metrics.

    <details open>
    <summary><strong>2 open issues</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Add A2A operation metrics to the ADK-backed reference scenario · New

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Exclude client setup and cleanup from A2A operation metrics · New

  • </details>

    <details>
    <summary><strong>What changed in this PR</strong></summary>

    Adds A2A operation metrics alongside the span conventions introduced in #195. This covers the operation-metrics portion of #254; streaming-event and task-lifecycle metrics remain deferred.

    Changes:

  • Defines client and server duration histograms and active-operation counters, plus binding and return-immediately attributes.

  • Extends the Python SDK reference scenario with metric recording and a client error case.

  • Adds metric documentation, coverage reports, and a changelog entry.
  • | File | Description |
    | ---- | ----------- |
    | reference/​src/​semconv_genai/​semconv_model.py | Registers display names for the four metrics. |
    | reference/​src/​semconv_genai/​report.py | Links metric reports to their documentation. |
    | reference/​scenarios/​a2a-python/​scenario.py | Records operation metrics and exercises a client error. |
    | reference/​scenarios/​a2a-python/​data.json | Updates captured metric and attribute coverage. |
    | reference/​scenarios/​a2a-python/​conformance.yaml | Adds the client task-not-found span expectation. |
    | reference/​reports/​a2a-server-operation-duration-metric.md | Reports server duration attribute coverage. |
    | reference/​reports/​a2a-server-active-operations-metric.md | Reports server active-operation attribute coverage. |
    | reference/​reports/​a2a-client-operation-duration-metric.md | Reports client duration attribute coverage. |
    | reference/​reports/​a2a-client-active-operations-metric.md | Reports client active-operation attribute coverage. |
    | reference/​README.md | Lists the four new metric reports. |
    | model/​a2a/​registry.yaml | Defines binding and return-immediately attributes. |
    | model/​a2a/​metrics.yaml | Defines metrics, timing boundaries, and attribute requirements. |
    | model/​a2a/​common.yaml | Shares error attributes between spans and metrics. |
    | docs/​registry/​attributes/​a2a.md | Adds generated documentation for the new attributes. |
    | docs/​gen-ai/​a2a.md | Documents metrics and recommended histogram buckets. |
    | changelog.d/​651.enhancement.md | Announces the new metrics and attributes. |
    </details>

    <sub>Review effort: Balanced</sub>

    polchernikova-w polchernikova-w commented on code on Nov 02, 2026 10:41 UTC
    Code Review
    model/a2a/metrics.yaml:1
    @@ -0,0 +1,78 @@
    +file_format: definition/2
    +attribute_groups:
    +  - id: a2a.operation.metrics.attributes
    +    visibility: internal
    +    attributes:
    +      - ref: a2a.method.name
    +        requirement_level: required
    +      - ref: a2a.protocol.binding
    +        requirement_level:
    +          conditionally_required: If available.
    +      - ref: a2a.protocol.version
    +
    +  - id: a2a.operation.duration.metrics.attributes
    +    visibility: internal
    +    attributes:
    +      - ref_group: a2a.operation.metrics.attributes
    +      - ref_group: a2a.error.attributes
    +      - ref: a2a.operation.return_immediately
    +        requirement_level:
    +          conditionally_required: If `a2a.method.name` is `SendMessage`.
    +
    +metrics:
    +  - name: a2a.client.operation.duration
    +    requirement_level: recommended
    +    instrument: histogram
    +    unit: s
    +    brief: Duration of an A2A operation as observed by the client.

    The adk_a2a scenario is not responsible for a2a telemetry, a scenario shouldn't re-emit telemetry that belongs to another library

    lmolkova lmolkova commented on code on Nov 03, 2026 02:13 UTC
    Code Review
    model/a2a/registry.yaml:1
    @@ -78,6 +78,44 @@ attributes:
           [versioning](https://a2a-protocol.org/latest/specification/#36-versioning).
         examples: ["1.0"]
         stability: development
    +  - key: a2a.protocol.binding

    Could a2a.protocol.binding move to a separate PR? It's a new concept that needs its own discussion, and the metrics can land without it.

    Main reason for it is that we decided against adding similar attribute for MCP, instead we use existing otel attributes Recording MCP transport. Please consider if it can be an option here.

    lmolkova lmolkova commented on code on Nov 03, 2026 02:13 UTC
    Code Review
    reference/scenarios/a2a-python/scenario.py:1
    @@ -98,11 +126,24 @@ def __init__(
             self._enrich_transport_span = enrich_transport_span
     
         async def handle_requests(self, request: Request) -> Response:
    +        start = time.perf_counter()
             body = await request.json()
             method = body["method"]
             params = body.get("params") or {}
             message = params.get("message") or {}
             interface = _jsonrpc_interface(self._card)
    +        metric_attrs = {
    +            "a2a.method.name": method,
    +            "a2a.protocol.binding": interface.protocol_binding,
    +            "a2a.protocol.version": interface.protocol_version,
    +        }
    +        _server_active.add(1, metric_attrs)

    If the handler raises, active_operations is never decremented and no duration is recorded. Instrumentations tend to copy reference scenarios, so could the record and decrement go in a finally, with error.type set from the exception? The same applies to the client calls in run_message_send_reference, run_message_stream_reference and run_tasks_get_reference.

    lmolkova lmolkova commented on code on Nov 03, 2026 02:15 UTC
    Code Review
    model/a2a/metrics.yaml:1
    @@ -0,0 +1,78 @@
    +file_format: definition/2
    +attribute_groups:
    +  - id: a2a.operation.metrics.attributes
    +    visibility: internal
    +    attributes:
    +      - ref: a2a.method.name
    +        requirement_level: required
    +      - ref: a2a.protocol.binding
    +        requirement_level:
    +          conditionally_required: If available.
    +      - ref: a2a.protocol.version
    +
    +  - id: a2a.operation.duration.metrics.attributes
    +    visibility: internal
    +    attributes:
    +      - ref_group: a2a.operation.metrics.attributes
    +      - ref_group: a2a.error.attributes
    +      - ref: a2a.operation.return_immediately
    +        requirement_level:
    +          conditionally_required: If `a2a.method.name` is `SendMessage`.
    +
    +metrics:
    +  - name: a2a.client.operation.duration
    +    requirement_level: recommended
    +    instrument: histogram
    +    unit: s
    +    brief: Duration of an A2A operation as observed by the client.
    +    note: |
    +      Measured from when the client sends the request until the response is
    +      received for non-streaming calls, or until the last event of the response
    +      stream is consumed for streaming calls.

          Measured from when the client sends the request until the response is
          received for non-streaming calls, until the last event of the response
          stream is consumed for streaming calls, or when operation ends with an error.
    

    lmolkova lmolkova commented on code on Nov 03, 2026 02:16 UTC
    Code Review
    model/a2a/metrics.yaml:1
    @@ -0,0 +1,78 @@
    +file_format: definition/2
    +attribute_groups:
    +  - id: a2a.operation.metrics.attributes
    +    visibility: internal
    +    attributes:
    +      - ref: a2a.method.name
    +        requirement_level: required
    +      - ref: a2a.protocol.binding
    +        requirement_level:
    +          conditionally_required: If available.
    +      - ref: a2a.protocol.version
    +
    +  - id: a2a.operation.duration.metrics.attributes
    +    visibility: internal
    +    attributes:
    +      - ref_group: a2a.operation.metrics.attributes
    +      - ref_group: a2a.error.attributes
    +      - ref: a2a.operation.return_immediately
    +        requirement_level:
    +          conditionally_required: If `a2a.method.name` is `SendMessage`.
    +
    +metrics:
    +  - name: a2a.client.operation.duration
    +    requirement_level: recommended
    +    instrument: histogram
    +    unit: s
    +    brief: Duration of an A2A operation as observed by the client.
    +    note: |
    +      Measured from when the client sends the request until the response is
    +      received for non-streaming calls, or until the last event of the response
    +      stream is consumed for streaming calls.
    +
    +      When this metric is reported alongside an `a2a.client` span, the metric
    +      value SHOULD be the same as the span duration.
    +    stability: development
    +    attributes:
    +      - ref_group: a2a.operation.duration.metrics.attributes
    +      - ref_group: a2a.client.address_and_port.attributes
    +
    +  - name: a2a.server.operation.duration
    +    requirement_level: recommended
    +    instrument: histogram
    +    unit: s
    +    brief: Duration of an A2A operation as observed by the server.
    +    note: |
    +      Measured from when the server starts handling the request until the
    +      response is produced for non-streaming calls, or until the last event of
    +      the response stream is sent for streaming calls.

    same nit on the error

    lmolkova lmolkova commented on code on Nov 03, 2026 02:18 UTC
    Code Review
    model/a2a/metrics.yaml:1
    @@ -0,0 +1,78 @@
    +file_format: definition/2
    +attribute_groups:
    +  - id: a2a.operation.metrics.attributes
    +    visibility: internal
    +    attributes:
    +      - ref: a2a.method.name
    +        requirement_level: required
    +      - ref: a2a.protocol.binding
    +        requirement_level:
    +          conditionally_required: If available.
    +      - ref: a2a.protocol.version
    +
    +  - id: a2a.operation.duration.metrics.attributes
    +    visibility: internal
    +    attributes:
    +      - ref_group: a2a.operation.metrics.attributes
    +      - ref_group: a2a.error.attributes
    +      - ref: a2a.operation.return_immediately
    +        requirement_level:
    +          conditionally_required: If `a2a.method.name` is `SendMessage`.
    +
    +metrics:
    +  - name: a2a.client.operation.duration
    +    requirement_level: recommended
    +    instrument: histogram
    +    unit: s
    +    brief: Duration of an A2A operation as observed by the client.
    +    note: |
    +      Measured from when the client sends the request until the response is
    +      received for non-streaming calls, or until the last event of the response
    +      stream is consumed for streaming calls.
    +
    +      When this metric is reported alongside an `a2a.client` span, the metric
    +      value SHOULD be the same as the span duration.
    +    stability: development
    +    attributes:
    +      - ref_group: a2a.operation.duration.metrics.attributes
    +      - ref_group: a2a.client.address_and_port.attributes
    +
    +  - name: a2a.server.operation.duration
    +    requirement_level: recommended
    +    instrument: histogram
    +    unit: s
    +    brief: Duration of an A2A operation as observed by the server.
    +    note: |
    +      Measured from when the server starts handling the request until the
    +      response is produced for non-streaming calls, or until the last event of
    +      the response stream is sent for streaming calls.
    +    stability: development
    +    attributes:
    +      - ref_group: a2a.operation.duration.metrics.attributes
    +
    +  - name: a2a.client.active_operations

    nit, following updated metric guidance (don't pluralize updowncounters), let's do

      - name: a2a.client.operation.active
    

    same for server

    lmolkova lmolkova commented on code on Nov 03, 2026 02:22 UTC
    Code Review
    model/a2a/registry.yaml:1
    @@ -78,6 +78,44 @@ attributes:
           [versioning](https://a2a-protocol.org/latest/specification/#36-versioning).
         examples: ["1.0"]
         stability: development
    +  - key: a2a.protocol.binding
    +    type:
    +      members:
    +        - id: jsonrpc
    +          value: JSONRPC
    +          brief: JSON-RPC 2.0 over HTTP.
    +          stability: development
    +        - id: grpc
    +          value: GRPC
    +          brief: gRPC.
    +          stability: development
    +        - id: http_json
    +          value: HTTP+JSON
    +          brief: HTTP+JSON/REST.
    +          stability: development
    +    brief: The A2A protocol binding used.
    +    note: >
    +      Corresponds to the `protocolBinding` of the selected Agent Card interface.
    +      See the A2A specification for
    +      [AgentInterface](https://a2a-protocol.org/latest/specification/#446-agentinterface)
    +      and
    +      [protocol bindings](https://a2a-protocol.org/latest/specification/#5-protocol-binding-requirements-and-interoperability).
    +    stability: development
    +  - key: a2a.operation.return_immediately

    Why only on metrics? It would be useful on the a2a.client and a2a.server spans for SendMessage too: it explains why one span takes milliseconds and another takes minutes, and it keeps span and metric attributes aligned.

    lmolkova lmolkova commented on code on Nov 03, 2026 02:23 UTC
    Code Review
    docs/gen-ai/a2a.md:1
    @@ -840,6 +845,341 @@ and SHOULD be provided **at span creation time** (if provided at all):
     <!-- END AUTOGENERATED TEXT -->
     <!-- endweaver -->
     
    +## Metrics
    +
    +### Metric: `a2a.client.operation.duration`
    +
    +This metric SHOULD be specified with
    +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.55.0/specification/metrics/api.md#instrument-advisory-parameters)
    +of `[ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 ]`.

    #655 aligns GenAI and MCP duration buckets with the upstream 1, 2.5, 5 sequence. Could these buckets follow it?

    of `[ 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10, 30, 60, 120, 300 ]`.
    

    lmolkova lmolkova commented on code on Nov 03, 2026 02:23 UTC
    Code Review
    docs/gen-ai/a2a.md:1
    @@ -840,6 +845,341 @@ and SHOULD be provided **at span creation time** (if provided at all):
     <!-- END AUTOGENERATED TEXT -->
     <!-- endweaver -->
     
    +## Metrics
    +
    +### Metric: `a2a.client.operation.duration`
    +
    +This metric SHOULD be specified with
    +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.55.0/specification/metrics/api.md#instrument-advisory-parameters)
    +of `[ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 ]`.
    +
    +<!-- weaver .registry.metrics[] | select(.name == "a2a.client.operation.duration") -->
    +<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
    +<!-- see templates/registry/markdown/snippet.md.j2 -->
    +<!-- prettier-ignore-start -->
    +
    +| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
    +| -------- | --------------- | ----------- | -------------- | --------- | ------ |
    +| `a2a.client.operation.duration` | Histogram | `s` | Duration of an A2A operation as observed by the client. [1] | ![Development](https://img.shields.io/badge/-development-blue) | |
    +
    +**[1]:** Measured from when the client sends the request until the response is
    +received for non-streaming calls, or until the last event of the response
    +stream is consumed for streaming calls.
    +
    +When this metric is reported alongside an `a2a.client` span, the metric
    +value SHOULD be the same as the span duration.
    +
    +**Requirement level:** [Recommended](https://github.com/open-telemetry/semantic-conventions/blob/v1.44.0/docs/general/signal-requirement-level.md).
    +
    +**Attributes:**
    +
    +| Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
    +| --- | --- | --- | --- | --- | --- |
    +| [`a2a.method.name`](/docs/registry/attributes/a2a.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | The name of the A2A request method. [1] | `SendMessage`; `SendStreamingMessage`; `GetTask` |
    +| [`a2a.operation.return_immediately`](/docs/registry/attributes/a2a.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` If `a2a.method.name` is `SendMessage`. | boolean | Whether the client requested the `SendMessage` operation to return immediately instead of waiting for the task to reach a terminal or interrupted state. [2] | `true`; `false` |
    +| [`a2a.protocol.binding`](/docs/registry/attributes/a2a.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` If available. | string | The A2A protocol binding used. [3] | `JSONRPC`; `GRPC`; `HTTP+JSON` |
    +| [`error.type`](https://github.com/open-telemetry/semantic-conventions/blob/v1.44.0/docs/registry/attributes/error.md) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` If and only if the operation fails. | string | Describes a class of error the operation ended with. [4] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` |
    +| [`a2a.protocol.version`](/docs/registry/attributes/a2a.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The version of the A2A protocol used. [5] | `1.0` |
    +| [`server.address`](https://github.com/open-telemetry/semantic-conventions/blob/v1.44.0/docs/registry/attributes/server.md) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` If applicable. | string | Host component of the selected Agent Card interface URL. [6] | `example.com`; `10.1.2.80`; `/tmp/my.sock` |
    +| [`server.port`](https://github.com/open-telemetry/semantic-conventions/blob/v1.44.0/docs/registry/attributes/server.md) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` When `server.address` is set. | int | Port component of the selected Agent Card interface URL. [7] | `80`; `8080`; `443` |
    +
    +**[1] `a2a.method.name`:** This attribute records the logical A2A operation name defined by the protocol. For example, `SendMessage` is the A2A operation name, while HTTP+JSON maps it to `POST /message:send`. See the A2A specification for [core operations](https://a2a-protocol.org/latest/specification/#31-core-operations) and [method mappings](https://a2a-protocol.org/latest/specification/#53-method-mapping-reference).
    +
    +**[2] `a2a.operation.return_immediately`:** Corresponds to the `returnImmediately` field of the A2A request `SendMessageConfiguration`. Instrumentation SHOULD record the effective value: when the request does not set the field, record the protocol default, `false`. See the A2A specification for [SendMessageConfiguration](https://a2a-protocol.org/latest/specification/#322-sendmessageconfiguration).
    +
    +**[3] `a2a.protocol.binding`:** Corresponds to the `protocolBinding` of the selected Agent Card interface. See the A2A specification for [AgentInterface](https://a2a-protocol.org/latest/specification/#446-agentinterface) and [protocol bindings](https://a2a-protocol.org/latest/specification/#5-protocol-binding-requirements-and-interoperability).
    +
    +**[4] `error.type`:** This attribute SHOULD be set to the protocol-provided A2A error reason
    +when available. Use `google.rpc.ErrorInfo.reason` with domain
    +`a2a-protocol.org`, for example `TASK_NOT_FOUND`, consistently across
    +JSON-RPC, HTTP+JSON, and gRPC bindings.
    +
    +If no A2A error reason is available, use the string representation of
    +the JSON-RPC error code or the binding-specific protocol status code,
    +following the applicable binding's error conventions. If no protocol
    +error response is available, use the canonical name of the exception
    +that occurred. Instrumentation SHOULD NOT infer an A2A error reason
    +from an HTTP or gRPC status code alone.
    +
    +See the A2A specification for
    +[error handling](https://a2a-protocol.org/latest/specification/#332-error-handling)
    +and
    +[error code mappings](https://a2a-protocol.org/latest/specification/#54-error-code-mappings).
    +
    +**[5] `a2a.protocol.version`:** See the A2A specification for [versioning](https://a2a-protocol.org/latest/specification/#36-versioning).
    +
    +**[6] `server.address`:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
    +
    +**[7] `server.port`:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available.
    +
    +---
    +
    +`a2a.method.name` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
    +
    +| Value | Description | Stability |
    +| --- | --- | --- |
    +| `CancelTask` | Request to cancel a task. | ![Development](https://img.shields.io/badge/-development-blue) |
    +| `CreateTaskPushNotificationConfig` | Request to create or update a task push notification configuration. | ![Development](https://img.shields.io/badge/-development-blue) |
    +| `DeleteTaskPushNotificationConfig` | Request to delete a task push notification configuration. | ![Development](https://img.shields.io/badge/-development-blue) |
    +| `GetExtendedAgentCard` | Request to get the extended agent card. | ![Development](https://img.shields.io/badge/-development-blue) |
    +| `GetTask` | Request to get the current state of a task. | ![Development](https://img.shields.io/badge/-development-blue) |
    +| `GetTaskPushNotificationConfig` | Request to get a task push notification configuration. | ![Development](https://img.shields.io/badge/-development-blue) |
    +| `ListTaskPushNotificationConfigs` | Request to list task push notification configurations. | ![Development](https://img.shields.io/badge/-development-blue) |
    +| `ListTasks` | Request to list tasks. | ![Development](https://img.shields.io/badge/-development-blue) |
    +| `SendMessage` | Request to send a message to an agent and receive a non-streaming response. | ![Development](https://img.shields.io/badge/-development-blue) |
    +| `SendStreamingMessage` | Request to send a message to an agent and receive a streaming response. | ![Development](https://img.shields.io/badge/-development-blue) |
    +| `SubscribeToTask` | Request to subscribe to task updates. | ![Development](https://img.shields.io/badge/-development-blue) |
    +
    +---
    +
    +`a2a.protocol.binding` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
    +
    +| Value | Description | Stability |
    +| --- | --- | --- |
    +| `GRPC` | gRPC. | ![Development](https://img.shields.io/badge/-development-blue) |
    +| `HTTP+JSON` | HTTP+JSON/REST. | ![Development](https://img.shields.io/badge/-development-blue) |
    +| `JSONRPC` | JSON-RPC 2.0 over HTTP. | ![Development](https://img.shields.io/badge/-development-blue) |
    +
    +---
    +
    +`error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
    +
    +| Value | Description | Stability |
    +| --- | --- | --- |
    +| `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
    +
    +<!-- prettier-ignore-end -->
    +<!-- END AUTOGENERATED TEXT -->
    +<!-- endweaver -->
    +
    +### Metric: `a2a.server.operation.duration`
    +
    +This metric SHOULD be specified with
    +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.55.0/specification/metrics/api.md#instrument-advisory-parameters)
    +of `[ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 ]`.

    Same as above, to align with #655.

    of `[ 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10, 30, 60, 120, 300 ]`.
    

    lmolkova lmolkova commented on code on Nov 03, 2026 02:23 UTC
    Code Review
    reference/scenarios/a2a-python/scenario.py:1
    @@ -34,6 +37,31 @@
     TENANT_OVER_HTTP = "billing-http"
     
     _reference_tracer = reference_tracer()
    +_meter = reference_meter()
    +# Bucket boundaries advised for the duration metrics by docs/gen-ai/a2a.md.
    +_DURATION_BUCKETS = [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300]

    _DURATION_BUCKETS = [0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10, 30, 60, 120, 300]
    

    lmolkova lmolkova commented on code on Nov 03, 2026 02:26 UTC
    Code Review
    model/a2a/registry.yaml:1
    @@ -78,6 +78,44 @@ attributes:
           [versioning](https://a2a-protocol.org/latest/specification/#36-versioning).
         examples: ["1.0"]
         stability: development
    +  - key: a2a.protocol.binding
    +    type:
    +      members:
    +        - id: jsonrpc
    +          value: JSONRPC
    +          brief: JSON-RPC 2.0 over HTTP.
    +          stability: development
    +        - id: grpc
    +          value: GRPC
    +          brief: gRPC.
    +          stability: development
    +        - id: http_json
    +          value: HTTP+JSON
    +          brief: HTTP+JSON/REST.
    +          stability: development
    +    brief: The A2A protocol binding used.
    +    note: >
    +      Corresponds to the `protocolBinding` of the selected Agent Card interface.
    +      See the A2A specification for
    +      [AgentInterface](https://a2a-protocol.org/latest/specification/#446-agentinterface)
    +      and
    +      [protocol bindings](https://a2a-protocol.org/latest/specification/#5-protocol-binding-requirements-and-interoperability).
    +    stability: development
    +  - key: a2a.operation.return_immediately
    +    type: boolean
    +    brief: >
    +      Whether the client requested the `SendMessage` operation to return
    +      immediately instead of waiting for the task to reach a terminal or
    +      interrupted state.
    +    note: >
    +      Corresponds to the `returnImmediately` field of the A2A request
    +      `SendMessageConfiguration`. Instrumentation SHOULD record the effective
    +      value: when the request does not set the field, record the protocol
    +      default, `false`.

    Instrumentation SHOULD record the effective

    value: when the request does not set the field, record the protocol
    default, false.

    why? it just adds telemetry volume and makes instrumentation assume defaults. Let's not set it unless it's explicitly provided (or not set when it's not provided or false)?

    polchernikova-w polchernikova-w commented on code on Nov 03, 2026 10:58 UTC
    Code Review
    model/a2a/registry.yaml:1
    @@ -78,6 +78,44 @@ attributes:
           [versioning](https://a2a-protocol.org/latest/specification/#36-versioning).
         examples: ["1.0"]
         stability: development
    +  - key: a2a.protocol.binding

    Moved to a separate CL, but just for future reference - the network.protocol.* doesn't work here because the grpc is not a network protocol, and rpc.system.name is also not an option because it has no value for http. I remove it now and will open a separate PR for it.

    polchernikova-w polchernikova-w commented on code on Nov 03, 2026 13:05 UTC
    Code Review
    model/a2a/registry.yaml:1
    @@ -78,6 +78,44 @@ attributes:
           [versioning](https://a2a-protocol.org/latest/specification/#36-versioning).
         examples: ["1.0"]
         stability: development
    +  - key: a2a.protocol.binding
    +    type:
    +      members:
    +        - id: jsonrpc
    +          value: JSONRPC
    +          brief: JSON-RPC 2.0 over HTTP.
    +          stability: development
    +        - id: grpc
    +          value: GRPC
    +          brief: gRPC.
    +          stability: development
    +        - id: http_json
    +          value: HTTP+JSON
    +          brief: HTTP+JSON/REST.
    +          stability: development
    +    brief: The A2A protocol binding used.
    +    note: >
    +      Corresponds to the `protocolBinding` of the selected Agent Card interface.
    +      See the A2A specification for
    +      [AgentInterface](https://a2a-protocol.org/latest/specification/#446-agentinterface)
    +      and
    +      [protocol bindings](https://a2a-protocol.org/latest/specification/#5-protocol-binding-requirements-and-interoperability).
    +    stability: development
    +  - key: a2a.operation.return_immediately
    +    type: boolean
    +    brief: >
    +      Whether the client requested the `SendMessage` operation to return
    +      immediately instead of waiting for the task to reach a terminal or
    +      interrupted state.
    +    note: >
    +      Corresponds to the `returnImmediately` field of the A2A request
    +      `SendMessageConfiguration`. Instrumentation SHOULD record the effective
    +      value: when the request does not set the field, record the protocol
    +      default, `false`.

    Make sense, removed the default

    polchernikova-w polchernikova-w commented on code on Nov 03, 2026 13:30 UTC
    Code Review
    model/a2a/registry.yaml:1
    @@ -78,6 +78,44 @@ attributes:
           [versioning](https://a2a-protocol.org/latest/specification/#36-versioning).
         examples: ["1.0"]
         stability: development
    +  - key: a2a.protocol.binding
    +    type:
    +      members:
    +        - id: jsonrpc
    +          value: JSONRPC
    +          brief: JSON-RPC 2.0 over HTTP.
    +          stability: development
    +        - id: grpc
    +          value: GRPC
    +          brief: gRPC.
    +          stability: development
    +        - id: http_json
    +          value: HTTP+JSON
    +          brief: HTTP+JSON/REST.
    +          stability: development
    +    brief: The A2A protocol binding used.
    +    note: >
    +      Corresponds to the `protocolBinding` of the selected Agent Card interface.
    +      See the A2A specification for
    +      [AgentInterface](https://a2a-protocol.org/latest/specification/#446-agentinterface)
    +      and
    +      [protocol bindings](https://a2a-protocol.org/latest/specification/#5-protocol-binding-requirements-and-interoperability).
    +    stability: development
    +  - key: a2a.operation.return_immediately

    Added for spans. Let me know if you'd prefer it to be a separate PR

    Shay-Deng Shay-Deng commented on Nov 12, 2026 23:32 UTC
    Reviewer

    Read through this from the A2A side (I work on A2A conformance across the SDKs). The duration boundaries line up with the spec's execution modes (§3.2.2: a blocking SendMessage waits for a terminal or interrupted state), and the earlier feedback looks addressed. Three things:

    1. a2a.operation.return_immediately for A2A 0.3 requests. SDKs with a 0.3 compat layer (a2a-python, a2a-java, a2a-dotnet) serve 0.3 clients on the same server, and a2a.protocol.version can be 0.3. 0.3 has no returnImmediately; it has MessageSendConfiguration.blocking with the opposite meaning, and the compat layers convert it as return_immediately = !blocking. That case matters in practice: a2a-dotnet's v0.3 model defaults blocking to false and always serializes it, so its 0.3 clients send non-blocking requests unless they set it explicitly (a2aproject/a2a-dotnet#386). Those calls come back early, which is exactly what this attribute is meant to explain. Maybe one sentence in the note, e.g. "For A2A 0.3 requests, which carry blocking instead, set it to true when blocking is false."

    2. Question: a2a.task.state on the duration metrics? A blocking SendMessage returns either at a terminal state or at an interrupted one (TASK_STATE_INPUT_REQUIRED / TASK_STATE_AUTH_REQUIRED), so the histogram mixes "the agent finished" with "the agent stopped to ask for input". That's the same reasoning as for return_immediately. It's low-cardinality, and the spans already omit it when there are several states. Fine to leave for the task-lifecycle follow-up if that's the plan.

    3. Scenario: the server streaming path can leak a2a.server.operation.active. In ReferenceJsonRpcDispatcher, a streaming response records the duration and decrements the counter only in the finally of traced_events(), and the outer finally skips it when streaming is set. If the client is gone before the response starts, Starlette raises ClientDisconnect while sending http.response.start and never iterates the body, so that finally doesn't run: the counter stays incremented and no duration is recorded. I reproduced it with Starlette 1.10.0 (the version in the scenario's lock) using a StreamingResponse whose body_iterator is wrapped the same way. Since instrumentations tend to copy the reference scenarios, it may be worth recording around the response's ASGI call instead, so it runs whether or not the body was iterated, with a flag so it's recorded only once.

    polchernikova-w polchernikova-w commented on Nov 17, 2026 13:15 UTC
    Author

    Read through this from the A2A side (I work on A2A conformance across the SDKs). The duration boundaries line up with the spec's execution modes (§3.2.2: a blocking SendMessage waits for a terminal or interrupted state), and the earlier feedback looks addressed. Three things:

    > 1. a2a.operation.return_immediately for A2A 0.3 requests. SDKs with a 0.3 compat layer (a2a-python, a2a-java, a2a-dotnet) serve 0.3 clients on the same server, and a2a.protocol.version can be 0.3. 0.3 has no returnImmediately; it has MessageSendConfiguration.blocking with the opposite meaning, and the compat layers convert it as return_immediately = !blocking. That case matters in practice: a2a-dotnet's v0.3 model defaults blocking to false and always serializes it, so its 0.3 clients send non-blocking requests unless they set it explicitly (a2aproject/a2a-dotnet#386). Those calls come back early, which is exactly what this attribute is meant to explain. Maybe one sentence in the note, e.g. "For A2A 0.3 requests, which carry blocking instead, set it to true when blocking is false."

    > 2. Question: a2a.task.state on the duration metrics? A blocking SendMessage returns either at a terminal state or at an interrupted one (TASK_STATE_INPUT_REQUIRED / TASK_STATE_AUTH_REQUIRED), so the histogram mixes "the agent finished" with "the agent stopped to ask for input". That's the same reasoning as for return_immediately. It's low-cardinality, and the spans already omit it when there are several states. Fine to leave for the task-lifecycle follow-up if that's the plan.

    > 3. Scenario: the server streaming path can leak a2a.server.operation.active. In ReferenceJsonRpcDispatcher, a streaming response records the duration and decrements the counter only in the finally of traced_events(), and the outer finally skips it when streaming is set. If the client is gone before the response starts, Starlette raises ClientDisconnect while sending http.response.start and never iterates the body, so that finally doesn't run: the counter stays incremented and no duration is recorded. I reproduced it with Starlette 1.10.0 (the version in the scenario's lock) using a StreamingResponse whose body_iterator is wrapped the same way. Since instrumentations tend to copy the reference scenarios, it may be worth recording around the response's ASGI call instead, so it runs whether or not the body was iterated, with a flag so it's recorded only once.

    Thank you for the review!

    1. I understand that those two parameters carry the same goal (but carry the opposite meaning) in different protocol versions, but "set return_immediately to true when blocking is false" sounds like something which belongs to the a2a specification, not the opentelemetry semantic convention.
    2. Sounds reasonable, but I'd defer it for the task-lifecycle follow-up.
    3. Fixed, thanks a lot

    Copilot Copilot commented on code on Nov 18, 2026 05:52 UTC
    Code Review
    model/a2a/metrics.yaml:1
    @@ -0,0 +1,79 @@
    +file_format: definition/2
    +attribute_groups:
    +  - id: a2a.operation.metrics.attributes
    +    visibility: internal
    +    attributes:
    +      - ref: a2a.method.name
    +        requirement_level: required

    The reference dispatcher copies body["method"] into both server metrics before SDK validation, so distinct nonexistent method names create distinct time series. This can exhaust metric cardinality limits and crowd out valid operation measurements. Define a bounded fallback such as _OTHER for unrecognized methods in the model and apply it in the dispatcher, while preserving recognized SDK and extension methods.

    Copilot Copilot commented on code on Nov 18, 2026 05:52 UTC
    Code Review
    reference/scenarios/a2a-python/scenario.py:1
    @@ -98,11 +160,21 @@ def __init__(
             self._enrich_transport_span = enrich_transport_span
     
         async def handle_requests(self, request: Request) -> Response:
    +        start = time.perf_counter()
             body = await request.json()
             method = body["method"]
             params = body.get("params") or {}
             message = params.get("message") or {}
             interface = _jsonrpc_interface(self._card)
    +        metric_attrs = {
    +            "a2a.method.name": method,
    +            "a2a.protocol.version": interface.protocol_version,
    +        }
    +        _server_active.add(1, metric_attrs)
    +        duration_attrs = dict(metric_attrs)
    +        return_immediately = method == "SendMessage" and (params.get("configuration") or {}).get("returnImmediately")

    Malformed SendMessage requests can permanently inflate a2a.server.operation.active. For example, a nonempty string in params.configuration raises AttributeError after the +1 but before the cleanup try/finally, so no duration or matching -1 is recorded. Move the increment after fallible request and span setup, immediately before the protected block.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 18, 2026 05:52 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🟡 Changes recommended

    Malformed requests can permanently inflate the active-operation metric, and unvalidated method names can create unbounded metric cardinality.

    <details open>
    <summary><strong>2 open issues</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Unrecognized method names can exhaust metric cardinality · New

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Malformed requests can leak active-operation metric increments · New

  • </details>

    <details>
    <summary><strong>2 resolved since last review</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Exclude client setup and cleanup from A2A operation metrics

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Add A2A operation metrics to the ADK-backed reference scenario

  • </details>

    <sub>Review effort: Balanced</sub>

    polchernikova-w polchernikova-w commented on code on Nov 18, 2026 10:25 UTC
    Code Review
    model/a2a/metrics.yaml:1
    @@ -0,0 +1,79 @@
    +file_format: definition/2
    +attribute_groups:
    +  - id: a2a.operation.metrics.attributes
    +    visibility: internal
    +    attributes:
    +      - ref: a2a.method.name
    +        requirement_level: required

    MCP (mcp.method.name) and the other GenAI metrics don't use an _OTHER fallback, so I'm leaving this out for now to stay consistent

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 18, 2026 10:32 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🔵 Needs a closer look

    The HTTP-enriched scenario does not emit the newly added a2a.operation.return_immediately attribute, leaving it undemonstrated on the enriched transport span and missing a corresponding conformance match.

    No open issues 🎉

    <details>
    <summary><strong>1 previously missed issue</strong></summary>

    In code that hasn't changed since last review

    <details>
    <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Exercise return_immediately on the HTTP transport span</summary>

    model/​a2a/​common.yaml:25

    This shared group adds a2a.operation.return_immediately to the HTTP server refinement, but the existing HTTP-enriched scenario never emits it. The only return_immediately=True call targets standalone; run_server_over_http_reference leaves the configuration unset. .github/instructions/evaluate-reference.instructions.md:40 requires flagging scenarios that could emit a changed attribute but do not. Please send a non-blocking SendMessage through over_http and add a corresponding conformance match so the new field is demonstrated on the enriched transport span too.
    </details>
    </details>

    <details>
    <summary><strong>2 resolved since last review</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Malformed requests can leak active-operation metric increments

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Unrecognized method names can exhaust metric cardinality

  • </details>

    <sub>Review effort: Balanced</sub>

    Copilot Copilot commented on code on Nov 18, 2026 10:40 UTC
    Code Review
    reference/scenarios/a2a-python/scenario.py:1
    @@ -98,11 +160,20 @@ def __init__(
             self._enrich_transport_span = enrich_transport_span
     
         async def handle_requests(self, request: Request) -> Response:
    +        start = time.perf_counter()

    The timer includes await request.json(), but _server_active is incremented only after body parsing and span setup. A slow upload therefore counts toward duration without contributing to the active-operation count, violating the shared boundaries in model/a2a/metrics.yaml:74-76. Move the timer start next to the active increment at the SDK dispatch boundary.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 18, 2026 10:40 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🟡 Changes recommended

    The duration timer starts before request-body parsing, while the active-operation count starts afterward, violating the metrics’ required shared boundaries during slow uploads.

    <details open>
    <summary><strong>1 open issue</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Start the timer at the active-operation boundary · New

  • </details>

    <sub>Review effort: Balanced</sub>

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 18, 2026 11:12 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🔵 Needs a closer look

    Human assessment is needed because malformed request configuration can cause instrumentation to raise an unhandled server error before SDK validation and bypass operation metrics.

    No open issues 🎉

    <details>
    <summary><strong>1 resolved since last review</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Start the timer at the active-operation boundary

  • </details>

    <sub>Review effort: Balanced</sub>

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 18, 2026 11:42 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🔵 Needs a closer look

    A minor changelog-formatting finding was omitted from the published review, so its impact on approval requires human judgment.

    No open issues 🎉

    <sub>Review effort: Balanced</sub>

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 18, 2026 12:25 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🟢 Approval recommended

    No active review issues remain for the A2A operation-metrics additions.

    No open issues 🎉

    <sub>Review effort: Balanced</sub>

    lmolkova lmolkova commented on code on Nov 19, 2026 01:07 UTC
    Code Review
    model/a2a/registry.yaml:1
    @@ -78,6 +78,19 @@ attributes:
           [versioning](https://a2a-protocol.org/latest/specification/#36-versioning).
         examples: ["1.0"]
         stability: development
    +  - key: a2a.operation.return_immediately

    This is a request parameter rather than a property of the operation, and a2a.operation. would be a new namespace. What do you think about following gen_ai.request.stream / gen_ai.request. and calling it a2a.request.return_immediately? That leaves room for other SendMessageConfiguration fields later (e.g. historyLength, acceptedOutputModes).

      - key: a2a.request.return_immediately
    

    lmolkova lmolkova commented on code on Nov 19, 2026 01:12 UTC
    Code Review
    model/a2a/common.yaml:1
    @@ -18,6 +18,11 @@ attribute_groups:
           - ref: a2a.message.reference_task_ids
             requirement_level:
               recommended: When the request message references task IDs.
    +      - ref: a2a.operation.return_immediately
    +        requirement_level:
    +          conditionally_required: >
    +            If `SendMessage` is requested to return immediately (value is `true`).
    +            When missing, the value is assumed to be `false`.

    nit: the brief already scopes this to SendMessage, so the condition can be shorter (same in metrics.yaml).

              conditionally_required: >
                If and only if the value is `true`. When missing, the value is
                assumed to be `false`.
    

    lmolkova lmolkova commented on code on Nov 19, 2026 01:12 UTC
    Code Review
    model/a2a/registry.yaml:1
    @@ -78,6 +78,19 @@ attributes:
           [versioning](https://a2a-protocol.org/latest/specification/#36-versioning).
         examples: ["1.0"]
         stability: development
    +  - key: a2a.operation.return_immediately
    +    type: boolean
    +    brief: >
    +      Whether the client requested the `SendMessage` operation to return
    +      immediately instead of waiting for the task to reach a terminal or
    +      interrupted state.

    nit: a bit shorter, same meaning:

        brief: >
          Whether `SendMessage` was requested to return before the task reaches
          a terminal or interrupted state.
    

    lmolkova lmolkova commented on code on Nov 19, 2026 01:12 UTC
    Code Review
    model/a2a/metrics.yaml:1
    @@ -0,0 +1,79 @@
    +file_format: definition/2
    +attribute_groups:
    +  - id: a2a.operation.metrics.attributes
    +    visibility: internal
    +    attributes:
    +      - ref: a2a.method.name
    +        requirement_level: required
    +      - ref: a2a.protocol.version
    +
    +  - id: a2a.operation.duration.metrics.attributes
    +    visibility: internal
    +    attributes:
    +      - ref_group: a2a.operation.metrics.attributes
    +      - ref_group: a2a.error.attributes
    +      - ref: a2a.operation.return_immediately
    +        requirement_level:
    +          conditionally_required: >
    +            If `SendMessage` is requested to return immediately (value is `true`).
    +            When missing, the value is assumed to be `false`.
    +
    +metrics:
    +  - name: a2a.client.operation.duration
    +    requirement_level: recommended
    +    instrument: histogram
    +    unit: s
    +    brief: Duration of an A2A operation as observed by the client.
    +    note: |
    +      Measured from when the client sends the request until the response is
    +      received for non-streaming calls, until the last event of the response
    +      stream is consumed for streaming calls, or until the operation ends with
    +      an error.
    +
    +      When this metric is reported alongside an `a2a.client` span, the metric
    +      value SHOULD be the same as the span duration.
    +    stability: development
    +    attributes:
    +      - ref_group: a2a.operation.duration.metrics.attributes
    +      - ref_group: a2a.client.address_and_port.attributes
    +
    +  - name: a2a.server.operation.duration
    +    requirement_level: recommended
    +    instrument: histogram
    +    unit: s
    +    brief: Duration of an A2A operation as observed by the server.
    +    note: |
    +      Measured from when the server starts handling the request until the
    +      response is produced for non-streaming calls, until the last event of
    +      the response stream is sent for streaming calls, or until the operation
    +      ends with an error.

    nit: "produced" vs "sent" for the two cases; using one verb keeps the boundary unambiguous.

          Measured from when the server starts handling the request until the
          response is sent for non-streaming calls, until the last event of
          the response stream is sent for streaming calls, or until the operation
          ends with an error.
    

    lmolkova lmolkova commented on code on Nov 19, 2026 01:12 UTC
    Code Review
    model/a2a/metrics.yaml:1
    @@ -0,0 +1,79 @@
    +file_format: definition/2
    +attribute_groups:
    +  - id: a2a.operation.metrics.attributes
    +    visibility: internal
    +    attributes:
    +      - ref: a2a.method.name
    +        requirement_level: required
    +      - ref: a2a.protocol.version
    +
    +  - id: a2a.operation.duration.metrics.attributes
    +    visibility: internal
    +    attributes:
    +      - ref_group: a2a.operation.metrics.attributes
    +      - ref_group: a2a.error.attributes
    +      - ref: a2a.operation.return_immediately
    +        requirement_level:
    +          conditionally_required: >
    +            If `SendMessage` is requested to return immediately (value is `true`).
    +            When missing, the value is assumed to be `false`.
    +
    +metrics:
    +  - name: a2a.client.operation.duration
    +    requirement_level: recommended
    +    instrument: histogram
    +    unit: s
    +    brief: Duration of an A2A operation as observed by the client.
    +    note: |
    +      Measured from when the client sends the request until the response is
    +      received for non-streaming calls, until the last event of the response
    +      stream is consumed for streaming calls, or until the operation ends with
    +      an error.
    +
    +      When this metric is reported alongside an `a2a.client` span, the metric
    +      value SHOULD be the same as the span duration.
    +    stability: development
    +    attributes:
    +      - ref_group: a2a.operation.duration.metrics.attributes
    +      - ref_group: a2a.client.address_and_port.attributes
    +
    +  - name: a2a.server.operation.duration
    +    requirement_level: recommended
    +    instrument: histogram
    +    unit: s
    +    brief: Duration of an A2A operation as observed by the server.
    +    note: |
    +      Measured from when the server starts handling the request until the
    +      response is produced for non-streaming calls, until the last event of
    +      the response stream is sent for streaming calls, or until the operation
    +      ends with an error.
    +    stability: development
    +    attributes:
    +      - ref_group: a2a.operation.duration.metrics.attributes
    +
    +  - name: a2a.client.operation.active
    +    requirement_level: recommended
    +    instrument: updowncounter
    +    unit: "{operation}"
    +    brief: Number of A2A operations in progress on the client.
    +    note: |
    +      Incremented when the client sends the request and decremented when the
    +      operation ends, following the same boundaries as
    +      `a2a.client.operation.duration`.

    nit: "same boundaries as" already covers increment/decrement; same for the server metric.

          Follows the same boundaries as `a2a.client.operation.duration`.
    

    lmolkova lmolkova commented on code on Nov 19, 2026 01:12 UTC
    Code Review
    reference/scenarios/a2a-python/scenario.py:1
    @@ -71,6 +104,40 @@ def _a2a_error_reason(details: object) -> str | None:
         return None
     
     
    +class _AsgiCallWrapper:
    +    """Wrap a Starlette response so cleanup runs even when the body iterator is
    +    never awaited.
    +
    +    If the client disconnects before the response starts, Starlette raises
    +    `ClientDisconnect` while sending `http.response.start`, and the
    +    `body_iterator` the dispatcher attached is never iterated, so its `finally`
    +    does not run. Starlette calls a response as `await response(scope, receive,
    +    send)`, so wrapping the response with an object that has `__call__` lets us
    +    record the metric and end the span once the dispatch itself returns or
    +    raises. The `_done` flag keeps it exactly once.
    +    """

    nit: shorten

        """Record the metric and end the span once the response is sent, even if
        the client disconnects before the body iterator runs.
        """
    

    lmolkova lmolkova commented on code on Nov 19, 2026 02:32 UTC
    Code Review
    model/a2a/registry.yaml:1
    @@ -78,6 +78,44 @@ attributes:
           [versioning](https://a2a-protocol.org/latest/specification/#36-versioning).
         examples: ["1.0"]
         stability: development
    +  - key: a2a.protocol.binding
    +    type:
    +      members:
    +        - id: jsonrpc
    +          value: JSONRPC
    +          brief: JSON-RPC 2.0 over HTTP.
    +          stability: development
    +        - id: grpc
    +          value: GRPC
    +          brief: gRPC.
    +          stability: development
    +        - id: http_json
    +          value: HTTP+JSON
    +          brief: HTTP+JSON/REST.
    +          stability: development
    +    brief: The A2A protocol binding used.
    +    note: >
    +      Corresponds to the `protocolBinding` of the selected Agent Card interface.
    +      See the A2A specification for
    +      [AgentInterface](https://a2a-protocol.org/latest/specification/#446-agentinterface)
    +      and
    +      [protocol bindings](https://a2a-protocol.org/latest/specification/#5-protocol-binding-requirements-and-interoperability).
    +    stability: development
    +  - key: a2a.operation.return_immediately

    Thanks! Fine to keep it in this PR.

    Digging into this, I think our A2A span design needs another look. A2A 1.0 blocks by default, so a default SendMessage is an agent invocation. I opened #730 for it.

    Whatever we pick there shouldn't break the metrics here. What do you think of the options in the issue?

    lmolkova lmolkova commented on Nov 19, 2026 02:40 UTC
    Reviewer

    Looks good, mostly suggestions to shorten description, the only substantial comment is on the new attribute naming

    TAOXUY TAOXUY commented on Nov 19, 2026 04:25 UTC
    Reviewer

    Left a couple inline comments on metric attribute cardinality and missing status/transport labels.

    Two PR-level questions:

  • a2a.protocol.binding: I saw this was moved out to #612 (+1 on Option 1 there). Since a2a..operation. has no http., rpc., or network.* attributes, there's currently no way to break down latency, errors, or active operations by binding (JSONRPC vs HTTP+JSON vs GRPC). Could we either keep a2a.protocol.binding here or make sure #612 adds it to these four metrics too?

  • Are a2a.{client,server}.{request,response}.size histograms (similar to mcp.{client,server}.{request,response}.size in #600) planned in the followup? Tracking payload sizes would be very useful since large task contexts and artifacts directly consume the caller's LLM context window.
  • TAOXUY TAOXUY commented on code on Nov 19, 2026 04:25 UTC
    Code Review
    model/a2a/metrics.yaml:1
    @@ -0,0 +1,79 @@
    +file_format: definition/2
    +attribute_groups:
    +  - id: a2a.operation.metrics.attributes
    +    visibility: internal
    +    attributes:
    +      - ref: a2a.method.name
    +        requirement_level: required
    +      - ref: a2a.protocol.version
    +
    +  - id: a2a.operation.duration.metrics.attributes
    +    visibility: internal
    +    attributes:
    +      - ref_group: a2a.operation.metrics.attributes
    +      - ref_group: a2a.error.attributes

    Two things on the operation/duration metric attributes:

    1. a2a.method.name is an open enum and Required on all four metrics. On JSON-RPC servers, method comes straight from the request body, so unknown/arbitrary method names from callers or scanners can blow up metric cardinality. Should we add _OTHER (like http.request.method and rpc.method) for unrecognized methods on metrics?
    2. Compared to mcp.*.operation.duration, we're missing transport/RPC status attributes here:
    - rpc.response.status_code: right now if ErrorInfo.reason is set (e.g. TASK_NOT_FOUND), error.type uses that and drops the JSON-RPC error code (-32001) or gRPC status. Also gateways/proxies that only inspect unary JSON-RPC error.code won't parse ErrorInfo.
    - http.response.status_code and http.request.method (when over HTTP): since JSONRPC and HTTP+JSON run over HTTP and JSON-RPC errors often come back in HTTP 200, having HTTP status/method helps separate L7 gateway errors (401/403/429/5xx) from L8 A2A errors.

    polchernikova-w polchernikova-w commented on code on Nov 19, 2026 09:27 UTC
    Code Review
    model/a2a/registry.yaml:1
    @@ -78,6 +78,19 @@ attributes:
           [versioning](https://a2a-protocol.org/latest/specification/#36-versioning).
         examples: ["1.0"]
         stability: development
    +  - key: a2a.operation.return_immediately

    Sounds good, done. Thanks!

    polchernikova-w polchernikova-w commented on code on Nov 19, 2026 09:46 UTC
    Code Review
    model/a2a/metrics.yaml:1
    @@ -0,0 +1,79 @@
    +file_format: definition/2
    +attribute_groups:
    +  - id: a2a.operation.metrics.attributes
    +    visibility: internal
    +    attributes:
    +      - ref: a2a.method.name
    +        requirement_level: required
    +      - ref: a2a.protocol.version
    +
    +  - id: a2a.operation.duration.metrics.attributes
    +    visibility: internal
    +    attributes:
    +      - ref_group: a2a.operation.metrics.attributes
    +      - ref_group: a2a.error.attributes

    1. Was already pushed back here https://github.com/open-telemetry/semantic-conventions-genai/pull/651#discussion_r4612369661

    2. The A2A spec gives every Error a specfic status code for every transport link, so http.response.status_code is redundant. Same for http.request.method: the A2A spec has this. Overall, I can't find where mcp adopt http.response.status_code or http.request.method. From what I can see, they use network.* attributes, which doesn't fit A2A same as here https://github.com/open-telemetry/semantic-conventions-genai/pull/651#discussion_r4453758005. It deserves some discussion so I'd leave it for out of this PR.

    opentelemetry-pr-dashboard[bot] opentelemetry-pr-dashboard[bot] commented on Nov 26, 2026 02:43 UTC
    Bot

    <!-- pull-request-dashboard-author-nudge:783d24a4c1654029818e24d46144a562 -->
    Hi @polchernikova-w — just a friendly reminder that this pull request is waiting on you. The dashboard status comment has the open items and is kept current.

  • Replying is enough to hand it off — answer, explain why no change is needed, or ask a follow-up. The dashboard rechecks who needs to act once nothing on the list is waiting on you.

  • To hand it back for any other reason, including the dashboard getting this wrong, comment /dashboard route:reviewers.
  • <!-- pull-request-dashboard-author-nudge-completed:783d24a4c1654029818e24d46144a562 -->

    _Outdated as of 2026-11-26 02:43 UTC: this reminder no longer reflects the current dashboard state. Check the dashboard status comment to see whether action is needed._

    polchernikova-w polchernikova-w commented on Nov 26, 2026 09:36 UTC
    Author

    Left a couple inline comments on metric attribute cardinality and missing status/transport labels.

    > Two PR-level questions:

    > a2a.protocol.binding: I saw this was moved out to #612 (+1 on Option 1 there). Since a2a..operation. has no http., rpc., or network. attributes, there's currently no way to break down latency, errors, or active operations by binding (JSONRPC vs HTTP+JSON vs GRPC). Could we either keep a2a.protocol.binding here or make sure #612 adds it to these four metrics too?

    * Are a2a.{client,server}.{request,response}.size histograms (similar to mcp.{client,server}.{request,response}.size in #600) planned in the followup? Tracking payload sizes would be very useful since large task contexts and artifacts directly consume the caller's LLM context window.

    Thanks a lot!

    1. As for protocol binding attribute, I think https://github.com/open-telemetry/semantic-conventions-genai/issues/612 discusses and covers both spans and metrics. It talks about spans only because metrics are not in the repo now.
    2. I think these belong to the transport layer (HTTP or gRPC), not to A2A

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 26, 2026 09:55 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🟡 Changes recommended

    Non-streaming paths finalize server metrics before sending responses, contradicting the model’s transmission-based endpoint and excluding slow sends that streaming measurements include.

    <details open>
    <summary><strong>1 open issue</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Non-streaming measurements exclude response transmission time · New

  • </details>

    <sub>Review effort: Balanced</sub>

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 26, 2026 10:25 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🔵 Needs a closer look

    Human assessment is needed because span-only conformance expectations leave the four new A2A metrics outside missing-telemetry checks.

    No open issues 🎉

    <details>
    <summary><strong>1 resolved since last review</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Non-streaming measurements exclude response transmission time

  • </details>

    <sub>Review effort: Balanced</sub>

    Assignees
    polchernikova-w polchernikova-w
    Labels
    risk: low confidence: 83.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: 92.5% (HIGH) · Higher = larger blast radius
    92.5%
    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: 83.5% · Lower = rushed or shallow review
    83.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: 15.3% · Safe to merge
    15.3%