SLA Metrics
Real-time service quality metrics.
GET /sla-metrics
Returns real-time service quality (SLA) metrics: percentile latencies, success/error rates, and service availability.
Endpoint
GET https://places.gotravelyzer.com/sla-metricsAuthentication
This endpoint does not require authentication and is not counted against your quotas.
Parameters
No parameters required.
Request
curl "https://places.gotravelyzer.com/sla-metrics"Response
Success (200 OK)
{
"period": "last_24h",
"window": "5m",
"latency": {
"p50": 3,
"p95": 18,
"p99": 35
},
"requests": {
"total": 124500,
"successRate": 99.8,
"errorRate": 0.2
},
"availability": {
"uptime": 99.99
}
}Response Fields
Metadata
| Field | Type | Description |
|---|---|---|
period | string | Observation period (e.g., last_24h) |
window | string | Aggregation window (e.g., 5m = 5 minutes) |
Latency Metrics
| Field | Type | Description |
|---|---|---|
latency.p50 | number | Median latency in ms (50% of requests are faster) |
latency.p95 | number | 95th percentile in ms |
latency.p99 | number | 99th percentile in ms |
Latency values are clamped to a minimum of 1ms for better readability.
Request Metrics
| Field | Type | Description |
|---|---|---|
requests.total | number | Total number of requests processed |
requests.successRate | number | Success rate (0-100%) |
requests.errorRate | number | Error rate (0-100%) |
Availability
| Field | Type | Description |
|---|---|---|
availability.uptime | number | Availability percentage (0-100%) |
HTTP Codes
| Code | Status | Description |
|---|---|---|
200 | OK | Metrics returned successfully |
503 | Service Unavailable | Metrics service unavailable |
Use Cases
Health Monitoring
Check that metrics are within acceptable thresholds:
#!/bin/bash
METRICS=$(curl -s "https://places.gotravelyzer.com/sla-metrics")
P95=$(echo $METRICS | jq '.latency.p95')
SUCCESS_RATE=$(echo $METRICS | jq '.requests.successRate')
UPTIME=$(echo $METRICS | jq '.availability.uptime')
echo "Latency P95: ${P95}ms"
echo "Success rate: ${SUCCESS_RATE}%"
echo "Availability: ${UPTIME}%"
# Check thresholds
if [ $(echo "$P95 > 200" | bc) -eq 1 ]; then
echo "ALERT: High P95 latency!"
fi
if [ $(echo "$SUCCESS_RATE < 99" | bc) -eq 1 ]; then
echo "ALERT: Low success rate!"
fiSupervision Dashboard
Retrieve metrics for a dashboard:
# Retrieve formatted metrics
curl -s "https://places.gotravelyzer.com/sla-metrics" | jq '{
latency_p50: .latency.p50,
latency_p95: .latency.p95,
latency_p99: .latency.p99,
success_rate: .requests.successRate,
error_rate: .requests.errorRate,
uptime: .availability.uptime,
total_requests: .requests.total
}'Automatic Alerts
Metrics-based alert script:
#!/bin/bash
ALERT_P95_THRESHOLD=200 # ms
ALERT_SUCCESS_THRESHOLD=99 # %
ALERT_UPTIME_THRESHOLD=99.5 # %
METRICS=$(curl -s "https://places.gotravelyzer.com/sla-metrics")
P95=$(echo $METRICS | jq '.latency.p95')
SUCCESS=$(echo $METRICS | jq '.requests.successRate')
UPTIME=$(echo $METRICS | jq '.availability.uptime')
ALERTS=""
if [ $(echo "$P95 > $ALERT_P95_THRESHOLD" | bc) -eq 1 ]; then
ALERTS+="High P95 latency: ${P95}ms (threshold: ${ALERT_P95_THRESHOLD}ms)\n"
fi
if [ $(echo "$SUCCESS < $ALERT_SUCCESS_THRESHOLD" | bc) -eq 1 ]; then
ALERTS+="Low success rate: ${SUCCESS}% (threshold: ${ALERT_SUCCESS_THRESHOLD}%)\n"
fi
if [ $(echo "$UPTIME < $ALERT_UPTIME_THRESHOLD" | bc) -eq 1 ]; then
ALERTS+="Low availability: ${UPTIME}% (threshold: ${ALERT_UPTIME_THRESHOLD}%)\n"
fi
if [ -n "$ALERTS" ]; then
echo -e "ALERTS DETECTED:\n$ALERTS"
# Send notification (Slack, email, etc.)
else
echo "All metrics are within normal thresholds"
fiInterpreting Metrics
Latency (P50, P95, P99)
| Percentile | Meaning | Typical Target |
|---|---|---|
| P50 | Median experience | < 50ms |
| P95 | Experience of 95% of users | < 200ms |
| P99 | Common worst case | < 500ms |
Success Rate
| Value | Interpretation |
|---|---|
| > 99.9% | Excellent |
| 99-99.9% | Normal |
| 95-99% | Degraded |
| < 95% | Critical problem |
Availability (Uptime)
| Value | Equivalent Downtime (monthly) |
|---|---|
| 99.99% | ~4 minutes |
| 99.9% | ~43 minutes |
| 99% | ~7 hours |
Technical Notes
- Metrics are calculated over a rolling 5-minute window
- Latency values are in milliseconds
- Rates are expressed as percentage (0-100)
- This endpoint is not subject to rate limits
- These are informational metrics, not contractual guarantees