collector

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TraditionalClusterID string = "bcs_unique_const_clusterid"
	TraditionalNamespace string = "bcs_unique_const_namespace"
	TraditionalName      string = "bcs_unique_const_name"
)

Variables

This section is empty.

Functions

func ParsePromMetric

func ParsePromMetric(metric io.Reader, cLabels map[string]string) ([]byte, error)

Types

type Collector

type Collector interface {
	Run(ctx context.Context, cfg *config.Config) error
}

Collector the collector configuration manager

func New

func New(cfg *config.Config, outputMgr output.Output) (Collector, error)

New create

type CollectorMetrics

type CollectorMetrics struct {
	Metrics []*PromMetric `json:"metrics"`
}

type CollectorWrapper

type CollectorWrapper struct {
	Collector CollectorMetrics `json:"collector"`
}

func ParsePromTextToOldVersion

func ParsePromTextToOldVersion(in io.Reader, cLabels map[string]string) (*CollectorWrapper, error)

type Family

type Family struct {
	//Time    time.Time
	Name    string        `json:"name"`
	Help    string        `json:"help"`
	Type    string        `json:"type"`
	Metrics []interface{} `json:"metrics,omitempty"` // Either metric or summary.
}

func NewFamily

func NewFamily(dtoMF *dto.MetricFamily, cLabels map[string]string) *Family

NewFamily consumes a MetricFamily and transforms it to the local Family type.

type Histogram

type Histogram struct {
	Labels  map[string]string `json:"labels,omitempty"`
	Buckets map[string]string `json:"buckets,omitempty"`
	Count   string            `json:"count"`
	Sum     string            `json:"sum"`
}

Histogram mirrors the Histogram proto message.

type Metric

type Metric struct {
	Labels map[string]string `json:"labels,omitempty"`
	Value  string            `json:"value"`
}

Metric is for all "single value" metrics, i.e. Counter, Gauge, and Untyped.

type MetricWrapper

type MetricWrapper struct {
	Data []*Family `json:"data"`
}

type PromMetric

type PromMetric struct {
	Name   string            `json:"key"`
	Labels map[string]string `json:"labels,omitempty"`
	Value  float64           `json:"value"`
}

type Summary

type Summary struct {
	Labels    map[string]string `json:"labels,omitempty"`
	Quantiles map[string]string `json:"quantiles,omitempty"`
	Count     string            `json:"count"`
	Sum       string            `json:"sum"`
}

Summary mirrors the Summary proto message.

Jump to

Keyboard shortcuts

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