Documentation
¶
Overview ¶
Package connstate holds each connection's state as the calls that used it last found it: healthy, unreachable, or auth_failed (#1898). It is fed by the places that see an upstream's answer -- the outbound HTTP chain for the api, graphql and mcp kinds, the Trino and S3 toolkits' telemetry -- and read when mcp_platform_connections is sampled. Nothing here sends a request: a connection nobody has called has no state, and is reported as configured.
The state is per process. Each replica reports the connections it has called, so the gauge is read with max by (kind, state) across replicas.
Index ¶
Constants ¶
const ( Healthy = "healthy" Unreachable = "unreachable" AuthFailed = "auth_failed" )
The states a call can leave a connection in.
Variables ¶
This section is empty.
Functions ¶
func FromHTTP ¶
FromHTTP is the state an HTTP answer leaves a connection in: 401 and 407 are a refused credential; a transport error, a timeout, or a 502, 503 or 504 is an upstream that could not be reached or could not answer; any other status is an upstream that answered, which is healthy whatever it said about the request itself. A caller that canceled the request says nothing about the upstream, and records nothing.
func FromResultText ¶
FromResultText is the state a failed tool result leaves a connection in when the result is all a caller has: its text names a refused credential (one of credential, the client's own stable error texts or codes), a lost network (Go's net error texts), or an upstream that answered and refused the request, which is healthy.
func Observe ¶
func Observe(kind, connection, s string)
Observe records the state a call found kind's connection in. A call with no connection name (a platform-wide client) and a state that is not one of Healthy, Unreachable and AuthFailed -- "" for an outcome that says nothing about the upstream -- are ignored, so the gauge's state label stays the set this package defines.
Types ¶
This section is empty.