Metrics reference

Every instrument the SDK records — 27 in all — with its type, unit, attributes, the values each attribute takes, its histogram buckets and its Prometheus name; then the Metrics trait the server's instruments are fed through, and what is not measured. The catalogue on the landing page is the short list of the server's own instruments.

All of them are recorded through the OpenTelemetry API (the otel feature) and exported by Telemetry (Configuring Telemetry). The server's are under the instrumentation scope a2a.server (Prometheus label otel_scope_name="a2a.server"), the client's under a2a.client. Metric names are not listed as stable in STABILITY.md, so a rename is announced in the CHANGELOG.

GroupInstrumentsRecorded by
Server calls and handler14OtelMetrics (the handler's default)
Client calls1Every client call
Agent card and webhooks2The card route; the push sender
Task store1A store that names its database
The tool loop9ToolLoop (feature tool-loop)

Server calls and handler

OtelMetrics records these, from the callbacks of the Metrics trait; with no with_metrics on the handler builder it is what a handler records to.

InstrumentTypeUnitAttributes
rpc.server.call.durationhistogramsrpc.system.name, rpc.method, rpc.status_code, error.type
a2a.server.requestscounter{request}method
a2a.server.responsescounter{response}method
a2a.server.errorscounter{error}method, error
a2a.server.request.durationhistogramsmethod
a2a.server.executor.durationhistogramsoutcome
a2a.server.queue_depthgauge{queue}none
a2a.server.persistence_errorscounter{error}operation, error
a2a.server.store_retriescounter{retry}operation, cause
a2a.server.push_deliveriescounter{delivery}outcome
a2a.server.pool.activegauge{connection}none
a2a.server.pool.idlegauge{connection}none
a2a.server.pool.createdcounter{connection}none
a2a.server.pool.closedcounter{connection}none

The catalogue's fifteenth row, db.client.operation.duration, is recorded by the task store, not OtelMetrics (below). The three duration histograms here use the RPC conventions' advisory buckets, 0.1 ms to 100 s (RPC_DURATION_BUCKETS):

0.0001, 0.0005, 0.001, 0.005, 0.01, 0.05, 0.1, 0.5, 1, 5, 10, 50, 100

A quantile cannot read above the top bucket, so a call that runs past 100 s reads as 100 s.

Attribute values

AttributeValues
methodThe A2A method: SendMessage, SendStreamingMessage, GetTask, ListTasks, CancelTask, SubscribeToTask, CreateTaskPushNotificationConfig, GetTaskPushNotificationConfig, ListTaskPushNotificationConfigs, DeleteTaskPushNotificationConfig, GetExtendedAgentCard
error on a2a.server.errorsServerError::metric_label: task_not_found, task_not_cancelable, invalid_params, serialization, http, http_client, transport, push_not_supported, internal, method_not_found, payload_too_large, unsupported_operation, invalid_state_transition, overloaded, halted; for an A2A error the binding answers as it is, unauthenticated or permission_denied for a refused credential, else its code's label (below); executor_drain_timeout on SendMessage when HandlerLimits::executor_drain_timeout elapses; and push_throttled on PushDelivery, once for each webhook delivery that waited for a permit under HandlerLimits::push_max_in_flight or push_max_in_flight_per_host
A2A code labelsparse_error, invalid_request, method_not_found, invalid_params, internal_error, task_not_found, task_not_cancelable, push_notification_not_supported, unsupported_operation, content_type_not_supported, invalid_agent_response, extended_agent_card_not_configured, extension_support_required, version_not_supported
outcome on a2a.server.executor.durationcompleted, error, budget_exhausted, canceled, aborted (executor_outcome)
outcome on a2a.server.push_deliveriesdelivered, failed (also once for an event whose task's webhook list could not be read), timeout, timeout_truncated, dropped, suspended, gone, throttled, expired, reservation_settled (push_outcome)
operation on persistence_errors and store_retriesstatus_update, artifact_append, artifact_push, event_append, task_snapshot, failed_state, history_append, event_log_catchup, queue_handoff, statement, audit_append, push_config_list (persistence_operation)
error on persistence_errorsThe A2A code label of the store's error, or one of the sub-kinds below
cause on store_retriesunavailable (the store said not now; a turn's write, retried for up to HandlerLimits::store_write_retry), connection_lost (with operation statement: a PostgreSQL statement ran once more on a new connection), read_only (with operation statement: a write a read-only server refused, after a failover, ran once more on a connection opened since)

Every one of these is a bounded set: none carries a task id, a message or a string the peer chose, so a client cannot inflate cardinality through them.

The persistence error sub-kinds, by operation:

operationerrorMeaning
event_appendposition_conflictThe position was already held by a different event, or the store could not establish it was the same one. Look for a second replica serving the same task id
event_appendtask_absentThe in-memory store held no such task (it was evicted)
event_appendhold_ceilingThe in-memory log, at its held-events ceiling, dropped an event an attached stream still owed; that stream ends with streamLagged
event_log_catchuptimed_outA resubscribe's wait for the log to catch up expired; the replay was served short
queue_handoffchannel_closedThe persistence processor was gone and the event was dropped
audit_appendauditAn audit record could not be written

rpc.server.call.duration

The OpenTelemetry semantic conventions' instrument, recorded once per inbound call on every binding, with their attributes:

  • rpc.system.name: jsonrpc (over HTTP or WebSocket), a2a_http_json, grpc, or slimrpc for a2a-protocol-slimrpc.
  • rpc.method: the fully qualified method (lf.a2a.v1.A2AService/SendMessage), _OTHER for one the server does not serve, or absent when the request was refused before it named one.
  • rpc.status_code: the status the binding answered with — the JSON-RPC error code (-32001), the HTTP status (404), or the gRPC status name (NOT_FOUND; gRPC and SLIMRPC, which uses gRPC's status codes, also report OK).
  • error.type, only when the call failed: that status, or cancelled for a call whose peer went away first.

What counts as failed is each binding's semantic conventions' rule, so error.type marks a server failure rather than every answer that was not a success, with one exception: cancelled, a call whose peer went away first, is set so it can be counted, and the recording rules and the error-ratio alert leave it out. Otherwise: every JSON-RPC error code ("All JSON RPC error codes SHOULD be considered errors"); on HTTP+JSON a 5xx but not a 4xx (the HTTP conventions leave a server span's status unset for a 4xx); on gRPC only UNKNOWN, DEADLINE_EXCEEDED, UNIMPLEMENTED, INTERNAL, UNAVAILABLE and DATA_LOSS. A GetTask for an unknown task is rpc.status_code NOT_FOUND (or 404) with no error.type; a dashboard that wants the 4xx class reads rpc.status_code. A binding outside this crate opts into gRPC's rule with CustomBinding::with_grpc_server_errors. The shipped recording rules and alerts go one step further and leave out a JSON-RPC code that A2A maps to a 4xx (-32001 and the rest), so a ratio does not depend on the binding the client chose (what counts as a failure).

It records calls the handler never sees, with the status they were answered: on JSON-RPC, a body that is not a request (no rpc.method), an unknown method, a batch over the limit; on HTTP+JSON and the axum router, a request refused before routing — an unsupported or missing A2A-Version, a content type, a path no route serves (no rpc.method) — and one refused on its body or parameters, under the route's method; on gRPC, a call refused for its metadata or a request that does not convert, under its method. A streaming call — SendStreamingMessage or SubscribeToTask, over SSE, gRPC or WebSocket — lasts until its stream ends, as the conventions ask ("the span SHOULD cover the full lifetime of the request and/or response streams"): it is recorded then, with the error the stream's last frame carried, or cancelled if the client went away first. That is why the shipped latency rules take quantiles over non-streaming calls only. The same values reach a custom Metrics as on_rpc_call.

The a2a.server.* counters

a2a.server.request.duration times the same calls by A2A method, with the same buckets. OpenTelemetry names a duration histogram .duration, so a dashboard built for the conventions finds it (it was a2a.server.latency until 0.15; see the upgrade guide).

requests, responses and errors are separate on purpose. A request ends in exactly one of the other two — a call answered with an error counts in errors, not in responses — so requests − responses − errors is the requests that produced no answer at all: a panicked executor, a dropped connection, a process that went away mid-request. A single counter would hide exactly the failure you want to see. requests − responses alone is not that gap: it counts every error as unanswered, so the recording rule in deploy/observability/ subtracts both (measured against a live Prometheus).

a2a.server.executor.duration records every executor run, by how it ended — the run, which usually outlives the call that started it (a streaming send, a task that waits for input). A run whose future was dropped (a panic, or an abort) is reported as aborted from the guard that watched it, with the time it had taken, so it is in the histogram rather than missing from it.

a2a.server.persistence_errors above zero means a store write failed: the streaming client already received the event, so the stored task and what clients saw have diverged, and a later GetTask returns the wrong answer. a2a.server.store_retries counts writes that failed once and then succeeded, so nothing was lost; a failover shows as a burst, one per statement in flight, and a rate that keeps rising is the store degrading before persistence_errors starts counting what it lost. The log line beside each retry is throttled to one every ten seconds, so the counter, not the log, is the measure.

a2a.server.push_deliveries counts each delivery's final outcome:

delivered          the webhook accepted it
failed             reached, and refused it — or the sender itself errored
timeout            the webhook did not answer inside the time it was given
timeout_truncated  a configuration result: push_delivery_timeout cut the schedule short
dropped            never started: the task's push lane was full behind a slow webhook
suspended          not attempted: the webhook failed push_suspend_after deliveries in a row
gone               the webhook answered 410 Gone and its config was removed
throttled          not attempted: it waited push_delivery_timeout for a slot in the push gate
expired            the push outbox gave up: older than push_outbox_max_age, not delivered
reservation_settled  not a delivery: a worker settled the rows a stopped replica reserved

timeout_truncated is not a network failure. It means push_delivery_timeout was shorter than the sender's own retry schedule, so the delivery was abandoned with attempts remaining; it will not resolve on its own and it will not appear as a webhook error. Every registered config is attempted for every event (spec §4.3.3); push_delivery_budget only sets how many deliveries run at once, so there is no skipped outcome (the push_outcome::SKIPPED constant remains for code that matches on it, and is never reported).

The pool instruments are reported by the servers this crate runs — Server::serve_with_shutdown (and the deprecated serve and serve_with_addr, which run on it). A connection is active while a request on it is in flight, including a response still streaming, and idle while it is open with none; closed counts connections that ended in an error or timeout. The gRPC and WebSocket dispatchers' own listeners, and a router you serve yourself, do not report them.

Client calls

rpc.client.call.duration is the conventions' client histogram (unit s, the same buckets as the server's), with rpc.system.name, rpc.method, rpc.status_code as the server records it (the JSON-RPC code, the HTTP status, or the gRPC status name, OK on a gRPC success), error.type for a failed call (that status, or the failure's class — timeout, transport — when the agent never answered), and server.address and server.port. A streaming call is measured until the caller drops its stream, as its span is.

A call is recorded as it ended for the caller, not as the agent answered: an answer the client then refuses (an interceptor's after hook errors, the result does not decode, the response is malformed, a content signature does not verify) is a failed call, with error.type serialization, invalid_response, content_not_verified or the hook's own error. A call the caller gives up on — its future dropped by a tokio::time::timeout or a select! — and a stream dropped before its final event or the end of its body are recorded as error.type cancelled, with the time they ran, as the server records a peer that goes away; the slow calls a caller abandons are the ones a latency panel most needs. A stream read to its end is not. The interceptors' error hook does not run for a dropped call: a destructor cannot await it. A call refused before anything is sent — an undeclared capability, a message that is not well formed, a before hook that fails — is not an RPC and is not recorded.

The metric records through the global meter provider — the one Telemetry installs — as it stands at each call, so a client built before Telemetry records once it is installed, under the meter a2a.client. A call on a custom transport that names no rpc.system.name (Transport::rpc_system) is not recorded, since that attribute is required.

Agent card and webhooks

http.server.request.duration (histogram, s) times each request for the card at /.well-known/agent-card.json, on any listener that serves it (JSON-RPC, HTTP+JSON, the axum router, WebSocket, gRPC), under the a2a.server scope. It carries only http.request.method, url.scheme, http.route, http.response.status_code, network.protocol.version and, for a 5xx, error.type (the status) — none of which a caller can choose freely. The request's span carries more (Spans reference).

http.client.request.duration (histogram, s) times each push-notification POST, every retry included, under the a2a.server scope. Its attributes are those of the attempt's POST span: http.request.method (POST), server.address, server.port, http.response.status_code when a response came back, and error.type when the attempt failed: the status for a 4xx or 5xx, timeout, or transport for no response. The URL is not an attribute, because it would carry the receiver's secret and unbounded values. a2a.server.push_deliveries counts each delivery's final outcome; this metric times each attempt.

Both use the HTTP conventions' advisory buckets, 5 ms to 10 s:

0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10

Task store

db.client.operation.duration (histogram, s) times each operation of a task store that names its database through TaskStore::database, under the a2a.server scope, with the database conventions' advisory buckets, 1 ms to 10 s:

0.001, 0.005, 0.01, 0.05, 0.1, 0.5, 1, 5, 10

Its attributes are the operation's span's (Spans reference): db.system.name (postgresql, sqlite, or a custom store's), db.operation.name (the trait method: get, save_status_delta, append_event, …), db.namespace and server.address / server.port for PostgreSQL, and on failure error.type: unavailable for a temporary failure (a pool with no free connection, a locked SQLite file, a PostgreSQL connection error), otherwise the A2A error code the store answered (-32603 internal). The SQLite and PostgreSQL stores, their tenant-aware forms, and the encrypted and audited wrappers around them name their database; the in-memory stores run against no database and record nothing. An operation whose future is dropped before it finishes records no duration.

In Prometheus, fed over OTLP, it is db_client_operation_duration_seconds, with labels db_system_name, db_operation_name and, on failures, error_type (measured 2026-10-24 against Prometheus 3.15.1 with a SQLite store).

The tool loop

A ToolLoop (server::tool_loop, feature tool-loop, with otel) records the OpenTelemetry GenAI conventions' metrics (open-telemetry/semantic-conventions-genai at 9ffc7e0, all development), with their advisory buckets:

InstrumentTypeUnitRecordedBuckets
gen_ai.client.inference.durationhistogramsEach model turn0.01 to 81.92 s, doubling
gen_ai.client.inference.usage.input_tokenscounter{token}Each turn whose provider reported a non-zero count—
gen_ai.client.inference.usage.output_tokenscounter{token}Likewise—
gen_ai.client.inference.operation.input_tokenshistogram{token}Each turn whose provider reported a count1 to 67,108,864, ×4
gen_ai.client.inference.operation.output_tokenshistogram{token}Likewise1 to 67,108,864, ×4
gen_ai.execute_tool.durationhistogramsEach tool call that ran0.01 to 81.92 s, doubling
gen_ai.invoke_agent.durationhistogramsEach run of the loop0.1 to 409.6 s, doubling
gen_ai.invoke_agent.inference_callshistogram{inference_call}Each run: how many turns it asked for1 to 128, doubling
gen_ai.invoke_agent.tool_callshistogram{tool_call}Each run: how many calls it ran1 to 128, doubling

Their attributes:

InstrumentsAttributes
A turn's duration and token histogramsgen_ai.operation.name (chat), gen_ai.provider.name, gen_ai.request.model; when known gen_ai.response.model (the first 16 names a process sees, _OTHER after, or for one over 128 bytes), server.address, server.port; error.type on failure
The usage countersThe same without error.type, plus gen_ai.token.modality (text)
gen_ai.execute_tool.durationgen_ai.tool.name, gen_ai.tool.type (function); error.type on failure
gen_ai.invoke_agent.durationgen_ai.request.model, gen_ai.agent.name (from ToolLoop::with_agent_name, when set); error.type on failure
The two per-run countsgen_ai.agent.name only

error.type is, for a turn, the provider's failure (ModelError::error_type: the HTTP status, timeout, transport, invalid_response, response_too_large, configuration, _OTHER); for a call, unknown_tool, invalid_arguments, tool_error or tool_fatal; for a run, the turn's type when the model failed, tool_fatal, turn_limit, budget_exhausted or empty_answer; and cancelled for any of them abandoned before it ended — its cancellation token fired, or the future running it was dropped, as an executor timeout does. gen_ai.client.operation.duration is not recorded: the conventions say it "SHOULD NOT be reported for inference operations".

The metrics go to the global meter provider as it is when each is recorded, so Telemetry installed after the loop is built still receives them; ToolLoop::with_meter sends them elsewhere.

Process and runtime

When metrics are exported, Telemetry also reports the process itself, under the semantic conventions' process metrics (audit C-13):

InstrumentKind, unitWhat
process.cpu.timecounter, s, cpu.mode = user | systemCPU time used, from /proc/self/stat (USER_HZ = 100)
process.memory.usageup-down counter, ByResident memory (VmRSS)
process.memory.virtualup-down counter, ByVirtual memory (VmSize)
process.thread.countup-down counter, {thread}Threads (Threads)
process.unix.file_descriptor.countup-down counter, {file_descriptor}Entries in /proc/self/fd

They are read on Linux only; on macOS and Windows they are not reported (no series rather than a wrong one), so nothing needs a new dependency or unsafe. The Tokio runtime Telemetry::builder().build() runs in (or the one given to with_tokio_runtime) reports three of Tokio's stable RuntimeMetrics, no tokio_unstable needed:

InstrumentUnitWhat
tokio.runtime.worker.count{thread}Worker threads
tokio.runtime.task.count{task}Tasks alive
tokio.runtime.global_queue.depth{task}Tasks waiting in the global queue

The conventions name no Tokio metric; these names are this crate's. A Telemetry built before the runtime starts reports none unless given its handle. without_process_metrics() turns both tables off. In Prometheus they are process_cpu_time_seconds_total, process_memory_usage_bytes, process_thread_count, tokio_runtime_task_count and so on.

Prometheus names

Prometheus, fed over OTLP with UnderscoreEscapingWithSuffixes (the shipped configuration), scraping a Collector's Prometheus exporter, or scraping the agent's own /metrics, gives the same names: dots become underscores, counters gain _total, an s unit gains _seconds, and a brace-annotated unit adds nothing. Labels follow the same rule (rpc.system.name → rpc_system_name). The Source column says whether the name was read from a live Prometheus or follows from that rule.

InstrumentPrometheus nameSource
rpc.server.call.durationrpc_server_call_duration_secondsmeasured
a2a.server.requestsa2a_server_requests_totalmeasured
a2a.server.responsesa2a_server_responses_totalmeasured
a2a.server.errorsa2a_server_errors_totalmeasured
a2a.server.request.durationa2a_server_request_duration_secondsmeasured
a2a.server.executor.durationa2a_server_executor_duration_secondsderived
a2a.server.queue_deptha2a_server_queue_depthmeasured
a2a.server.persistence_errorsa2a_server_persistence_errors_totalmeasured
a2a.server.store_retriesa2a_server_store_retries_totalderived
a2a.server.push_deliveriesa2a_server_push_deliveries_totalmeasured
a2a.server.pool.activea2a_server_pool_activemeasured
a2a.server.pool.idlea2a_server_pool_idlemeasured
a2a.server.pool.createda2a_server_pool_created_totalmeasured
a2a.server.pool.closeda2a_server_pool_closed_totalmeasured
db.client.operation.durationdb_client_operation_duration_secondsmeasured
rpc.client.call.durationrpc_client_call_duration_secondsmeasured
http.server.request.durationhttp_server_request_duration_secondsderived
http.client.request.durationhttp_client_request_duration_secondsderived
gen_ai.client.inference.durationgen_ai_client_inference_duration_secondsmeasured
gen_ai.client.inference.usage.input_tokensgen_ai_client_inference_usage_input_tokens_totalmeasured
gen_ai.client.inference.usage.output_tokensgen_ai_client_inference_usage_output_tokens_totalmeasured
gen_ai.client.inference.operation.input_tokensgen_ai_client_inference_operation_input_tokensmeasured
gen_ai.client.inference.operation.output_tokensgen_ai_client_inference_operation_output_tokensmeasured
gen_ai.execute_tool.durationgen_ai_execute_tool_duration_secondsmeasured
gen_ai.invoke_agent.durationgen_ai_invoke_agent_duration_secondsmeasured
gen_ai.invoke_agent.inference_callsgen_ai_invoke_agent_inference_callsmeasured
gen_ai.invoke_agent.tool_callsgen_ai_invoke_agent_tool_callsmeasured

The server rows marked measured were rendered through opentelemetry-prometheus 0.33.1, the version matching this crate's opentelemetry_sdk (re-measured 2026-10-18 after the 0.15 rename and the move to UCUM units). The client, store and GenAI rows are the names the shipped recording rules and dashboards query, every one of which returned data from a live Prometheus fed by these agents (2026-10-23 and 2026-10-24; see deploy/observability/README.md). The {token}, {inference_call} and {tool_call} histograms have no unit suffix, because the exporter suffixes only units it can translate. The derived rows were added after those measurements.

Alongside them the exporter emits target_info, a gauge carrying the resource (Resource attributes).

The Metrics trait

The server's instruments are fed through server::metrics::Metrics, a trait with a default no-op implementation for every method. OtelMetrics implements it; so can you, to count something of your own (RequestHandlerBuilder::with_additional_metrics) or to replace the export (with_metrics).

CallbackCalledFeeds
on_request(method)A request is received, before processinga2a.server.requests
on_response(method)A response is sent successfullya2a.server.responses
on_error(method, error_kind)A request ends in an errora2a.server.errors
on_latency(method, duration)A request completes, either waya2a.server.request.duration
on_rpc_call(&RpcCall)Once per inbound call on every binding, including calls the handler never reachedrpc.server.call.duration
on_executor_run(outcome, duration)An executor's run endsa2a.server.executor.duration
on_queue_depth_change(active_queues)The number of active event queues changesa2a.server.queue_depth
on_connection_pool_stats(&ConnectionPoolStats)With the HTTP connection counts, from the SDK's own serversa2a.server.pool.*
on_persistence_error(operation, error_kind)A task write could not be persisteda2a.server.persistence_errors
on_store_retry(operation, cause)A store operation is run again after a failure that passeda2a.server.store_retries
on_push_delivery(outcome)A push delivery endsa2a.server.push_deliveries
on_refusal(cause)A request is refused before any work: stream_cap, tenant_cap, push_config_cap, idempotency_store, event_log, halt_storea2a.server.refusals
on_lease(event)A task lease event: lapseda2a.server.lease.events
on_halt(scope, action, stopped)A halt or resume is applied: scope all | tenant | root (a job), action halt | resume, and the running tasks it stoppeda2a.server.halts, a2a.server.halt.stopped_tasks
on_steering(outcome)A steering message is decided about (ADR 0036): delivered, handed_off, replayed, full, ended, too_large, halted, unread, receiveda2a.server.steering
on_claim(event)A turn-claim event: reaped (the reaper ended a task its replica left), finished (the reaper logged and pushed the ending of a task that was terminal in the store when its replica stopped)a2a.server.claim.events
on_subscribe_wake(cause)A cross-replica SubscribeToTask stream stops waiting to read the store again, on a store that can wake it (with_log_notifications): notification, resync (the listener reconnected), or timeouta2a.server.subscribe.wakes

RpcCall carries system, method (Option), duration, status_code (Option), error_type (Option) and tenant (Option, the tenant the handler resolved), the values above. The label constants are public modules: executor_outcome, persistence_operation, push_outcome, event_append_error, event_log_catchup_error, queue_handoff_error, control (refusal, lease, halt_scope, halt_action, claim) and subscribe_wake (notification, resync, timeout). The four control-plane hooks, and on_subscribe_wake, are new in 0.16.0 with empty default bodies, so an existing Metrics implementation compiles unchanged (audit H11, E-F25).

Tenant and agent dimensions

Off by default, so no series an existing dashboard reads changes. On OtelMetrics (from OtelMetricsBuilder::build() or Telemetry::otel_metrics()):

use a2a_protocol_sdk::server::otel::Telemetry;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let telemetry = Telemetry::builder().build()?;
let metrics = telemetry
    .otel_metrics()
    .with_tenant_dimension(["acme", "globex"]) // others are `_OTHER`
    .with_agent_name("billing"); // one per handler
drop(metrics);
Ok(())
}

with_tenant_dimension(allowed) adds a2a.tenant to rpc.server.call.duration, a2a.server.executor.duration and a2a.server.refusals: the tenant's name when it is in allowed, _OTHER for any other tenant, and no label for a request with none, so each series splits into at most allowed.len() + 1, the bound the operator writes. with_agent_name(name) adds gen_ai.agent.name (the span's attribute name) to those and to the control-plane counters, for a process serving several agents with one OtelMetrics each. There is no job or task dimension, by rule (ADR 0034 §4): a job, root or task id is unbounded, and a per-job view is a trace query (a2a.task.id, the lineage root) or a collector's span metrics, not a series. ConnectionPoolStats carries active_connections, idle_connections, total_connections_created and connections_closed, the last two cumulative since start (OtelMetrics adds only the increase to its counters). NoopMetrics discards everything, and Arc<T> implements Metrics for any T that does.

MetricsHandle is the shareable Metrics a task store holds: every store in this crate has with_metrics(MetricsHandle), built with MetricsHandle::new(metrics) or MetricsHandle::from_arc(arc), and defaults to NoopMetrics. The store reports what only a store can see — an event that never reached the log, a held event dropped at the ceiling. The handler builder gives the default store it creates the handler's own metrics; a store you supply keeps the metrics you gave it, so pass the same metrics to both if you want those counts.

What is not measured

Stated so a green dashboard is not mistaken for a complete one:

  • A store's individual SQL statements have no span. Each task-store operation is one span and one db.client.operation.duration point; the statements inside it are not. sqlx 0.9 reports each as a tracing event, not a span (target sqlx::query, with the SQL as db.statement — placeholders, not the bound values — rows_affected and elapsed_secs), at DEBUG, or at WARN when it takes a second or more. Under Telemetry those events are log records in the trace of the operation that ran them; the slow ones at the default INFO log level, every one with TelemetryBuilder::with_log_level(Level::DEBUG). A custom store that does not override TaskStore::database has neither span nor duration.
  • There is no per-tenant metric dimension. A tenant hitting max_concurrent_tasks shows as Overloaded errors in the aggregate; see Multi-Tenancy for what the limits actually are. (The call's span does carry a2a.tenant.)
  • Model calls are seen only through the tool loop. An executor built on server::tool_loop (feature tool-loop) records a chat span per model call and an execute_tool span per tool call, under invoke_agent, and the gen_ai.* metrics above. Any other model client is invisible to the SDK: instrument it, or use a framework that reports chat spans.
  • The connection pool of the gRPC and WebSocket listeners and of a router you serve yourself is not reported.