metrics

package module
v0.0.0-...-a622c4c Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindPrometheus

func BindPrometheus(s *gin.Engine)

BindPrometheus bind prometheus endpoint.

func EnableMetric

func EnableMetric(srv *gin.Engine, options ...MetricsOptFunc) (err error)

EnableMetric enable metrics for exsits gin server

func NewHTTPMetricSrv

func NewHTTPMetricSrv(ctx context.Context, options ...MetricsOptFunc) (srv *http.Server, err error)

NewHTTPMetricSrv start new gin server with metrics api

Types

type MetricsOptFunc

type MetricsOptFunc func(*metricOption) error

MetricsOptFunc option of metrics

func WithMetricAddr

func WithMetricAddr(addr string) MetricsOptFunc

WithMetricAddr set option addr

func WithMetricGraceWait

func WithMetricGraceWait(wait time.Duration) MetricsOptFunc

WithMetricGraceWait set wating time after graceful shutdown

func WithPprofPath

func WithPprofPath(path string) MetricsOptFunc

WithPprofPath set option pprofPath

Jump to

Keyboard shortcuts

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