bump go-grpc-prometheus since 1.2.0 actually exposes the metrics
v1.1.0 (which is what we currently use), does not expose metrics which makes it impossible to migrate.
This commit is contained in:
23
vendor/github.com/grpc-ecosystem/go-grpc-prometheus/util.go
generated
vendored
23
vendor/github.com/grpc-ecosystem/go-grpc-prometheus/util.go
generated
vendored
@@ -6,9 +6,19 @@ package grpc_prometheus
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
)
|
||||
|
||||
type grpcType string
|
||||
|
||||
const (
|
||||
Unary grpcType = "unary"
|
||||
ClientStream grpcType = "client_stream"
|
||||
ServerStream grpcType = "server_stream"
|
||||
BidiStream grpcType = "bidi_stream"
|
||||
)
|
||||
|
||||
var (
|
||||
allCodes = []codes.Code{
|
||||
codes.OK, codes.Canceled, codes.Unknown, codes.InvalidArgument, codes.DeadlineExceeded, codes.NotFound,
|
||||
@@ -25,3 +35,16 @@ func splitMethodName(fullMethodName string) (string, string) {
|
||||
}
|
||||
return "unknown", "unknown"
|
||||
}
|
||||
|
||||
func typeFromMethodInfo(mInfo *grpc.MethodInfo) grpcType {
|
||||
if !mInfo.IsClientStream && !mInfo.IsServerStream {
|
||||
return Unary
|
||||
}
|
||||
if mInfo.IsClientStream && !mInfo.IsServerStream {
|
||||
return ClientStream
|
||||
}
|
||||
if !mInfo.IsClientStream && mInfo.IsServerStream {
|
||||
return ServerStream
|
||||
}
|
||||
return BidiStream
|
||||
}
|
||||
|
Reference in New Issue
Block a user