Overview
The Metrics API supports querying across different views (traces, observations, scores) and allows you to:- Select specific dimensions to group your data
- Apply multiple metrics with different aggregation methods
- Filter data based on metadata, timestamps, and other properties
- Analyze data across time with customizable granularity
- Order results according to your needs
Query Parameters
The API accepts a JSON query object passed as a URL-encoded parameter:Query Object Structure
Dimension Object Structure
Metric Object Structure
count- Count of recordslatency- Duration/latency metrics
sum- Sum of valuesavg- Average of valuescount- Count of recordsmax- Maximum valuemin- Minimum valuep50- 50th percentilep75- 75th percentilep90- 90th percentilep95- 95th percentilep99- 99th percentile
Filter Object Structure
Time Dimension Object
hour, day, week, month, and auto.
Example
Hereβs an example of querying the number of traces grouped by name:API
Python SDK
Install packageData Model
The Metrics API provides access to several data views, each with its own set of dimensions and metrics you can query. This section outlines the available options for each view.Available Views
Trace Dimensions
Trace Metrics
Observation Dimensions
Observation Metrics
Score Dimensions (Common)
Score Metrics
Numeric Scores
Categorical Scores
Categorical scores have an additional dimension: