opencensus-go icon indicating copy to clipboard operation
opencensus-go copied to clipboard

ochttp.ServerResponseCountByStatusCode misdefined?

Open jmhodges opened this issue 6 years ago • 2 comments
trafficstars

There's a chance I've misunderstood the API, so I guess this is feedback about that, if I did.

ochttp.ServerResponseCountByStatusCode has its Measure set to ochttp.ServerLatency, but shouldn't it have its own Measure?

jmhodges avatar Dec 05 '18 08:12 jmhodges

No it doesn't need that. ServerResponseCountByStatusCode just needs a (any) measure that is recorded each time when a response is sent and the record operation needs to be tagged with a statuscode tag allowing for the break down into counts per statuscode. The measure ServerLatency holds a specific value but for this view.Count aggregation any value counts as 1.

So the API allows to use a Measure to be used multiple times in different Views allowing for less strain on your application. Typically Count aggregations reuse Measures.

basvanbeek avatar Dec 05 '18 09:12 basvanbeek

Ah! It would be cool to have that documented somewhere in this code's docs

jmhodges avatar Dec 15 '18 12:12 jmhodges