Categorygithub.com/clambin/github-exporter
module
0.4.0
Repository: https://github.com/clambin/github-exporter.git
Documentation: pkg.go.dev

# README

github-exporter

GitHub tag (latest by date) Build) Codecov Go Report Card

Prometheus exporter for GitHub repositories

Installation

Binaries are available on the release page. Container images are available on ghcr.io.

Usage

Command-line options

The following command-line arguments can be passed:

Usage:
  github-exporter [flags]

Flags:
      --config string   Configuration file
      --debug           Log debug messages
  -h, --help            help for github-exporter
  -v, --version         version for github-exporter

By default, github-monitor looks for the configuration file (config.yaml) in the following locations:

  • /etc/github-exporter
  • $HOME/.github-exporter
  • .

Configuration

The configuration file contains the following options:

# set debug to true to log debug messages
debug: false
# listener address for the /metrics endpoint
addr: :9090
# this section lists all repos to be monitored. Repos can be specified in either the `repo` section as an individual
# repo, or in the `user` section, which will monitor all repos for that user.
# notes: 
#   - github-exporter will not remove any duplicate repos
#   - organizations are currently not supported
repos:
  user:
    - clambin
  repo:
    - clambin/github-exporter
  # set archived to true to report metrics for archived repos. By default these are not reported on.
  archived: false
git:
  # token contains your github token to access the GitHub API.
  token: <your-token>
  # cache specifies how long to cache GitHub information.  
  cache: 1h

Any value in the configuration file may be overriden by setting an environment variable with a prefix GITHUB_EXPORTER_. E.g. to override the git token, set the following variable:

export GITHUB_EXPORTER_GIT.TOKEN="your-token"

Prometheus metrics

metrictypelabelshelp
github_exporter_api_inflight_currentGAUGEcurrent in flight requests
github_exporter_api_inflight_maxGAUGEmaximum in flight requests
github_exporter_forksGAUGEarchived, repoTotal number of forks
github_exporter_http_request_duration_secondsSUMMARYcode, method, pathhttp request duration in seconds
github_exporter_http_requests_totalCOUNTERcode, method, pathtotal number of http requests
github_exporter_issuesGAUGEarchived, repoTotal number of open issues
github_exporter_pullsGAUGEarchived, repoTotal number of open pull requests
github_exporter_starsGAUGEarchived, repoTotal number of stars

Authors

  • Christophe Lambin

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

# Packages

No description provided by the author