Open
Description
Describe the bug
In the distributor, the metric cortex_request_duration_seconds
is counting 4xx as status_code="success"
when the distributor Push()
return an httpgrpc error with a 4xx code inside.
From a quick look, I believe the problem is in the httpgrpc server where only 5xx are converted into httpgprc errors:
https://github.com/weaveworks/common/blob/bd288de53d57de300fa286688ce2fc935687213f/httpgrpc/server/server.go#L67-L69
The grpc instrumentation then report everything which is not an error as success
:
https://github.com/weaveworks/common/blob/bd288de53d57de300fa286688ce2fc935687213f/middleware/grpc_instrumentation.go#L14-L26
Expected behavior
To be reported as status_code=4xx
.