Skip to main content

Crate sentry_options_validation

Crate sentry_options_validation 

Source
Expand description

Schema validation library for sentry-options.

Schemas are loaded once into a SchemaRegistry and shared via Arc. Values are validated against schemas as complete objects.

Values refresh lazily on read on the same thread. A read past the staleness window re-reads the values directory on the calling thread and publishes the new snapshot via ArcSwap (last-writer-wins). The full scheme is in docs/architecture.md; the memory-ordering invariants are documented inline in the refresh method below.

Structs§

NamespaceSchema
Schema for a namespace, containing validator and option metadata
OptionMetadata
Metadata for a single option in a namespace schema
SchemaRegistry
Registry for loading and storing schemas
ValuesStore
Validates and serves option values, reloading them lazily on read and serving the current snapshot lock-free via ArcSwap. See refresh for the staleness window and memory-ordering details.

Enums§

ValidationError
Errors that can occur during schema and value validation

Constants§

LOCAL_OPTIONS_DIR
Local fallback path for development
OPTIONS_DIR_ENV
Environment variable to override options directory
OPTIONS_SUPPRESS_MISSING_DIR_ENV
Environment variable to suppress missing directory errors
PRODUCTION_OPTIONS_DIR
Production path where options are deployed via config map

Functions§

resolve_options_dir
Resolve options directory using fallback chain:
validate_k8s_name_component
Validate a name component is valid for K8s (lowercase alphanumeric, ‘-’, ‘.’)

Type Aliases§

PropagationCallback
Callback invoked when a namespace’s values are updated. Receives (namespace, delay_secs) — the propagation delay from ConfigMap generation to the app reading the new values.
ValidationResult
Result type for validation operations
ValuesByNamespace
A map of option values keyed by their namespace