Skip to main content

Overview

S2 Lite provides built-in monitoring endpoints for health checks and metrics collection, making it easy to integrate with your observability stack.

Health Checks

The /health endpoint provides a simple way to check if S2 Lite is running and ready to accept requests.

Endpoint Details

  • URL: /health
  • Method: GET
  • Success Response: HTTP 200 OK
  • Use Cases: Readiness probes, liveness probes, load balancer health checks

Example Usage

Kubernetes Probes

Prometheus Metrics

S2 Lite exposes internal metrics in Prometheus text format at the /metrics endpoint.
The /metrics endpoint returns Prometheus-formatted metrics for operational monitoring, not business metrics like storage or throughput.

Available Metrics

S2 Lite tracks the following operational metrics:

Append Latency Metrics

s2_append_permit_latency_seconds
  • Type: Histogram
  • Description: Time taken to acquire permission to append
  • Buckets: 5ms, 10ms, 25ms, 50ms, 100ms, 250ms, 500ms, 1s, 2.5s
s2_append_ack_latency_seconds
  • Type: Histogram
  • Description: End-to-end append acknowledgment latency
  • Buckets: 5ms, 10ms, 25ms, 50ms, 100ms, 250ms, 500ms, 1s, 2.5s

Batch Size Metrics

s2_append_batch_records
  • Type: Histogram
  • Description: Number of records per append batch
  • Buckets: 1, 10, 50, 100, 250, 500, 1000
s2_append_batch_bytes
  • Type: Histogram
  • Description: Size in bytes of append batches
  • Buckets: 512B, 1KB, 4KB, 16KB, 64KB, 256KB, 512KB, 1MB

Scraping Metrics

Example output:

Prometheus Configuration

Prometheus Scrape Config

Add S2 Lite as a scrape target in prometheus.yml:

Kubernetes ServiceMonitor

If using Prometheus Operator:

Helm Chart Configuration

When using the S2 Lite Helm chart:

Grafana Dashboards

Sample Queries

Average Append Latency (P50, P95, P99)
Append Rate
Average Batch Size (Records)
Average Batch Size (Bytes)

Example Grafana Panel

API Metrics (Cloud Only)

The /metrics API endpoint for basin and stream metrics is not supported in S2 Lite. These metrics are only available on the S2 cloud service.
For programmatic access to business metrics (storage, throughput, operations), use the S2 cloud service:

Alerting

Sample Prometheus Alerts

Logging

S2 Lite outputs structured logs to stdout. Configure log level using the RUST_LOG environment variable:
In production, set RUST_LOG=info or RUST_LOG=warn to reduce log volume.

Performance Monitoring

SlateDB Configuration

S2 Lite uses SlateDB as its storage engine. Configure SlateDB settings using SL8_ prefixed environment variables:
Lower flush intervals improve write latency but may increase object storage API calls.

Monitoring Best Practices

  1. Set up health checks - Use /health for liveness and readiness probes
  2. Monitor append latency - Track P95 and P99 latency to detect performance degradation
  3. Alert on downtime - Configure alerts when S2 Lite becomes unavailable
  4. Track batch sizes - Understand your workload patterns
  5. Use structured logging - Enable JSON logging for better log aggregation
  6. Monitor resource usage - Track CPU, memory, and network metrics at the infrastructure level