https://github.com/horgix/github-metrics-exporter
Gathering of various GitHub metrics + export in Prometheus/Openmetrics format
https://github.com/horgix/github-metrics-exporter
github metrics metrics-exporter prometheus
Last synced: 3 months ago
JSON representation
Gathering of various GitHub metrics + export in Prometheus/Openmetrics format
- Host: GitHub
- URL: https://github.com/horgix/github-metrics-exporter
- Owner: Horgix
- License: mit
- Created: 2022-06-16T11:16:09.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-13T13:08:20.000Z (about 2 years ago)
- Last Synced: 2025-03-05T17:46:08.931Z (3 months ago)
- Topics: github, metrics, metrics-exporter, prometheus
- Language: Rust
- Homepage:
- Size: 169 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# GitHub Metrics Exporter
[](https://github.com/Horgix/github-metrics-exporter/actions/workflows/build.yml)
This project is a "metric exporter" for GitHub metrics. Essentially, it
collects them through GitHub API (mainly the GraphQL one) and expose them e.g.
through an HTTP endpoint with a Prometheus format.It aims at collecting metrics such as:
- Total number of PRs on a repo
- Number of open PRs on a repo
- Number of drafts PRs on a repo
- Age of the oldest open PR on a repo
- Number of PRs that wait for a given user reviews
- Number of PRs currently open by a given user
- ...in order to create graphs, alerts, whatever you want with them!
## Status: ultra-early-alpha-wip-quickndirty-poc
This project, as you'll quickly notice by looking around, is currently more of
a test than anything else.What that means is that **it's definitely not doing everything it claims**.
What is also means is that **contributions are more than welcome and you can
totally shape the future of this project** if you want to :)## How it works
Summary:
- [](https://crates.io/crates/octocrab)
`github-metrics` uses the **Octocrab** Rust GitHub client library to query
the GitHub GraphQL API
- [](https://crates.io/crates/serde)
The response is deserialized into proper structs using **Serde** and **Serde
JSON** with as much default (de)serializer as possible, but also some custom
ones (e.g. to extract nested values from GraphQL reponses or to compute
`Durations` between a given date and now)
- [](https://crates.io/crates/anyhow)
**Anyhow** is used to give proper context to errors while still keeping a
readable code