Docs / Running yasp
Observability
# Health
| Endpoint | Answers |
|---|---|
GET /healthz | 200 while the process runs |
GET /readyz | 200 while the database is reachable, 503 otherwise; the body says whether this instance is the leader |
# Metrics
GET /metrics serves Prometheus/OpenMetrics text: request latency per route, check results, engine transitions, notification queue depth and lag, probe last-seen and clock offset, and yasp_leader. Set server.metrics_token to require Authorization: Bearer <token>. With the read-only demo on and no token set, /metrics is off.
To send metrics to an OpenTelemetry pipeline, scrape /metrics with the Collector's prometheus receiver.
# Logs
JSON on stdout by default (--log-format pretty for humans). The level comes from RUST_LOG, default info. Secrets are never logged.
# Traces (OpenTelemetry)
yasp exports traces over OTLP/HTTP when an endpoint is set with the standard variables:
OTEL_EXPORTER_OTLP_ENDPOINT=https://otel-collector.example.com:4318 yasp serve| Variable | Purpose |
|---|---|
OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_TRACES_ENDPOINT | Turns export on. The traces endpoint is used as-is; the general one gets /v1/traces appended |
OTEL_EXPORTER_OTLP_HEADERS | Authentication, e.g. x-honeycomb-team=… or Authorization=Bearer … |
OTEL_SERVICE_NAME | Default yasp |
OTEL_RESOURCE_ATTRIBUTES | e.g. deployment.environment=prod,service.instance.id=yasp-a |
OTEL_TRACES_SAMPLER, OTEL_TRACES_SAMPLER_ARG | e.g. parentbased_traceidratio and 0.1 |
Spans cover every HTTP request (method, route, status, latency) and what the logs show at the configured level: engine work, notification sends, ACME, and database queries at RUST_LOG=sqlx=info. Spans are batched and flushed on shutdown. If the collector is unreachable, spans are dropped; serving is never affected.