Skip to content

Prometheus exporter GitHub and Jira Integrated DORA metrics

License

Notifications You must be signed in to change notification settings

mprokopov/dora-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DORA exporter

DORA metrics prometheus compatible exporter.

Grafana Dashboard Screenshot

Grafana Dashboard

https://grafana.com/grafana/dashboards/20889-dora-v2/

Installation

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.

Run in docker

docker run --rm -e GITHUB_TOKEN=gh_xxxxx -p 8090:8090 dora-exporter

Configuration

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.

Snapshot path

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.

Backstage backend support

DORA exporter has support for catalog either from enterprise Backstage installation or from static source using Yaml configuration.

Backstage

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

Static

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

Debugging

Error level can be selected from command line using flag -log. Possible error log values are: info,debug,warning or error

Example

dora-exporter -log debug

GitHub Integration setup

You need to setup webhook preferrably organization wide like this

https:///api/github

Jira integration setup

Setup webhook for Jira issues to point to: https:///api/jira

About

Prometheus exporter GitHub and Jira Integrated DORA metrics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published