mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
7e5e8eb9d2
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.
(cherry picked from commit 12520ee964)
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
|
|
}
|