Introduction
The Custom Views enables you to define, save, and execute advanced queries over trace data using a SQL-like syntax. With Custom Views, you can explore trace data in a way that fits the needs by selecting specific fields, applying aggregations, defining aliases, and grouping results.
To view the details:
- Navigate to Infrastructure > Traces.
- Click the menu in the left right corner.
- In My Traces Views, select Custom Views.
The following are the key functionalities.
Field Selection
Allows you to choose the fields such as app
, service
, operation
, or tags like url.path
, infra.group
, and so on.
Example:
- Pattern-Based Filtering and Grouping
select service
where app =~ 'defau' AND infra.group =~ 'NO_GR'
groupBy (service)
Returns services where the app name contains "defau" and infra.group matches "NO_GR".
Results are grouped by service.
- Multi-Field Selection and Grouping
select count(service)
where app IN ('default')
Returns the total number of spans that contain a service value for the app "default".
Aggregation
Allows you to summarize your data by applying the functions to selected fields.
Note
Only the aggregation functionscount
, sum
, avg
, min
, and max
are supported.Example:
select count(service)
where app IN ('default')
Returns the total number of spans that contain a service value for the app "default".
Derived Fields
You can calculate aggregates using arithmetic, such as: error rates and throughput.
Example:
select app,
service AS svc,
operation AS op,
count(*) AS spanCount,
avg(durationUs) AS avgLatency,
(sum(error) / count(*)) * 100 AS errorRate
groupBy (app, service, operation)
Shows total spans, average latency, and error rate by app, service, and operation.
Fields are aliased for clarity.
Grouping
Allows you to group results by one or more fields.
Example:
- Pattern-Based Filtering and Grouping
select service
where app =~ 'defau' AND infra.group =~ 'NO_GR'
groupBy (service)
Returns services where the app name contains "defau" and infra.group matches "NO_GR".
Results are grouped by service.
- Multi-Field Selection and Grouping
select count(service)
where app IN ('default')
Returns the total number of spans that contain a service value for the app "default".
Filtering
Use where
to filter your results. You can:
- Match exact values:
= for exact match'
- Match patterns:
=~ for pattern match (similar to LIKE)'
- Filter by multiple values:
IN (...) for multi-value match
- Combine conditions:
starts with: Match fields that start with a given prefix
.
Aliases
Use AS to rename output fields for readability. Aliases are recommended for clarity.
Note
For any function, query result size is limited (default: 100 rows). If the result exceeds the limit, the system displays an error to refining your query.The Custom Views enables you to save the view and reuse it.
To save the view, click SAVE VIEW.