prometheus

package
v0.1.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoPrometheusAddress = errors.New("no address specified")

ErrNoPrometheusAddress is an error, which is returned when no Prometheus endpoint address was configured.

Functions

This section is empty.

Types

type Option

type Option func(p *Prometheus)

Option is a function which can configure a Prometheus instance.

func WithAddress

func WithAddress(addr string) Option

WithAddress configures Prometheus to use the given address of the Prometheus instance.

func WithAvailableBytesQuery

func WithAvailableBytesQuery(query string) Option

WithAvailableBytesQuery configures Prometheus to use the given query for fetching metrics about available bytes.

func WithAvailableInodesQuery

func WithAvailableInodesQuery(query string) Option

WithAvailableInodesQuery configures Prometheus to use the given query for fetching metrics about available inodes.

func WithCapacityBytesQuery

func WithCapacityBytesQuery(query string) Option

WithCapacityBytesQuery configures Prometheus to use the given query for fetching metrics about volume capacity in bytes.

func WithCapacityInodesQuery

func WithCapacityInodesQuery(query string) Option

WithCapacityInodesQuery configures Prometheus to use the given query for fetching metrics about the capacity of inodes for volumes.

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient configures Prometheus to use the given http.Client.

func WithRoundTripper

func WithRoundTripper(rt http.RoundTripper) Option

WithRoundTripper configures Prometheus to use the given http.RoundTripper.

type Prometheus

type Prometheus struct {
	// contains filtered or unexported fields
}

Prometheus is an implementation of metricssource.Source, which collects metrics about persistent volume claims from a Prometheus instance.

func New

func New(opts ...Option) (*Prometheus, error)

New creates a new Prometheus metrics source and configures it with the given options.

func (*Prometheus) Get

Get implements the metricssource.Source interface

Jump to

Keyboard shortcuts

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