• Stars
    star
    343
  • Rank 123,371 (Top 3 %)
  • Language
    Go
  • License
    MIT License
  • Created about 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

:octocat: Prometheus exporter for github metrics

⚠️ This repository is moving to the githubexporter organisation at githubexporter/github-exporter ⚠️

Timeline of changes:

  • 22/05/2023 - All current images are available in the new Docker Hub organisation at https://hub.docker.com/r/githubexporter/github-exporter
  • 30/05/2023 - GitHub repository will be migrated to https://github.com/githubexporter/github-exporter
  • 30/05/2023 - Any new images will be pushed to the githubexporter Docker Hub repository only
  • 21/08/2023 - All existing images will be removed from the infinityworks/github-exporter Docker Hub repository.
  • 30/08/2023 - The infinityworks/github-exporter Docker Hub repository will be deprecated

Prometheus GitHub Exporter

Exposes basic metrics for your repositories from the GitHub API, to a Prometheus compatible endpoint.

Configuration

This exporter is setup to take input from environment variables. All variables are optional:

  • ORGS If supplied, the exporter will enumerate all repositories for that organization. Expected in the format "org1, org2".
  • REPOS If supplied, The repos you wish to monitor, expected in the format "user/repo1, user/repo2". Can be across different Github users/orgs.
  • USERS If supplied, the exporter will enumerate all repositories for that users. Expected in the format "user1, user2".
  • GITHUB_TOKEN If supplied, enables the user to supply a github authentication token that allows the API to be queried more often. Optional, but recommended.
  • GITHUB_TOKEN_FILE If supplied instead of GITHUB_TOKEN, enables the user to supply a path to a file containing a github authentication token that allows the API to be queried more often. Optional, but recommended.
  • API_URL Github API URL, shouldn't need to change this. Defaults to https://api.github.com
  • LISTEN_PORT The port you wish to run the container on, the Dockerfile defaults this to 9171
  • METRICS_PATH the metrics URL path you wish to use, defaults to /metrics
  • LOG_LEVEL The level of logging the exporter will run with, defaults to debug

Install and deploy

Run manually from Docker Hub:

docker run -d --restart=always -p 9171:9171 -e REPOS="infinityworks/ranch-eye, infinityworks/prom-conf" githubexporter/github-exporter

Build a docker image:

docker build -t <image-name> .
docker run -d --restart=always -p 9171:9171 -e REPOS="infinityworks/ranch-eye, infinityworks/prom-conf" <image-name>

Docker compose

github-exporter:
    tty: true
    stdin_open: true
    expose:
      - 9171
    ports:
      - 9171:9171
    image: githubexporter/github-exporter:latest
    environment:
      - REPOS=<REPOS you want to monitor>
      - GITHUB_TOKEN=<your github api token>

Metrics

Metrics will be made available on port 9171 by default An example of these metrics can be found in the METRICS.md markdown file in the root of this repository

Tests

There is a set of blackbox behavioural tests which validate metrics endpoint in the test directory. Run as follows

make test

Version Release Procedure

Once a new pull request has been merged into master the following script should be executed locally. The script will trigger a new image build in docker hub with the new image having the tag release-<version>. The version is taken from the VERSION file and must follow semantic versioning. For more information see semver.org.

Prior to running the following command ensure the number has been increased to desired version in VERSION:

./release-version.sh

Metadata

More Repositories

1

prometheus-example-queries

Simple place for people to provide examples of queries they've found useful.
857
star
2

Guide_Rancher_Monitoring

Easy to follow guide on how to deploy and make the best use of the Rancher community catalog template for Prometheus.
113
star
3

prometheus-rancher-exporter

Exposes Rancher metrics to Prometheus
Go
99
star
4

docker-hub-exporter

Prometheus exporter for the Docker Hub
Go
76
star
5

101-Sessions

Documentation and support material for IW 101 Sessions
JavaScript
52
star
6

hpilo-exporter

Prometheus HP iLO exporter
Python
47
star
7

snow-cannon

An infrastructure as code approach to deploying Snowflake using Terraform
HCL
23
star
8

gar-exporter

Google Analytics Reporting API V4
Python
16
star
9

music

A REST api demo project that generates sequence diagrams from tests
Go
13
star
10

moby-container-stats

Prometheus Exporter - container stats exposed directly from the moby stats API
Go
12
star
11

docker-cloud-exporter

Prometheus Exporter for Docker Cloud
Go
8
star
12

graf-db

Pre-Configured data container for Grafana dashboards based upon Prometheus & Rancher.
8
star
13

prom-conf

Prometheus config container
7
star
14

terraform-canary

HCL
7
star
15

data-academy-serverless-example

A repository to demonstrate a simple serverless repo for the data academy.
Shell
7
star
16

ranch-eye

Simple container stats using Rancher as the source.
6
star
17

serverless

Serverless Application Template
JavaScript
6
star
18

kubehack

Kubernetes Hack Night
5
star
19

iw-tech-test

Infinity Works Tech Test - Starter Projects
Java
4
star
20

academy-tech-test

Python
4
star
21

iw-tech-test-py

Infinity Works Tech Test - Python Starter Project
Python
4
star
22

iw-data-test-python

Infinity Works Data Test - Starter Project
Python
4
star
23

generation-academy-tech-test

A sample tech test repo for the Generation Data Academy
Python
4
star
24

data-academy-cloudformation-example

A repository to demonstrate a simple CloudFormation repo for the data academy.
Python
3
star
25

iw-tech-test-dotnet

Infinity Works Tech Test - Starter Projects for .NET Core
C#
3
star
26

iw-data-test-python-pandas

Python
3
star
27

iw-tech-test-terraform-azure

Technical test for Engineers using azure terraform
Shell
3
star
28

aws-decryption-go

Decrypt AWS Encryption SDK formatted blobs using a custom private key
Go
2
star
29

iw-tech-test-platform

Infinity Works Platform Tech Test
Makefile
2
star
30

autovault

This project generates a raw vault model from metadata
Python
2
star
31

iw-tech-test-snowflake

Python
2
star
32

sample-jenkins-pipeline-job

Java
2
star
33

Bamboo-api-exporter

Open source toolkit for exporting data via bambooHR's API
Python
2
star
34

pact-demo

An example repo that shows a consumer of an api and the provider of that API being integrated with a locally hosted Pact Broker.
TypeScript
2
star
35

rsgo

ReadySteadyGo
2
star
36

email-signature-generator

A simple email signature generator
HTML
2
star
37

node-app-base

Basic utilities for running node microservices
JavaScript
2
star
38

awscli-terraform-snowflake

A docker image containing awscli, terraform and snowflake
Dockerfile
2
star
39

snailx_api

SnailX external team API.
Python
1
star
40

snailx_dev_env

Development environment repo for SnailX external team.
Makefile
1
star
41

iw-tech-test-terraform

Dockerfile
1
star
42

spike-aws-batch

Go
1
star
43

javascript-academy-tech-test

HTML
1
star
44

iw-tech-test-nodejs

Infinity Works Node.js Engineering Tech Test
JavaScript
1
star
45

go-workshop-practical

Go
1
star
46

go-common

Some small common go libs and utils
Go
1
star
47

bamboo-contact-sheet

A quick and dirty way to create an office contact sheet from Bamboo HR
Python
1
star
48

aws-sso-google-sync

Populate AWS SSO directly with your G Suite users and groups using either a CLI or AWS Lambda
Go
1
star
49

amazon-connect-flow-sync

Automated syncing of contact flows between a local directory and an amazon connect instance
JavaScript
1
star