github_exporter

command module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: MIT Imports: 19 Imported by: 0

README

main

Github exporter for Prometheus

This is a Github exporter for Prometheus metrics exposed by Github API. Written in Go with pluggable metrics collectors.

Status

Project is highly development, only a limited amount of collectors are implemented, starting from the ones that are needed the most at the time.

Features

  • Rate limit implementation as recommended by Github
  • Pluggable collectors, easy to integrate
  • Configurable caching of responses

Usage

For more detailed usage instructions and flags, check out the help (--help) flag.

export GITHUB_PRIVATE_KEY=""
export GITHUB_APP_ID=""
export GITHUB_INS_ID=""

./exporter [<flags>]

Usage (Docker)

You can run this exporter using a Docker image as well. Example:

docker pull konradasb/github_exporter
docker run -d -p 9024:9024 \
  -e GITHUB_PRIVATE_KEY="" \
  -e GITHUB_APP_ID="" \
  -e GITHUB_INS_ID="" \
  konradasb/github_exporter [<flags>]

Environment variables

These environment variables (or their --flag counterparts) are required:

  • GITHUB_PRIVATE_KEY
  • GITHUB_APP_ID
  • GITHUB_INS_ID

For more information on Github App(s) see here

Configuration

Example Prometheus scrape job configuration:

scrape_configs:
  - job_name: github_exporter
    scrape_interval: 60s
    scrape_timeout: 30s
    static_configs:
      - targets:
        - 127.0.0.1:9024

Adjust scrape_interval and scrape_timeout as needed. It might not be the right values depending on configuration - count of organizations, repositories, cache expiration times and etc.

Collectors

List of collectors, descriptions and wether they are enabled by default

Name Description Enabled
actions collector for Github Actions service true
ratelimit collector for Github ratelimits true

Development

Prerequisites:

  • Go >= 1.17

Building:

git clone https://github.com/konradasb/github_exporter.git
cd github_exporter
make build
./github_exporter --help

Contributing

Pull requests are always welcome. For any major changes, open an issue discussing the changes first before opening a pull request.

Update tests as appropriate.

License

License - MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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