Github exporter for Prometheus metrics. Written in Go, with love ❤️

Github exporter for Prometheus

main

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

  • Pluggable collectors, easy to integrate
  • Rate limit implementation as recommended by Github:
    • Response caching / Response revalidation
    • Conditional requests
    • Burst safeguards
    • Throttling

Usage

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

export GH_PRIVATE_KEY=""
export GH_APP_ID=""
export GH_INS_ID=""

./github_exporter --help
Prometheus exporter for Github metrics.
Written in Go, with love ❤️

Usage:
  exporter [flags]

Flags:
      --host string                Host on which to expose metrics (HOST) (default "0.0.0.0")
      --port string                Port on which to expose metrics (PORT) (default "9042")
      --log-level string           Output log level severity (LOG_LEVEL) (default "debug")
      --web-metrics-path string    Path to HTTP metrics (WEB_METRICS_PATH) (default "/metrics")
      --web-healthz-path string    Path to HTTP healthz (WEB_HEALTHZ_PATH) (default "/healthz")
      --web-version-path string    Path to HTTP version (WEB_VERSION_PATH) (default "/version")
      --gh-organizations strings   List of Github organizations to scrape (GH_ORGANIZATIONS)
      --gh-repositories strings    List of Github repositories to scrape (GH_REPOSITORIES)
      --gh-private-key string      Github App Private Key (required) (GH_PRIVATE_KEY)
      --gh-app-id int              Github App application ID (required) (GH_APP_ID)
      --gh-ins-id int              Github App instalation ID (required) (GH_INS_ID)
  -h, --help                       help for exporter
  -v, --version                    version for exporter

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 GH_PRIVATE_KEY="" \
  -e GH_APP_ID="" \
  -e GH_INS_ID="" \
  konradasb/github_exporter [<flags>]

Environment variables

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

  • GH_PRIVATE_KEY
  • GH_APP_ID
  • GH_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

Owner
Konradas Bunikis
Site Reliability Engineer @ Hostinger
Konradas Bunikis
Similar Resources

Prometheus metrics exporter for libvirt.

Libvirt exporter Prometheus exporter for vm metrics written in Go with pluggable metric collectors. Installation and Usage If you are new to Prometheu

Jul 4, 2022

Prometheus Exporter for Kvrocks Metrics

Prometheus Exporter for Kvrocks Metrics

Prometheus Kvrocks Metrics Exporter This is a fork of oliver006/redis_exporter to export the kvrocks metrics. Building and running the exporter Build

Sep 7, 2022

A prometheus exporter which reports metrics about your Gmail inbox.

prometheus-gmail-exporter-go A prometheus exporter for gmail. Heavily inspired by https://github.com/jamesread/prometheus-gmail-exporter, but written

Nov 15, 2022

LLS-Exporter exports fuel level sensor data (rs-485 lls protocol) as prometheus metrics

LLS Exporter LLS Exporter reads rs485/rs232 data from serial port, decodes lls protocol and exports fuel level sensor data as prometheus metrics. Lice

Dec 14, 2021

Openshift's hpessa-exporter allows users to export SMART information of local storage devices as Prometheus metrics, by using HPE Smart Storage Administrator tool

hpessa-exporter Overview Openshift's hpessa-exporter allows users to export SMART information of local storage devices as Prometheus metrics, by using

Jan 17, 2022

Exporter your cypress.io dashboard into prometheus Metrics

Cypress.io dashboard Prometheus exporter Prometheus exporter for a project from Cypress.io dashboards, giving the ability to alert, make special opera

Feb 8, 2022

Kepler (Kubernetes-based Efficient Power Level Exporter) uses eBPF to probe energy related system stats and exports as Prometheus metrics

Kepler (Kubernetes-based Efficient Power Level Exporter) uses eBPF to probe energy related system stats and exports as Prometheus metrics

kepler Kepler (Kubernetes Efficient Power Level Exporter) uses eBPF to probe energy related system stats and exports as Prometheus metrics Architectur

Dec 26, 2022

Sensu-go-postgres-metrics - The sensu-go-postgres-metrics is a sensu check that collects PostgreSQL metrics

sensu-go-postgres-metrics Table of Contents Overview Known issues Usage examples

Jan 12, 2022

The metrics-agent collects allocation metrics from a Kubernetes cluster system and sends the metrics to cloudability

metrics-agent The metrics-agent collects allocation metrics from a Kubernetes cluster system and sends the metrics to cloudability to help you gain vi

Jan 14, 2022
Github billing exporter - Billing exporter for GitHub organizations

GitHub billing exporter Forked From: https://github.com/borisputerka/github_bill

Nov 2, 2022
Openvpn exporter - Prometheus OpenVPN exporter For golang

Prometheus OpenVPN exporter Please note: This repository is currently unmaintain

Jan 2, 2022
Amplitude-exporter - Amplitude charts to prometheus exporter PoC

Amplitude exporter Amplitude charts to prometheus exporter PoC. Work in progress

May 26, 2022
Vulnerability-exporter - A Prometheus Exporter for managing vulnerabilities in kubernetes by using trivy
Vulnerability-exporter - A Prometheus Exporter for managing vulnerabilities in kubernetes by using trivy

Kubernetes Vulnerability Exporter A Prometheus Exporter for managing vulnerabili

Dec 4, 2022
Netstat exporter - Prometheus exporter for exposing reserved ports and it's mapped process

Netstat exporter Prometheus exporter for exposing reserved ports and it's mapped

Feb 3, 2022
📡 Prometheus exporter that exposes metrics from SpaceX Starlink Dish
📡  Prometheus exporter that exposes metrics from SpaceX Starlink Dish

Starlink Prometheus Exporter A Starlink exporter for Prometheus. Not affiliated with or acting on behalf of Starlink(™) ?? Starlink Monitoring System

Dec 19, 2022
Prometheus exporter for Chia node metrics

chia_exporter Prometheus metric collector for Chia nodes, using the local RPC API Building and Running With the Go compiler tools installed: go build

Sep 19, 2022
NVIDIA GPU metrics exporter for Prometheus leveraging DCGM

DCGM-Exporter This repository contains the DCGM-Exporter project. It exposes GPU metrics exporter for Prometheus leveraging NVIDIA DCGM. Documentation

Dec 27, 2022
A Prometheus exporter which scrapes metrics from CloudLinux LVE Stats 2
A Prometheus exporter which scrapes metrics from CloudLinux LVE Stats 2

CloudLinux LVE Exporter for Prometheus LVE Exporter - A Prometheus exporter which scrapes metrics from CloudLinux LVE Stats 2 Help on flags: -h, --h

Nov 2, 2021
A Prometheus metrics exporter for AWS that fills in gaps CloudWatch doesn't cover

YAAE (Yet Another AWS Exporter) A Prometheus metrics exporter for AWS that fills in gaps CloudWatch doesn't cover About This exporter is meant to expo

Dec 10, 2022