metricsclient

package
v0.0.0-...-a761d13 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultTransport

func DefaultTransport(logger log.Logger, isTLS bool) *http.Transport

func MTLSTransport

func MTLSTransport(logger log.Logger) (*http.Transport, error)

func Read

func Read(r io.Reader) ([]*clientmodel.MetricFamily, error)

func Write

func Write(w io.Writer, families []*clientmodel.MetricFamily) error

Types

type Client

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

func New

func New(logger log.Logger, client *http.Client, maxBytes int64, timeout time.Duration, metricsName string) *Client

func (*Client) RemoteWrite

func (c *Client) RemoteWrite(ctx context.Context, req *http.Request,
	families []*clientmodel.MetricFamily, interval time.Duration) error

RemoteWrite is used to push the metrics to remote thanos endpoint

func (*Client) RetrievRecordingMetrics

func (c *Client) RetrievRecordingMetrics(ctx context.Context, req *http.Request, name string) ([]*clientmodel.MetricFamily, error)

func (*Client) Retrieve

func (c *Client) Retrieve(ctx context.Context, req *http.Request) ([]*clientmodel.MetricFamily, error)

func (*Client) Send

func (c *Client) Send(ctx context.Context, req *http.Request, families []*clientmodel.MetricFamily) error

type MetricsData

type MetricsData struct {
	Type   string          `json:"resultType"`
	Result []MetricsResult `json:"result"`
}

type MetricsJson

type MetricsJson struct {
	Status string      `json:"status"`
	Data   MetricsData `json:"data"`
}

type MetricsResult

type MetricsResult struct {
	Metric map[string]string `json:"metric"`
	Value  []interface{}     `json:"value"`
}

type PartitionedMetrics

type PartitionedMetrics struct {
	Families []*clientmodel.MetricFamily
}

Jump to

Keyboard shortcuts

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