github-pr-prometheus-exporter

command module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 12 Imported by: 0

README

github-pr-prometheus-exporter

Prometheus Exporter for Github Pull Requests

Preparation

Copy .envrc and load it.

$ cp .envrc.sample .envrc
$ # edit .envrc
$ # source .envrc

The target repositories are specified by GITHUB_REPOSITORIES environment varibales, that should be written in org/reponame, separated by commas.

export GITHUB_REPOSITORIES="chaspy/datadog-github-pr,chaspy/favsearch"

How to run

Local
$ go run main.go
Binary

Get the binary file from Releases and run it.

Docker
$ docker run -e GITHUB_TOKEN="${GITHUB_TOKEN}" -e GITHUB_REPOSITORIES="${GITHUB_REPOSITORIES}" chaspy/github-pr-prometheus-exporter:v0.1.0

Metrics

$ curl -s localhost:8080/metrics | grep github_pr_prometheus_exporter_pull_request_count
# HELP github_pr_prometheus_exporter_pull_request_count Number of Pull Requests
# TYPE github_pr_prometheus_exporter_pull_request_count gauge
github_pr_prometheus_exporter_pull_request_count{author="chaspy",label="",number="1470",repo="quipper/kubernetes-clusters",reviewer=""} 1
github_pr_prometheus_exporter_pull_request_count{author="dependabot-preview[bot]",label="dependencies,security",number="5563",repo="quipper/server-templates",reviewer=""} 1
github_pr_prometheus_exporter_pull_request_count{author="renovate[bot]",label="renovate:datadog,renovate:datadog/2.6.13",number="1798",repo="quipper/kubernetes-clusters",reviewer="chaspy"} 1
github_pr_prometheus_exporter_pull_request_count{author="renovate[bot]",label="renovate:ingress-nginx,renovate:ingress-nginx/3.20.1",number="1739",repo="quipper/kubernetes-clusters",reviewer="chaspy"} 1

Datadog Autodiscovery

If you use Datadog, you can use Kubernetes Integration Autodiscovery feature.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL