Versions in this module Expand all Collapse all v0 v0.1.1 Jun 24, 2021 v0.1.0 Jun 12, 2021 Changes in this version + func PromGinHandler() gin.HandlerFunc + func PromHTTPHandler() http.Handler + type Config struct + MetricEndpoint string + Namespace string + type DBHandler interface + AfterExecution func(scope *gorm.Scope) + BeforeExecution func(scope *gorm.Scope) + type DefaultDBHandler struct + func NewDefaultDBHandler(namespace string) *DefaultDBHandler + func (m *DefaultDBHandler) AfterExecution(scope *gorm.Scope) + func (m *DefaultDBHandler) BeforeExecution(scope *gorm.Scope) + func (m *DefaultDBHandler) Init(namespace string) + type DefaultHTTPClientHandler struct + func NewDefaultHTTPClientHandler(namespace string) *DefaultHTTPClientHandler + func (m *DefaultHTTPClientHandler) HandleLatency(r *http.Response, latency float64) + func (m *DefaultHTTPClientHandler) HandleRequest(r *http.Request) + func (m *DefaultHTTPClientHandler) HandleResponse(r *http.Response) + func (m *DefaultHTTPClientHandler) Init(namespace string) + type DefaultHTTPServerHandler struct + func NewDefaultHTTPServerHandler(namespace string, metricEndpoint string) *DefaultHTTPServerHandler + func (m *DefaultHTTPServerHandler) HandleLatency(wi *ResponseWriterInterceptor, latency float64) + func (m *DefaultHTTPServerHandler) HandleRequest(r *http.Request) + func (m *DefaultHTTPServerHandler) HandleResponse(wi *ResponseWriterInterceptor) + func (m *DefaultHTTPServerHandler) Init(namespace string, metricEndpoint string) + type HTTPClientHandler interface + HandleLatency func(r *http.Response, latency float64) + HandleRequest func(r *http.Request) + HandleResponse func(r *http.Response) + type HTTPServerHandler interface + HandleLatency func(r *ResponseWriterInterceptor, latency float64) + HandleRequest func(r *http.Request) + HandleResponse func(r *ResponseWriterInterceptor) + type Monitor struct + func New(cfg *Config) *Monitor + func (m *Monitor) HTTPHandler() http.Handler + func (m *Monitor) Handler() http.Handler + func (m *Monitor) ListenAndServe(addr string) error + func (m *Monitor) MustRegister(cs ...prometheus.Collector) + func (m *Monitor) NamedCollector(name string) prometheus.Collector + func (m *Monitor) Register(c prometheus.Collector) error + func (m *Monitor) RegisterWithName(name string, c prometheus.Collector) error + func (m *Monitor) SetDBHandler(handler DBHandler) + func (m *Monitor) SetHTTPClientHandler(handler HTTPClientHandler) + func (m *Monitor) SetHTTPServerHandler(handler HTTPServerHandler) + func (m *Monitor) WrapAndServeDB(conn *gorm.DB) + func (m *Monitor) WrapAndServeHTTPClient(client *http.Client) + func (m *Monitor) WrapAndServeHTTPServer(srv *http.Server) + type ResponseWriterInterceptor struct + Body []byte + Method string + URL *url.URL + func (w *ResponseWriterInterceptor) Write(body []byte) (int, error) + func (w *ResponseWriterInterceptor) WriteHeader(statusCode int) + type RoundTripWrapper struct + func (m *RoundTripWrapper) RoundTrip(r *http.Request) (*http.Response, error)