Query data with natural language

Assistant can write, explain, and optimize queries across your observability stack. For every supported data source, the workflow is the same: describe what you want, refine the result, and optionally add the visualization to a dashboard.

Use @ to mention a specific data source in your prompt, for example, @prometheus-ds, so Assistant queries the correct one.

Review supported data sources

Assistant supports natural-language query workflows across your observability stack, including:

SignalExample data sourcesQuery language
MetricsPrometheusPromQL
LogsLokiLogQL
TracesTempoTraceQL

It also supports other sources such as profiles, SQL databases, and cloud provider backends. For the full list, refer to Query data.

Try example prompts

Query metrics

Use metrics prompts when you want Assistant to generate PromQL or refine a metrics query.

Create a PromQL query in @prometheus-ds that shows p95 latency for checkout_service over the last hour.

Group by region and sort by highest error rate.

Query logs

Use logs prompts when you want Assistant to filter, parse, or summarize log data.

Find logs from @loki-logs where job=“checkout” and level=“error” in the last 15 minutes.

Parse the JSON payload and show the top five error codes.

Query traces

Use traces prompts when you want Assistant to find slow traces or summarize trace details.

Query @tempo-traces for traces longer than 2 seconds.

Show the slowest spans and include their service names.

Explain and optimize queries

Use explanation prompts when you already have a query and want to understand or improve it.

Explain what this PromQL query does: rate(http_requests_total{job="api"}[5m])

This query is returning too much data. Help me filter it to only the production namespace.

For more information, refer to Query data.

Script

The Assistant can write, explain, and optimize queries across your observability stack. Describe what you want in natural language and the Assistant generates valid syntax and can visualize the results. It works with metrics, logs, and traces, and with many other supported data sources.

For every data source, the workflow is the same. Describe what you want, refine the result, and optionally add it to a dashboard. Use the at symbol followed by a data source name to target a specific source. For example, at prometheus-ds or at loki-logs. This helps the Assistant query the right data and give more accurate answers.

If you already have a query and want to understand it, paste it in and ask the Assistant to explain it. If a query is slow or returning too much data, describe the problem and ask for help optimizing it.