go-server-timing icon indicating copy to clipboard operation
go-server-timing copied to clipboard

How to merge timings with downstream timinngs

Open ensonic opened this issue 4 years ago • 0 comments

The code in https://github.com/mitchellh/go-server-timing/blob/master/middleware.go#L97 currently calls:

headers.Set(HeaderKey, h.String())

I am adding the timings to a http proxy and it would be good to not clober the downstream timing from the actual backend. This could probably be done by using Add instead of Set. Is there a reason for not merging the headers?

If I use the servertiming.MiddlewareOpts{DisableHeaders: true} on the proxy I see my backend timings. Otherwise the get overwritten.

ensonic avatar Jun 18 '21 08:06 ensonic