metrics

package
v0.0.0-...-d5ae2a8 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunMetrics

func RunMetrics(metricCount, labelCount, seriesCount, metricLength, labelLength, valueInterval, seriesInterval, metricInterval int, constLabels []string, stop chan struct{}) (chan struct{}, error)

RunMetrics creates a set of Prometheus test series that update over time

func SendRemoteWrite

func SendRemoteWrite(config *ConfigWrite) error

SendRemoteWrite initializes a http client and sends metrics to a prometheus compatible remote endpoint.

func ServeMetrics

func ServeMetrics(port int) error

ServeMetrics serves a prometheus metrics endpoint with test series

func ToTimeSeriesSlice

func ToTimeSeriesSlice(metricFamilies []*dto.MetricFamily) []prompb.TimeSeries

ToTimeSeriesSlice converts a slice of metricFamilies containing samples into a slice of TimeSeries

Types

type Client

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

Client for the remote write requests.

func (*Client) Store

func (c *Client) Store(ctx context.Context, req *prompb.WriteRequest) error

Store sends a batch of samples to the HTTP endpoint.

type ConfigWrite

type ConfigWrite struct {
	URL             url.URL
	RequestInterval time.Duration
	BatchSize,
	RequestCount int
	UpdateNotify    chan struct{}
	PprofURLs       []*url.URL
	Tenant          string
	TLSClientConfig tls.Config
	TenantHeader    string
}

ConfigWrite for the remote write requests.

Jump to

Keyboard shortcuts

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