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§
- Namespace
Schema - Schema for a namespace, containing validator and option metadata
- Option
Metadata - Metadata for a single option in a namespace schema
- Schema
Registry - Registry for loading and storing schemas
- Values
Store - Validates and serves option values, reloading them lazily on read and
serving the current snapshot lock-free via
ArcSwap. Seerefreshfor the staleness window and memory-ordering details. - Values
Store Builder - Builder for constructing a
ValuesStore.
Enums§
- Validation
Error - Errors that can occur during schema and value validation
Constants§
- DEFAULT_
REFRESH_ THRESHOLD - Default minimum age of a cached values snapshot before a read triggers a refresh. A per-thread jitter of up to 1 s is added on top to spread the reload across threads.
- DNS1123_
LABEL_ MAX_ LEN - Maximum length of a K8s DNS-1123 label (RFC 1123).
- 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 a valid K8s DNS-1123 label: lowercase alphanumeric and ‘-’, starts and ends alphanumeric, at most 63 chars.
Type Aliases§
- Propagation
Callback - 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. - Validation
Result - Result type for validation operations
- Values
ByNamespace - A map of option values keyed by their namespace