pubsub metrics for RPCs
This commit is contained in:
parent
d8a669c85a
commit
896edfe072
@ -44,6 +44,9 @@ var (
|
||||
PubsubDeliverMessage = stats.Int64("pubsub/delivered", "Counter for total delivered messages", stats.UnitDimensionless)
|
||||
PubsubRejectMessage = stats.Int64("pubsub/rejected", "Counter for total rejected messages", stats.UnitDimensionless)
|
||||
PubsubDuplicateMessage = stats.Int64("pubsub/duplicate", "Counter for total duplicate messages", stats.UnitDimensionless)
|
||||
PubsubRecvRPC = stats.Int64("pubsub/recv_rpc", "Counter for total received RPCs", stats.UnitDimensionless)
|
||||
PubsubSendRPC = stats.Int64("pubsub/send_rpc", "Counter for total sent RPCs", stats.UnitDimensionless)
|
||||
PubsubDropRPC = stats.Int64("pubsub/drop_rpc", "Counter for total dropped RPCs", stats.UnitDimensionless)
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -374,5 +374,11 @@ func (trw *tracerWrapper) Trace(evt *pubsub_pb.TraceEvent) {
|
||||
if trw.tr != nil {
|
||||
trw.tr.Trace(evt)
|
||||
}
|
||||
case pubsub_pb.TraceEvent_RECV_RPC:
|
||||
stats.Record(context.TODO(), metrics.PubsubRecvRPC.M(1))
|
||||
case pubsub_pb.TraceEvent_SEND_RPC:
|
||||
stats.Record(context.TODO(), metrics.PubsubSendRPC.M(1))
|
||||
case pubsub_pb.TraceEvent_DROP_RPC:
|
||||
stats.Record(context.TODO(), metrics.PubsubDropRPC.M(1))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user