mirror of
https://github.com/coder/coder.git
synced 2026-06-06 14:38:23 +00:00
12520ee964
Add metrics for `aibridged` and `aibridgeproxyd`'s provider statuses. AI providers can be modified, and possibly misconfigured, at runtime. These metrics help operators understand the state of these provider definitions in case unexpected behaviour is observed.
29 lines
986 B
Go
29 lines
986 B
Go
package aibridged
|
|
|
|
// ProviderStatus is the lifecycle state of a configured AI provider.
|
|
type ProviderStatus string
|
|
|
|
const (
|
|
// ProviderStatusEnabled indicates the provider is configured and
|
|
// valid, and is included in the active pool snapshot.
|
|
ProviderStatusEnabled ProviderStatus = "enabled"
|
|
// ProviderStatusDisabled indicates the provider is configured but
|
|
// intentionally turned off by an operator.
|
|
ProviderStatusDisabled ProviderStatus = "disabled"
|
|
// ProviderStatusError indicates the provider is configured but
|
|
// cannot be constructed (missing keys, unsupported type, malformed
|
|
// settings).
|
|
ProviderStatusError ProviderStatus = "error"
|
|
)
|
|
|
|
// ProviderOutcome classifies one ai_providers row, including disabled
|
|
// and errored rows the pool excludes. Err is populated only when
|
|
// Status == ProviderStatusError; the build error is already logged at
|
|
// the call site.
|
|
type ProviderOutcome struct {
|
|
Name string
|
|
Type string
|
|
Status ProviderStatus
|
|
Err error
|
|
}
|