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

Feature suggestion: Log the x-github-request-id #152

Open
gm3dmo opened this issue Jul 2, 2024 · 3 comments
Open

Feature suggestion: Log the x-github-request-id #152

gm3dmo opened this issue Jul 2, 2024 · 3 comments

Comments

@gm3dmo
Copy link

gm3dmo commented Jul 2, 2024

Would be nice if there was someway of logging the x-github-request-id header.

It would be helpful to have this in cases where the attempt to get a token from app/installations/<installation_id>/access_tokens fails with a "Network Error" where it fails to reach api.github.com for some reason versus any case when GitHub.com is responding with an error.

@gr2m
Copy link
Contributor

gr2m commented Jul 3, 2024

The x-github-request-id header is set on responses. If we cannot reach api.github.com, we do not have the x-github-request-id response header, or am I missing something?

@gm3dmo
Copy link
Author

gm3dmo commented Jul 3, 2024

There are 3 cases:

  1. Client requests access token and receives it. In this case the x-github-request-id can be logged.
  2. Client requests access token and receive an error from GitHub. In this case the x-github-request-id can be logged and is super useful for zooming in on logs.
  3. Client makes a request (possibly through some maze of proxies) and receives no response whatsoever. This makes it easier to point at the network as the place to begin troubleshooting.

Many litres of tears and escalations may be saved with this precious knowledge.

@gr2m
Copy link
Contributor

gr2m commented Jul 3, 2024

For case 2., in case of a request error, it should log the full request + response (with credentials redacted), it's the standard @octokit behavior. Do you have an example build where actions/create-github-app-token failed? It would be helpful to see logs

For case 1., we can add that if it's helpful, pull request welcome

For 3., a similar error should be logged as in 2., only lacking a response property

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

No branches or pull requests

2 participants