stateset-observability
Observability primitives for StateSet iCommerce:
- Structured tracing bootstrap (
init_tracing) - Business counters (orders, payments, inventory)
- RED metrics (
record_request_*) - SLO evaluation (
SloTarget,SloEvaluation) - Span/metric naming conventions (
conventions)
Tracing
use init_tracing;
init_tracing
.expect;
Metrics + RED + SLO
use Duration;
use ;
let metrics = init_metrics;
metrics.record_order_created;
metrics.record_request_success;
metrics.record_request_error;
let snapshot = metrics.snapshot;
let report = snapshot
.evaluate_operation_slo
.expect;
assert!;
Conventions
- Span names:
stateset.<normalized_operation>(for examplestateset.order_create) - Metric names:
stateset_requests_totalstateset_request_errors_totalstateset_request_duration_ms_total
- Label keys:
serviceoperationenvironmentregionoutcome
Use normalize_name, operation_span_name, and operation_metric_label to keep cardinality stable.
Feature Flags
| Feature | Description | Default |
|---|---|---|
otel |
OpenTelemetry OTLP export via tracing-opentelemetry |
No |
The tracing bootstrap is deliberately lightweight and imposes no backend on
downstream applications; counters are AtomicU64 and safe to clone across threads.
Part of StateSet iCommerce
Wired into stateset-embedded so engine
operations are instrumented by default. Part of the
StateSet iCommerce engine.
License
MIT OR Apache-2.0