v4

latestOpenAPI 3.1.02026-08-019681,1012.0 MB
trace

Query Metrics V2

Same as /metrics/search but returns metrics with node-type counts: trace (requests_count), session_count, and span_count in aggregate_metrics and in each bucket, similar to /metrics/custom_search.

post/projects/{project_id}/metrics/search/v2

Path parameters

project_idstring uuid4 required

Request body

log_stream_idstring uuid4 nullable

Log stream id associated with the traces.

experiment_idstring uuid4 nullable

Experiment id associated with the traces.

metrics_testing_idstring uuid4 nullable

Metrics testing id associated with the traces.

start_timestring date-time required

Include traces from this time onward.

end_timestring date-time required

Include traces up to this time.

intervalinteger
group_bystring nullable

Example request

{
  "end_time": "2023-10-01T01:00:00Z",
  "filters": [
    {
      "case_sensitive": true,
      "name": "input",
      "operator": "eq",
      "type": "text",
      "value": "example input"
    }
  ],
  "group_by": "model",
  "interval": 5,
  "log_stream_id": "00000000-0000-0000-0000-000000000000",
  "start_time": "2023-10-01T00:00:00Z"
}

Response

Successful Response

group_by_columnsstring[] required
aggregate_metricsobject required
bucketed_metricsobject required
ems_captured_errorboolean

Whether any EMS error codes were encountered in the queried metrics

standard_errorsobject nullable

Structured EMS errors for each error code encountered, keyed by code