Skip to main content
Push metrics from your applications to automatically detect and respond to health issues.

How It Works

Send metrics like error rates, response times, and resource usage. Kodo analyzes these metrics and automatically updates service status based on configurable thresholds.

Default Thresholds

MetricDegradedPartial OutageMajor Outage
Error rate>1%>10%>50%
Response time>1000ms>3000ms>10000ms
CPU usage>70%>85%>95%
Memory usage>70%>85%>95%

Pushing Metrics

curl -X POST "https://kodostatus.com/api/v1/metrics/ingest" \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "your_api_key",
    "service": "API Gateway",
    "metrics": {
      "error_rate": 2.5,
      "response_time_ms": 245,
      "cpu_percent": 65,
      "memory_percent": 78
    }
  }'
The API key is passed in the body, not as a header. This allows easier integration from environments where headers are difficult to set.

Available Metrics

MetricTypeDescription
error_ratenumberError percentage (0-100)
response_time_msnumberAverage response time
cpu_percentnumberCPU usage (0-100)
memory_percentnumberMemory usage (0-100)
request_countnumberRequests in this period
error_countnumberErrors in this period

Integration Examples

// Push metrics every minute
setInterval(async () => {
  await fetch('https://kodostatus.com/api/v1/metrics/ingest', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      api_key: process.env.KODO_API_KEY,
      service: 'API Gateway',
      metrics: {
        error_rate: calculateErrorRate(),
        response_time_ms: getAvgResponseTime(),
        request_count: getRequestCount()
      }
    })
  });
}, 60000);

Response

{
  "success": true,
  "received_at": "2024-01-15T10:30:00Z",
  "health_status": "operational",
  "alerts": []
}
If thresholds are exceeded:
{
  "success": true,
  "received_at": "2024-01-15T10:30:00Z",
  "health_status": "degraded",
  "alerts": [
    {
      "metric": "error_rate",
      "value": 12.5,
      "threshold": 10,
      "severity": "partial_outage"
    }
  ]
}

Custom Thresholds

Configure custom thresholds per service in the dashboard under Services > [Service] > Metrics.