feat: add chatd tool call error metrics and logging (#24559)

- Add `coderd_chatd_tool_errors_total` prometheus counter (labels:
provider, model, tool_name)
- Log tool call errors at warn level with correlation fields: chat_id,
owner_id, organization_id, workspace_id, agent_id, parent_chat_id,
trigger_message_id, tool_name, tool_call_id, provider, model
- Thread enriched logger from chatd.go into chatloop via
`RunOptions.Logger`
- Remove squashing of all MCP tool calls to the `mcp` bucket

> 🤖
This commit is contained in:
Cian Johnston
2026-04-22 16:19:56 +00:00
committed by GitHub
parent 7904bed947
commit 72e3ae9c5f
6 changed files with 243 additions and 72 deletions
+3
View File
@@ -259,6 +259,9 @@ coderd_chatd_stream_subscribers 0
# HELP coderd_chatd_streams_active Current number of chat stream state entries (in-flight plus retained).
# TYPE coderd_chatd_streams_active gauge
coderd_chatd_streams_active 0
# HELP coderd_chatd_tool_errors_total Total tool calls that returned an error result.
# TYPE coderd_chatd_tool_errors_total counter
coderd_chatd_tool_errors_total{provider="",model="",tool_name=""} 0
# HELP coderd_chatd_tool_result_size_bytes Size in bytes of each tool execution result.
# TYPE coderd_chatd_tool_result_size_bytes histogram
coderd_chatd_tool_result_size_bytes{provider="",model="",tool_name=""} 0