Adds `langgraph deploy metrics` with compact, agent-friendly JSON grouped by section, chart, and series. Existing time-range and metric filters are preserved; host-backend and its UI response schema are unchanged. - Default: real `project_metric`, inferred units, three-decimal values, latest/min/max/avg, and `[ISO timestamp, value]` points; empty sections are explicit. - `--summary`: same shape without points. `--raw`: original host-backend schema without reshaping or rounding. Mutually exclusive. - Bounds always report the requested window: end defaults to now (UTC), and start defaults to 15 minutes before the resolved end. With only `--end-time`, start is 15 minutes before that value; with only `--start-time`, end is now. The CLI sends both bounds explicitly and reports identical values in the output. `step_seconds` is the most common within-series timestamp gap (smallest on ties), uses an integer for whole seconds, and is null only when no series has two timestamps. Statistics ignore missing/non-finite values; latest means latest non-missing sample. Size comparison (realistic synthetic unit-test fixture, identical compact JSON serialization; not a live deployment benchmark): | Before: raw UI schema | After: default | After: summary | | --- | --- | --- | | 4,302 bytes | 1,226 bytes (72% smaller) | 806 bytes (81% smaller) | Known gotcha (pre-existing, unchanged here): pass `--host-url` after the subcommand. A group-level `langgraph deploy --host-url ... metrics <id>` silently ignores that option and can hit prod instead, producing a confusing 403. ```bash langgraph deploy metrics --host-url https://dev.api.host.langchain.com <id> ``` Follow-up: https://github.com/langchain-ai/langgraph/pull/9562 adds compute and Postgres tier scaling, stacked on this branch. Retarget it to `main` after this PR merges. ## References - [Slack thread](https://langchain.slack.com/archives/C0BHM1C5R5L/p1793216413707489) Made by [Open SWE](https://github.com/langchain-ai/open-swe) · [view thread](https://openswe.langchain.dev/agents/5c8cafeb-c089-587f-aa85-af220f2f13f6) · openai:gpt-6.1-sol (medium) --------- Co-authored-by: Hari Dhanushkodi <hari-dhanushkodi@users.noreply.github.com> Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
215 lines
7 KiB
JSON
215 lines
7 KiB
JSON
{
|
|
"id": "019a0000-0000-7000-8000-000000000001-metrics",
|
|
"title": "Metrics for deployment",
|
|
"charts": [],
|
|
"sub_sections": [
|
|
{
|
|
"id": "019a0000-0000-7000-8000-000000000001-queue",
|
|
"title": "Queue",
|
|
"description": "Queue metrics",
|
|
"index": 0,
|
|
"charts": [
|
|
{
|
|
"id": "019a0000-0000-7000-8000-000000000001-Memory Usage %",
|
|
"title": "Memory Usage %",
|
|
"description": "Resource usage over time",
|
|
"index": 0,
|
|
"chart_type": "line",
|
|
"series": [
|
|
{
|
|
"id": "019a0000-0000-7000-8000-000000000001-Avg Memory Usage %",
|
|
"name": "Avg Memory Usage %",
|
|
"metric": "run_count",
|
|
"project_metric": "memory_usage",
|
|
"metadata": null,
|
|
"filters": null,
|
|
"feedback_key": null,
|
|
"workspace_id": null,
|
|
"metric_definition": null,
|
|
"group_by_definitions": null,
|
|
"filter_definition": null,
|
|
"group_by": null
|
|
},
|
|
{
|
|
"id": "019a0000-0000-7000-8000-000000000001-Max Memory Usage %",
|
|
"name": "Max Memory Usage %",
|
|
"metric": "run_count",
|
|
"project_metric": "memory_usage",
|
|
"metadata": null,
|
|
"filters": null,
|
|
"feedback_key": null,
|
|
"workspace_id": null,
|
|
"metric_definition": null,
|
|
"group_by_definitions": null,
|
|
"filter_definition": null,
|
|
"group_by": null
|
|
}
|
|
],
|
|
"data": [
|
|
{
|
|
"series_id": "019a0000-0000-7000-8000-000000000001-Max Memory Usage %",
|
|
"timestamp": "2026-10-28T00:02:00+00:00",
|
|
"value": 50.33333,
|
|
"group": null
|
|
},
|
|
{
|
|
"series_id": "019a0000-0000-7000-8000-000000000001-Max Memory Usage %",
|
|
"timestamp": "2026-10-28T00:01:00+00:00",
|
|
"value": 40.22222,
|
|
"group": null
|
|
},
|
|
{
|
|
"series_id": "019a0000-0000-7000-8000-000000000001-Max Memory Usage %",
|
|
"timestamp": "2026-10-28T00:00:00+00:00",
|
|
"value": 30.11111,
|
|
"group": null
|
|
},
|
|
{
|
|
"series_id": "019a0000-0000-7000-8000-000000000001-Avg Memory Usage %",
|
|
"timestamp": "2026-10-28T00:02:00+00:00",
|
|
"value": null,
|
|
"group": null
|
|
},
|
|
{
|
|
"series_id": "019a0000-0000-7000-8000-000000000001-Avg Memory Usage %",
|
|
"timestamp": "2026-10-28T00:01:00+00:00",
|
|
"value": 20.23456,
|
|
"group": null
|
|
},
|
|
{
|
|
"series_id": "019a0000-0000-7000-8000-000000000001-Avg Memory Usage %",
|
|
"timestamp": "2026-10-28T00:00:00+00:00",
|
|
"value": 10.12345,
|
|
"group": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "019a0000-0000-7000-8000-000000000001-Restarts",
|
|
"title": "Restarts",
|
|
"description": "Resource usage over time",
|
|
"index": 0,
|
|
"chart_type": "line",
|
|
"series": [
|
|
{
|
|
"id": "019a0000-0000-7000-8000-000000000001-Restarts",
|
|
"name": "Restarts",
|
|
"metric": "run_count",
|
|
"project_metric": "restart_count",
|
|
"metadata": null,
|
|
"filters": null,
|
|
"feedback_key": null,
|
|
"workspace_id": null,
|
|
"metric_definition": null,
|
|
"group_by_definitions": null,
|
|
"filter_definition": null,
|
|
"group_by": null
|
|
}
|
|
],
|
|
"data": [
|
|
{
|
|
"series_id": "019a0000-0000-7000-8000-000000000001-Restarts",
|
|
"timestamp": "2026-10-28T00:02:00+00:00",
|
|
"value": 2,
|
|
"group": null
|
|
},
|
|
{
|
|
"series_id": "019a0000-0000-7000-8000-000000000001-Restarts",
|
|
"timestamp": "2026-10-28T00:01:00+00:00",
|
|
"value": 1,
|
|
"group": null
|
|
},
|
|
{
|
|
"series_id": "019a0000-0000-7000-8000-000000000001-Restarts",
|
|
"timestamp": "2026-10-28T00:00:00+00:00",
|
|
"value": 0,
|
|
"group": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "019a0000-0000-7000-8000-000000000001-Queue wait time",
|
|
"title": "Queue wait time",
|
|
"description": "Resource usage over time",
|
|
"index": 0,
|
|
"chart_type": "line",
|
|
"series": [
|
|
{
|
|
"id": "019a0000-0000-7000-8000-000000000001-Queue wait time",
|
|
"name": "Queue wait time",
|
|
"metric": "run_count",
|
|
"project_metric": "run_queue_wait_time",
|
|
"metadata": null,
|
|
"filters": null,
|
|
"feedback_key": null,
|
|
"workspace_id": null,
|
|
"metric_definition": null,
|
|
"group_by_definitions": null,
|
|
"filter_definition": null,
|
|
"group_by": null
|
|
}
|
|
],
|
|
"data": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "019a0000-0000-7000-8000-000000000001-api",
|
|
"title": "API",
|
|
"description": "API metrics",
|
|
"index": 1,
|
|
"charts": [
|
|
{
|
|
"id": "019a0000-0000-7000-8000-000000000001-Latency",
|
|
"title": "Latency",
|
|
"description": "Resource usage over time",
|
|
"index": 0,
|
|
"chart_type": "line",
|
|
"series": [
|
|
{
|
|
"id": "019a0000-0000-7000-8000-000000000001-P95 Latency",
|
|
"name": "P95 Latency",
|
|
"metric": "run_count",
|
|
"project_metric": "p95_latency",
|
|
"metadata": null,
|
|
"filters": null,
|
|
"feedback_key": null,
|
|
"workspace_id": null,
|
|
"metric_definition": null,
|
|
"group_by_definitions": null,
|
|
"filter_definition": null,
|
|
"group_by": null
|
|
}
|
|
],
|
|
"data": [
|
|
{
|
|
"series_id": "019a0000-0000-7000-8000-000000000001-P95 Latency",
|
|
"timestamp": "2026-10-28T00:02:00+00:00",
|
|
"value": 0.34567,
|
|
"group": null
|
|
},
|
|
{
|
|
"series_id": "019a0000-0000-7000-8000-000000000001-P95 Latency",
|
|
"timestamp": "2026-10-28T00:01:00+00:00",
|
|
"value": 0.23456,
|
|
"group": null
|
|
},
|
|
{
|
|
"series_id": "019a0000-0000-7000-8000-000000000001-P95 Latency",
|
|
"timestamp": "2026-10-28T00:00:00+00:00",
|
|
"value": 0.12345,
|
|
"group": null
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "019a0000-0000-7000-8000-000000000001-pg",
|
|
"title": "Postgres",
|
|
"description": "Postgres metrics",
|
|
"index": 2,
|
|
"charts": []
|
|
}
|
|
]
|
|
}
|