metrics

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Path        string
	Description string
	Handler     http.Handler
}

Handler is the representation of an HTTP handler that would be used by the metrics server to expose the metrics

type PrometheusProvider

type PrometheusProvider struct {
	Registry *prometheus.Registry
	// contains filtered or unexported fields
}

PrometheusProvider is the implementation of the Provider interface to send metrics to Prometheus.

func NewPrometheusProvider

func NewPrometheusProvider() *PrometheusProvider

NewPrometheusProvider creates a new prometheus metrics provider It'll create the provider and initialize all the needed metric objects.

func (*PrometheusProvider) Handler

func (p *PrometheusProvider) Handler() Handler

Handler returns the handler that would be used by the metrics server to expose the metrics.

func (*PrometheusProvider) IncreaseCronTaskErrors

func (p *PrometheusProvider) IncreaseCronTaskErrors(name string)

func (*PrometheusProvider) IncreaseGithubCacheHits

func (p *PrometheusProvider) IncreaseGithubCacheHits(method, handler string)

func (*PrometheusProvider) IncreaseGithubCacheMisses

func (p *PrometheusProvider) IncreaseGithubCacheMisses(method, handler string)

func (*PrometheusProvider) IncreaseRateLimiterErrors added in v0.3.0

func (p *PrometheusProvider) IncreaseRateLimiterErrors()

func (*PrometheusProvider) IncreaseWebhookErrors

func (p *PrometheusProvider) IncreaseWebhookErrors(name string)

func (*PrometheusProvider) IncreaseWebhookRequest

func (p *PrometheusProvider) IncreaseWebhookRequest(name string)

func (*PrometheusProvider) ObserveCronTaskDuration

func (p *PrometheusProvider) ObserveCronTaskDuration(name string, elapsed float64)

func (*PrometheusProvider) ObserveGithubRequestDuration

func (p *PrometheusProvider) ObserveGithubRequestDuration(handler, method, statusCode string, elapsed float64)

func (*PrometheusProvider) ObserveHTTPRequestDuration

func (p *PrometheusProvider) ObserveHTTPRequestDuration(handler, method, statusCode string, elapsed float64)

type Server

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

func NewServer

func NewServer(port string, handler Handler, pprof bool) *Server

NewServer creates a new metrics server. It receives a handler to expose the metrics from a provider. Right now we're just exposing one handler but in the future it'd support a slice of handlers Also, you can activate/deactivate pprof profiles as well setting the pprof argument to true

func (*Server) Start

func (m *Server) Start()

Start starts the metrics server in the provider port

func (*Server) Stop

func (m *Server) Stop()

Stop gracefully stops the server

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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