Skip to content

Distributor instrumentation reports "success" to requests returning 4xx when called via HTTPgRPC #3949

Open
@pracucci

Description

@pracucci

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions