opencensus-go
opencensus-go copied to clipboard
ochttp.ServerResponseCountByStatusCode misdefined?
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?
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.
Ah! It would be cool to have that documented somewhere in this code's docs