Skip to content

Commit fa48f1d

Browse files
committed
fix(intake): regenerate API contracts and tighten the metrics endpoint
Addresses review findings on #1374. P1 — the generated contracts were missing the new surface, failing CI's Lint all. Regenerated OpenAPI, the Python SDK via Stainless, the vendored CLI, and the web SDK. The traces resource now exposes `get_metrics`, and `Trace` carries agent_id / agent_name / agent_version. Stainless placed the new endpoint as a top-level `trace_metrics` standalone API with a `reviewme_list` method. Per the resolve-reviewme guidance, a single-method resource folds into its parent, so it lives on the existing intake `traces` resource as `get_metrics`; the path and schemas are untouched. P3 — the metrics endpoint accepted page, page_size and sort through the shared list validator and silently ignored them, implying a paginated response where every bucket in the range is returned. It now validates against its own parameter set, so `?page=999` is a 400 rather than a misleading 200. P3 — the span rollup CTE filtered only on trace_id, so a trace_id shared across ingest formats pulled in unrelated spans before the join discarded them. Restrict by (source_format, trace_id) as the page-refs variant and the join already do. trace_id is kept in the predicate to drive the bloom filter. Verified the figures are unchanged against live ClickHouse. Signed-off-by: mschwab <mschwab@nvidia.com>
1 parent 3930a5d commit fa48f1d

62 files changed

Lines changed: 1736 additions & 198 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/cli/reference.mdx

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6811,7 +6811,7 @@ nemo intake ingest spans create [OPTIONS]
68116811
**Options:**
68126812

68136813
* `--workspace`
6814-
* `--source`: (required)
6814+
* `--source`: Stable name for the source trace store, such as `langsmith` or `mlflow`.
68156815
* `--spans`: JSON string
68166816

68176817
**Help:**
@@ -7103,9 +7103,49 @@ nemo intake traces [OPTIONS] COMMAND [ARGS]...
71037103

71047104
**Commands:**
71057105

7106+
* `get-metrics`: Get Trace Metrics
71067107
* `list`: List Traces
71077108
* `get`: Get Trace
71087109

7110+
##### nemo intake traces get-metrics
7111+
7112+
Get Trace Metrics
7113+
7114+
**Usage:**
7115+
7116+
```shell
7117+
nemo intake traces get-metrics [OPTIONS]
7118+
```
7119+
7120+
**Options:**
7121+
7122+
* `--workspace`
7123+
* `--bucket <CHOICE>`: Time bucket granularity. [possible values: total, day, week, month]
7124+
* `--timezone`: IANA timezone the buckets are aligned to, e.g. America/Los_Angeles.
7125+
7126+
**Filter Options:**
7127+
7128+
* `--filter FILTER_JSON`: Use --filter with JSON for complex/nested queries, or --filter. FIELD options for simple fields. Both can be combined, with field options taking precedence.
7129+
JSON-only fields:
7130+
started_at: \{gte: str, lte: str}
7131+
7132+
Filter the traces the metrics are computed over. Accepts the same fields as the traces list, so agent_id or agent_name scopes the rollup to one agent.
7133+
* `--filter.id`
7134+
* `--filter.agent-id`
7135+
* `--filter.agent-name`
7136+
* `--filter.evaluation-id`
7137+
* `--filter.session-id`
7138+
* `--filter.status`
7139+
* `--filter.test-case-id`
7140+
7141+
**Help:**
7142+
7143+
* `--help, -h`: Show this message and exit.
7144+
7145+
**Output Options:**
7146+
7147+
* `--output-format, --output, -f <CHOICE>`: Output format for an entity. [possible values: json, yaml, raw, code]
7148+
71097149
##### nemo intake traces list
71107150

71117151
List Traces
@@ -7133,6 +7173,8 @@ JSON-only fields:
71337173

71347174
Filter root-span-backed traces by id, session_id, root status, root span started_at, evaluation_id, and test_case_id.
71357175
* `--filter.id`
7176+
* `--filter.agent-id`
7177+
* `--filter.agent-name`
71367178
* `--filter.evaluation-id`
71377179
* `--filter.session-id`
71387180
* `--filter.status`

openapi/ga/individual/platform.openapi.yaml

Lines changed: 171 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)