grafana / quickpizza

Pizza, pizza, pizza!
https://quickpizza.grafana.com/
Apache License 2.0
58 stars 12 forks source link

backend/http: fix client shadowing that caused trace scrambling #18

Closed roobre closed 1 year ago

roobre commented 1 year ago

I submit this PR as an acknowledgement that it has been 0 days since the last time that Go's variable shadowing in lambdas made me waste 1 hour debugging. Fool me once, same on you; fool me 27 times, shame on me.

This PR fixes a bug where the contextualized clients were overriding each other, instead of being contextualized per each request. This caused traces to be scrambled when two requests were processed in parallel, with their parents mixed up.