Configure the Drone data source
This document explains how to configure the Drone data source in Grafana.
Before you begin
Before you configure the data source, ensure you have:
- Drone data source plugin installed: For installation instructions, refer to Install the Drone data source.
- Grafana permissions: Organization administrator role.
- A Drone API token: Find your token on the
<YOUR_DRONE_URL>/accountpage of your Drone instance. - Network access: Outbound connectivity from Grafana to your Drone instance over HTTPS.
Add the data source
To add the Drone data source:
- Click Connections in the left-side menu.
- Click Add new connection.
- Type
Dronein the search bar. - Select Drone.
- Click Add new data source.
Configure the connection
The data source connects to your Drone instance’s API. Enter the base URL of your Drone server in the URL field.
Server URL
Include the protocol, such as https://, and don’t add a trailing slash. The following examples show correct and incorrect URLs:
Authentication
The Drone data source uses API token authentication.
The token is stored securely and isn’t shown after you save the data source.
Verify the connection
Click Save & test to verify the connection. Grafana runs a health check that requests the list of repositories from your Drone instance. When the connection succeeds, Grafana displays a success message.
If the test fails, refer to Troubleshoot the Drone data source for solutions to common connection and authentication errors.
Provision the data source
You can define the data source in YAML files as part of the Grafana provisioning system. For more information, refer to Provision Grafana.
apiVersion: 1
datasources:
- name: Drone
type: grafana-drone-datasource
jsonData:
variables:
url: <YOUR_DRONE_URL>
secureJsonData:
drone.token: <YOUR_API_TOKEN>Replace <YOUR_DRONE_URL> with the URL of your Drone instance and <YOUR_API_TOKEN> with your Drone API token.
Provision with Terraform
You can provision the data source using the Grafana Terraform provider.
resource "grafana_data_source" "drone" {
type = "grafana-drone-datasource"
name = "Drone"
json_data_encoded = jsonencode({
variables = {
url = "<YOUR_DRONE_URL>"
}
})
secure_json_data_encoded = jsonencode({
"drone.token" = var.drone_token
})
}For more information, refer to the Grafana Terraform provider documentation.


