Repository navigation
[docs] Restructure the observability chapter - #1262
Conversation
…ance Generated-by: Claude Code 2.1.296 (Claude Opus 5.5)
|
Thanks for the overview and scope improvements! Since #1219 has merged, could you also include the remaining metrics and logging work from #1235 in this PR?
This would complete the observability chapter restructuring in one PR. |
… Log Generated-by: Claude Code 2.1.301 (Claude Opus 5.5)
|
@wenjin272 Done in c4837fc, so this now covers the rest of #1235. The metric tables keep each metric's meaning, scope and unit, with the qualifications moved to numbered notes under each table and a link to Flink's Web UI metrics docs. Logging has minimal Python and Java examples inside an Action, the Trace Log sections drop the internal timing and reporting details, and the compatibility notes are gone. I've updated the title and description to match. |
wenjin272
left a comment
There was a problem hiding this comment.
Thanks for restructuring the observability chapter and addressing the earlier feedback! The metrics and logging guidance is much clearer now. I have three small clarification suggestions below to help users locate metrics and choose Trace Log targets.
| | **Model Resource**, **Tool**, **Skill**, **MCP Server**, **Subagent** | `action.<action_name>.<kind>.<name>`, where `<kind>` is `model_resource`, `tool`, `skill`, `mcp_server` or `subagent` | `action.tool_call_action.tool.get_weather.numOfToolCallsSucceeded` | | ||
|
|
||
| Execution latency is measured from matching start and outcome observations of the same call in the same task attempt. Assigning a call identity before preparation or submission does not start the timer. Invoked Tools retain their own start and completion timestamps, even when the reports arrive after a durable call or parallel batch returns. Queueing and time spent waiting for other calls in the batch are excluded. Outcome counters still update when no matching start is available. | ||
| Each group below the Agent scope is a key-value group: `<action_name>` is the Action's name, `<model_name>` the model a chat model reports usage for, and `<name>` the resource, Tool, Skill, MCP Server or sub-agent name. Reporters that support key-value groups, such as Prometheus, expose them as labels. |
There was a problem hiding this comment.
Could you briefly explain that chat_model_action and tool_call_action are built-in Action names and link to the relevant documentation? Users may not know which name to look for in metric paths.
There was a problem hiding this comment.
Updated in bb48488: the paragraph after the scope table now identifies chat_model_action and tool_call_action as built-in Actions.
| #### Token Usage Metrics | ||
|
|
||
| Metric names listed in the built-in tables above are reserved in their corresponding scopes. Custom metrics must use different names within the same scope. | ||
| Token usage metrics are recorded when chat models are invoked through `ChatModelConnection`, which helps track LLM API usage and cost. |
There was a problem hiding this comment.
Please clarify that token usage in the built-in chat flow appears under action.chat_model_action.model.<model_name>, rather than the user Action that sends ChatRequestEvent.
There was a problem hiding this comment.
Clarified in bb48488: the built-in chat flow records token usage metrics under action.chat_model_action.model.<model_name>, not under the Action that sends ChatRequestEvent.
| #### Event and Action Metrics | ||
| - **Metrics** show how much and how fast: Event and Action throughput, input-run outcomes and latency, LLM, Tool and sub-agent calls, and token usage. They go through [Flink's metric system](https://nightlies.apache.org/flink/flink-docs-release-1.20/docs/ops/metrics/), so they reach the same reporters and dashboards as the rest of the job. | ||
| - **Logs** carry what your Action code and the framework write through Flink's logging framework, such as warnings and stack traces. | ||
| - **The [Trace Log](#trace-log)** records Events, Action executions and the calls made within Actions as structured JSON, so you can follow what one input did. By default it records only Events; configure `trace-log.targets` to include Actions and component calls. |
There was a problem hiding this comment.
Could you introduce EVENT_ONLY (Events only, the default) and ALL (all entity types observed by the framework) before the Recording Targets example? Detailed matching rules can remain in the linked configuration reference.
There was a problem hiding this comment.
Updated in bb48488: Recording Targets now introduces EVENT_ONLY (Events only, the default) and ALL (all entity types the framework observes) before the example. Matching rules remain in the configuration reference.
…Log scope presets Generated-by: Claude Code 2.1.302 (Claude Opus 5.5)
wenjin272
left a comment
There was a problem hiding this comment.
Thanks for addressing my comments. LGTM
Linked issue: #1235
Purpose of change
Covers all of #1235 in one PR, as suggested in review.
monitoring.mdnow reads as one observability chapter:The
trace-log,json-formatandrecording-levelanchors that other pages link to are kept. The Chinese docs aren't touched.Tests
Docs only. The site builds with Hugo 0.110.0, the version
docs/setup_hugo.shpins, with no warnings, and every in-page anchor resolves. Restated metric and Trace Log behavior was checked against the runtime, for example that an input run already active at restore records neither an outcome nor latency (BuiltInInputRunMetricsTest) and that the default Trace Log appender writes plain JSON (%msg%ninSlf4jTraceLogger).API
No.
Documentation
doc-neededdoc-not-neededdoc-includedWas this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code 2.1.301 (Claude Opus 5.5)