Metrics & Analytics
AlertifyPro records every check result as a time-series of status and response_time_ms values. Use these endpoints to power dashboards, SLA reports, and trend analysis.
Service metrics​
GET /api/v1/services/{id}/metrics
Authorization: Bearer <token>
Query parameters:
| Parameter | Format | Default | Description |
|---|---|---|---|
from | RFC3339 | Last 24 hours | Start of time range |
to | RFC3339 | Now | End of time range |
# Last 24 hours (default)
curl "http://localhost:3001/api/v1/services/svc-uuid/metrics" \
-H "Authorization: Bearer $WK_TOKEN"
# Custom range
curl "http://localhost:3001/api/v1/services/svc-uuid/metrics?from=2026-03-01T00:00:00Z&to=2026-03-02T00:00:00Z" \
-H "Authorization: Bearer $WK_TOKEN"
Returns a time-series array of check metrics including status, response_time_ms, and status_code.
Service uptime​
GET /api/v1/services/{id}/uptime
Query parameters:
| Parameter | Format | Default | Description |
|---|---|---|---|
from | RFC3339 | 30 days ago | Start of period |
to | RFC3339 | Now | End of period |
# Default last 30 days
curl "http://localhost:3001/api/v1/services/svc-uuid/uptime" \
-H "Authorization: Bearer $WK_TOKEN"
Response when uptime data is available:
{
"service_id": "uuid",
"period_start": "2026-02-01T00:00:00Z",
"period_end": "2026-03-02T00:00:00Z",
"uptime_percentage": 99.82,
"total_checks": 43200,
"failed_checks": 78
}
Response when no historical data has been computed yet:
{
"service_id": "uuid",
"status": "GREEN",
"note": "no historical uptime report computed yet"
}
Service check log​
GET /api/v1/services/{id}/checks
Query parameters:
| Parameter | Format | Default | Description |
|---|---|---|---|
since | RFC3339 | Last 1 hour | Only return checks after this time |
# Last 1 hour (default)
curl "http://localhost:3001/api/v1/services/svc-uuid/checks" \
-H "Authorization: Bearer $WK_TOKEN"
# Custom window
curl "http://localhost:3001/api/v1/services/svc-uuid/checks?since=2026-03-01T00:00:00Z" \
-H "Authorization: Bearer $WK_TOKEN"
Each result includes status (GREEN/YELLOW/RED), response_time_ms, optional status_code, and checked_at timestamp.
Custom metric ingestion​
You can push your own numeric metrics into AlertifyPro:
POST /api/v1/metrics/custom
Authorization: Bearer <token>
Content-Type: application/json
{
"metric_definition_id": "<uuid>",
"value": 127.5,
"labels": { "region": "us-east-1" },
"source": "my-app"
}
| Field | Type | Required | Description |
|---|---|---|---|
metric_definition_id | UUID | ✅ | Pre-configured metric definition |
value | float | ✅ | Numeric metric value |
labels | object | No | Key-value labels |
source | string | No | Source system identifier |