Skip to main content
S2 Lite provides built-in observability features including Prometheus metrics, structured logging, and health endpoints.

Health Checks

S2 Lite exposes a /health endpoint for readiness and liveness checks.

Health Endpoint

Responses:
  • 200 OK with body "OK" - Server is healthy and database is accessible
  • 503 Service Unavailable - Database status check failed

Configuration

The startup probe allows up to 10 minutes for initialization, which is important when using object storage with high latency or large datasets.

Prometheus Metrics

S2 Lite exposes Prometheus metrics at /metrics in text format.

Metrics Endpoint

Available Metrics

Append Metrics

s2_append_permit_latency_seconds
  • Type: Histogram
  • Description: Time waiting for append permit (backpressure indicator)
  • Buckets: 0.005, 0.010, 0.025, 0.050, 0.100, 0.250, 0.500, 1.000, 2.500 seconds
s2_append_ack_latency_seconds
  • Type: Histogram
  • Description: Time from append request to acknowledgment
  • Buckets: 0.005, 0.010, 0.025, 0.050, 0.100, 0.250, 0.500, 1.000, 2.500 seconds
s2_append_batch_records
  • Type: Histogram
  • Description: Number of records per append batch
  • Buckets: 1, 10, 50, 100, 250, 500, 1000 records
s2_append_batch_bytes
  • Type: Histogram
  • Description: Size in bytes of append batches
  • Buckets: 512, 1024, 4096, 16384, 65536, 262144, 524288, 1048576 bytes

Process Metrics

Standard Prometheus process metrics are automatically included:
  • process_cpu_seconds_total - CPU time
  • process_resident_memory_bytes - Resident memory
  • process_virtual_memory_bytes - Virtual memory
  • process_open_fds - Open file descriptors
  • process_max_fds - Maximum file descriptors

Scraping Configuration

Helm Chart Integration

The S2 Lite Helm chart supports automatic ServiceMonitor creation:
values.yaml
For TLS-enabled deployments:
values.yaml

Logging

S2 Lite uses structured logging with configurable levels.

Log Levels

Configure via the RUST_LOG environment variable:

Log Format

Logs are output in a structured format:

Docker Logging

View logs:
With timestamp:

Kubernetes Logging

View logs:
Stream from multiple pods:

Systemd Logging

View logs:
With filters:

Grafana Dashboards

Example Dashboard

Here’s a basic Grafana dashboard configuration for S2 Lite:
s2-lite-dashboard.json

Key Queries

Append latency percentiles:
Append throughput:
Backpressure indicator:

Alerting

Prometheus Alert Rules

alerts.yml

Health Check Monitoring

Monitor the health endpoint with your monitoring system:
docker-compose.yml

Performance Monitoring

Key Performance Indicators

  1. Append Latency: Time to acknowledge writes
  2. Permit Latency: Backpressure / queueing time
  3. Throughput: Records and bytes per second
  4. Memory Usage: Track for memory leaks
  5. CPU Usage: Detect resource constraints

Benchmarking

Use the built-in benchmark tool:
Monitor metrics during the benchmark to establish baselines.

Tracing

S2 Lite includes HTTP request tracing via tower-http:
  • Request/response logging at INFO level
  • Detailed request info at DEBUG level
  • Trace IDs in structured logs
Distributed tracing (OpenTelemetry) is not currently supported but is planned for a future release.

Next Steps

Configuration

Configure S2 Lite settings

Deployment

Deploy to production