envoyproxy / envoyproxy/envoy

improve grpc error stats

Aperta
#5,720 14 commenti 1 reazione 1 assegnatario Rivendicata da @nikolay-pshenichny Vedi su GitHub
enhancement help wanted
Lingua principale
C++
Stelle
28.9k
Fork
5.6k
Merge medio
1g 22h
PR unite (30g)
430

Descrizione

*Title*: *Improve gRPC error stats*

*Description*:
Right now it appears that even gRPC responses with errors count toward the various 200/2xx stats counters, probably because the HTTP code itself will be 200.

The rq_success_ and rq_error_ stats take into account gRPC errors, but only if the gRPC error falls in the 5xx range:
```
absl::optional grpc_status = Grpc::Common::getGrpcStatus(headers);
if (grpc_status &&
!Http::CodeUtility::is5xx(Grpc::Utility::grpcToHttpStatus(grpc_status.value()))) {
upstream_request_->upstream_host_->stats().rq_success_.inc();
} else {
upstream_request_->upstream_host_->stats().rq_error_.inc();
}
```

It would be nice to add options to Envoy to:
1) count gRPC codes toward the existing http-style stats and/or
2) emit new metrics for gRPC codes (i.e. 0-16)

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.