Documentation ¶
Overview ¶
Package metrics is grpc's server-side and client-side metrics can continue to be captured using prometheus.
Index ¶
- func ClientHTTPService(addr string) *http.Server
- func ClientRegister(mux *http.ServeMux)
- func Register(mux *http.ServeMux, grpcServer *grpc.Server)
- func ServerHTTPService(addr string, grpcServer *grpc.Server) *http.Server
- func SetClientPattern(pattern string)
- func SetServerPattern(pattern string)
- func StreamClientMetrics() grpc.StreamClientInterceptor
- func StreamServerMetrics(opts ...Option) grpc.StreamServerInterceptor
- func UnaryClientMetrics() grpc.UnaryClientInterceptor
- func UnaryServerMetrics(opts ...Option) grpc.UnaryServerInterceptor
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientHTTPService ¶
ClientHTTPService initialize the client's prometheus exporter service and use http://ip:port/metrics to fetch data
func ClientRegister ¶
ClientRegister for http routing and grpc methods
func ServerHTTPService ¶
ServerHTTPService initialize the prometheus exporter service on the server side and fetch data using http://ip:port/metrics
func SetClientPattern ¶
func SetClientPattern(pattern string)
SetClientPattern set the client pattern
func SetServerPattern ¶
func SetServerPattern(pattern string)
SetServerPattern set the server pattern
func StreamClientMetrics ¶
func StreamClientMetrics() grpc.StreamClientInterceptor
StreamClientMetrics metrics stream interceptor
func StreamServerMetrics ¶
func StreamServerMetrics(opts ...Option) grpc.StreamServerInterceptor
StreamServerMetrics metrics stream interceptor
func UnaryClientMetrics ¶
func UnaryClientMetrics() grpc.UnaryClientInterceptor
UnaryClientMetrics metrics unary interceptor
func UnaryServerMetrics ¶
func UnaryServerMetrics(opts ...Option) grpc.UnaryServerInterceptor
UnaryServerMetrics metrics unary interceptor
Types ¶
type Option ¶
type Option func(*options)
Option set metrics
func WithCounterMetrics ¶
func WithCounterMetrics(metrics ...*prometheus.CounterVec) Option
WithCounterMetrics add Counter type indicator
func WithGaugeMetrics ¶
func WithGaugeMetrics(metrics ...*prometheus.GaugeVec) Option
WithGaugeMetrics add Gauge type indicator
func WithHistogramMetrics ¶
func WithHistogramMetrics(metrics ...*prometheus.HistogramVec) Option
WithHistogramMetrics adding Histogram type indicators
func WithSummaryMetrics ¶
func WithSummaryMetrics(metrics ...*prometheus.SummaryVec) Option
WithSummaryMetrics add Summary type indicator