Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been evaluating
github-exporter
at wiley.com as part of our strategy to adopt Prometheus and Cortex as scalable enterprise services for monitoring in the cloud.We are interested to use github-exporter and love to contribute to this project, but considering the scope of this PR I wanted to follow up first with a personal PR.
Changes
OpenIssues
In the current form OpenIssues counts the non-PR issues,
https://github.com/infinityworks/github-exporter/blob/master/exporter/metrics.go#L80-L83
According to GitHub definition OpenIssues is a sum of PRs + non-PR issues.
https://docs.github.com/en/rest/reference/issues
Querying PRs
In the current form only page 0 is collected which contributes to incorrect PR reporting as soon as the repo has more PRs than the default page size returned by GH. I believe the default is 30.
https://github.com/infinityworks/github-exporter/blob/master/exporter/gather.go#L121
Additions
Querying PRs
Added
PR_QUERY_OPTIONS
to be able to control PRs query parameters.Example:
per_page=100&sort=long-running&direction=descending
See for more details https://docs.github.com/en/rest/reference/pulls#list-pull-requests
PullRequestLongRunningCount
By default PRs are considered long running if not closed after two weeks. The threshold is controlled by
PR_LONG_RUNNING_TIME_DIFF
env variable.This metric is important for Wiley to track PRs that are open for long periods. With this we plan to provide feedback to owners of monitored repos so they can close outstanding PRs.
Helm chart
The chart helps with managing
github-exporter
deployments in Kubernetes. Integration with Prrometheus is achieved through the k8sServiceMonitor
.