heimdall
heimdall copied to clipboard
Add stats to Request Metrics
Thinking something on these lines,NewHTTPClient(timeout, opts)
, by default the stats integration would be false, but if opts := Options{Stats: true}
, then it should be enabled
@sohamkamani Can you help pick this up plz ?
Just a few clarifications... what format would these stats be in? (json, statsd, ...), and also, what would be the best way to output them?
I was thinking we should provide the stats option with an io.Writer
argument which heimdall would write to for every request
Or have a plugin system like this WDYT?
@sohamkamani Makes sense to have a plugin system, IMO
@sohamkamani Are you planning to work on this ?
@rShetty Yes this is in progress https://github.com/gojektech/heimdall/tree/plugins
Regarding stats, wouldn't it make sense to just use httptrace? This allows the clients to implement whatever tracing strategy they'd like (statsd, json, datadog, etc) without us having to change the lib.
Any thoughts on this?
@italolelis Looks like a good option. Users can hook into the events they are interested in. But one possible thing is, this might not be possible with custom Http client if the client doesn't support. Have to consider custom clients.
Hey @gowtham-sai,
Thanks for coming back to my comment. Absolutely, custom clients are quite important. But as far as I know httptrace
is not interfering with any custom clients, it's just a context based tracer that any client can use. The only reason I suggested is because it seems a bit out of the scope of this client to provide this tracing capabilities when the standard go library already provides ways for us to handle this.