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

There should be a way to forward the request_id header when initializing the client #209

Closed
Soulou opened this issue Apr 6, 2021 · 1 comment · Fixed by #262
Closed
Assignees

Comments

@Soulou
Copy link
Member

Soulou commented Apr 6, 2021

Currently if a project is using this module, we loose track of the request when it is used since no request_id can be forwarded.

@EtienneM EtienneM self-assigned this Aug 4, 2022
@EtienneM
Copy link
Member

EtienneM commented Aug 4, 2022

At Scalingo we use go-handler to automatically set a request ID:

https://github.com/Scalingo/go-handlers/blob/639d40004569f616e04c5d2d506126d54d667e3f/request_id_middleware.go

We would like to update the Do method to take a context.Context in argument:

func (c *client) Do(req *APIRequest) (*http.Response, error) {

So that we can set the request ID in the requests to the API here (if there is a request ID in the context):

req.HTTPRequest.Header.Add("User-Agent", c.userAgent)

Fixing this issue will lead to a new major version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants