promx

package
v10.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdapterGin

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

func NewAdapterGin

func NewAdapterGin(p *PrometheusWrapper) *AdapterGin

func (*AdapterGin) Middleware

func (a *AdapterGin) Middleware(enable bool, reqKey string) gin.HandlerFunc

type Config

type Config struct {
	Enable         bool
	App            string
	ListenPort     int
	BasicUserName  string
	BasicPassword  string
	LogApi         map[string]struct{}
	LogMethod      map[string]struct{}
	Buckets        []float64
	Objectives     map[float64]float64
	DefaultCollect bool
}

type PrometheusWrapper

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

func NewPrometheusWrapper

func NewPrometheusWrapper(conf *Config) *PrometheusWrapper

func (*PrometheusWrapper) EventLog

func (p *PrometheusWrapper) EventLog(module, event string)

func (*PrometheusWrapper) ExceptionLog

func (p *PrometheusWrapper) ExceptionLog(module, exception string)

func (*PrometheusWrapper) HistogramLatencyLog

func (p *PrometheusWrapper) HistogramLatencyLog(module, api, method string, latency float64)

func (*PrometheusWrapper) Log

func (p *PrometheusWrapper) Log(api, method, code string, sendBytes, rcvdBytes, latency float64)

func (*PrometheusWrapper) RcvdBytesLog

func (p *PrometheusWrapper) RcvdBytesLog(module, api, method, code string, byte float64)

func (*PrometheusWrapper) RegCustomCollector

func (p *PrometheusWrapper) RegCustomCollector(c prometheus.Collector)

func (*PrometheusWrapper) RequestLog

func (p *PrometheusWrapper) RequestLog(module, api, method, code string)

func (*PrometheusWrapper) ResetCounter

func (p *PrometheusWrapper) ResetCounter()

func (*PrometheusWrapper) SendBytesLog

func (p *PrometheusWrapper) SendBytesLog(module, api, method, code string, byte float64)

func (*PrometheusWrapper) SiteEventLog

func (p *PrometheusWrapper) SiteEventLog(module, event, site string)

func (*PrometheusWrapper) StateLog

func (p *PrometheusWrapper) StateLog(module, state string, value float64)

func (*PrometheusWrapper) SummaryLatencyLog

func (p *PrometheusWrapper) SummaryLatencyLog(module, api, method string, latency float64)

Jump to

Keyboard shortcuts

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