Documentation ¶
Index ¶
- Variables
- type Option
- func WithAddress(addr string) Option
- func WithAvailableBytesQuery(query string) Option
- func WithAvailableInodesQuery(query string) Option
- func WithCapacityBytesQuery(query string) Option
- func WithCapacityInodesQuery(query string) Option
- func WithHTTPClient(client *http.Client) Option
- func WithRoundTripper(rt http.RoundTripper) Option
- type Prometheus
Constants ¶
This section is empty.
Variables ¶
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 ¶
WithAddress configures Prometheus to use the given address of the Prometheus instance.
func WithAvailableBytesQuery ¶
WithAvailableBytesQuery configures Prometheus to use the given query for fetching metrics about available bytes.
func WithAvailableInodesQuery ¶
WithAvailableInodesQuery configures Prometheus to use the given query for fetching metrics about available inodes.
func WithCapacityBytesQuery ¶
WithCapacityBytesQuery configures Prometheus to use the given query for fetching metrics about volume capacity in bytes.
func WithCapacityInodesQuery ¶
WithCapacityInodesQuery configures Prometheus to use the given query for fetching metrics about the capacity of inodes for volumes.
func WithHTTPClient ¶
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 ¶
func (p *Prometheus) Get(ctx context.Context) (metricssource.Metrics, error)
Get implements the metricssource.Source interface