DORA metrics prometheus compatible exporter.
https://grafana.com/grafana/dashboards/20889-dora-v2/
DORA exporter is a single binary that doesn't require any dependencies. Though you might want to run it using docker. The default port is 8090, but this can be changed in the configuration.
docker run --rm -e GITHUB_TOKEN=gh_xxxxx -p 8090:8090 dora-exporter
Configuration file location can be specified using command line flag -config.file.
dora-exporter -config.file=config.yml
GitHub token is required to query information about the deployment and commit, so we expect the GITHUB_TOKEN environment variable to contain valid token. See Generate GitHub token for details.
DORA-exporter saves state in the prometheus compatible file format. This allows to preserve the statistics state between reboots.
Location for the storage can be set in the following config.yml section.
storage:
file:
path: /data/prometheus.prom
It is advised to map it to the external volume to preserve state between restarts.
DORA exporter has support for catalog either from enterprise Backstage installation or from static source using Yaml configuration.
Backstage component in order to be available for dora-exporter query should contain github.com/project-slug annotation.
In case an owner can't be determined, default Unknown
team will be used.
Example
---
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: dora-exporter
title: DORA-Metrics
description: DORA Metrics exporter
annotations:
github.com/project-slug: mprokopov/dora-exporter
github.com/team-slug: mprokopov/Infrastructure
Put to the config file the following settings
catalog:
mode: backstage
endpoint: http://backstage.com
Statis is the default mode and will use the information about the teams from the yaml dictionary as per example below.
catalog:
mode: static
teams:
- name: team1
github_repositories:
- owner/repo1
- owner/repo2
jira_projects:
- PROJECT1
- PROJECT2
- name: team2
github_repositories:
- owner/repo3
- owner/repo4
Error level can be selected from command line using flag -log
.
Possible error log values are: info,debug,warning or error
dora-exporter -log debug
You need to setup webhook preferrably organization wide like this
https:///api/github
Setup webhook for Jira issues to point to: https:///api/jira