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§
- Arrow
Event Schema - One per-event payload struct. Combined into the unified
obs_eventstable byArrowSchemaModel. - Arrow
Field - One leaf-typed field in the Arrow schema for a per-event payload struct.
- Arrow
Schema Model - Unified
obs_eventstable schema. Used byParquetSinkto pre- compute the file-level Arrow schema, byClickHouseSinkto emit theCREATE TABLEDDL, and byobs migrate {parquet,clickhouse}for CI-driven migrations. Spec 14 § 4 / KD5 + spec 22 § 1. - Callsite
Record - Stable record kept per
callsite_id. Spec 31 § 3.2. - ObsCallsite
Registry - Process-local callsite registry. Spec 31 § 3.2.
- Otel
Attribute View - 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.
- Schema
Registry - Runtime registry: by-name and by-hash lookup populated from the
linkmedistributed slice at observer init. Owned byStandardObserver; sinks receiveArc<SchemaRegistry>at construction. - Scrubbed
Envelope - 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§
- Arrow
Leaf Type - Logical Arrow type for a leaf field. Mirrors the subset of
arrow_schema::DataTypewe ever produce fromEventSchema::FIELDS. - Callsite
Source - Callsite source — drives both human display and the BLAKE3 input. Spec 31 § 3.4 enum.
- Decode
Error - Error returned by
EventSchemaErased::render_jsonand the futuredecode_to_*methods (Phase 2). Spec 14 § 2. - Otlp
Value - OTLP
AnyValuesubstitute for the Phase-1 surface. The real OTLP types live inobs-otel(Phase 3 task 3.8); we use a small substitute here soEventSchemaErased::decode_to_otlp_kvcan be declared without a circularobs-core ↔ obs-oteldependency. - Scrub
Error - 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
EventSchemacodegen registers into. Walked once at observer init to build the runtimeSchemaRegistry. See spec 14 § 3.
Traits§
- Arrow
Struct Builder - Codegen-emitted Arrow
StructArrayrow builder. The defaultEventSchemaErased::decode_to_arrow_structimplementation walks the buffa wire format and calls the matchingappend_*method per declared field, in declaration order from the schema’sFIELDStable. Sinks (obs-parquet,obs-clickhouse) implement this trait over their builder types; Phase 4A codegen may overridedecode_to_arrow_structfor per-event projections. Spec 14 § 2 / spec 94 § 2.5. - Event
Schema Erased - Object-safe view of a single schema. Sinks consume
&'static dyn EventSchemaErasedlooked up via thecrate::registry::SchemaRegistry. - Sealed
- Sealing supertrait — only
obs-buildcodegen andobs-macros::derive(Event)may implementEventSchemaErased. 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] == 0corner 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
payloadand return a slice ofscratchwith the rewritten bytes. The caller must clear/keepscratchas it sees fit; this helper truncates and writes from offset 0.
Type Aliases§
- Shared
Registry - Convenience: shared
Arc<SchemaRegistry>for sink construction.