- Click the Query tab.
- Click Editor in the top left.
- Write your query in the editor.
- Click Run.
- APL is a data processing language that supports filtering, extending, and summarizing data. For more information, see Introduction to APL.
- MPL is a metric-focused query language that combines the simplicity of APL with the expressive power of PromQL. It enables effective querying, transformation, and aggregation of metric data, supporting diverse observability use cases. For more information, see Introduction to MPL.
Generate query using natural language
Instead of writing the query yourself, you can use Axiom AI to generate a query for you. Explain what you want to infer from your data in your own words and Axiom AI generates the valid APL query.Query using natural language isn’t currently supported for metrics datasets.
- Click the Query tab.
- Click APL, and then click in the query editor.
- Press Cmd/Ctrl K.
- Type what you want to infer from your data in your own words using natural language, and then click Generate. For example, type
Show me the most common status responses in HTTP logs. - Axiom’s AI generates the APL query based on your prompt and gives you the following options:
- Click Accept to update the editor with the generated query and change the generated query before running it. Any previous input in the query editor is lost.
- Click Accept and run to update the editor with the generated query and run it immediately. Any previous input in the query editor is lost.
- Click Reject to go back to your previous input in the query editor and close the query generator.
Iterate over prompt history
Axiom saves the prompts you type in the query generator. To find one of your previous prompts and generate an APL query for it:- Click the Query tab.
- Click APL, and then click in the query editor.
- Press Cmd/Ctrl K.
- Cycle through your history using the arrow keys and to find the prompt.
- Click Generate.
APL examples
Some APL queries are explained below. The pipe symbol| separates the operations as they flow from left to right, and top to bottom.
APL is case-sensitive for everything: dataset names, field names, operators, functions, etc.
Use double forward slashes (//) for comments.
count operator
The below query returns the number of events from the sample-http-logs dataset.
limit operator
The limit operator returns a random subset of rows from a dataset up to the specified number of rows. This query returns a thousand rows from sample-http-logs randomly chosen by APL.
summarize operator
The summarize operator produces a table that aggregates the content of the dataset. This query returns a chart of the avg(req_duration_ms), and a table of geo.city and avg(req_duration_ms) of the sample-http-logs dataset from the time range of 2 days and time interval of 4 hours.
MPL examples
align operator
The align operator aggregates metric values over time windows. This query returns the average value of the go.memory.used metric from the otel-demo-metrics dataset, grouped into 5-minute intervals.
where operator
The where operator restricts results to series whose tag values match the specified conditions. This query returns the average value of the go.memory.used metric from the otel-demo-metrics dataset for the checkout deployment, aligned over 5-minute windows.
group operator
The group operator combines multiple series by tag values into a single aggregated series. This query returns the sum of go.memory.used per deployment, aligned to 5-minute windows, showing memory usage broken down by k8s.deployment.name.