Giter Site home page Giter Site logo

peterhalasz / github_actions_exporter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cpanato/github_actions_exporter

0.0 0.0 0.0 2.66 MB

GitHub Action Exporter

License: Apache License 2.0

Go 97.19% Makefile 0.47% Dockerfile 0.31% Mustache 2.03%

github_actions_exporter's Introduction

GitHub Actions Exporter

Prometheus exporter exposing GitHub Actions metrics.

Right now this exporter only expose the one metric which is the WorkFlow execution time.

Other metrics can be added in the future.

Getting Started

This exporter receives webhook events from GitHub.

If you want to collect metrics from a GitHub repository you will need to create a webhook in your GitHub repo.

You need just to select the Check Run event and the set your secret (that you start your exporter, see below)

The webhook will call /gh_event path on your endpoint by default. You can change this with the --web.gh-webhook-path option.

gh_webook

Also it collects the Action Billing metrics, for that you will need to setup a GitHub API Access Token

When configuring for an organization Access tokens must have the repo or admin:org scope. When configuring for an user Access tokens must have the user scope.

Prerequisites

To run this project, you will need a working Go environment.

Installing

go get -u github.com/cpanato/github_actions_exporter

Building

Build the sources with

make build

Run the binary

./github_actions_exporter --gh.github-webhook-token="MY_TOKEN" --gh.github-api-token="Accesstoken" --gh.github-org="honk_org"

Docker

You can deploy this exporter using the ghcr.io/cpanato/github_actions_exporter-linux-amd64 Docker image.

For example:

docker pull ghcr.io/cpanato/github_actions_exporter-linux-amd64:v0.2.0
docker run -d -p 9101:9101 ghcr.io/cpanato/github_actions_exporter-linux-amd64:v0.2.0 --gh.github-webhook-token="1234567890token" --gh.github-api-token="Accesstoken" --gh.github-org="honk_org"

Testing

Running unit tests

make test

Manual testing

cd example/
export GITHUB_WEBHOOK_TOKEN="..."
export GITHUB_API_TOKEN="..."
export GITHUB_ORG="..."
docker-compose up --build

Open Prometheus at http://localhost:9090 and explore the available metrics.

Contributing

Refer to CONTRIBUTING.md.

License

Apache License 2.0, see LICENSE.

github_actions_exporter's People

Contributors

dependabot[bot] avatar cpanato avatar peterhalasz avatar janakerman avatar amandahla avatar janakerman-form3 avatar lalten avatar pzmi-f3 avatar rguliyev avatar github-actions[bot] avatar stefanluptak avatar

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.