mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-11-18 11:53:33 +01:00
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>