Documentation
¶
Overview ¶
Package sherpaprom provides a collector of statistics for incoming Sherpa requests that are exported over to Prometheus.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector implements the Collector interface from the sherpa package.
func NewCollector ¶
func NewCollector(api string, reg prometheus.Registerer) (*Collector, error)
NewCollector creates a new collector for the named API. Metrics will be labeled with "api". The following prometheus metrics are automatically registered on reg, or the default prometheus registerer if reg is nil:
sherpa_requests_total calls, per function sherpa_errors_total error responses, per function,code sherpa_protocol_errors_total incorrect requests sherpa_bad_function_total unknown functions called sherpa_javascript_request_total requests to sherpa.js sherpa_json_request_total requests to sherpa.json sherpa_requests_duration_seconds histogram for .01, .05, .1, .2, .5, 1, 2, 4, 8, 16, per function
func (*Collector) BadFunction ¶
func (c *Collector) BadFunction()
BadFunction increases counter "sherpa_bad_function_total" by one.
func (*Collector) FunctionCall ¶
FunctionCall increases "sherpa_requests_total" by one, adds the call duration to "sherpa_requests_duration_seconds" and possibly increases "sherpa_error_total" and "sherpa_servererror_total".
func (*Collector) JSON ¶
func (c *Collector) JSON()
JSON increases "sherpa_json_requests_total" by one.
func (*Collector) JavaScript ¶
func (c *Collector) JavaScript()
JavaScript increases "sherpa_javascript_requests_total" by one.
func (*Collector) ProtocolError ¶
func (c *Collector) ProtocolError()
ProtocolError increases counter "sherpa_protocol_errors_total" by one.