Expand description
Shared neutral contracts for the sc-observability workspace.
This crate defines the reusable value types, diagnostics, typestate span contracts, health reports, and open extension traits consumed by the higher layers in the workspace. It intentionally avoids owning sinks, routing runtimes, exporter behavior, or application-specific payload types.
Modules§
- constants
- Shared cross-crate constants owned by
sc-observability-types. - error_
codes - Stable
ErrorCoderegistry forsc-observability-types.
Structs§
- Action
Name - Validated stable action name for log and span events.
- Correlation
Id - Validated request/correlation identifier used for cross-record joins.
- Diagnostic
- Structured diagnostic payload reusable across CLI, logging, and telemetry.
- Diagnostic
Summary - Small diagnostic summary used in health and last-error reporting.
- Duration
Ms - Canonical millisecond duration type used across the workspace.
- EnvPrefix
- Validated environment prefix used for config loading namespaces.
- Error
Code - Stable machine-readable error code used across diagnostics and error types.
- Error
Context - Builder-style context wrapper used by public crate error types.
- Event
Error - Event validation or lifecycle error returned during emit paths.
- Export
Error - Export error returned by concrete telemetry exporters.
- Exporter
Health - Health summary for one configured telemetry exporter.
- Flush
Error - Flush error returned by explicit flush operations.
- Identity
Error - Error returned when process identity resolution fails.
- Init
Error - Initialization error returned by public construction entry points.
- LogEvent
- Structured log record emitted by the logging and routing layers.
- LogField
Match - One exact-match field filter in a historical/follow log query.
- LogQuery
- Shared historical/follow query contract used by the logging reader/runtime layers.
- LogSink
Error - Logging sink error returned by concrete sink implementations.
- LogSnapshot
- Stable synchronous result contract returned by query/follow polling surfaces.
- Logging
Health Report - Aggregate logging health report.
- Metric
Name - Validated metric identity using [A-Za-z0-9._-/]+.
- Metric
Record - Structured metric observation projected from routing or telemetry layers.
- Metric
Unit - Validated metric unit using [A-Za-z0-9._-/%]+.
- Observability
Health Report - Aggregate routing/runtime health report.
- Observation
- Shared envelope around a typed observation payload.
- Outcome
Label - Validated stable outcome label for event results.
- Process
Identity - Caller-resolved process identity attached to observations and log events.
- Projection
Error - Projection error returned by log/span/metric projectors.
- Projection
Registration - Construction-time registration for log/span/metric projection of a payload.
- Query
Health Report - Aggregate health report for the shared query/follow surface.
- Recoverable
Steps - Ordered recovery steps for a recoverable diagnostic.
- Schema
Version - Validated schema version label for shared envelopes and log records.
- Service
Name - Validated service name carried in logs and telemetry.
- Shutdown
Error - Shutdown error returned when graceful shutdown fails.
- Sink
Health - Health summary for one concrete logging sink.
- Sink
Name - Validated stable name for a logging sink or telemetry exporter.
- Span
Ended - Typestate marker for a completed span.
- Span
Event - Event attached to a span timeline without creating a child span.
- SpanId
- Validated 16-character lowercase hexadecimal span identifier.
- Span
Record - Producer-facing span record whose lifecycle is encoded via typestate.
- Span
Started - Typestate marker for a started-but-not-yet-ended span.
- State
Name - Validated stable state name for state-transition payloads.
- State
Transition - Typed description of an entity moving from one state to another.
- Subscriber
Error - Subscriber error returned by observation subscribers.
- Subscriber
Registration - Construction-time registration for one typed observation subscriber.
- Target
Category - Validated stable target category for log events.
- Telemetry
Health Report - Aggregate telemetry/export health report.
- Timestamp
- Canonical UTC timestamp type used across the workspace.
- Tool
Name - Validated tool identity used for top-level configuration.
- Trace
Context - Generic trace correlation context shared by logs, spans, and observations.
- TraceId
- Validated 32-character lowercase hexadecimal trace identifier.
- Value
Validation Error - Validation error returned when a public value type rejects an input.
Enums§
- Exporter
Health State - Health state for an individual telemetry exporter.
- Level
- Canonical event/log severity level.
- Level
Filter - Level threshold used by filtering surfaces.
- LogOrder
- Deterministic result ordering for historical query and follow polling.
- Logging
Health State - Top-level health state for the lightweight logging layer.
- Metric
Kind - Supported metric aggregation shapes.
- Observation
Error - Routing/runtime error returned by
Observability::emit. - Observation
Health State - Top-level health state for the observation routing runtime.
- Process
Identity Policy - Policy describing how process identity is populated at runtime.
- Query
Error - Stable shared error contract for historical query and follow operations.
- Query
Health State - Top-level health state for historical query and follow availability.
- Remediation
- Required remediation metadata attached to every diagnostic.
- Sink
Health State - Health state for an individual log sink.
- Span
Signal - Generic span lifecycle signal used by projectors and telemetry assembly.
- Span
Status - Final span status for a completed span record.
- Telemetry
Error - Telemetry emit error returned by
Telemetryoperations. - Telemetry
Health State - Top-level health state for telemetry export.
Constants§
- DEFAULT_
ENV_ PREFIX_ SEPARATOR - Separator used when deriving environment prefixes.
- OBSERVATION_
ENVELOPE_ VERSION - Current version string for the observation envelope contract.
Traits§
- Diagnostic
Info - Trait for public error surfaces that can expose an attached diagnostic.
- LogProjector
- Open projector contract from typed observations into log events.
- Metric
Projector - Open projector contract from typed observations into metric records.
- Observability
Health Provider - Shared contract for exposing telemetry health without an OTLP crate dependency.
- Observable
- Marker trait for consumer-owned observation payloads.
- Observation
Filter - Open filter contract evaluated before subscriber or projector execution.
- Observation
Subscriber - Open subscriber contract for typed observations.
- Process
Identity Resolver - Open resolver contract for caller-defined process identity lookup.
- Span
Projector - Open projector contract from typed observations into span signals.