Git Product home page Git Product logo

github-exporter's Introduction

Prometheus GitHub Exporter

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

Status

This exporter was forked from: https://github.com/infinityworks/github-exporter - help is wanted to fill in the gaps and community requests of the upstream project.

This is a friendly, helpful soft fork of the work of @rucknar.

Setup

This exporter is setup to take input from environment variables:

Required

  • 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".

At least one of those 3 options should be provided.

Optional

  • 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" alexellis/github-exporter:0.1.0

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: alexellis/github-exporter:0.1.0
    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

Contributing

Procedure

Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

License

MIT

github-exporter's People

Contributors

rucknar avatar alexellis avatar caarlos0 avatar iamtgray avatar ben-st avatar hairyhenderson avatar jlevesy avatar msiuts avatar

Stargazers

Giovanni keppelen avatar Luis Cacho avatar Stavros Foteinopoulos avatar Timothy Colbert avatar Sven Dowideit avatar Ricardo Amaro avatar Robert Kielty avatar Francisco Navarro avatar Nikhil Sharma avatar  avatar

Watchers

James Cloos avatar Ricardo Pinto avatar  avatar  avatar

Forkers

robertkielty

github-exporter's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.