metrics

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package metrics provides a variety of wire bindings for the Prometheus client library.

Index

Constants

This section is empty.

Variables

Set is used by wire.

Functions

func ProvideFactory

func ProvideFactory(r prometheus.Registerer) promauto.Factory

ProvideFactory is called by wire.

Types

type Handler

type Handler http.Handler

Handler exports prometheus metrics.

func ProvideMetricsHandler

func ProvideMetricsHandler(
	l *log.Logger,
	g prometheus.Gatherer,
	r prometheus.Registerer,
) Handler

ProvideMetricsHandler is called by wire.

type Interceptor

type Interceptor struct {
	// contains filtered or unexported fields
}

Interceptor provides methods for unary and streaming gRPC calls.

func ProvideInterceptor

func ProvideInterceptor(
	auto promauto.Factory,
) *Interceptor

ProvideInterceptor is called by wire.

func (*Interceptor) Stream

func (i *Interceptor) Stream(
	srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler,
) error

Stream wraps a streaming gRPC call.

func (*Interceptor) Unary

func (i *Interceptor) Unary(
	ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler,
) (interface{}, error)

Unary wraps a unary gRPC call.

type Wrapper

type Wrapper func(h http.Handler, name string) http.Handler

Wrapper will add metrics collection to the given handler.

func ProvideWrapper

func ProvideWrapper(
	auto promauto.Factory,
) Wrapper

ProvideWrapper is called by wire.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL