Build Queries
Each panel in a dashboard is powered by one or more queries against a data source. The query language depends on the signal type you are querying.
| Signal | Query language | Example use |
|---|---|---|
| Metrics | PromQL | CPU usage, request rate, error rate |
| Logs | LogQL | Filter and aggregate log lines |
| Traces | TraceQL | Search spans by duration, status, or attribute |
Write a query in the panel editor
Step 1 — Open a panel in edit mode (hover the panel and press E, or select Edit from the panel menu).
Step 2 — In the Query tab at the bottom of the editor, select your data source from the drop-down.
Step 3 — Write your query in the query field. OpsPilot provides syntax hints and auto-complete for supported query languages.
Step 4 — Click Refresh (or the refresh icon) to run the query and preview results in the panel above.
Step 5 — Click Apply to save the query to the panel, or Save to persist the entire dashboard.
Multiple queries per panel
You can add more than one query to a single panel. Each query returns a separate series or dataset, and all results are rendered together in the visualization.
Click + Add query below the existing query to add another.
Tip
Use query aliases (the Legend field) to give each series a meaningful label in the panel legend.
Switching data sources
The data source can be changed at any time from within the panel editor:
Step 1 — Open the panel in edit mode.
Step 2 — In the Query tab, click the data source drop-down and select a different source.
The query field resets to match the new data source's query language.
Further reading
Need more help?
Contact support in the chat bubble and let us know how we can assist.