Documentation ¶
Overview ¶
Package prometheus - Copyright NetApp Inc, 2021 All rights reserved
Package prometheus creates an HTTP end-point for Prometheus to scrape on `/metrics` It also publishes a list of available metrics for human consumption on `/`
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Prometheus ¶
type Prometheus struct { *exporter.AbstractExporter // contains filtered or unexported fields }
func (*Prometheus) Export ¶
Export - Unlike other Harvest exporters, we don't export data but put it in cache. The HTTP daemon serves that cache on request.
An important aspect of the whole mechanism is that all incoming data should have a unique UUID and object pair, otherwise they'll overwrite other data in the cache. This key is also used by the HTTP daemon to trace back the name of the collectors and plugins where the metrics come from (for the info page)
func (*Prometheus) Init ¶
func (p *Prometheus) Init() error
func (*Prometheus) ServeInfo ¶
func (p *Prometheus) ServeInfo(w http.ResponseWriter, r *http.Request)
ServeInfo provides a human-friendly overview of metric types and source collectors this is done in a very inefficient way, by "reverse engineering" the metrics. That's probably ok, since we don't expect this to be called often.
func (*Prometheus) ServeMetrics ¶
func (p *Prometheus) ServeMetrics(w http.ResponseWriter, r *http.Request)