Drone query editor
This document explains how to use the Drone query editor to build queries against your Drone repositories and builds.
Before you begin
- Ensure you’ve configured the Drone data source.
- Verify your Drone API token has access to the repositories you want to query.
Query actions
Select the query type with the Action selector. The query editor supports the following actions:
Repo List: Returns the active repositories registered to Drone.Repo Info: Returns the details of a single repository.Build List: Returns the recent builds for a repository.Build Info: Returns the details of a single build.
The repository drop-downs include only repositories that are active in Drone. Inactive repositories are filtered out.
Get the repository list
The Repo List action returns the active repositories registered to Drone. It takes no parameters.
To create a Repo List query:
- Select the Drone data source.
- Select
Repo Listfrom the Action selector.
Get repository details
The Repo Info action returns the details of a single repository.
To create a Repo Info query:
- Select the Drone data source.
- Select
Repo Infofrom the Action selector. - Select a repository.
Get the build list
The Build List action returns the recent builds for a repository.
To create a Build List query:
- Select the Drone data source.
- Select
Build Listfrom the Action selector. - Select a repository.
Note
The
Build Listaction returns at most the 100 most recent builds, not all builds for the repository.
Get a specific build
The Build Info action returns the details of a single build.
To create a Build Info query:
- Select the Drone data source.
- Select
Build Infofrom the Action selector. - Select a repository.
- Select or enter a build number.
Note
The Build number drop-down contains at most 100 recent builds, but you can type in a build number that isn’t in the list, and the plugin returns data for that build.
Data reference
Repository and build queries return the fields provided by the Drone API. The following tables describe the most useful fields for building panels, transformations, and template variables. The plugin converts timestamp fields from epoch seconds to Grafana time values.
Repository fields
The Repo List and Repo Info actions return these fields:
Build fields
The Build List and Build Info actions return these fields, among others:
Note
The exact set of build fields depends on your Drone version and the event that triggered the build. To compute build duration, subtract
startedfromfinishedwith a transformation.
Query examples
The following examples show common query configurations and the panels that best suit them.
Example: Audit active repositories
To list every repository registered to Drone:
- Select the Drone data source.
- Select
Repo Listfrom the Action selector.
This query returns one row per active repository, including its name, slug, and created, updated, and synced timestamps. Use a Table panel to review which repositories are registered and when they were last synced.
Example: Track recent build activity for a repository
To review the most recent builds for a repository:
- Select the Drone data source.
- Select
Build Listfrom the Action selector. - Select a repository.
This query returns up to the 100 most recent builds with their status and started, finished, created, and updated timestamps. Use a Table panel to browse the builds, and sort by started to see the latest activity first.
Example: Visualize build status distribution
To see how many builds succeed compared to those that fail:
- Create a
Build Listquery for a repository, as shown in the previous example. - Add a
Group by transformation on the
statusfield and calculate a count. - Visualize the result in a Pie chart or Bar chart panel.
Example: Calculate build duration
To measure how long builds take:
- Create a
Build Listquery for a repository. - Add an
Add field from calculation transformation that subtracts
startedfromfinished. - Visualize the result in a Time series or Table panel.
Example: Inspect a single build
To drill into the details of one build:
- Select the Drone data source.
- Select
Build Infofrom the Action selector. - Select a repository.
- Select or enter a build number.
This query returns the full details for a single build, which is useful for a focused Stat or Table panel, or as a target when you drill down from a Build List panel.
Use cases
The following scenarios show how to combine these queries into useful dashboards. Because the data source doesn’t support alerting, use dashboard panels to monitor CI activity visually.
Monitor repository CI health
Build a dashboard that surfaces the state of a repository’s pipeline:
- Recent builds panel: Use
Build Listin a Table panel to show the latest builds and their status. - Success rate panel: Use
Build Listwith a Group by transformation onstatusto show the success-to-failure ratio in a Pie chart. - Build duration panel: Use
Build Listwith a calculatedfinishedminusstartedfield to track how build times trend.
Correlate builds with other signals
Use annotations to overlay Drone build events on panels from other data sources. This helps you correlate deployments and CI activity with changes in application metrics, such as error rates or latency.
Known limitations
- The
Build Listaction returns at most the 100 latest builds, not all builds. - The data source doesn’t support alerting.


