Open mgale opened 2 years ago
This would be a welcome addition, I'm not sure what is the best way to pass tracing data around, but I suspect it will be via some header in the request.
I create a PR here: https://github.com/mailgun/groupcache/pull/37 which I have not tested yet. Feedback welcome.
I would like to pass contextual data to the Getter interface Get function via ctx.
For example, using tracing tools like Datadog, the client HTTP headers need to be added before the HTTP request is sent and pulled off when the loading function is run. That could allow complete application visibility: https://docs.datadoghq.com/tracing/setup_overview/custom_instrumentation/go/#distributed-tracing
It could also allow the caller to pass other context-related information into the fill function. It seems like receiving side is possible by providing a custom Context func: https://github.com/mailgun/groupcache/blob/master/http.go#L74
However, it does not look like there is any way currently to add onto the HTTP client request: https://github.com/mailgun/groupcache/blob/master/http.go#L244