Skip to content

Commit

Permalink
fix incorrect metric grpc_server_connection_number
Browse files Browse the repository at this point in the history
  • Loading branch information
xianjingfeng committed Jun 7, 2023
1 parent cb22510 commit 18c07b8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ public Attributes transportReady(Attributes transportAttrs) {
}

public void transportTerminated(Attributes transportAttrs) {
grpcMetrics.decGauge(GRPC_SERVER_CONNECTION_NUMBER_KEY);
if (transportAttrs != null) {
grpcMetrics.decGauge(GRPC_SERVER_CONNECTION_NUMBER_KEY);
}
super.transportTerminated(transportAttrs);
}
}

0 comments on commit 18c07b8

Please sign in to comment.