Overview
MetoroQL has a PromQL-like syntax but provides unified access to different types of data:- Metrics (both standard and custom)
- Logs
- Traces
- Kubernetes resources
Key Differences from PromQL
MetoroQL is generally a subset of promql with a few notable difference:- Counters return the delta of consecutive values by default
- Queries can be over resource types other than metrics
- Timeseries queries must have an aggregate applied to them
Counter Handling
In PromQL, counter metrics require explicit functions likerate()
or increase()
to calculate the rate of change. In MetoroQL, counter values are automatically presented as the difference between consecutive data points. This means:
- Values represent changes between points rather than cumulative values
- You should not apply
rate()
orincrease()
functions to chart changes
http_requests_total
would show monotonically increasing cumulative values that generally aren’t immediately useful without applying rate()
or increase()
.
Multi-domain Queries
One of the most powerful features of MetoroQL is the ability to query across different observability domains using special metric names:logs
- Log datatraces
- Distributed tracing datakubernetes_resources
- Kubernetes resources information- Any other metric identifier is treated as a regular metric
Forced aggregations
In mQL all timeseries queries require an explicit aggregation function such as:sum
avg
min
max
count
histogram_quantile
Basic Query Syntax
A simple MetoroQL timeseries query has the following structure:Special Data Types
In addition to metrics, you can write mQL queries over logs, traces and kubernetes_resources. Each of these resources have their own rules on how they can be queried.Log Queries
- Log queries just support only the count aggregate.
- They support all filtering and group by operation.
- Structured json logs attributes are parsed into filterable fields.
Trace Queries
- Trace queries support both the
count
aggregation and thetrace_duration_quantile
. - They support all filtering and group by operation.
- All custom attributes are queryable for filtering and group bys
Kubernetes Resources Queries
- Trace queries support both the
count
aggregation and all other aggerations after thejson_path
function is applied. - They support all filtering and group by operation.
json_path
, you can:
- Extract and analyze specific fields from Kubernetes resources
- Use
sum
,avg
,min
, ormax
aggregations with the extracted values
Advanced Features
Filtering
MetoroQL supports several filtering operators:Binary Operations
You can create complex queries using arithmetic operations. Supported operations are:+
addition-
subtraction*
multiplication/
division%
modulo^
exponentiation==
equal!=
not equal<=
less than or equal>=
greater than or equal