mirror of
https://github.com/QuilibriumNetwork/ceremonyclient.git
synced 2026-02-21 18:37:26 +08:00
* Add Prometheus server * Add Prometheus gRPC metrics * Add BlossomSub metrics --------- Co-authored-by: Cassandra Heart <7929478+CassOnMars@users.noreply.github.com>
28 lines
712 B
Go
28 lines
712 B
Go
package grpc
|
|
|
|
import "google.golang.org/grpc"
|
|
|
|
// ServerOptions returns a list of grpc.ServerOptions which are commonly used.
|
|
func ServerOptions(opts ...grpc.ServerOption) []grpc.ServerOption {
|
|
return append(opts,
|
|
grpc.ChainUnaryInterceptor(
|
|
serverMetrics.UnaryServerInterceptor(),
|
|
),
|
|
grpc.ChainStreamInterceptor(
|
|
serverMetrics.StreamServerInterceptor(),
|
|
),
|
|
)
|
|
}
|
|
|
|
// ClientOptions returns a list of grpc.DialOptions which are commonly used.
|
|
func ClientOptions(opts ...grpc.DialOption) []grpc.DialOption {
|
|
return append(opts,
|
|
grpc.WithChainStreamInterceptor(
|
|
clientMetrics.StreamClientInterceptor(),
|
|
),
|
|
grpc.WithChainUnaryInterceptor(
|
|
clientMetrics.UnaryClientInterceptor(),
|
|
),
|
|
)
|
|
}
|