Skip to main content

Module registry

Module registry 

Source
Expand description

Schema registry — EventSchemaErased object-safe trait, the linkme-collected EVENT_SCHEMAS distributed slice, the runtime SchemaRegistry, and the ScrubbedEnvelope worker→sink handoff.

Spec 14.

Structs§

ArrowEventSchema
One per-event payload struct. Combined into the unified obs_events table by ArrowSchemaModel.
ArrowField
One leaf-typed field in the Arrow schema for a per-event payload struct.
ArrowSchemaModel
Unified obs_events table schema. Used by ParquetSink to pre- compute the file-level Arrow schema, by ClickHouseSink to emit the CREATE TABLE DDL, and by obs migrate {parquet,clickhouse} for CI-driven migrations. Spec 14 § 4 / KD5 + spec 22 § 1.
CallsiteRecord
Stable record kept per callsite_id. Spec 31 § 3.2.
ObsCallsiteRegistry
Process-local callsite registry. Spec 31 § 3.2.
OtelAttributeView
View of the OTel attribute set baked into a schema at codegen time. Phase-1 ships an empty struct; codegen populates it in Phase 2. Spec 14 § 2 / spec 20 § 2.3.
SchemaRegistry
Runtime registry: by-name and by-hash lookup populated from the linkme distributed slice at observer init. Owned by StandardObserver; sinks receive Arc<SchemaRegistry> at construction.
ScrubbedEnvelope
Read-only view of an envelope whose payload has already been run through the per-tier scrubber. Constructed by the worker; consumed by sinks.

Enums§

ArrowLeafType
Logical Arrow type for a leaf field. Mirrors the subset of arrow_schema::DataType we ever produce from EventSchema::FIELDS.
CallsiteSource
Callsite source — drives both human display and the BLAKE3 input. Spec 31 § 3.4 enum.
DecodeError
Error returned by EventSchemaErased::render_json and the future decode_to_* methods (Phase 2). Spec 14 § 2.
OtlpValue
OTLP AnyValue substitute for the Phase-1 surface. The real OTLP types live in obs-otel (Phase 3 task 3.8); we use a small substitute here so EventSchemaErased::decode_to_otlp_kv can be declared without a circular obs-core ↔ obs-otel dependency.
ScrubError
Error returned by EventSchemaErased::scrub_for_log. Spec 14 § 2.

Constants§

ENVELOPE_COLUMNS
Envelope columns emitted by every analytical sink. Spec 22 § 1.1 “Envelope” + “Resource” rows, intentionally short names matching the ClickHouse template in spec 22 § 3.

Statics§

EVENT_SCHEMAS
The link-time distributed slice every EventSchema codegen registers into. Walked once at observer init to build the runtime SchemaRegistry. See spec 14 § 3.

Traits§

ArrowStructBuilder
Codegen-emitted Arrow StructArray row builder. The default EventSchemaErased::decode_to_arrow_struct implementation walks the buffa wire format and calls the matching append_* method per declared field, in declaration order from the schema’s FIELDS table. Sinks (obs-parquet, obs-clickhouse) implement this trait over their builder types; Phase 4A codegen may override decode_to_arrow_struct for per-event projections. Spec 14 § 2 / spec 94 § 2.5.
EventSchemaErased
Object-safe view of a single schema. Sinks consume &'static dyn EventSchemaErased looked up via the crate::registry::SchemaRegistry.
Sealed
Sealing supertrait — only obs-build codegen and obs-macros::derive(Event) may implement EventSchemaErased. External crates go through the codegen so we can add methods to the trait without breaking downstream impls. Spec 14 KD-D49.

Functions§

callsite_id
Compute a stable 64-bit callsite id from the canonical inputs. Spec 31 § 3.1 — the perturb-to-non-zero path is preserved.
perturb_to_nonzero
Force a non-zero 64-bit id from a 32-byte BLAKE3 output. Reserved for the head[0..8] == 0 corner case (probability 2⁻⁶⁴). Spec 31 § 3.1.
render_payload_json
Decode a buffa payload into JSON using runtime field metadata.
scrub_payload
Redact PII/SECRET fields in payload and return a slice of scratch with the rewritten bytes. The caller must clear/keep scratch as it sees fit; this helper truncates and writes from offset 0.

Type Aliases§

SharedRegistry
Convenience: shared Arc<SchemaRegistry> for sink construction.