Skip to content

Metrics

This page lists every Prometheus metric Agent Kourier exports at /metrics, with its labels and what it counts. Setting up the scrape is Export metrics and traces.

Metric labels carry configured names (Bindings, connections) and values from closed sets, never prompts, answers, user names or error text.

Series by connection

A broker serves up to 16 ChatConnections (Limits: its own included if it has one, and none at all for a broker with no own connection whose listed namespaces hold none it can serve). The series that belong to one carry the label connection, the ChatConnection as namespace/name, so that one connection's numbers are not added to another's: agentkourier_chat_connected, agentkourier_intake_total, agentkourier_chat_api_calls_total, agentkourier_slack_events_shed_total, agentkourier_slack_ack_duration_seconds, agentkourier_slack_http_requests_total, agentkourier_slack_http_retries_total, agentkourier_teams_requests_total, agentkourier_teams_tokens_refused_total, agentkourier_teams_activities_shed_total, agentkourier_teams_activities_lost_total, agentkourier_teams_socket_envelopes_total, agentkourier_teams_socket_reconnects_total, agentkourier_teams_socket_gap_seconds, agentkourier_teams_socket_ready, agentkourier_teams_graph_notifications_total, agentkourier_teams_graph_channels, agentkourier_teams_graph_polls_total, agentkourier_teams_graph_read_messages_total, agentkourier_teams_graph_catchups_total, agentkourier_teams_graph_throttled_total, agentkourier_webhook_requests_total, agentkourier_webhook_ack_duration_seconds, agentkourier_webhook_last_accepted_timestamp_seconds, agentkourier_chat_listener_requests_total, agentkourier_outbox_pending and agentkourier_outbox_oldest_age_seconds. Series that belong to a Binding carry binding, and the rest are the broker's as a whole.

How many values of connection each family can have:

  • agentkourier_intake_total, agentkourier_chat_api_calls_total, agentkourier_slack_events_shed_total, agentkourier_slack_ack_duration_seconds, agentkourier_slack_http_requests_total, agentkourier_slack_http_retries_total, agentkourier_teams_requests_total, agentkourier_teams_tokens_refused_total, agentkourier_teams_activities_shed_total, agentkourier_teams_activities_lost_total, agentkourier_teams_socket_envelopes_total, agentkourier_teams_socket_reconnects_total, agentkourier_teams_socket_gap_seconds, agentkourier_teams_graph_notifications_total, agentkourier_teams_graph_polls_total, agentkourier_teams_graph_read_messages_total, agentkourier_teams_graph_catchups_total and agentkourier_teams_graph_throttled_total: one for each connection the broker serves, so at most 16 (a call that is still in flight when a connection is removed can bring one of its series back, stale). A connection that was never served has none.
  • agentkourier_teams_socket_ready: one for each region of each Microsoft Teams connection in socket mode that the broker serves, three regions (amer, emea, apac), so at most 48. It says 0 for a region whose socket is not ready, and for every region once the connection's run has ended.
  • agentkourier_teams_graph_channels: one for each state (subscribed, waiting_group, failing) of each Microsoft Teams connection with a spec.teams.notificationURL that the broker serves, and each (polling, waiting_group, failing) of each one without, so at most 48. It says 0 for every state once the connection's run has ended.
  • agentkourier_webhook_requests_total, agentkourier_webhook_ack_duration_seconds and agentkourier_webhook_last_accepted_timestamp_seconds: each webhook connection the broker serves, so at most 16. agentkourier_webhook_requests_total has a series for every outcome and reason it can count, at 0 from when the connection's run starts, so that a rule over it has a value after a restart. agentkourier_webhook_ack_duration_seconds has a series for each outcome the connection has answered a request with since the broker started, so at most 10 for each connection. agentkourier_webhook_last_accepted_timestamp_seconds has one series for each connection that has answered a request accepted since the broker started, and none before.
  • agentkourier_chat_connected: at most one for each connection the broker serves, so at most 16. It says 0 for a connection that is not connected: one that stopped because the platform rejected its credentials, one whose Secret cannot be read or whose credentials the platform rejected when it was asked whose bot it is, so that it never started, and one that is starting. A connection that is waiting for the platform to say whose bot it is has no series yet, unless its Secret could not be read before it waited, which set the 0.
  • agentkourier_chat_listener_requests_total: one for each connection the leader serves, whether it runs or not, so at most 16, and unknown for every other request. The path of a request is the sender's to choose, so a connection it names is a value only while the leader serves that connection; a standby serves none, and counts every request under unknown.
  • agentkourier_outbox_pending and agentkourier_outbox_oldest_age_seconds: each connection served, which says 0 while it has no unposted row; the empty value, for rows written before the broker recorded connections; and each connection that is no longer served but still has an unposted row, until retention abandons the row.

What the broker does to the series:

  • When the broker stops serving a ChatConnection while it runs, it deletes that connection's series of the families in the first four items above, its agentkourier_chat_listener_requests_total series and its agentkourier_chat_connected series. A request to the connection's route after that is counted under connection="unknown", until the broker serves the connection again, so no request brings the deleted series back. A connection stops being served when its ChatConnection is deleted, when an older ChatConnection pushed it past the limit, or when it is a second connection of a Slack or Microsoft Teams app that an older one uses; the last holds also when a rotated Secret turns a connection into the second of such an app. If it serves the connection again, those counters start from zero, and agentkourier_chat_connected is back at 0 and then 1 when it is up. A connection that is restarted because its ChatConnection or its Secret changed, and one whose credentials the platform rejected, keep theirs (a rejected one says 0). A connection also leaves the served set while the broker runs when its namespace loses the label that AGENTKOURIER_CONNECTION_NAMESPACE_SELECTOR matches, which the broker follows live: it stops serving the connection after the next read and deletes its series, as for a deleted connection, with no restart. It leaves too when its namespace is taken off AGENTKOURIER_CONNECTION_NAMESPACES, when the selector changes and no longer matches it, or when it was the broker's own and AGENTKOURIER_CHAT_CONNECTION now names another or is unset (and its namespace is not admitted), but the three variables are read at start, so the restart that applies the change starts with no series of it.
  • The two outbox gauges are read from the stored rows at each scrape, with one query grouped by connection, and the broker adds a 0 for each connection it serves that the query did not return. The replica that leads adds the team connections it serves (a refused second connection of an app is not one); a replica that does not lead names only its own connection, and none when the broker has no own connection. A row written before the broker recorded connections has connection="" until the leader gives it to its own connection when it starts, and again after an older image has written rows. A broker with no own connection has none to give it to: its leader refuses to start while such a row exists (Troubleshoot).
  • Each connection's adapter has its own lanes, so the event limits on Limits apply to each connection separately.

Alert rules for a broker with no connection of its own

A broker with an own connection ends the process, with exit code 1, when Slack rejects its token. A broker with none does not: every connection it serves is a team connection, which a rejected token stops alone. With every token rejected the pod stays up and /readyz says ready, and agentkourier_chat_connected is 0 for each connection while its Bindings read ChatCredentialsRejected. Two rules on the metric catch it. Both use for: 10m, longer than a reconnect, which sets the gauge to 0 until Slack's hello, or in HTTP mode until the connection's auth.test passes again (Limits).

