configwarn

package
v1.142.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package configwarn is where the platform reports a configuration warning (#1898). A warning is a log line and a count: config_validation_warnings_total under a bounded code, so a fleet sees a misconfiguration as a series and not only as a line somebody has to read. It also holds the checks the platform runs over its personas, connections and agent instructions at boot, and again for a persona written through the admin API.

Some warnings are raised while the configuration file is read, before the observability layer exists. Those are counted here and handed to the recorder when Flush runs, so a boot warning is never lost to ordering.

Index

Constants

View Source
const (
	// CodePersonaToolUnregistered: a persona's tools.allow names, without a
	// wildcard, a tool this deployment does not register.
	CodePersonaToolUnregistered = "persona_tool_unregistered"
	// CodePersonaIncoherent: a persona grants a capability it cannot complete.
	CodePersonaIncoherent = "persona_incoherent"
	// CodeAgentInstructionsUnknownTool: the agent instructions name a tool
	// this deployment does not register.
	CodeAgentInstructionsUnknownTool = "agent_instructions_unknown_tool"
	// CodeUnusedConnection: no persona's connection rules admit a connection.
	CodeUnusedConnection = "unused_connection"
	// CodeUnrecognizedKeys: the configuration file carries keys the platform
	// ignores.
	CodeUnrecognizedKeys = "unrecognized_keys"
	// CodeDeprecatedAPIVersion: the configuration names a deprecated apiVersion.
	CodeDeprecatedAPIVersion = "deprecated_api_version"
	// CodeDeprecatedKey: the configuration uses a renamed key.
	CodeDeprecatedKey = "deprecated_key"
	// CodePlaceholderUnexpanded: a ${...} placeholder named an unset variable.
	CodePlaceholderUnexpanded = "placeholder_unexpanded"
	// CodeEphemeralOAuthKey: the OAuth server signs with a per-process key.
	CodeEphemeralOAuthKey = "ephemeral_oauth_signing_key"
	// CodePortalNoObjectStorage: the portal has no object storage.
	CodePortalNoObjectStorage = "portal_no_object_storage"
	// CodeResourcesNoObjectStorage: managed resources have no object storage.
	CodeResourcesNoObjectStorage = "resources_no_object_storage"
	// CodeMemoryNoEmbedding: memory runs without an embedding provider.
	CodeMemoryNoEmbedding = "memory_no_embedding"
	// CodeExcludePersonaUnknown: calls.exclude_personas names no persona.
	CodeExcludePersonaUnknown = "exclude_persona_unknown"
	// CodeDeploymentIDUnset: an OTLP exporter is on with no deployment id.
	CodeDeploymentIDUnset = "deployment_id_unset"
)

The warning codes config_validation_warnings_total records. Each names one condition; the log line beside it carries the specifics.

Variables

This section is empty.

Functions

func CheckPersona

func CheckPersona(ctx context.Context, p *persona.Persona, registered, toolkitTools []string)

CheckPersona runs the persona checks for one persona written through the admin API, so the warning a boot would raise is raised at write time.

func CheckStartup

func CheckStartup(ctx context.Context, s Startup)

CheckStartup runs every boot check, logging and counting each finding. Startup-only for the values in force at boot; a persona written later is checked by CheckPersona from the admin API.

func Flush

func Flush(ctx context.Context)

Flush hands the warnings raised before the recorder existed to it. A no-op until opsobs has a recorder, and after the first Flush that finds one.

func Warn

func Warn(ctx context.Context, code, msg string, args ...any)

Warn logs msg as a warning carrying code, and counts it. args are slog key/value pairs; values a caller supplies must already be sanitized.

Types

type Connection

type Connection struct {
	Kind string
	Name string
}

Connection names one configured connection.

func Connections

func Connections(reg *registry.Registry) []Connection

Connections is every connection the registry's toolkits serve, as the toolkits that list their connections report them, sorted by kind and name.

type Startup

type Startup struct {
	// AgentInstructions is the customized agent-instruction layer in force.
	AgentInstructions string
	// Registered is every tool name the deployment registers, the platform's
	// own tools included.
	Registered []string
	// Toolkits is the toolkit registry: the coherence rules are keyed to the
	// tools its toolkits register, and its connections are checked for reach.
	Toolkits *registry.Registry
	// Personas is the persona registry in force.
	Personas *persona.Registry
}

Startup is what the boot checks read.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL