promremote

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 12 Imported by: 6

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
}

func NewWriteClient

func NewWriteClient(endpoint, instance, job string, reg *prometheus.Registry) (*Client, error)

func (*Client) Endpoint

func (c *Client) Endpoint() string

func (*Client) Registry

func (c *Client) Registry() *prometheus.Registry

func (*Client) Run

func (c *Client) Run(interval time.Duration, quit chan bool)

Collect metrics and send them to remote server in interval. Does not block main thread execution

func (*Client) SetBasicAuth

func (c *Client) SetBasicAuth(username, password string) error

Set credentials needed for basic auth, return error if not provided

type ErrInvalidMetricDesc

type ErrInvalidMetricDesc struct {
	Desc string
}

func (*ErrInvalidMetricDesc) Error

func (e *ErrInvalidMetricDesc) Error() string

type ErrMissingAuthCredentials

type ErrMissingAuthCredentials struct{}

func (ErrMissingAuthCredentials) Error

type ErrMissingEndpoint

type ErrMissingEndpoint struct{}

func (ErrMissingEndpoint) Error

func (e ErrMissingEndpoint) Error() string

type ErrMissingInstance

type ErrMissingInstance struct{}

func (ErrMissingInstance) Error

func (e ErrMissingInstance) Error() string

type ErrMissingJob

type ErrMissingJob struct{}

func (ErrMissingJob) Error

func (e ErrMissingJob) Error() string

type ErrMissingRegistry

type ErrMissingRegistry struct{}

func (ErrMissingRegistry) Error

func (e ErrMissingRegistry) Error() string

type ErrRemoteWriteFailed

type ErrRemoteWriteFailed struct {
	StatusCode int
	Body       string
}

func NewErrRemoteWriteFailed

func NewErrRemoteWriteFailed(status int, resBody io.ReadCloser) *ErrRemoteWriteFailed

func (*ErrRemoteWriteFailed) Error

func (e *ErrRemoteWriteFailed) Error() string

type MetricData

type MetricData struct {
	Labels    map[string]string
	Timestamp time.Time
	Value     float64
}

Jump to

Keyboard shortcuts

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