prometheus

package
v0.48.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: GPL-3.0 Imports: 14 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket added in v0.46.0

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

func (Bucket) CumulativeCount added in v0.46.0

func (b Bucket) CumulativeCount() float64

func (Bucket) UpperBound added in v0.46.0

func (b Bucket) UpperBound() float64

type Counter added in v0.46.0

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

func (Counter) Value added in v0.46.0

func (c Counter) Value() float64

type Gauge added in v0.46.0

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

func (Gauge) Value added in v0.46.0

func (g Gauge) Value() float64

type Histogram added in v0.46.0

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

func (Histogram) Buckets added in v0.46.0

func (h Histogram) Buckets() []Bucket

func (Histogram) Count added in v0.46.0

func (h Histogram) Count() float64

func (Histogram) Sum added in v0.46.0

func (h Histogram) Sum() float64

type Metric

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

func (*Metric) Counter added in v0.46.0

func (m *Metric) Counter() *Counter

func (*Metric) Gauge added in v0.46.0

func (m *Metric) Gauge() *Gauge

func (*Metric) Histogram added in v0.46.0

func (m *Metric) Histogram() *Histogram

func (*Metric) Labels

func (m *Metric) Labels() labels.Labels

func (*Metric) Summary added in v0.46.0

func (m *Metric) Summary() *Summary

func (*Metric) Untyped added in v0.46.0

func (m *Metric) Untyped() *Untyped

type MetricFamilies added in v0.46.0

type MetricFamilies map[string]*MetricFamily

func (MetricFamilies) Get added in v0.46.0

func (mfs MetricFamilies) Get(name string) *MetricFamily

func (MetricFamilies) GetCounter added in v0.46.0

func (mfs MetricFamilies) GetCounter(name string) *MetricFamily

func (MetricFamilies) GetGauge added in v0.46.0

func (mfs MetricFamilies) GetGauge(name string) *MetricFamily

func (MetricFamilies) GetHistogram added in v0.46.0

func (mfs MetricFamilies) GetHistogram(name string) *MetricFamily

func (MetricFamilies) GetSummary added in v0.46.0

func (mfs MetricFamilies) GetSummary(name string) *MetricFamily

func (MetricFamilies) Len added in v0.46.0

func (mfs MetricFamilies) Len() int

type MetricFamily added in v0.46.0

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

func (*MetricFamily) Help added in v0.46.0

func (mf *MetricFamily) Help() string

func (*MetricFamily) Metrics added in v0.46.0

func (mf *MetricFamily) Metrics() []Metric

func (*MetricFamily) Name added in v0.46.0

func (mf *MetricFamily) Name() string

func (*MetricFamily) Type added in v0.46.0

func (mf *MetricFamily) Type() textparse.MetricType

type Prometheus

type Prometheus interface {
	// ScrapeSeries and parse prometheus format metrics
	ScrapeSeries() (Series, error)
	Scrape() (MetricFamilies, error)
}

Prometheus is a helper for scrape and parse prometheus format metrics.

func New

func New(client *http.Client, request web.Request) Prometheus

New creates a Prometheus instance.

func NewWithSelector added in v0.21.0

func NewWithSelector(client *http.Client, request web.Request, sr selector.Selector) Prometheus

NewWithSelector creates a Prometheus instance with the selector.

type Quantile added in v0.46.0

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

func (Quantile) Quantile added in v0.46.0

func (q Quantile) Quantile() float64

func (Quantile) Value added in v0.46.0

func (q Quantile) Value() float64

type Series added in v0.46.0

type Series []SeriesSample

Series is a list of SeriesSample

func (*Series) Add added in v0.46.0

func (s *Series) Add(kv SeriesSample)

Add appends a metric.

func (Series) FindByName added in v0.46.0

func (s Series) FindByName(name string) Series

FindByName finds metrics where it's __name__ label matches given name. It expects the metrics is sorted. Complexity: O(log(N))

func (Series) FindByNames added in v0.46.0

func (s Series) FindByNames(names ...string) Series

FindByNames finds metrics where it's __name__ label matches given any of names. It expects the metrics is sorted. Complexity: O(log(N))

func (Series) Len added in v0.46.0

func (s Series) Len() int

Len returns metric length.

func (Series) Less added in v0.46.0

func (s Series) Less(i, j int) bool

Less reports whether the element with index i should sort before the element with index j.

func (Series) Max added in v0.46.0

func (s Series) Max() float64

Max returns the max value. It does NOT expect the metrics is sorted. Complexity: O(N)

func (*Series) Reset added in v0.46.0

func (s *Series) Reset()

Reset resets the buffer to be empty, but it retains the underlying storage for use by future writes.

func (Series) Sort added in v0.46.0

func (s Series) Sort()

Sort sorts data.

func (Series) Swap added in v0.46.0

func (s Series) Swap(i, j int)

Swap swaps the elements with indexes i and j.

type SeriesSample added in v0.46.0

type SeriesSample struct {
	Labels labels.Labels
	Value  float64
}

SeriesSample is a pair of label set and value

func (SeriesSample) Name added in v0.46.0

func (s SeriesSample) Name() string

Name the __name__ label value

type Summary added in v0.46.0

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

func (Summary) Count added in v0.46.0

func (s Summary) Count() float64

func (Summary) Quantiles added in v0.46.0

func (s Summary) Quantiles() []Quantile

func (Summary) Sum added in v0.46.0

func (s Summary) Sum() float64

type Untyped added in v0.46.0

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

func (Untyped) Value added in v0.46.0

func (u Untyped) Value() float64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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