Skip to main content

Crate sc_observability_types

Crate sc_observability_types 

Source
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 ErrorCode registry for sc-observability-types.

Structs§

ActionName
Validated stable action name for log and span events.
CorrelationId
Validated request/correlation identifier used for cross-record joins.
Diagnostic
Structured diagnostic payload reusable across CLI, logging, and telemetry.
DiagnosticSummary
Small diagnostic summary used in health and last-error reporting.
DurationMs
Canonical millisecond duration type used across the workspace.
EnvPrefix
Validated environment prefix used for config loading namespaces.
ErrorCode
Stable machine-readable error code used across diagnostics and error types.
ErrorContext
Builder-style context wrapper used by public crate error types.
EventError
Event validation or lifecycle error returned during emit paths.
ExportError
Export error returned by concrete telemetry exporters.
ExporterHealth
Health summary for one configured telemetry exporter.
FlushError
Flush error returned by explicit flush operations.
IdentityError
Error returned when process identity resolution fails.
InitError
Initialization error returned by public construction entry points.
LogEvent
Structured log record emitted by the logging and routing layers.
LogFieldMatch
One exact-match field filter in a historical/follow log query.
LogQuery
Shared historical/follow query contract used by the logging reader/runtime layers.
LogSinkError
Logging sink error returned by concrete sink implementations.
LogSnapshot
Stable synchronous result contract returned by query/follow polling surfaces.
LoggingHealthReport
Aggregate logging health report.
MetricName
Validated metric identity using [A-Za-z0-9._-/]+.
MetricRecord
Structured metric observation projected from routing or telemetry layers.
MetricUnit
Validated metric unit using [A-Za-z0-9._-/%]+.
ObservabilityHealthReport
Aggregate routing/runtime health report.
Observation
Shared envelope around a typed observation payload.
OutcomeLabel
Validated stable outcome label for event results.
ProcessIdentity
Caller-resolved process identity attached to observations and log events.
ProjectionError
Projection error returned by log/span/metric projectors.
ProjectionRegistration
Construction-time registration for log/span/metric projection of a payload.
QueryHealthReport
Aggregate health report for the shared query/follow surface.
RecoverableSteps
Ordered recovery steps for a recoverable diagnostic.
SchemaVersion
Validated schema version label for shared envelopes and log records.
ServiceName
Validated service name carried in logs and telemetry.
ShutdownError
Shutdown error returned when graceful shutdown fails.
SinkHealth
Health summary for one concrete logging sink.
SinkName
Validated stable name for a logging sink or telemetry exporter.
SpanEnded
Typestate marker for a completed span.
SpanEvent
Event attached to a span timeline without creating a child span.
SpanId
Validated 16-character lowercase hexadecimal span identifier.
SpanRecord
Producer-facing span record whose lifecycle is encoded via typestate.
SpanStarted
Typestate marker for a started-but-not-yet-ended span.
StateName
Validated stable state name for state-transition payloads.
StateTransition
Typed description of an entity moving from one state to another.
SubscriberError
Subscriber error returned by observation subscribers.
SubscriberRegistration
Construction-time registration for one typed observation subscriber.
TargetCategory
Validated stable target category for log events.
TelemetryHealthReport
Aggregate telemetry/export health report.
Timestamp
Canonical UTC timestamp type used across the workspace.
ToolName
Validated tool identity used for top-level configuration.
TraceContext
Generic trace correlation context shared by logs, spans, and observations.
TraceId
Validated 32-character lowercase hexadecimal trace identifier.
ValueValidationError
Validation error returned when a public value type rejects an input.

Enums§

ExporterHealthState
Health state for an individual telemetry exporter.
Level
Canonical event/log severity level.
LevelFilter
Level threshold used by filtering surfaces.
LogOrder
Deterministic result ordering for historical query and follow polling.
LoggingHealthState
Top-level health state for the lightweight logging layer.
MetricKind
Supported metric aggregation shapes.
ObservationError
Routing/runtime error returned by Observability::emit.
ObservationHealthState
Top-level health state for the observation routing runtime.
ProcessIdentityPolicy
Policy describing how process identity is populated at runtime.
QueryError
Stable shared error contract for historical query and follow operations.
QueryHealthState
Top-level health state for historical query and follow availability.
Remediation
Required remediation metadata attached to every diagnostic.
SinkHealthState
Health state for an individual log sink.
SpanSignal
Generic span lifecycle signal used by projectors and telemetry assembly.
SpanStatus
Final span status for a completed span record.
TelemetryError
Telemetry emit error returned by Telemetry operations.
TelemetryHealthState
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§

DiagnosticInfo
Trait for public error surfaces that can expose an attached diagnostic.
LogProjector
Open projector contract from typed observations into log events.
MetricProjector
Open projector contract from typed observations into metric records.
ObservabilityHealthProvider
Shared contract for exposing telemetry health without an OTLP crate dependency.
Observable
Marker trait for consumer-owned observation payloads.
ObservationFilter
Open filter contract evaluated before subscriber or projector execution.
ObservationSubscriber
Open subscriber contract for typed observations.
ProcessIdentityResolver
Open resolver contract for caller-defined process identity lookup.
SpanProjector
Open projector contract from typed observations into span signals.