Metrics
Comprehensive metrics for all your resources.
Overview
SailOps collects and displays metrics for:
- Containers - CPU, memory, network, storage
- Databases - Connections, queries, storage
- Cache - Memory, operations, hit rate
- Gateways - Requests, latency, errors
Viewing Metrics
Resource Metrics
- Navigate to any resource (Container, Database, etc.)
- Click the Metrics tab
- Select time range
- View charts and data
Dashboard Metrics
The dashboard shows overview metrics:
- Resource usage across all containers
- Database connection counts
- Cache hit rates
Time Ranges
Collection runs every 15 s. Gateway, route and website traffic use fixed complete intervals: the smallest step in 30, 60, 120, 300, 600, 900, 1800, 3600, 7200, 10800, 21600 or 43200 seconds that keeps the requested range at or below 100 points. Other resource charts use range/100 with a minimum of 30 s.
| Requested range | Traffic interval |
|---|---|
| 15 minutes | 30 s |
| 1 hour | 1 min |
| 3 hours | 2 min |
| 6 hours | 5 min |
| 12 hours | 10 min |
| 24 hours | 15 min |
| 7 days | 2 h |
| 30 days | 12 h |
Traffic timestamps mark interval starts. The still-filling interval is omitted: the series ends at the last complete interval before the earlier of the requested end and now minus 30 s.
The ranges available in the toolbar depend on your organization's support plan. Each plan sets a maximum metric retention period — only ranges within that limit are offered. Custom date ranges are also validated against this limit.
Some resource types have shorter built-in limits regardless of your plan. For example, database, cache, NATS and gateway engine metrics are available for up to 30 days, and organization-level observability metrics for up to 24 hours. A message below the toolbar indicates when a range has been truncated.
Container Metrics
CPU Usage
Measures processor utilization:
CPU Usage (%) = (CPU time used / CPU time allocated) × 100
| Level | Meaning |
|---|---|
| 0-60% | Normal operation |
| 60-80% | Consider scaling |
| 80-100% | Critical, scale immediately |
Memory Usage
Measures RAM utilization:
Memory Usage = Working Set Memory / Memory Limit
| Level | Meaning |
|---|---|
| 0-70% | Healthy |
| 70-85% | Watch closely |
| 85-100% | Risk of OOM |
Network I/O
Measures data transfer:
- Bytes Received - Incoming data
- Bytes Transmitted - Outgoing data
- Packets - Network packet counts
Storage I/O
Measures disk operations:
- Bytes Read - Data read from disk
- Bytes Written - Data written to disk
- IOPS - I/O operations per second
Container-Specific Metrics
| Metric | Description |
|---|---|
| Restarts | Number of container restarts |
| Uptime | Time since last restart |
| Replicas | Running vs desired instances |
Database Metrics
Connection Metrics
| Metric | Description |
|---|---|
| Active Connections | Currently connected clients |
| Idle Connections | Inactive connections |
| Max Connections | Connection limit |
| Connection Wait | Queue time for connections |
Query Metrics
| Metric | Description |
|---|---|
| Queries/second | Query throughput |
| Query Latency | Average query time |
| Slow Queries | Queries exceeding threshold |
| Transactions | Transaction count |
Storage Metrics
| Metric | Description |
|---|---|
| Database Size | Total data size |
| Table Size | Per-table storage |
| Index Size | Index storage |
| WAL Size | Write-ahead log size |
Replication Metrics (HA)
| Metric | Description |
|---|---|
| Replication Lag | Bytes behind primary |
| Standby Status | Replica state |
| WAL Position | Current log position |
Cache Metrics
Memory Metrics
| Metric | Description |
|---|---|
| Used Memory | Current memory usage |
| Peak Memory | Maximum memory used |
| Memory Fragmentation | Internal fragmentation |
| Evicted Keys | Keys removed due to memory |
Operations Metrics
| Metric | Description |
|---|---|
| Commands/second | Operation throughput |
| Hit Rate | Percentage of cache hits |
| Misses | Cache miss count |
| Keyspace | Total key count |
Connection Metrics
| Metric | Description |
|---|---|
| Connected Clients | Current connections |
| Blocked Clients | Clients in blocking ops |
| Rejected Connections | Connections refused |
Gateway Metrics
Where to find traffic
- Gateway Overview: compact charts; Observability: All routes or an HTTP, gRPC, TCP or TLS route.
- Container Overview: Associated routes, with Requests/sec (last 5 min) and p99 upstream response time (latest complete interval). Shared routes carry
Shared with {N} services · whole-route figuresand are excluded from the container aggregate. Observability shows Route traffic per route. - Website Overview and Observability: Quick Expose and custom-domain HTTPRoutes summed across gateways. CDN edge cache hits and routes created outside SailOps are not attributed.
- Managed Grafana: Gateways & Traffic.
Traffic definitions
| Metric | Definition |
|---|---|
| Request rate | HTTP and gRPC requests in each interval divided by its length, in req/s. TCP/TLS connections are shown separately. |
| Requests in window | HTTP and gRPC requests in observed intervals. Intervals with a counter reset or a collection gap are excluded. TCP/TLS connections are counted separately. |
| Success rate | (total − 4xx − 5xx) / total. 1xx (including WebSocket 101 upgrades), redirects and 304 count as success. gRPC errors in grpc-status over HTTP 200 also count as HTTP success. |
| Error rate (4xx + 5xx) | (4xx + 5xx) / HTTP and gRPC requests. Grafana's Error rate (5xx, selected range) uses sailops_gateway_5xx_ratio, which counts only 5xx and can be lower. |
| Errors | Counts per displayed interval. A timeout before response headers is also counted as a 504; a timeout after headers keeps its status. Timeouts and connection failures overlap the status classes and are not part of the error rate. |
| Requests without a complete upstream response | Sum requests minus response-time sample count over the window, excluding unobserved intervals. Includes timeouts after headers, client resets and WebSocket upgrades. |
| Gateway HTTP requests | Requests received, responses sent and 4xx/5xx responses on the gateway's listeners. Includes forwarded and gateway-generated responses. Available even when routed counters are missing, including gateways with no routes. |
| Answered by the gateway | Requests Envoy answered itself: no matching route (404), no available backend (503), policy denials (401/403/429), redirects. Not attributed to any route. Retried upstream attempts can hide part of it. |
| Requests closed before a response | Gateway listener requests minus responses, summed over the window then clamped at zero. Gateway aggregate only; per-route client aborts are not measured. |
| TCP/TLS connections | Connections opened through TCPRoute and TLSRoute; separate connection failures. Excluded from HTTP totals and ratios. |
Route counters describe traffic forwarded to a backend. A route with no backend endpoints can therefore show no routed traffic. Gateway HTTP requests still shows observed listener traffic, including 404 or 503 responses. Answered by the gateway requires both routed and listener observations; it stays unavailable when routed counters are missing. No backend available is a gateway-aggregate state when that attribution shows a positive gateway 5xx count, rather than a route backend-status check. Gateway listener figures cover the whole listener, including any system-namespace routes. The shared gateway does not expose listener totals to an individual project. Listener-minus-upstream differences are signed per interval: sum over the window before clamping at zero, because retries count once per upstream attempt.
No traffic means an observed interval with zero HTTP requests; No HTTP traffic identifies TCP/TLS-only traffic. No Traffic Data means data is unavailable. Missing intervals remain gaps; no traffic has no success/error ratio or response-time value.
Upstream response time
Time from the request fully received by the gateway until the upstream response completes. Excludes requests without a complete response (timeouts after headers, client resets, WebSocket upgrades). Whole milliseconds.
This includes upstream connection-pool wait, connection establishment, retries, backend processing and response transfer to the gateway. It excludes client TLS, request upload, pre-router filters and CDN cache hits. Envoy records whole milliseconds; averages below about 10 ms can read up to 0.5 ms low.
A stream the backend ends cleanly (SSE, server-streaming gRPC, large downloads) counts once, for its whole duration, in the interval where it ends. Streams cut by the request timeout or closed by the client count none. Set an appropriate route request timeout, or 0s for unlimited streams. A WebSocket upgrade counts once as a successful 101 and has no upstream response time sample.
Histograms flush every 5 s, so a response-time sample can land one interval late; compare incomplete-response counts over a window. Percentiles are linearly interpolated within histogram buckets like Prometheus histogram_quantile. Some percentiles exceed the largest histogram bound and are shown as lower bounds (> X ms).
Metric Visualization
Chart Types
Line Charts
- Show trends over time
- Compare multiple metrics
- Identify patterns
Area Charts
- Show cumulative values
- Stack multiple series
- Visualize totals
Bar Charts
- Compare discrete values
- Show distributions
- Highlight peaks
Chart Interactions
- Hover - View exact values
- Zoom - Focus on time range
- Pan - Navigate time
- Legend - Toggle series
Alerts and metrics
See Alerts Overview and Grafana alerting. Configure No data handling explicitly.
Accessing Metrics
Dashboard View
All metrics are available through the SailOps dashboard:
- Navigate to any resource
- Click the Metrics tab
- Select the time range
- View real-time charts and data
Metric Retention
How far back you can view metrics depends on your organization's support plan:
| Plan | Maximum Retention |
|---|---|
| Basic | 7 days |
| Starter | 30 days |
| Business | 90 days |
| Custom | 365 days |
Samples are aggregated at query time without downsampling. Gateway, route and website traffic is limited to 30 days and the plan limit.
Best Practices
1. Set Up Dashboards
Create custom views for:
- Production health
- Development metrics
- Cost optimization
2. Baseline Your Metrics
Know what's normal:
- Record baseline values
- Understand daily patterns
- Document expected ranges
3. Set Meaningful Alerts
Alert on actionable conditions:
- Avoid alert fatigue
- Set appropriate thresholds
- Include context
4. Review Regularly
Weekly metric reviews:
- Identify trends
- Spot anomalies early
- Plan capacity
Troubleshooting
Metrics Not Showing
- Verify resource is running
- Check time range selection
- Wait for data collection (1-2 minutes)
- Refresh the page
Metrics Look Wrong
- Check time zone settings
- Verify metric calculation
- Compare with resource status
- Contact support if needed
Missing Historical Data
- Check retention policy
- Verify time range exists