prometheus

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseMetricsText

func ParseMetricsText(text []byte, openMetrics bool) (map[string]Metric, error)

Types

type Client

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

func NewClient

func NewClient(logger logrus.FieldLogger, prometheusURL string, transport http.RoundTripper) (*Client, error)

func (*Client) MetricsForSelector

func (c *Client) MetricsForSelector(ctx context.Context, selector string) (map[string]Metric, error)

type Metric

type Metric struct {
	MetricType MetricType
	Name       string
	Help       string
	Unit       string
	Comment    string
}

func (Metric) String

func (m Metric) String() string

type MetricType

type MetricType string

MetricType models the type of a metric.

const (
	// Possible values for MetricType
	MetricTypeCounter        MetricType = "counter"
	MetricTypeGauge          MetricType = "gauge"
	MetricTypeHistogram      MetricType = "histogram"
	MetricTypeGaugeHistogram MetricType = "gaugehistogram"
	MetricTypeSummary        MetricType = "summary"
	MetricTypeInfo           MetricType = "info"
	MetricTypeStateset       MetricType = "stateset"
	MetricTypeUnknown        MetricType = "unknown"
)

Jump to

Keyboard shortcuts

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