Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector interface { ApiErrorOccurred() ServerPanicked(err error) MeasureRequestDuration(start time.Time, labels prometheus.Labels) }
func NewCollector ¶
type DefaultCollector ¶
type DefaultCollector struct {
// contains filtered or unexported fields
}
func (*DefaultCollector) ApiErrorOccurred ¶
func (c *DefaultCollector) ApiErrorOccurred()
func (*DefaultCollector) MeasureRequestDuration ¶
func (c *DefaultCollector) MeasureRequestDuration(start time.Time, labels prometheus.Labels)
func (*DefaultCollector) ServerPanicked ¶
func (c *DefaultCollector) ServerPanicked(err error)
type HttpHandler ¶
type HttpHandler struct {
// contains filtered or unexported fields
}
HttpHandler is a thin middleware for gathering metrics about http request. It makes no decision about error handling. If one occurred, we log it and pass request on to the underlying handler to make a decision
func NewHttpHandler ¶
func (*HttpHandler) ServeHTTP ¶
func (h *HttpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type NoopCollector ¶
type NoopCollector struct{}
func (*NoopCollector) ApiErrorOccurred ¶
func (c *NoopCollector) ApiErrorOccurred()
func (*NoopCollector) MeasureRequestDuration ¶
func (c *NoopCollector) MeasureRequestDuration(time.Time, prometheus.Labels)
func (*NoopCollector) ServerPanicked ¶
func (c *NoopCollector) ServerPanicked(error)
type PrometheusConfig ¶
type PrometheusConfig struct {
ScrapeConfigs []ScrapeConfig `yaml:"scrape_configs"`
}
type ScrapeConfig ¶
type ScrapeConfig struct { JobName string `yaml:"job_name"` StaticConfigs []StaticConfig `yaml:"static_configs"` }
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the http server that will be serving the /metrics request for prometheus
type StaticConfig ¶
type StaticConfig struct {
Targets []string `yaml:"targets"`
}
Click to show internal directories.
Click to hide internal directories.