Documentation ¶
Index ¶
- type Handler
- type PrometheusProvider
- func (p *PrometheusProvider) Handler() Handler
- func (p *PrometheusProvider) IncreaseCronTaskErrors(name string)
- func (p *PrometheusProvider) IncreaseGithubCacheHits(method, handler string)
- func (p *PrometheusProvider) IncreaseGithubCacheMisses(method, handler string)
- func (p *PrometheusProvider) IncreaseWebhookErrors(name string)
- func (p *PrometheusProvider) IncreaseWebhookRequest(name string)
- func (p *PrometheusProvider) ObserveCronTaskDuration(name string, elapsed float64)
- func (p *PrometheusProvider) ObserveGithubRequestDuration(handler, method, statusCode string, elapsed float64)
- func (p *PrometheusProvider) ObserveHTTPRequestDuration(handler, method, statusCode string, elapsed float64)
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type 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) 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 ¶
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