Observability
Respire emits OpenTelemetry-compatible activities and metrics from sources named Respire.
Traces and metrics
builder.Services.AddOpenTelemetry()
.WithTracing(tracing => tracing.AddSource("Respire"))
.WithMetrics(metrics => metrics.AddMeter("Respire"));
Instrumentation follows OpenTelemetry database semantic conventions. db.namespace reports the configured Redis database index.
Raw command values are not attached to spans because arbitrary Redis payloads cannot be reliably sanitized. Pipelines and transactions are recorded as single operations.
Latency
Operation latency uses the stable db.client.operation.duration histogram and records seconds, as required by the semantic convention.
Logging
Pass an ILoggerFactory through RespireOptions or use the dependency-injection integration. Logs cover connection lifecycle and recovery without logging command payloads.
Health state
For health checks or dashboards, combine IsConnected with ConnectionStateChanged:
redis.ConnectionStateChanged += change =>
healthState.Update(change.Endpoint, change.State, change.Error);
A transient reconnection is expected to move through connection states; use application-level thresholds before paging an operator.