Metrics · getInsights
Insights: metrics and ask stats
GET /v1/metrics
What the app's Insights section shows: every metric with its recent points and threshold alerts (live metrics first, then test ones), and how quickly asks are decided (live asks only).
- Who may call it
- humans: every member
- Server
- https://api.logu.dev
Parameters#
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Logu-Workspace | header | string | optional | Humans only: the workspace to act in (default: your personal workspace). Agents always act in their API key's workspace. · e.g. wsp_01K7D7Y8Z0B2D4F6H8K0M2P4R6 |
Example#
curl -s "https://api.logu.dev/v1/metrics" \
-H "Authorization: Bearer $LOGU_SESSION_TOKEN"
Responses#
200
Metrics and ask stats.
{
"metrics": [
{
"id": "met_01K7DQ4A6C8E0G2J4L6N8Q0S2U",
"project": "shop",
"metric": "orders",
"label": "Orders today",
"unit": "orders",
"value": 42,
"at": "2026-10-12T14:03:11.000Z",
"agent": {
"id": "agt_01K7D8F2H4K6M8P0R2T4V6X8Z0",
"name": "deploy-bot"
},
"test": false,
"points": [
{
"value": 37,
"at": "2026-10-12T13:03:11.000Z"
},
{
"value": 42,
"at": "2026-10-12T14:03:11.000Z"
}
],
"alerts": [
{
"id": "alr_01K7DQ5B7D9F1H3K5M7P9R1T3V",
"condition": "below",
"threshold": 10,
"triggered": false
}
]
}
],
"asks": {
"waiting": 1,
"decided7d": 12,
"timedOut7d": 1,
"medianDecisionSeconds": 151
}
}
Response fields
| Field | Type | Required | Notes |
|---|---|---|---|
metrics | Metric[] | required | |
metrics[].id | string | required | |
metrics[].project | string | required | |
metrics[].metric | string | required | |
metrics[].label | string | null | required | |
metrics[].unit | string | null | required | |
metrics[].value | number | required | |
metrics[].at | string | required | date-time |
metrics[].points | MetricPoint[] | required | |
metrics[].points[].value | number | required | |
metrics[].points[].at | string | required | date-time |
metrics[].alerts | MetricAlert[] | required | |
metrics[].alerts[].id | string | required | |
metrics[].alerts[].condition | "above" | "below" | required | |
metrics[].alerts[].threshold | number | required | |
metrics[].alerts[].triggered | boolean | required | |
metrics[].agent | AgentRef | null | required | |
metrics[].agent.id | string | required | |
metrics[].agent.name | string | required | |
metrics[].test | boolean | required | Reported with a test API key (lg_test_…): kept apart from the live metric of the same name, not kept in the long-term history, and its threshold alerts create test events. |
asks | AskStats | required | |
asks.waiting | integer | required | |
asks.decided7d | integer | required | |
asks.timedOut7d | integer | required | |
asks.medianDecisionSeconds | number | null | required |
Errors#
Every error is {"error":{"code","message","hint","docUrl","requestId"}}: branch on code. See Errors.
| Status | Code | Meaning |
|---|---|---|
| 401 | unauthorized | No credentials, or the API key or session is invalid or revoked. |
| 403 | forbidden | The caller is authenticated but may not do this (wrong role, or an API key on a human-only endpoint). |
| 404 | not_found | No such route, or the resource doesn't exist in your workspace. |
| 500 | internal_error | Something went wrong on Logu's side. |