prometheus

package
v2.0.0-...-ca652af Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

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

func (p *Prometheus) Export(data *matrix.Matrix) (exporter.Stats, error)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL