docs: update metrics docs to include metadata batcher metrics (#21665)

This updates the metrics docs to include metrics added in
https://github.com/coder/coder/pull/21330

Signed-off-by: Callum Styan <callumstyan@gmail.com>
This commit is contained in:
Callum Styan
2026-01-26 09:22:14 -08:00
committed by GitHub
parent 7123518baa
commit 806d7e4c11
2 changed files with 70 additions and 0 deletions
+7
View File
@@ -114,6 +114,13 @@ deployment. They will always be available from the agent.
| `coder_aibridged_non_injected_tool_selections_total` | counter | The number of times an AI model selected a tool to be invoked by the client. | `model` `name` `provider` |
| `coder_aibridged_prompts_total` | counter | The number of prompts issued by users (initiators). | `initiator_id` `model` `provider` |
| `coder_aibridged_tokens_total` | counter | The number of tokens used by intercepted requests. | `initiator_id` `model` `provider` `type` |
| `coderd_agentapi_metadata_batch_size` | histogram | Total number of metadata entries in each batch, updated before flushes. | |
| `coderd_agentapi_metadata_batch_utilization` | histogram | Number of metadata keys per agent in each batch, updated before flushes. | |
| `coderd_agentapi_metadata_batches_total` | counter | Total number of metadata batches flushed. | `reason` |
| `coderd_agentapi_metadata_dropped_keys_total` | counter | Total number of metadata keys dropped due to capacity limits. | |
| `coderd_agentapi_metadata_flush_duration_seconds` | histogram | Time taken to flush metadata batch to database and pubsub. | `reason` |
| `coderd_agentapi_metadata_flushed_total` | counter | Total number of unique metadatas flushed. | |
| `coderd_agentapi_metadata_publish_errors_total` | counter | Total number of metadata batch pubsub publish calls that have resulted in an error. | |
| `coderd_agents_apps` | gauge | Agent applications with statuses. | `agent_name` `app_name` `health` `username` `workspace_name` |
| `coderd_agents_connection_latencies_seconds` | gauge | Agent connection latencies in seconds. | `agent_name` `derp_region` `preferred` `username` `workspace_name` |
| `coderd_agents_connections` | gauge | Agent connections with statuses. | `agent_name` `lifecycle_state` `status` `tailnet_node` `username` `workspace_name` |
+63
View File
@@ -915,3 +915,66 @@ coder_aibridged_tokens_total{initiator_id="95f6752b-08cc-4cf1-97f7-c2165e3519c5"
coder_aibridged_tokens_total{initiator_id="95f6752b-08cc-4cf1-97f7-c2165e3519c5",model="gpt-5-nano",provider="openai",type="output"} 2014
coder_aibridged_tokens_total{initiator_id="95f6752b-08cc-4cf1-97f7-c2165e3519c5",model="gpt-5-nano",provider="openai",type="prompt_audio"} 0
coder_aibridged_tokens_total{initiator_id="95f6752b-08cc-4cf1-97f7-c2165e3519c5",model="gpt-5-nano",provider="openai",type="prompt_cached"} 31872
#HELP coderd_agentapi_metadata_batch_size Total number of metadata entries in each batch, updated before flushes.
# TYPE coderd_agentapi_metadata_batch_size histogram
coderd_agentapi_metadata_batch_size_bucket{le="10"} 11
coderd_agentapi_metadata_batch_size_bucket{le="25"} 12
coderd_agentapi_metadata_batch_size_bucket{le="50"} 12
coderd_agentapi_metadata_batch_size_bucket{le="100"} 12
coderd_agentapi_metadata_batch_size_bucket{le="150"} 12
coderd_agentapi_metadata_batch_size_bucket{le="200"} 12
coderd_agentapi_metadata_batch_size_bucket{le="250"} 12
coderd_agentapi_metadata_batch_size_bucket{le="300"} 12
coderd_agentapi_metadata_batch_size_bucket{le="350"} 12
coderd_agentapi_metadata_batch_size_bucket{le="400"} 12
coderd_agentapi_metadata_batch_size_bucket{le="450"} 12
coderd_agentapi_metadata_batch_size_bucket{le="500"} 12
coderd_agentapi_metadata_batch_size_bucket{le="+Inf"} 12
coderd_agentapi_metadata_batch_size_sum 71
coderd_agentapi_metadata_batch_size_count 12
# HELP coderd_agentapi_metadata_batch_utilization Number of metadata keys per agent in each batch, updated before flushes.
# TYPE coderd_agentapi_metadata_batch_utilization histogram
coderd_agentapi_metadata_batch_utilization_bucket{le="1"} 0
coderd_agentapi_metadata_batch_utilization_bucket{le="2"} 0
coderd_agentapi_metadata_batch_utilization_bucket{le="3"} 0
coderd_agentapi_metadata_batch_utilization_bucket{le="4"} 0
coderd_agentapi_metadata_batch_utilization_bucket{le="5"} 10
coderd_agentapi_metadata_batch_utilization_bucket{le="6"} 10
coderd_agentapi_metadata_batch_utilization_bucket{le="7"} 13
coderd_agentapi_metadata_batch_utilization_bucket{le="8"} 13
coderd_agentapi_metadata_batch_utilization_bucket{le="9"} 13
coderd_agentapi_metadata_batch_utilization_bucket{le="10"} 13
coderd_agentapi_metadata_batch_utilization_bucket{le="15"} 13
coderd_agentapi_metadata_batch_utilization_bucket{le="20"} 13
coderd_agentapi_metadata_batch_utilization_bucket{le="40"} 13
coderd_agentapi_metadata_batch_utilization_bucket{le="80"} 13
coderd_agentapi_metadata_batch_utilization_bucket{le="160"} 13
coderd_agentapi_metadata_batch_utilization_bucket{le="+Inf"} 13
coderd_agentapi_metadata_batch_utilization_sum 71
coderd_agentapi_metadata_batch_utilization_count 13
# HELP coderd_agentapi_metadata_batches_total Total number of metadata batches flushed.
# TYPE coderd_agentapi_metadata_batches_total counter
coderd_agentapi_metadata_batches_total{reason="scheduled"} 12
# HELP coderd_agentapi_metadata_dropped_keys_total Total number of metadata keys dropped due to capacity limits.
# TYPE coderd_agentapi_metadata_dropped_keys_total counter
coderd_agentapi_metadata_dropped_keys_total 0
# HELP coderd_agentapi_metadata_flush_duration_seconds Time taken to flush metadata batch to database and pubsub.
# TYPE coderd_agentapi_metadata_flush_duration_seconds histogram
coderd_agentapi_metadata_flush_duration_seconds_bucket{reason="scheduled",le="0.01"} 12
coderd_agentapi_metadata_flush_duration_seconds_bucket{reason="scheduled",le="0.025"} 12
coderd_agentapi_metadata_flush_duration_seconds_bucket{reason="scheduled",le="0.05"} 12
coderd_agentapi_metadata_flush_duration_seconds_bucket{reason="scheduled",le="0.1"} 12
coderd_agentapi_metadata_flush_duration_seconds_bucket{reason="scheduled",le="0.25"} 12
coderd_agentapi_metadata_flush_duration_seconds_bucket{reason="scheduled",le="0.5"} 12
coderd_agentapi_metadata_flush_duration_seconds_bucket{reason="scheduled",le="1"} 12
coderd_agentapi_metadata_flush_duration_seconds_bucket{reason="scheduled",le="2.5"} 12
coderd_agentapi_metadata_flush_duration_seconds_bucket{reason="scheduled",le="5"} 12
coderd_agentapi_metadata_flush_duration_seconds_bucket{reason="scheduled",le="+Inf"} 12
coderd_agentapi_metadata_flush_duration_seconds_sum{reason="scheduled"} 0.008704553
coderd_agentapi_metadata_flush_duration_seconds_count{reason="scheduled"} 12
# HELP coderd_agentapi_metadata_flushed_total Total number of unique metadatas flushed.
# TYPE coderd_agentapi_metadata_flushed_total counter
coderd_agentapi_metadata_flushed_total 71
# HELP coderd_agentapi_metadata_publish_errors_total Total number of metadata batch pubsub publish calls that have resulted in an error.
# TYPE coderd_agentapi_metadata_publish_errors_total counter
coderd_agentapi_metadata_publish_errors_total 0