githubexporter / github-exporter

:octocat: Prometheus exporter for github metrics
MIT License
420 stars 121 forks source link

feat: Enable GitHub App authentication and monitoring #96

Closed galbirk closed 1 year ago

galbirk commented 1 year ago

In this PR I added the feature of authenticating to GitHub API with github app and allowing to fetch metrics about it.

Tests:

$ make test                                                                                                              
?       github.com/infinityworks/github-exporter        [no test files]
?       github.com/infinityworks/github-exporter/config [no test files]
?       github.com/infinityworks/github-exporter/exporter       [no test files]
?       github.com/infinityworks/github-exporter/http   [no test files]
=== RUN   TestHomepage
Created sequence diagram (2641264843_2166136261.html): /Users/galbirkman/projects/github-exporter/test/.sequence/2641264843_2166136261.html
--- PASS: TestHomepage (0.01s)
=== RUN   TestGithubExporter
time="2023-05-21T16:16:57+03:00" level=info msg="Fetching https://api.github.com/repos/myOrg/myRepo?per_page=100 \n"
time="2023-05-21T16:16:57+03:00" level=info msg="Fetching https://api.github.com/repos/myOrg/myRepo/releases \n"
time="2023-05-21T16:16:57+03:00" level=info msg="Fetching https://api.github.com/repos/myOrg/myRepo/pulls \n"
time="2023-05-21T16:16:57+03:00" level=info msg="API data fetched for repository: https://api.github.com/repos/myOrg/myRepo?per_page=100"
time="2023-05-21T16:16:57+03:00" level=info msg="All Metrics successfully collected"
Created sequence diagram (31181356_2166136261.html): /Users/galbirkman/projects/github-exporter/test/.sequence/31181356_2166136261.html
--- PASS: TestGithubExporter (0.07s)
PASS
ok      github.com/infinityworks/github-exporter/test   1.269s

Closes #95