Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub monitoring mixin with dashboards #64

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

fionaliao
Copy link

Mixins are a collection of configurable, reusable Prometheus rules, alerts and/or Grafana dashboards for a particular system. The idea is that you can use these to set up appropriate monitoring for your systems. (More details here: https://github.com/monitoring-mixins/docs.)

This pull request is an initial attempt at a GitHub mixin, providing a dashboard for repository stats, and another one for tracking the GitHub API usage.

I've added the mixin here as ideally it should live in the repository containing the code which emits the telemetry data (metrics) on which the mixin is based. (A couple of example mixins which do this: node_exporter, kube-state-metrics.)

Changes

  • Added GitHub mixin with the two dashboards. The dashboards are defined in Jsonnet and use the Grafonnet library.
  • Updated the Travis CI config so the mixin is tested.
  • Added user label to pull_request_count metric. Previously it only had the repo label which isn't enough to uniquely identify a GitHub repository.
    • Used gofmt, which reformatted a couple of imports in the Go files I edited for this.

Screenshots

repo-stats-dashboard
api-usage-dashboard

Dashboard is currently in JSON and has test data.
Also fixed whitespace causing mixin linting to fail.
Previously, only the repo label was added to the pull request metric.
Multiple repositories can have the same repo value - the user label is
required to uniquely identify a GitHub repository.
Created a GitHub repository dashboard, which graphs exporter metrics for
a given repository. Also created an API usage dashboard to check the
if the exporter is running out of requests.

The dashboards use Grafonnet, a library for writing Grafana dashboards.
Added jsonnet-bundler integration so the Grafonnet package can be
fetched.
jb install has to be run before linting as the linter checks the
dependency files exist.
Added dashboard descriptions to README and updated running instructions so
Jsonnet libraries that are required by the build are installed.
@fionaliao fionaliao marked this pull request as draft December 15, 2020 12:17
@fionaliao fionaliao marked this pull request as ready for review December 15, 2020 12:18
@rgeyer
Copy link
Contributor

rgeyer commented Jul 21, 2021

Hello @Rucknar, I see that you have previously reviewed PRs and gotten them merged, hoping you can do the same for this one.

We are working in earnest to get this exporter embedded in the Grafana Agent and deploy this dashboard as an easily consumable integration on Grafana Cloud.

It would be ideal to do so from the master branch, if possible.

Thanks!

@rgeyer
Copy link
Contributor

rgeyer commented Jul 21, 2021

Actually, I just started to try consuming this in anger, and it needs some minor tweaks. Please standby :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants