GitHub user joeyutong added a comment to the discussion: 
[Discussion][Observability 2/2] Built-in Operational Metrics for Flink Agents

Thanks for raising these points. I agree that these contracts should be made 
more explicit.

**Retry scope and compatibility.** The move from `model` to `model_resource` is 
an intentional breaking change to the metric scope; the compatibility statement 
applies only to the existing metric names. The scope value identifies the 
configured ChatModel setup selected by `ChatRequestEvent.model`, not the 
underlying ChatModel connection. LLM health and retry metrics belong to the 
setup because they describe the framework-level logical call and retry loop in 
`ChatModelAction`. Connection or provider SDK transport retries are a separate 
lower-level signal and are not covered by these metrics.

**MCP Server identity.** The Part 1 prototype already propagates this identity 
in both Java and Python. When an MCP Server declared in the AgentPlan is 
expanded into Tool resources, each discovered MCP Tool retains the declared 
server resource name. At execution time, the Tool exposes that name through the 
common Tool execution metadata contract, and the metrics recorder uses it as 
the `mcp_server` scope. Both runtime paths use the same metadata key and 
semantics. If that identity is unavailable, the runtime does not infer it from 
the endpoint and does not emit the server-scoped metric.

**Latency aggregation.** Agreed. The current latency histograms are scoped to 
an Action and resource, so their exported percentiles should not be treated as 
generally composable across Actions. The resource-wide aggregation statement 
applies to counters such as call successes and failures, not to latency 
percentiles. The proposal now clarifies that `llmCallLatencyMs`, Tool latency, 
Skill latency, and MCP latency describe their respective per-Action resource 
scopes.

**Gauge recovery semantics.** In the prototype, all four proposed Gauges are 
reconstructed from restored runtime state. Active input runs come from the 
restored processing-key state, pending input Events from the pending-Event 
state, pending Action tasks from the restored ActionTask queues, and active 
Action executions from restored tasks whose execution-start marker is set. 
These Gauges are reconstructed from checkpointed state rather than reset or 
treated as best-effort after failover. The proposal now spells out these state 
sources.

**Tool success/failure parity.** Tool outcome is a framework-level contract 
rather than an interpretation of arbitrary return payloads. A normal return is 
successful; an exception or a framework-recognized error result is failed. Java 
`ToolResponse.error` and the corresponding normalized Tool result used by the 
Python execution path both produce a failed Tool execution. The runtime does 
not inspect an arbitrary raw return value to guess whether it represents an 
error. This boundary is now explicit in the proposal.


GitHub link: 
https://github.com/apache/flink-agents/discussions/901#discussioncomment-17698167

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to