github-pr-exporter

command module
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

github-pr-exporter

A prometheus exporter for monitoring pull requests for specified users in the last X number of days. Useful for tracking things like hacktoberfest within your org.

Build Status Go Report Card GitHub release (latest by date) Docker Pulls

alt text

Usage

Once started, application will be accessible at http://localhost:8080/metrics

CLI
# Install with Go
go install github.com/circa10a/github-pr-exporter@latest

# Execute
❯ github-pr-exporter -h
Usage of ./github-pr-exporter:
      --config string       Path to config file (default "./config.yaml")
      --days-ago int        How many days back to search for pull requests (default 90)
      --ignore-user-repos   Ignore the user's own repos
      --interval int        How many seconds to wait before refreshing pull request data. Defaults to 6 hours (default 21600)
      --port int            What port to listen on (default 8080)
pflag: help requested
Configuration file

The CLI expects a YAML config file like so:

---
config:
  users:
    - circa10a
    - sindresorhus

You can also look in the examples directory

Docker
docker run -p 8080:8080 -v $PWD/config.yaml:/config.yaml circa10a/github-pr-exporter
docker-compose

First, update examples/config.yaml

Then, to start a preconfigured prometheus + grafana + exporter stack:

docker compose up

Then you can browse the preconfigured dashboard at http://localhost:3000/d/h_PRluMnk/pull-requests?orgId=1

Metrics

Name Type Cardinality Help
pull_request gauge 4 A pull request from a user in config. Contains labels user, created_at, link, and status
pull_request_total gauge 0 Total number of pull requests created by all users in the configured time window (previous 90 days)

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