- alert: AgentKourierNoChatConnectionUp
  expr: max(agentkourier_chat_connected{namespace="agent-kourier"}) < 1
  for: 10m
- alert: AgentKourierChatConnectionDown
  expr: agentkourier_chat_connected{namespace="agent-kourier"} == 0
  for: 10m

The first says no connection is up at all; the second names (by its connection label) each connection that is down while others may be up. The series exist on the leader only, and a standby has none, so max over the Deployment's pods reads the leader's. namespace="agent-kourier" stands for the release's namespace. The metric carries no namespace label itself, so the selector relies on the label that the Prometheus Operator puts on the targets of a ServiceMonitor: the chart's ServiceMonitor sets no relabeling, and that label is the Operator's default, which was not run for this page. Use the label your scrape gives this release.

Two cases these rules do not see. A broker that serves no connection has no series, and max of nothing is no value, so the first rule stays silent: that is a broker whose listed namespaces hold no ChatConnection yet, and absent(agentkourier_chat_connected{namespace="agent-kourier"}) for the same time catches it, and the minutes of a takeover too. And a connection that is waiting to learn whose bot its token is has no series yet, so the second rule does not see it; its Bindings read ChannelJoined Unknown with ChatUnavailable, and a rule on agentkourier_binding_ready == 0 does (Binding verification).

Connection, configuration and turns

