| name | time-series-dashboard |
| description | Manage dashboards, metrics, alert rules, and query time-series data in the time-series-dashboard application. Use this skill for all operations against the running server. |
| tools | ["Bash","Read","Write","Edit"] |
time-series-dashboard skill
This skill covers all HTTP API operations for the time-series-dashboard application.
Authentication flow
All admin routes require a session cookie obtained from login. Ingest routes require a Bearer API key.
CSRF=$(curl -s http://localhost:3000/api/csrf | jq -r '.token')
curl -c /tmp/tsd_cookies.txt -X POST http://localhost:3000/api/auth/login \
-H "Content-Type: application/json" \
-H "X-CSRF-Token: $CSRF" \
-d '{"password": "your-admin-password"}'
API keys
curl -b /tmp/tsd_cookies.txt http://localhost:3000/api/keys
CSRF=$(curl -b /tmp/tsd_cookies.txt -s http://localhost:3000/api/csrf | jq -r '.token')
curl -b /tmp/tsd_cookies.txt -X POST http://localhost:3000/api/keys \
-H "Content-Type: application/json" \
-H "X-CSRF-Token: $CSRF" \
-d '{"name": "production-server"}'
curl -b /tmp/tsd_cookies.txt -X DELETE http://localhost:3000/api/keys/key_abc123 \
-H "X-CSRF-Token: $CSRF"
Metrics CRUD
curl -b /tmp/tsd_cookies.txt http://localhost:3000/api/metrics
curl -b /tmp/tsd_cookies.txt -X POST http://localhost:3000/api/metrics \
-H "Content-Type: application/json" \
-H "X-CSRF-Token: $CSRF" \
-d '{
"name": "cpu_usage",
"slug": "cpu_usage",
"type": "gauge",
"unit": "%",
"color": "#0891b2",
"description": "CPU utilization percentage"
}'
curl -b /tmp/tsd_cookies.txt -X PATCH http://localhost:3000/api/metrics/cpu_usage \
-H "Content-Type: application/json" \
-H "X-CSRF-Token: $CSRF" \
-d '{"description": "Updated description"}'
curl -b /tmp/tsd_cookies.txt -X DELETE http://localhost:3000/api/metrics/cpu_usage \
-H "X-CSRF-Token: $CSRF"
Dashboards CRUD
curl -b /tmp/tsd_cookies.txt http://localhost:3000/api/dashboards
curl -b /tmp/tsd_cookies.txt -X POST http://localhost:3000/api/dashboards \
-H "Content-Type: application/json" \
-H "X-CSRF-Token: $CSRF" \
-d '{"name": "Production Overview", "defaultRange": "1h"}'
curl -b /tmp/tsd_cookies.txt http://localhost:3000/api/dashboards/dash_abc123
curl -b /tmp/tsd_cookies.txt -X POST http://localhost:3000/api/dashboards/dash_abc123/panels \
-H "Content-Type: application/json" \
-H "X-CSRF-Token: $CSRF" \
-d '{
"title": "CPU Usage",
"metricId": "cpu_usage",
"chartType": "stat",
"width": "half"
}'
curl -b /tmp/tsd_cookies.txt -X DELETE http://localhost:3000/api/dashboards/dash_abc123 \
-H "X-CSRF-Token: $CSRF"
Alert rules
curl -b /tmp/tsd_cookies.txt http://localhost:3000/api/alerts
curl -b /tmp/tsd_cookies.txt -X POST http://localhost:3000/api/alerts \
-H "Content-Type: application/json" \
-H "X-CSRF-Token: $CSRF" \
-d '{
"name": "High Error Rate",
"metricId": "error_rate",
"condition": "gt",
"threshold": 1.5,
"enabled": 1
}'
curl -b /tmp/tsd_cookies.txt -X PATCH http://localhost:3000/api/alerts/rule_xyz \
-H "Content-Type: application/json" \
-H "X-CSRF-Token: $CSRF" \
-d '{"enabled": 0}'
curl -b /tmp/tsd_cookies.txt http://localhost:3000/api/alerts/events
curl -b /tmp/tsd_cookies.txt http://localhost:3000/api/alerts/rule_xyz/events
Querying time-series data
curl -b /tmp/tsd_cookies.txt \
"http://localhost:3000/api/metrics/cpu_usage/data?from=-1h"
curl -b /tmp/tsd_cookies.txt \
"http://localhost:3000/api/metrics/cpu_usage/data?from=-24h&aggregation=avg&bucket=5m"
curl -b /tmp/tsd_cookies.txt \
"http://localhost:3000/api/metrics/cpu_usage/data?from=-7d&aggregation=max&bucket=1h&limit=168"
curl -b /tmp/tsd_cookies.txt \
"http://localhost:3000/api/query?metrics=cpu_usage,request_rate&from=-1h&aggregation=avg&bucket=5m"
Export
curl -b /tmp/tsd_cookies.txt \
"http://localhost:3000/api/export?metricId=cpu_usage&from=-7d&format=csv" \
-o cpu_usage_export.csv
curl -b /tmp/tsd_cookies.txt \
"http://localhost:3000/api/export?metricId=cpu_usage&from=-24h&format=json" \
-o cpu_usage_export.json
curl -b /tmp/tsd_cookies.txt \
"http://localhost:3000/api/export?from=-30d&format=json" \
-o all_metrics_export.json
Settings
curl -b /tmp/tsd_cookies.txt -X POST http://localhost:3000/api/settings/password \
-H "Content-Type: application/json" \
-H "X-CSRF-Token: $CSRF" \
-d '{"currentPassword": "old-password", "newPassword": "new-password"}'
curl -b /tmp/tsd_cookies.txt -X PATCH http://localhost:3000/api/settings \
-H "Content-Type: application/json" \
-H "X-CSRF-Token: $CSRF" \
-d '{"retentionDays": 60}'
curl -b /tmp/tsd_cookies.txt -X POST http://localhost:3000/api/auth/logout \
-H "X-CSRF-Token: $CSRF"
Health check
curl http://localhost:3000/api/health