heimdall icon indicating copy to clipboard operation
heimdall copied to clipboard

Add stats to Request Metrics

Open devdinu opened this issue 6 years ago • 10 comments

devdinu avatar Feb 14 '18 05:02 devdinu

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

rShetty avatar Feb 22 '18 07:02 rShetty

@sohamkamani Can you help pick this up plz ?

rShetty avatar Mar 20 '18 05:03 rShetty

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

sohamkamani avatar Apr 04 '18 13:04 sohamkamani

Or have a plugin system like this WDYT?

sohamkamani avatar Apr 04 '18 13:04 sohamkamani

@sohamkamani Makes sense to have a plugin system, IMO

rShetty avatar Apr 05 '18 14:04 rShetty

@sohamkamani Are you planning to work on this ?

rShetty avatar Jun 22 '18 09:06 rShetty

@rShetty Yes this is in progress https://github.com/gojektech/heimdall/tree/plugins

sohamkamani avatar Jun 23 '18 06:06 sohamkamani

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 avatar Jul 16 '18 12:07 italolelis

@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.

gwthm-in avatar Feb 23 '19 03:02 gwthm-in

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.

italolelis avatar Feb 25 '19 13:02 italolelis