Metric Type Labels Definition
agentkourier_chat_connected gauge connection 1 while the connection to the chat platform is up, else 0, by ChatConnection. For Slack in Socket Mode that is while its WebSocket is up; in HTTP mode, while the connection takes Slack's requests on the chat listener, from when auth.test passed until its run ends. A connection that is stopped, or that cannot start, says 0. The series of a connection is deleted when the broker stops serving it (the ChatConnection is deleted, or is no longer one the broker serves). /readyz does not say this, and a broker whose connections are all down is still ready: alert on it.
agentkourier_turn_outcomes_total counter binding, outcome Turns that ended, by Binding and how: the terminal state of the task, or the class of what stopped it. outcome is one of completed, failed, rejected, canceled, credentials_rejected, forbidden, unreachable, session_gone, binding_gone, wedged, uncancellable, pause_ended, answer_rejected, refused, no_final, response_too_large, lookup_incomplete. It is counted before the session turn ended log line.
agentkourier_config_stale gauge 1 before the first config load, and while the running config may lag its source: the latest reload failed, or the source says it cannot be reached.
agentkourier_config_reload_errors_total counter Config reloads that failed.
agentkourier_config_invalid_objects gauge kind Objects that the broker refuses or holds past their deletion, by kind (AgentBackend, ChatConnection or Binding): a Binding of this broker (it names this broker's connection, or none that exists) that fails validation, or whose chat IDs or features the platform of its ChatConnection does not take (InvalidPlatformID, UnsupportedOnPlatform); any AgentBackend in the cluster that fails it, including one no Binding of this broker uses; this broker's own ChatConnection when it fails validation or was deleted and is held; and, while that connection is held, each Binding of it and each AgentBackend they use that was deleted and is held with it; a held Binding that resolution leaves out, for any reason (it lost its channel, its backend is gone, or its backend no longer allows it), is counted and not served. Always 0 while the config is read from files, where one bad object fails the whole reload and counts under agentkourier_config_reload_errors_total instead.
agentkourier_config_held_objects gauge kind Objects that were deleted and that the broker holds at their last good generation, by kind, while its own ChatConnection is deleted and held: the connection itself, the Bindings of it that are gone, and the AgentBackends that they and the Bindings of it that are still there use and that are gone. A nonzero value means the broker holds from memory what the cluster no longer has; a held Binding that resolution leaves out, for any reason (it lost its channel, its backend is gone, or its backend no longer allows it), is held and not served, and has no status to say so. The broker's log at the start of the hold counts only those whose backend is not in the config at that moment (held_without_backend). Always 0 while the config is read from files, and 0 when nothing is held; a broker with no own connection holds nothing, so it is always 0 there too.
agentkourier_config_binding_rejections gauge reason Bindings that are not accepted as written, by reason: InvalidSpec, BackendNotFound, BackendRejected, ConnectionNotFound, ConnectionRejected, ConnectionNotServed, NamespaceNotAllowed, AgentNamespaceNotAllowed, InvalidPlatformID, UnsupportedOnPlatform or ChannelConflict, and other for a reason outside that set (none is written today). A Binding that is served from an older generation of itself counts too. The series can overlap: a Binding with more than one rejection is counted under each of its reasons, so their sum can exceed the number of Bindings that are not accepted. Always 0 while the config is read from files. A Binding that is not accepted has no agentkourier_binding_ready series, since that gauge is the prober's and only a served Binding is probed: alert on this one. ConnectionNotServed counts the Bindings whose Accepted condition the leader writes that reason to: those of a ChatConnection that exists and that the broker does not serve (it is past the 16 the broker serves, its namespace was taken off the list, it was the broker's own connection and AGENTKOURIER_CHAT_CONNECTION now names another or is unset, and its namespace is not on the admission list, or it is a second connection of a Slack or Microsoft Teams app the broker already serves). A connection the broker served before and does not now keeps its Bindings in the count for as long as its ChatConnection exists, even when another release serves it. A Binding that the connection does not admit has no such status and is not counted, and a Binding that another reason comes before in the order of the Accepted reasons is not counted under it (it counts under that reason). A Binding of a refused connection that is served from an older generation and has a rejection that comes after it (NamespaceNotAllowed, AgentNamespaceNotAllowed or ChannelConflict) counts under both. It is the leader's own count, taken at each pass of its status writer: a standby, which has no writer, reads 0 for it, and so does a replica that has not led yet; the series of the other reasons are every replica's, from the config it read. A new leader sets it at the first pass of its writer, as it starts leading. Sum it over the replicas, or read the leader's.
agentkourier_binding_status_writes_total counter result Writes of a Binding's status by the leader, by result: written, put_back (written again to the words it already had, because the status was changed since: a person's edit, or another writer; steady growth is a fight, which the troubleshooting page explains), or failed (the API server refused the write or could not be reached; the write is tried again after a wait that starts at 10 seconds and doubles up to 5 minutes). A write that finds the Binding already deleted counts as none of them. It has series only after the leader of a broker that reads the custom resources has tried a write, so it has none while the config is read from files.
agentkourier_crd_schema_state gauge crd, state What the broker found when it compared the schema hash on each of the three CRDs with the one it was built with, at start and again every minute: 1 for the state found and 0 for the other three, by crd and state (match; mismatch: another hash, so the CRDs and this image are not from the same chart release, and the log warns when a CRD's result changes to it, naming the CRD and both hashes; it warns again if the CRD goes unknown and back; unannotated: the CRD has no hash, as a CRD from an older chart or file; unknown: the CRD could not be read). The hash is an annotation that the generated CRD files carry, so a Helm install and a kubectl apply apply it (a GitOps tool that applies the files should too: that is what such a tool should do, and none has been run): it says which files were applied, and is not proof of what the API server serves (a CRD edited by hand keeps it). During an API outage the series goes to unknown, so mismatch reads 0 and an alert on it resolves, then fires again when the API server answers. A broker that reads files has no series. A broker with mismatch serves as usual: update the CRDs the way they were installed, to those of the chart release that matches the image (helm upgrade with crds.install for CRDs Helm made, kubectl apply --server-side -f of that release's files/crds for CRDs kubectl made), and the next comparison clears it.
agentkourier_credential_rejections_total counter binding Credentials an agent rejected, by Binding: the front door refused the Binding's token.
agentkourier_audit_write_failures_total counter kind Audit entries that could not be written, by kind.
agentkourier_approval_outcomes_total counter binding, outcome Pauses a Binding's policy turned away (auto_denied, ask_user_cancelled), tool approvals decided (approved, denied, partially_approved) or timed out (timed_out), or pauses of either kind that were ended without a word in the thread because their Binding is not in the config or the broker does not serve their chat connection (a second connection of a Slack or Microsoft Teams app another connection uses, or one that is not in the config; a connection that is in the config and not running, with its credentials rejected say, is served and its pauses wait) (orphaned, 5m after the first sweep that finds the pause both past its timeout and orphaned: Limits), by Binding and outcome.
agentkourier_interaction_decisions_total counter result Presses decided on an interaction, by result. unrecorded counts a press ended because its decision audit row cannot be written; no decision is sent.
agentkourier_interaction_timeouts_total counter Interactions that timed out unanswered, and were ended as the timeout does (not those counted as orphaned above).
agentkourier_outbox_abandoned_total counter reason Outbound posts given up on, by reason: the outbox's own invalid (not postable, or an unreadable payload), lookup_timeout and expired (still unposted after 7 days), or the platform's channel_gone, too_long, invalid_content and other.
agentkourier_leader gauge 1 while this replica does Agent Kourier's work (it leads, or it is the only replica: SQLite), 0 while it is a standby.
agentkourier_leader_takeovers_total counter Times this replica took the leadership: it won the lease and was given the next epoch.
agentkourier_leader_pod_label_writes_total counter result Writes of the leader label, agentkourier.dev/role=leader, on this replica's own pod, which the chart's chat Service selects, by result: labeled (put on, as the replica began to lead), unlabeled (taken off, as the replica started, and at shutdown when it may have been on) or failed (the API server refused the patch or could not be reached in time; it is logged as an error and tried again, see Limits; a first write refused as forbidden, or for a pod the API server does not have, fails the start instead). Only a broker with a chat listener that is told its pod (AGENTKOURIER_POD_NAMESPACE) has these series, and only for a result it has seen. A leader whose failed count rises while labeled does not is one the chat Service cannot reach, and a replica whose removal at start keeps failing is not ready. Alert on increase(agentkourier_leader_pod_label_writes_total{result="failed"}[5m]) > 0 held for: 10m: writes have failed for ten minutes, longer than the 30 s that the wait between tries grows to.
agentkourier_chat_listener_requests_total counter outcome, platform, connection Requests to the chat listener (AGENTKOURIER_CHAT_LISTEN), by outcome: served (the connection's handler was called), not_found (the path is not /chat/<platform>/<namespace>/<name>: 404), method (a method other than POST: 405), no_route (no connection with that path takes requests on this replica: it is a standby, the connection is not running here or is not served, or it takes nothing over HTTP; answered 503 with Retry-After), too_large (the body is past its cap: 413), unreadable (the body could not be read whole: 400) or busy (as many handlers as the listener runs at once were already running, or the body did not fit in what the listener holds of bodies at once: 503 with Retry-After; see Limits). platform is the platform the path names when it is slack, teams or webhook, and other for any other platform and for a path that is not a route's shape. connection is the ChatConnection the path names, as namespace/name, while the leader serves it: the broker's own connection and every team connection it serves, from the leader's first look at its connections (or, for one that takes requests on the listener, a Slack connection in HTTP mode, a Microsoft Teams connection in http mode or with a spec.teams.notificationURL, or a webhook connection, from when its route is put on the listener, if that comes first), whether the connection runs or not. Its no_route requests are counted under it too while it has not started, restarts or is stopped (its Secret cannot be read, or its credentials were rejected), until the broker stops serving it (above). Every other request is counted under unknown: a path that names no connection the leader serves (a second connection of a Slack or Microsoft Teams app another connection uses, a connection the broker no longer serves, a path under another platform, or none at all), every request to a standby, and every not_found and method, which are answered before the connection is looked up. The path is never a label as it is: it is the sender's to choose. A broker with no chat listener has no series, and one that has a listener has a series only for a combination of labels it has seen. Per connection, sum by (connection) (increase(agentkourier_chat_listener_requests_total{outcome=~"no_route\|busy"}[15m])) > 0 names each connection that had requests answered 503 in the last 15 minutes.

Operations, intake, delivery and triggers

Metric Definition
agentkourier_operation_duration_seconds Duration of a finite operation, including failures and retries, by operation (the span name, such as agentkourier.agent.send or agentkourier.store.GetSession) and outcome. Agent execution ends at a terminal state, input-required or auth-required; both pause states are non-error outcomes. Agent and store calls are no longer also recorded in agentkourier_agent_operation_duration_seconds and agentkourier_store_operation_duration_seconds, which duplicated this histogram: select them with operation=~"agentkourier.agent.*" and operation=~"agentkourier.store.*"
agentkourier_agent_first_text_duration_seconds Attempt start to first nonempty text observed on send/answer; no observations for follow snapshots
http_client_request_duration_seconds HTTP request through response EOF or close; an SSE response includes its stream lifetime
agentkourier_intake_total Message/press dispositions, by source, disposition and connection; source="reply_queue",disposition="duplicate" counts durable duplicates separately; a bot's message, and a person's message outside a thread in a channel whose Binding has a personMessage trigger, is trigger_matched, trigger_unmatched (no trigger took it) or ignored (an unbound channel, or a reply in a thread); an event that a webhook connection took is counted too, under source="message": trigger_matched, trigger_unmatched, ignored (no Binding of the connection has its channel), duplicate (a body whose start was decided, a turn started or the start refused, while the broker remembers it) or error; a person's reply that a mention-only Binding turned away is unmentioned
agentkourier_slack_ack_duration_seconds The envelope taken off the connection to completion of the ack attempt, or return with ack withheld, by outcome and connection; so it includes the wait behind the earlier events of the same channel. It measures queueing the ack, not confirmation from Slack. An event that is shed or dropped at shutdown is left unacknowledged and gets no sample: agentkourier_slack_events_shed_total counts the shed ones. In HTTP mode it is the request handed to the connection to its answer, acknowledged (200) or withheld (503: the broker did not take the event, or did not within the wait), for each event or press that was put on its channel's lane
agentkourier_slack_http_requests_total Requests Slack sent to a connection in HTTP mode, by outcome and connection: acknowledged (200: the event or press was taken, or was nothing to take), challenge (200: a url_verification, answered with its challenge), bad_signature (401: the signature or timestamp is missing, or the signature is not the signing secret's), stale (401: the timestamp is further from the broker's clock than Limits allows), malformed (400: signed, and no event or press the adapter can read), not_running (503: the connection's run is not taking requests, as between two attempts), shed (503: its channel's lane was full; agentkourier_slack_events_shed_total says which bound), withheld (503: the broker did not take it) or timeout (503: not taken within the wait). A request that comes before the connection's first run is answered and not counted
agentkourier_slack_http_retries_total Signed requests to a connection in HTTP mode that carry X-Slack-Retry-Num, which Slack sets on a request it sends again because an earlier one was not answered 200 in time (Slack's own behaviour, not checked here), by connection
agentkourier_webhook_requests_total Requests sent to a webhook connection, by outcome, reason and connection: accepted (200: the broker took the event, or dropped it as one it already had), ignored (200: no_actor, no actor pointer resolved and the connection drops such events), self (200: an actor is the connection's identity, so the agent's own event is dropped), unmapped (200: no_channel, the channel did not resolve or is not a channel's shape; bad_id, the thread's field resolved only to values that are not identifiers, or to an identifier that holds :, which a thread may not; no_thread, the thread's field did not resolve or is empty), unverified (401: unsigned, the verify header is missing or empty; bad_signature, it does not hold the prefix and the body's signature or the token; stale, the body timestamp is missing, not an integer, or outside the window, or the body could not be read for it: with verify.timestamp set, a signed body that is not one JSON object, is nested too deep or has a key twice on the way to the time is stale, not malformed), malformed (400: unreadable, the body could not be read; schema, it is not one JSON object of valid UTF-8; depth, it is nested too deep; duplicate_key, a key is in its object twice on the way to a value the connection reads), not_running (503: the connection's run is not taking requests, as between two attempts), withheld (503: the broker did not take it), timeout (503: not taken within the wait) or cancelled (503: the sender closed the request before the broker took it). The reason of accepted, self, not_running, withheld, timeout and cancelled is none. A request that comes before the connection's first run is counted too
agentkourier_webhook_ack_duration_seconds Histogram of the time a webhook connection took to answer a request, from when its handler was called to its answer, by outcome (the outcomes of agentkourier_webhook_requests_total) and connection. It holds the reading, verifying and parsing of the body and, for an event that gets that far, the wait for the broker to take it behind the connection's earlier events, which ends in timeout after 2 seconds (Limits): so a timeout is observed at about 2 seconds or less, and an accepted holds the time the broker took to take the event. It does not hold the time the chat listener took to read the body before it called the handler, and a request the chat listener answered itself (agentkourier_chat_listener_requests_total) has no sample. A series exists for an outcome once the connection has answered a request with it. Its buckets are those of the other duration histograms, so the 2 second wait falls between the bounds 1 and 2.5
agentkourier_webhook_last_accepted_timestamp_seconds Gauge: the Unix time at which a webhook connection last answered a request accepted (200: verified, mapped and taken by the broker, or dropped as an event it already had), by connection. No other answer sets it: an event dropped as self, ignored or unmapped reached no Binding, and a 401, 400 or 503 was not taken. The series does not exist until the connection's first accepted request after the broker starts, and it is the leader's, as the connection runs there. time() - max by (connection) (max_over_time(agentkourier_webhook_last_accepted_timestamp_seconds[2d])) is how long ago the connection last took an event, across restarts and changes of leader, as long as the last one is within the range (Alert on webhook deliveries). Aggregate it with max, not sum: it is a time
agentkourier_slack_events_shed_total Slack events left unacknowledged, so that Slack may send them again, because the adapter already held as many as it may, by reason and connection: channel_backlog (the channel's own events fill its limit) or adapter_backlog (the events of all channels fill theirs, and the channel already holds one). The limits are on Limits. A steady count means a channel's events take longer to handle than they arrive
agentkourier_teams_requests_total Requests Microsoft Teams sent to a connection's route on the chat listener, by outcome and connection: accepted (200: an activity put on its channel's lane, or one with nothing to hand on), duplicate (200: an activity that came before, within the window that Limits gives), invoke (an invoke, answered at once), bad_token (401: the token failed a check, which agentkourier_teams_tokens_refused_total names), keys_unavailable (503: the Bot Framework's signing keys could not be read), malformed (400: no activity the adapter can read), wrong_tenant (403: an activity of another tenant), not_running (503: the connection's run is not taking activities, as between two attempts) or shed (503: its channel's lane, or all of them, held as many as they may). Microsoft Teams sends an activity answered 503 again once, about 0.6 seconds later, so each such answer is counted in agentkourier_teams_activities_shed_total, and the second delivery, if it comes, here again
agentkourier_teams_tokens_refused_total Bearer tokens that a connection's route refused, by reason and connection: no_bearer, malformed, algorithm, unknown_key, keys_unavailable, signature, not_endorsed (the key is not endorsed for Microsoft Teams), issuer, audience (not the connection's spec.teams.appID), expired, not_yet_valid or service_url (the token's service URL is not the activity's)
agentkourier_teams_activities_shed_total Activities of a Microsoft Teams connection answered 503, by reason and connection: not_running (the connection's run was not taking them), channel_backlog (the channel's lane was full), adapter_backlog (the lanes of all channels were, and the channel already had one waiting) or socket_busy (in socket mode, an envelope past the ones that the connection's sockets handle at once, whatever its type, which Limits gives). Over HTTPS, Teams sends such an activity again once, about 0.6 seconds later, and it is taken then if there is room, so a count here is not a loss by itself: a second count for the same activity is. Whether Teams sends again an activity answered 503 over a socket (socket mode) was not measured. An activity that the chat listener turned away before the route (a standby, or a connection that is not running here) is counted by agentkourier_chat_listener_requests_total as no_route instead
agentkourier_teams_activities_lost_total Messages of a Microsoft Teams connection that no turn will see, after Teams was answered 200 for their activity or Microsoft Graph 202 for their notification, by reason and connection: stopped (accepted, and still waiting or being handed on when the drain at the connection's stop ran out, whether it came as an activity or through Microsoft Graph), not_taken (an activity's message, which the broker's intake did not take in the tries that Limits gives; counted once, at the last) and graph_not_taken (the same, of a message read through Microsoft Graph: a notified message, or one that a poll or a catch-up read found). Neither Teams nor Graph sends them again, and a poll does not read them again
agentkourier_teams_socket_envelopes_total Envelopes that Microsoft Teams sent over the sockets of a connection in socket mode, by type (activity, invoke, or other, which is answered 400), outcome and connection. The outcome is what the envelope was answered with, the outcomes of agentkourier_teams_requests_total (accepted, duplicate, invoke, malformed, wrong_tenant, not_running, shed), or busy (503 at once: the connection's sockets were handling as many envelopes as Limits gives) or unanswered (the reply frame could not be sent). An envelope is not counted in agentkourier_teams_requests_total. One answered 503 is counted in agentkourier_teams_activities_shed_total too: not_running and the backlogs as over HTTPS, and busy as socket_busy; one answered 200 and then lost is counted in agentkourier_teams_activities_lost_total as over HTTPS. An envelope counted unanswered was worked on, and counted in those families as its answer says, but the frame that carries the answer could not be sent
agentkourier_teams_socket_reconnects_total Connects of a socket of a connection in socket mode that follow another in its region, by region, reason and connection: expiry (the replacement of a socket a minute before its token expires: every 9 minutes, with the 10-minute life measured), the code of a SocketClosing that Teams sent (socket_mode_disabled, replaced, token_reused, no_identity, or closing_other for any other), closed (the socket ended otherwise), server_timeout (Teams sent nothing for the time Limits gives), ready_timeout (no SocketReady in time), rate_limited (429), refused (403), unavailable (5xx) or failed (any other failure to open a socket)
agentkourier_teams_socket_gap_seconds Histogram of the intervals in which no socket of a connection in socket mode was ready, by connection: from the start of its run, or from the end of its last ready socket, to the next socket ready or the end of the run. Teams does not deliver what it sent in such an interval, then or later; the broker logs each interval after the first with its start and end
agentkourier_teams_socket_ready Whether a connection in socket mode has a ready socket in a region (1) or not (0), by region and connection. agentkourier_chat_connected is 1 while at least one region's is
agentkourier_teams_graph_notifications_total What Microsoft Graph sent to the spec.teams.notificationURL of a connection (Alerts on Microsoft Teams), by kind, outcome and connection. The kinds are validation (Graph's validation handshake, within each make and renew of a subscription; its outcome is answered), change (a change of a bound channel's messages) and lifecycle (an event of a subscription). A change's outcome is taken (the message was read and the broker's intake took it), not_taken (the intake did not take it in its tries; counted in agentkourier_teams_activities_lost_total too, as graph_not_taken, and a message still on its lane when the drain at the connection's stop runs out as stopped), duplicate (an activity or an earlier notification of the same message had already been handed on, within the window that Limits gives for an activity), own (a post of the connection's own bot), ignored (no post: a system event, a deleted message, one with no sender or no text), edit (an edit or a deletion, which no trigger reads), not_named (another app's post that no botMessage trigger of the channel names), gone (Graph answered 404 when the message was read), fetch_failed (the message could not be read in its tries) or malformed (a resource or a change type the broker cannot read, or a message of another channel than its subscription's). A lifecycle event's outcome is reauthorization_required (the subscription is renewed), subscription_removed (it is made anew), missed (Graph did not deliver some of the channel's notifications: a catch-up read of the channel follows, counted in agentkourier_teams_graph_catchups_total) or other. Either kind may also be client_state (its clientState is not the connection's: dropped, and the subscription it names is made anew; logged in one WARN line for each body, and those lines paced as Limits gives), wrong_tenant, unknown_subscription (a subscription the connection does not hold: dropped), shed (its channel's lane, or all of them, held as many as they may: answered 503) or not_running (the connection's run was not taking them, or had not listed its subscriptions yet: answered 503). Graph sends a notification answered 503 again. A request that comes before the connection's first run is answered and not counted
agentkourier_teams_graph_channels The channels that the Bindings of a Microsoft Teams connection name, by the state of their Microsoft Graph intake and connection. With a spec.teams.notificationURL, by their subscription: subscribed, waiting_group (the Microsoft Entra group of the channel's team is not known yet, so no subscription can be made: an activity of the channel tells it) or failing (the last call to make, renew or delete it failed, the listing of the app's subscriptions at the start of the run did, or the app's subscription to the channel for another URL holds it, which Graph lets an app have one of: Alerts on Microsoft Teams). Without one, by their poll (Polling): polling, waiting_group (the same) or failing (Microsoft Graph refused the last poll for good, a 401, 403, 404 or 400, or the channel's delta named no deltaLink within the pages the broker reads)
agentkourier_teams_graph_polls_total Polls of a bound channel's messages by a Microsoft Teams connection with no spec.teams.notificationURL (Polling), by outcome and connection: syncing (a poll of a channel with no deltaLink: its delta's pages read for the poll, none handed on, and a catch-up read made), started (the poll whose pages reached the channel's deltaLink), too_long (each poll of a channel whose delta named no deltaLink within the pages the broker reads: it is failing, read by its catch-up read alone), polled (a read of the deltaLink, its new messages put on the channel's lane, and the replies of its recent threads read), reset (Graph no longer took the deltaLink, the stored one included: the channel is read to a new one), throttled (Graph answered 429: every read of the connection waits for its Retry-After), failed (a failure that may pass, such as a 5xx, a timeout, a full lane or a stored position that could not be read) or refused (a 401, 403, 404 or 400: the channel is failing)
agentkourier_teams_graph_read_messages_total Messages that a poll or a catch-up read found in a bound channel of a Microsoft Teams connection, by outcome and connection: taken, not_taken (counted in agentkourier_teams_activities_lost_total too, as graph_not_taken), duplicate, own, ignored and not_named as in agentkourier_teams_graph_notifications_total, old (made before the read's bound: history, or a change of an older post) or shed (its channel's lane had no room: the read is made again)
agentkourier_teams_graph_catchups_total Catch-up reads of a bound channel's recent threads (Catch-up reads), by trigger, outcome and connection. The triggers are start (a channel's first poll in a run, or a read anew after a reset), syncing (a later poll of a channel with no deltaLink), socket_gap (a gap of the sockets ended, on a connection with no notificationURL) and missed (Graph's lifecycle notification missed); the outcomes read, failed and not_running (the connection took nothing then)
agentkourier_teams_graph_throttled_total Reads of Microsoft Graph by the polls and catch-up reads of a Microsoft Teams connection that Graph answered 429, by connection; each paused every read of the connection for its Retry-After
agentkourier_turn_queue_wait_seconds Enqueue to first execution attempt in this process; a restart may observe the same waiting reply again
agentkourier_sessions_active / agentkourier_sessions_paused Current in-process runners and runners parked on input
agentkourier_stream_reconnects_total Completed reconnect attempts, by outcome
agentkourier_session_recovery_total Adopted tasks, recording failures and reconciliation diagnostic notices
agentkourier_reply_queue_depth / agentkourier_reply_queue_oldest_age_seconds Durable undelivered reply count and oldest age
agentkourier_outbox_pending / agentkourier_outbox_oldest_age_seconds Unposted, nonabandoned rows and oldest age, by connection (the connection whose app posts the row); includes incomplete stream rows. A served connection with no such row says 0, as Series by connection says
agentkourier_outbox_delivery_duration_seconds Row creation to successful delivery/adoption attempt; replay after a crash can produce another observation
agentkourier_render_final_total Final rendering outcomes: delivered, empty output, permanent failure, retry exhaustion, deadline exceeded or cancelled
agentkourier_retention_removed_total Stored content that retention removed, by what: stranded_replies (undelivered replies dropped after 30 days, a turn that was never sent: worth an alert on any increase), cleared_interactions (settled interactions whose request and answer were emptied), audit_entries (purged past AGENTKOURIER_AUDIT_RETENTION; an increase with the setting at keep is a fault), and expired_sessions with the rows that went with them, session_replies, session_interactions, session_presses and session_outbox (sessions deleted 90 days after their threadTTL), and stale_tasks with the stale_task_interactions cancelled with them (a task that a crash left on a session past that horizon, ended so that the session can be deleted; a standing increase means crashes). See Stored data
agentkourier_interactions_pending Durable pending interactions
agentkourier_interaction_wait_seconds Creation to first committed resolution, by kind and outcome (the state it resolved to); retries do not add another observation; the pending interactions that retention cancels with a stale task are not observed
agentkourier_chat_api_calls_total Chat adapter operations and results, by operation, outcome and connection. On a Slack connection they include logical API errors over HTTP 200; cached user lookups are adapter operations too. On a Microsoft Teams connection the operations are Post, Update, PostButtons (the post of a message's buttons as a card of their own under its text, after the text's Post or with an Update, or the edit of that card when the buttons change: a Post whose buttons fail still counts success, and only PostButtons counts the failure), ChannelAccess, IsMember (the read of the members of a channel's team when a person presses), IsBot, ResolveUser (a person's name, counted too when the adapter holds it and makes no request, and the read of the name of the decider that the card ending a question or an approval names, when the adapter does not hold it) ThreadBetween (a turn's read of its thread's replies through Microsoft Graph, at most 20 pages, the thread's first message too when the read leads with it; and a read of a channel whose team is not known yet, which makes no request, as error), ThreadRoot (the read of a thread's first message alone, one request to Microsoft Graph and no page of replies, for the first turn of a session that a person's mention started in the thread; a channel whose team is not known yet is error with no request) Find (the outbox's lookup of a post through Microsoft Graph before it posts one that it queued or tried before, counted by what the read met, whether or not the lookup takes it as not found: a refusal of Graph is api_error; a channel whose team is not known yet, a thread past its pages, a page off Graph or already read and an answer too long are error; a read that runs out of time, before or after a page came back, is timeout), and, on a connection with a spec.teams.notificationURL, ListSubscriptions, Subscribe, Renew and Unsubscribe (the calls to Microsoft Graph that list, make, renew and delete its subscriptions; a delete of one that Graph no longer has is channel_gone) and FetchMessage (each read of a message that Graph notified, its tries counted one by one), PollDelta (each page of a poll's read of a channel's delta), PollReplies (each read of a recent thread's replies by a poll) and CatchUp (each catch-up read of a channel's recent threads), and the outcomes success, auth_rejected (Microsoft Entra refused the client secret for the bot's token, or the Bot Connector the token or the bot, which an admin disabled), rate_limited, channel_gone (on ThreadBetween, Find, FetchMessage, the polls' and catch-up reads and the subscriptions' calls, Graph's 404 of what it reads or changes), too_long, api_error (another refusal of Entra, the Bot Connector or Graph: on ThreadBetween, Find, FetchMessage, the polls' and catch-up reads and the subscriptions' calls, Graph's 401, 403 and 5xx, and Entra's refusal of the token for Graph alone), invalid (a message the adapter refused before any call) or, for any other error, its class, such as timeout, cancelled or error. On Slack the outcomes include rate_limited, auth_rejected, channel_gone, not_streaming, api_error, and mode_refused (Slack refused the chunks mode of a stream, which makes Agent Kourier fall back to markdown_text and show no more steps). The ThreadBetween operation is a turn's read of its thread's earlier messages, for a mentioned turn in a chat.threadReplies: mention Binding and for a bot's mention on any Binding (on Slack conversations.replies, at most 5 pages, with an auth.test; on Microsoft Teams, Graph's replies of the thread, as above), which on a bot's first turn in a thread includes what opened it: rate_limited on it is why a turn went out with the line that the replies could not be read. The SetThreadStatus operation is assistant.threads.setStatus, which sets and clears the is working… status of an alert thread; its duration is agentkourier_operation_duration_seconds{operation="agentkourier.chat.SetThreadStatus"}. A refusal is counted as api_error, and after a refusal that turns the status off for the connection no more calls are made or counted. The ChannelAccess operation is Binding verification's read of a channel (conversations.info, one a pass for each Binding): channel_gone there is a channel that does not exist or that the bot cannot see, and api_error includes a missing scope. Its duration is agentkourier_operation_duration_seconds{operation="agentkourier.chat.ChannelAccess"}. The GroupsReadable operation is the same verification's read of an approver group (usergroups.users.list, one request and one operation for each group a pass, however many Bindings name it, unless a read is cut short at its Binding's 8 second bound, when the next Binding that needs the group reads it again): api_error includes a group that does not exist and a missing scope. Its duration is agentkourier_operation_duration_seconds{operation="agentkourier.chat.GroupsReadable"}
agentkourier_thread_unmentioned_total Replies in a thread Agent Kourier owns that a Binding with chat.threadReplies: mention, or a session that a bot's mention or a personMessage trigger began on any Binding, ignored because they did not mention Agent Kourier, by binding: nothing was written or sent, no reaction was added and the thread's threadTTL was not extended. A reply in an expired thread counts too (it gets no expiry notice). A typed answer admitted to a pending question that takes text replies (the a2a dialect's free-text question) is not counted here: it needs no mention and is queued as that question's answer. (A redelivery of such an answer's event after the question closed is counted, once, as it is then an ignored reply.) It is the engagement of a thread that people discuss without waking the agent, so a rising count with a flat turn count is the feature working, and a Binding whose people complain that Agent Kourier ignores them shows it here.
agentkourier_mentions_total What the names in a turn's final reply came to on a Binding that sets chat.mentions, by binding and outcome: made (a message that mentions the person was queued, which is not yet a delivery or a notification), undeclared (an @name no entry declares, which mentions nobody) and capped (a declared person past chat.maxMentionsPerTurn, who is not mentioned). A turn that failed, was stopped or was rejected counts nothing. A turn rendered again after a restart may count undeclared and capped twice, and a crash just after a mention is queued can leave it out of made.
agentkourier_thread_context_total Turns that asked for what was posted in their thread since the previous turn: mentioned turns of a Binding with chat.threadReplies: mention or of a thread a personMessage trigger began, and a bot's mention on any Binding, which reads every author's messages since the previous bot's mention and, on the thread's first, what opened it; and, on Microsoft Teams, the first turn of a session that a person's mention started in a thread, which reads what opened the thread and nothing else (on Slack such a turn does not ask, and is not counted). By binding and outcome: read (a block of replies went with the turn), empty (there was nothing to add: nothing the turn would show since the previous turn, or a window with none left, as after two near-simultaneous mentions), cut (a block went, with a last line that says how many earlier replies it left out: more than 50, past the block's 6000-unit cap, or older than the newest 1000 messages of the window; a reply longer than 1000 units is shortened, not left out; what opened the thread is never left out), failed (the turn went with the fixed line "Agent Kourier could not read the earlier replies in this thread.": the platform's read of the window or of what opened the thread failed or was rate limited past one wait of at most 5 s, the thread's window was past the pages the platform reads (on Slack 5, of its window; on Microsoft Teams 20 of 50 replies, of the whole thread), or the reply queue could not say which messages were turns) and unsupported (the platform cannot read a thread, so the turn went with the mentioned message alone; one info log line for each Binding). A turn is counted once when it is first sent (a resend after the agent was busy does not ask again), and again if a restart sends it anew. Nothing a person wrote is in a log line. A rising failed with agentkourier_chat_api_calls_total{operation="ThreadBetween",outcome="rate_limited"} says the reads are rate limited, which Slack counts against the same conversations.replies budget as the outbox's recovery
agentkourier_trigger_matched_total / agentkourier_trigger_unmatched_total Messages a Binding's botMessage or personMessage trigger matched, and bot messages, and people's messages outside a thread where the Binding has a personMessage trigger, that matched none (the heartbeat an exclude turns away counts here), by binding. A webhook connection's events that reach the Binding of their channel count here too, matched or not by its webhookEvent triggers; a match is counted once its decision is taken, so a limited event that is delivered again is counted again, and an event that matched none is not remembered, so it is counted unmatched each time it is delivered. A rising unmatched count after a template change means the trigger's regexes no longer fit; the debug log line names the channel, the message, and a bot's ID and kind, never the text. A bot's mention that a Binding takes counts as matched
agentkourier_trigger_decisions_total What a matched message did to its key's thread, by binding and decision: started (a turn that started: a new investigation), repeat (a note that it fired again), closed (a note that it resolved), close_unknown (a close with no open thread, ignored), dedup (a message delivered again after its decision was taken, which does nothing), empty_key (a keyed trigger whose key came out empty, so the message is an investigation of its own) and not_started (the session hook said the turn will not start, such as a refused prompt: the event is acknowledged, no cooldown begins) and limited (a start that one of the trigger's limits stopped: no turn, no key held, nothing posted in the alert's thread; see agentkourier_trigger_limited_total). A webhook event that a limit stopped is not remembered, so the same event delivered again is decided again: it is counted limited each time it is stopped, while agentkourier_trigger_limited_total counts it once. A webhook event whose thread's ended session cannot be replaced yet is not_started and uses none of the limits, or, if it was withheld only as its start was submitted, the one place its redelivery takes again. It is not remembered either: the same event delivered again is decided again, and counted again, started once the session can take it. A bot's mention has only started (a turn, in a new or an owned thread), limited and not_started (its session cannot take a turn, which uses none of the limits, or its prompt was refused), plus dedup. A decision is counted once it is taken. An attempt that fails, such as a start the session could not queue, counts nothing here and is counted as agentkourier_intake_total{disposition="error"}; the platform may deliver the event again, and that delivery is decided and counted then, as started if it starts the turn. A turn that was queued but whose thread was never marked started, with no delivery to mend it, is counted started when a later fire of its key adopts it. So started counts the turns that started, and a failed start that its redelivery made is one started and no dedup. Two exceptions: a start with no thread rules (a botMessage trigger without thread, every personMessage trigger, every webhookEvent trigger and every bot's mention) keeps no record of its start, so its redelivery after a restart, which Agent Kourier no longer remembers, is counted as started again, though its turn is queued once; and a change of leader with an event in flight can count one start twice, once by each replica, as nothing fences the marks of trigger threads. Flapping shows as repeat and closed rising while started stays flat; the key is in the debug and info log lines only as a short hash
agentkourier_trigger_limited_total Starts that a limit stopped, so no investigation began, by binding, trigger (its index in the Binding's chat.triggers) and limit: rate (the trigger started its rateLimit.maxRuns in the last rateLimit.per), concurrent (rateLimit.maxConcurrent of its investigations are running) or daily (it started maxRunsPerDay in the last 24 hours); when more than one is reached the daily cap is reported, then the rate, then the concurrency. A repeat, a close and a note are never limited. The alert is not posted about: it reached people through its own receiver. Once for each window, which opens with the first stopped start and lasts the trigger's rateLimit.per, one line in the channel (top level, through the outbox) says how many were not investigated and why, for example "7 messages not investigated in the last 10m (rate limit).", and names no alert. A count that keeps rising means the limits are too tight for the storm, or that the investigations are slow (concurrent), or that one source is noisy (daily). A bot's mention counts under the index of the Binding's mention trigger (0 for an empty chat.triggers), with its fixed limits and a window of 30 minutes, and the audit log has an entry for each one stopped. Its concurrent counts a mention while its own turn is queued or is the session's task, not a later turn in its thread, and so does a personMessage trigger's for its start. A connection with no replies, such as a webhook connection, gets no digest line: this count, and a WARN line for each stopped delivery that names it, are the only record (a redelivery stopped again is logged again and not counted again). Such an event was answered 200 and is not remembered, so it is lost unless its sender, or you, delivers it again
agentkourier_trigger_refused_total Starts that began no turn because the first prompt failed its safety check or could not be rendered, by binding, trigger (its index in the Binding's chat.triggers), ref (the value that failed, as a template names it without the dot: Fields.alertname, Key, Link, State, Channel, Source, or template for a template that failed to run) and reason (characters, too_long, not_link, invalid for a webhook event's id field none of whose values was an identifier, render_error or other). ref and reason come from closed sets, and the entry names are the Binding's own. Each refusal is also a note in the alert's thread, "Not investigated: ...", and an audit entry that names the ref, reason and length of the value and never the value; a refusal opens no cooldown, so a fire of the key more than a minute later starts an investigation. A rising count after a change to the template or to how the alerting tool formats its messages means a value the template reads no longer fits its check. On a connection with no replies, such as a webhook connection, the note is dropped: the WARN line and the audit entry remain
agentkourier_investigation_feedback_total Votes cast on the final message of an investigation (the thread a botMessage trigger started) or of an answer (a Binding with feedback.enabled; a turn that another bot's mention or a personMessage trigger started is one), by binding, agent, alertname and verdict (useful or not_useful). It counts votes cast, so a person who changes their vote adds one under the new verdict and the first stays counted; pressing the button of the verdict already recorded counts nothing. It therefore reads as activity and as an upper bound, and never as the standing of an alert, which is read from the feedback table: it keeps one latest vote for each person and message (Stored data). A vote counts only from a member of the channel and never from a bot. alertname comes from the session origin's bounded subject only for a validated alertname on the botMessage origin (which a botMessage trigger's start records), on alertmanager (kept only by sessions created before that origin was retired), or on legacy (migrated from the older session schema); a generic source subject is none for an answer or unknown for an investigation. A Binding has at most 100 alert names of its own in this process, after which the votes count under other

Binding verification

The leader probes each Binding of every connection the broker serves, when it starts, when the config or a Secret it refers to changes, and every 5 minutes (with up to 10% jitter) after a pass begins. A change triggers a pass at most once every 30 seconds, and a Binding that a reload adds is a change like any other: one that comes sooner waits, and a new Binding has no series until then; the pass for it, which sees the last change, runs when the 30 seconds are over. A probe fetches the agent's card on a new connection and reads the Binding's channel as the bot of the Binding's own ChatConnection (conversations.info on Slack), and makes no call for a connection that is not running (the condition reads ChatUnavailable, or the reason that says why); for a Binding that asks for tool approvals from user groups, it also reads each of the groups, in order, until one cannot be read (usergroups.users.list on Slack, one request for each of at most 10 groups, within one bound of 8 seconds for all of them). A pass reads each group once: a Binding that names a group another Binding has read, or is reading, in the same pass waits for that read, within its own 8 seconds, and takes its answer, so a pass makes at most one request for each group each connection's Bindings name (the Bindings of two connections never share a read, since each app reads a group on its own), unless a read is cut short at its Binding's 8 seconds: the next Binding that needs the group then reads it again, and the request that was cut may still have counted against Slack's limit. The wait counts against the waiting Binding's own 8 seconds even when the read it waited for is cut, so a Binding can read unknown (ChatUnavailable) for a pass because another Binding on the connection came to the group first with less time left. The requests count against Slack's rate limit for the method, which a tool-approval press's group check shares (a press that Slack rate-limits is kept and tried again, not refused). Slack puts the method in its Tier 2, "20+ per minute" (the method's page), counted for each method, workspace and app (Slack's rate limits); see Limits for what that allows. A read that is rate-limited makes the condition unknown (ChatUnavailable) for every Binding whose read reaches the group (one that stops at an earlier group of its own list does not), until a later pass reads it. It sends the agent no message and posts nothing. A standby exports none of these series.

A Binding has agentkourier_binding_condition series for a condition once its first probe has ended. Its Ready series, with agentkourier_binding_ready, come once every first probe has ended, or once a first result has found it false: a result that is false sets agentkourier_binding_ready to 0 at once, even while the other probe is in flight, and a result that is not yet known (unknown) is hidden until the other probe has ended too, whichever probe ends first. A rule on agentkourier_binding_ready == 0 therefore fires for a Binding that one probe has found false, and does not fire for one whose other first probe is still in flight and whose first result is not yet known. Once all of a Binding's first probes have ended, a result that is not yet known counts as not ready and sets the gauge to 0. A Binding's series are deleted when a reload removes it or moves it to a ChatConnection the broker does not serve, and the leader logs one INFO line stopped verifying a Binding for each; so a series that is gone can mean this, and its absence is not health. An edit that takes a Binding's last approver group away deletes its ApproversReadable series alone (the other series stay), and the leader logs one INFO line stopped verifying a condition of a Binding; so does an AcknowledgmentShown series that stops applying (see Binding status). An edit that gives a Binding its first group makes Ready not yet known, unless it is already false, and that sets no series: its Ready series and agentkourier_binding_ready keep their last value until the pass that reads the groups ends.

A probe is not retried. One failure holds agentkourier_binding_ready at 0 until the next pass, which begins 4.5 to 5.5 minutes after the last one began (and up to one 5-second tick later). That includes a single 5xx, 409 or refused connection, as an agent in the middle of a rollout gives, which reads false, as does a backend that does not answer within its 8-second bound, and a result that is not yet known (for example an agent's 408, 425 or 429, a chat rate limit or deadline, or the Prober's own timeout), which reads unknown. A turn's connect waits up to 30 seconds, so a backend that takes longer than 8 seconds to serve its agent card reads false although a turn could still reach it. status="false" of agentkourier_binding_condition leaves the results that are not yet known out, but not the transient failures, so an alert on either should use a for: well beyond one interval, such as 10m, since the next pass can take a while to reach a Binding when backends are slow to answer.

The reason for a result is not a label; it is in the log line of the change. Troubleshoot an install lists each reason and what to do about it.

  • a WARN a condition is false for a condition that went false;
  • a WARN a condition is unknown for ChatCredentialsChanged (the chat credentials Secret holds other tokens than the ones in use: restart Agent Kourier for the broker's own connection; a team connection restarts by itself) and for ChatCredentialsUnusable (the Secret, or a key of it, is gone or empty, or the Secret is of a type that is never read: the connection keeps the tokens it read, and for the own connection a restart fails until the Secret is mended);
  • an INFO a condition is unknown for any other result that is not yet known: for the agent, a 408, 425 or 429; for the chat platform, a rate limit, a deadline, a connection that is not running (chat: no platform is running the connection, naming it), or the chat platform read failed, with its cause in the line's cause attribute (for Slack, its code such as no_permission when it answered, or the transport's error such as connection refused when it did not);
  • an INFO a condition is now true, with the reason it had before in was, for a condition that was false, or unknown after a first result. A first result that is true has no line.

A probe whose check could not tell leaves the condition unknown with no such line: its line is a probe failed, with the error, and a failure of the prober itself has its own line, the prober failed. A Binding that a reload removed during a pass has no a probe failed line for its agent probe, which finds the Binding gone. Its channel probe runs for the pass's own list of Bindings, so it can still log a change for the Binding before the stopped verifying line.

Metric Type Labels Definition
agentkourier_binding_ready gauge binding 1 while every condition of the Binding is true, 0 while one is false or not yet known. It is the prober's result for a Binding the broker serves, and so says nothing of Accepted: a Binding that was refused after an edit and is served from its last good generation can read 1, and one that is not served has no series. See agentkourier_config_binding_rejections.
agentkourier_binding_condition gauge binding, condition, status 1 for the status the condition has and 0 for the other two, by Binding. condition is BackendReachable (the agent card was fetched and is one Agent Kourier can use), ChannelJoined (the bot is in the Binding's channel, which exists and is not archived), ApproversReadable (the bot can read every user group in the Binding's interactions.approverGroups; only a Binding with tool approvals and approver groups has the series), AcknowledgmentShown (only a Binding whose chat.acknowledgment.emoji names a reaction on a platform with no reactions has the series, and it is always false; it has no probe, and so no agentkourier_binding_probe_duration_seconds series) or Ready. status is true, false or unknown.
agentkourier_binding_probe_duration_seconds histogram condition How long a probe took, by BackendReachable, ChannelJoined or ApproversReadable, whatever it found. For ApproversReadable it is the read of all of a Binding's groups together, with any wait for a read of one of them that another Binding's probe was making.

Postgres store

Only with AGENTKOURIER_STORE=postgres.

Metric Type Definition
agentkourier_store_deposed_total counter Writes the store refused because another replica has led since: its epoch was stale.
agentkourier_store_pool_conns gauge Connections of the store's pool, in use, idle or being made.
agentkourier_store_pool_acquired_conns gauge Connections of the store's pool in use.
agentkourier_store_pool_idle_conns gauge Idle connections of the store's pool.
agentkourier_store_pool_max_conns gauge Largest size of the store's pool.
agentkourier_store_pool_acquires_total counter Connections taken from the store's pool.
agentkourier_store_pool_empty_acquires_total counter Takes that had to wait for a connection.
agentkourier_store_pool_canceled_acquires_total counter Takes that a context ended before they got a connection.
agentkourier_store_pool_acquire_seconds_total counter Time spent taking connections from the store's pool.

Runtime

Metric Definition
go_*, process_* The Go runtime and process collectors.
go_sql_* SQLite only: database pool statistics, separately for the read and write pools (db_name). Postgres exposes agentkourier_store_pool_* instead.

Reading them

Duration histograms cover milliseconds through one hour, except agentkourier_binding_probe_duration_seconds, whose buckets end at 10 seconds. Use separate latency queries for execution, human wait and visible delivery. The terminal turn outcome counter describes the backend task; agentkourier_render_final_total describes what happened to the output in chat. A completed task can have a failed final render.

Backlog scrapes query the store, SQLite or Postgres, with a one-second timeout. A failed query produces an invalid metric and a failed scrape rather than reporting a false zero backlog.

Reference: OpenTelemetry HTTP span conventions and span links.