Menu

Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.

Documentation Azure Devops data source for Grafana
Enterprise

Azure DevOps data source for Grafana

The Azure DevOps data source plugin allows you to query and visualize Azure DevOps data from within Grafana.

Before you begin

  • Ensure you have an Azure devops account and a personal access token.
  • Ensure you have one of the following account types:
    • Grafana Cloud: Pro customers, Advanced customers, or Pro trial users with the Enterprise plugin add-on enabled
    • Grafana Enterprise: Customers with an activated license and a user with Grafana server or organization administration permissions
  • Ensure the Enterprise plugin add-on is enabled.

Known limitations

  • Template variables cannot be multi-select; only single selection is supported.
  • Only the following feature set is provided as part of the plugin

Features covered

ServiceAPIReference Docs
CoreProjects - ListAPI
GitRepositories - ListAPI
Pull Requests - ListAPI
BuildBuilds - ListAPI
Definitions - ListAPI
PipelinesPipelines - ListAPI
Runs - ListAPI
ReleaseDefinitions - ListAPI
Deployments - ListAPI
Releases - ListAPI

Install the Azure DevOps data source plugin

To install the data source, refer to Installation.

Get a personal access token from Azure DevOps

To get a personal access token, refer to Azure DevOps docs - Personal access token section.

Set the necessary read permissions for your API token. This includes workItems.read, code.read, code.status, build.read, release.read, test.read and packaging.read. You can skip specific permissions if you are not using that specific feature.

Configure the data source in Grafana

Add a data source by filling in the following fields:

FieldDescription
URLURL of your Azure DevOps instance. Example: https://dev.azure.com/xxxxxx
PAT TokenAzure DevOps personal access token. Refer the previous section to know how to generate one.
Projects LimitNumber of projects to retrieve. Defaults to 100. Useful when having more than 100 projects in the org

Configure the data source with provisioning

You can configure data sources using config files with Grafana’s provisioning system. To read more about how configuration works, including the full list of settings for data sources, refer to Provisioning Grafana.

yaml
apiVersion: 1
datasources:
  - name: Azure Devops
    type: grafana-azuredevops-datasource
    version: 1
    orgId: 1
    uid: azure_devops_001
    basicAuth: false
    editable: false
    isDefault: false
    jsonData:
      url: https://dev.azure.com/xxxxxxxx
      projectsLimit: 100
    secureJsonData:
      patToken: xxxxxxxxxxxxxxxxxxxxxxxxx

Query the data source

The query editor allows you to query different set of data from Azure DevOps. Based on the query type selected in the query editor, you can retrieve data from different APIs.

Projects

  • View a list of all projects in the organization that the data source has access to.
  • The underlying API is Projects - List.

Repositories

  • Retrieve a list of git repositories in the organization that the data source has access to.
  • (Optional) You can specify the project ID to filter the repositories for the project specified.
  • The underlying API is Repositories - List.

Pull Requests

  • Retrieve a list of pull requests for the specified project.
  • (Optional) You can specify the repository ID to filter the pull requests specific to the repository.
  • The underlying API is Get Pull Requests By Project

Builds

  • View a list of builds for the specified project.
  • Project ID is a mandatory field.
  • Query response is scoped to dashboard’s time range. maxTime and minTime parameters are passed to the API automatically based on dashboard time range.
  • The underlying API is Builds - List

Build definitions

  • View a list of build definitions for the specified project.
  • Project ID is a mandatory field.
  • The underlying API is Build Definitions - List.

Pipelines

  • View a list of pipelines for the specified project.
  • Project ID is a mandatory field
  • Underlying API is Pipelines - List

Pipeline runs

  • Gets top 10000 runs for the pipeline specified
  • Project ID and Pipeline ID are mandatory fields
  • Underlying API is Pipeline Runs - List

Releases

  • Gets a list of releases for the project specified
  • Project ID is a mandatory field
  • Query response will be scoped to dashboard’s time range. maxCreatedTime and minCreatedTime parameters are passed to the API automatically based on dashboard time range
  • Underlying API is Releases - List

Release definitions

  • Gets a list of release definitions for the project specified
  • Project ID is a mandatory field
  • Underlying API is Release Definitions - List

Release deployments

  • Gets a list of release deployments for the project specified
  • Project ID is a mandatory field
  • Underlying API is Release deployments - List

Templates and variables

To add a new Azure DevOps query variable, refer to Add a query variable. Use your Azure devops data source as your data source for the following available queries:

Query TypeDescription
ProjectsReturns the list of project IDs. Project ID will be a value. The project name is used as the display value
RepositoriesReturns the list of repository IDs. Repository ID will be the value. The repository name is used as the display value. Optionally, you can specify the project to filter the repositories to only for the specific project

Note: You can’t apply regex in variable editor by the project/repo name. Also multi variable is not supported in the plugin

Get the most out of the plugin