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

Refactored github-exporter #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dgeorgievski
Copy link

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

Note: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response.

Querying PRs

Additions

Querying PRs

  • Added new options for querying GitHub pulls
    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

  • Added a new metric for long running PR 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 k8s ServiceMonitor.

OpenIssues reflects now GitHub definition: PRs + non-PR issues.
Added new options for querying GitHub pulls, corrected paging of PRs responses,
and expanded Pull struct to include other PR attributes.
Added a new metric for long running PR requests. By default PRs are considered
long running if not closed after two weeks.
@Rucknar
Copy link
Contributor

Rucknar commented Mar 23, 2021

Thanks @dgeorgievski. Let me have a review but from an initial scan, this looks fantastic!

@Rucknar
Copy link
Contributor

Rucknar commented Mar 23, 2021

Of note, there is a 'WIP' though it's a bit stale now, refactored to address some of the open issues:

#54

@dgeorgievski
Copy link
Author

dgeorgievski commented Mar 24, 2021

Of note, there is a 'WIP' though it's a bit stale now, refactored to address some of the open issues:

#54

Thanks for sharing @Rucknar . We'd love to help with the WIPs tasks. Many of them overlap with our roadmap especially when we start ingesting more metrics from our ever growing GitHub footprint.

@dgeorgievski
Copy link
Author

Hi @Rucknar ,

Any update on the nest steps?

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