v1

latestOpenAPI 3.1.02026-07-26231646860.9 KB
trace

Query Custom Metrics

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

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.

interval_minutesinteger

Time interval in minutes for bucketing

group_bystring nullable

Column to group by

Example request

{
  "end_time": "2024-01-07T23:59:59Z",
  "filter_tree": {
    "and_": [
      {
        "filter": {
          "case_sensitive": true,
          "name": "input",
          "operator": "contains",
          "type": "text",
          "value": "customer"
        }
      }
    ]
  },
  "group_by": "model",
  "interval_minutes": 1440,
  "log_stream_id": "c5fef527-51f6-49d0-800a-1859b678a098",
  "metric_details": [
    {
      "aggregation": "Sum",
      "id": "w1",
      "metric_name": "num_total_tokens"
    },
    {
      "aggregation": "Average",
      "id": "w2",
      "metric_name": "toxicity"
    }
  ],
  "start_time": "2024-01-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