client

package
v3.28.4 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements a client for KSM, capable of retrieving prometheus metrics from a given endpoint.

func New

func New(opts ...OptionFunc) (*Client, error)

New builds a Client using the given options. By default, it will use pester as an HTTP Doer and a noop logger.

func (*Client) MetricFamiliesGetFunc

func (c *Client) MetricFamiliesGetFunc(url string) prometheus.FetchAndFilterMetricsFamilies

MetricFamiliesGetFunc returns a function that obtains metric families from a list of prometheus queries.

type OptionFunc

type OptionFunc func(kc *Client) error

func WithLogger

func WithLogger(logger *log.Logger) OptionFunc

WithLogger returns an OptionFunc to change the logger from the default noop logger.

func WithMaxRetries

func WithMaxRetries(retries int) OptionFunc

WithMaxRetries returns an OptionFunc to change the number of retries for Pester Client.

func WithTimeout

func WithTimeout(timeout time.Duration) OptionFunc

WithTimeout returns an OptionFunc to change the timeout for Pester Client.

Jump to

Keyboard shortcuts

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