metrics

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ReadHeaderTimeout = time.Second * 60
)

Variables

This section is empty.

Functions

func RegisterPrometheusIfEnabled

func RegisterPrometheusIfEnabled(cfg *Config, srv *grpc.Server)

RegisterPrometheusIfEnabled registers prometheus metrics if they are enabled.

Types

type Config

type Config struct {
	ListenAddress string `json:"listen_address"`

	ZPages bool       `json:"zpages"`
	GRPC   GRPCConfig `json:"grpc"`
	HTTP   bool       `json:"http"`
	DB     bool       `json:"db"`
}

Config defined configuration format for diagnostics and performance metrics.

func (Config) AllDisabled

func (m Config) AllDisabled() bool

AllDisabled returns true if all metrics options are disabled. Otherwise, false.

type GRPCConfig

type GRPCConfig struct {
	Counters  bool `json:"counters"`
	Durations bool `json:"durations"`
	Gateway   bool `json:"gateway"`
}

func (GRPCConfig) AllDisabled

func (p GRPCConfig) AllDisabled() bool

type Server

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

func NewServer

func NewServer(cfg *Config, log *zerolog.Logger) *Server

newMetricsServer creates an http.Server that serves diagnostic metrics.

func (*Server) HTTP

func (s *Server) HTTP() *http.Server

Jump to

Keyboard shortcuts

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