Logging Middleware: Add GitHub API Rate Limiting information#413
Conversation
|
Side note: google/go-github#3453 is approved and is waiting for a merge. It seems that there will be a new go-github version released soon. |
|
Small update: google/go-github#3453 has been merged. After a few more minutes to think about: This PR does NOT depend on a new go-github release, as we don't use variables / structures from the package in the logging middleware. |
|
Hey @asvoboda, |
|
Sorry about that. Can you also update the go.mod dependency on latest so the build will pass? However, I'm not sure if we want to take a non tagged dependency. |
|
The build is failing due to a panic in the tests, not due to dependency issues. As mentioned in this comment, we don't actually depend on any new functionality in |
…ory address or nil pointer dereference [recovered]"
|
@asvoboda This PR doesn't require a go-github update, as we don't depend on it. This was a false information from my initially. Sorry for the confusion. @bluekeyes Thanks for the additional review. I made the requested changes. The unit tests should also work now (at least with The new logging output (using a With full rate limit information Without Without rate limit logging information at all |
bluekeyes
left a comment
There was a problem hiding this comment.
Looks good, thanks for the contribution and for iterating with us on the details!
|
@bluekeyes My pleasure. Thanks for the help. |
|
Oh, its out already: https://github.com/palantir/go-githubapp/releases/tag/v0.32.1 |
Context
This Pull Request adds the GitHub API Rate Limiting information into the Logging Middleware, if enabled.
It is disabled by default, as this can blow your log volume.
For more information on GitHub Rate Limiting, see https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#checking-the-status-of-your-rate-limit
How to use it
Result
Log lines will look like
Depends on ...
Attention! This Pull Request depends on google/go-github#3453
The fields
UsedandResourceare not part ofgo-githubyet. If google/go-github#3453 gets merged, the following steps are required to move this PR forward:google/go-githubversion needs to be releasedgoogle/go-githubneed to be raised insidepalantir/go-githubappStep 2 can also be added into this PR.
Missing work
Feedback
I open up this PR to get feedback early on, even if the PR is not mergeable yet.