Documentation
¶
Index ¶
Constants ¶
View Source
const ( // EnvChiPrometheusLatencyBuckets represents an environment variable, which is formatted like "100,200,300,400" as string EnvChiPrometheusLatencyBuckets = "CHI_PROMETHEUS_LATENCY_BUCKETS" RequestsCollectorName = "chi_requests_total" LatencyCollectorName = "chi_request_duration_milliseconds" )
View Source
const (
// Agent metrics
AgentStatusCount = "agent_status_count"
)
Variables ¶
View Source
var UniqueVisitsPerWeek = &uniqueVisits{ counter: totalUniqueVisitPerWeekMetric, visitorsCache: make(map[string]struct{}), }
Functions ¶
func IncreaseOvaDownloadsTotalMetric ¶
func IncreaseOvaDownloadsTotalMetric(state string)
func NewPrometheusMetricsHandler ¶
func NewPrometheusMetricsHandler() *prometheusMetricsHandler
NewPrometheusMetricsHandler adds custom metrics and proxy to prometheus handler
func RegisterMetrics ¶
Types ¶
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
Middleware is a handler that exposes prometheus metrics for the number of requests, the latency, and the response size partitioned by status code, method, and HTTP path.
func NewMiddleware ¶
func NewMiddleware(name string) *Middleware
New returns a new prometheus middleware for the provided service name.
func (Middleware) Collectors ¶
func (m Middleware) Collectors() []prometheus.Collector
Collectors returns collector for your own collector registry.
func (Middleware) Handler ¶
func (m Middleware) Handler(next http.Handler) http.Handler
Handler returns a handler for the middleware pattern.
func (Middleware) MustRegisterDefault ¶
func (m Middleware) MustRegisterDefault()
MustRegisterDefault registers collectors to DefaultRegisterer. If you don't initialize the collector registry, this method should be called before calling promhttp.Handler().
Click to show internal directories.
Click to hide internal directories.