internal

package
v0.31.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewZapToGokitLogAdapter

func NewZapToGokitLogAdapter(logger *zap.Logger) gokitLog.Logger

NewZapToGokitLogAdapter create an adapter for zap.Logger to gokitLog.Logger

Types

type JobsMap

type JobsMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

JobsMap maps from a job instance to a map of timeseries instances for the job.

func NewJobsMap

func NewJobsMap(gcInterval time.Duration) *JobsMap

NewJobsMap creates a new (empty) JobsMap.

type MetadataCache

type MetadataCache interface {
	Metadata(metricName string) (scrape.MetricMetadata, bool)
	SharedLabels() labels.Labels
}

MetadataCache is an adapter to prometheus' scrape.Target and provide only the functionality which is needed

type MetricFamily

type MetricFamily interface {
	Add(metricName string, ls labels.Labels, t int64, v float64) error
	IsSameFamily(metricName string) bool
	ToMetric() (*metricspb.Metric, int, int)
}

MetricFamily is unit which is corresponding to the metrics items which shared the same TYPE/UNIT/... metadata from a single scrape.

type MetricsAdjuster

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

MetricsAdjuster takes a map from a metric instance to the initial point in the metrics instance and provides AdjustMetrics, which takes a sequence of metrics and adjust their start times based on the initial points.

func NewMetricsAdjuster

func NewMetricsAdjuster(tsm *timeseriesMap, logger *zap.Logger) *MetricsAdjuster

NewMetricsAdjuster is a constructor for MetricsAdjuster.

func (*MetricsAdjuster) AdjustMetrics

func (ma *MetricsAdjuster) AdjustMetrics(metrics []*metricspb.Metric) ([]*metricspb.Metric, int)

AdjustMetrics takes a sequence of metrics and adjust their start times based on the initial and previous points in the timeseriesMap. Returns the total number of timeseries that had reset start times.

type OcaStore

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

OcaStore translates Prometheus scraping diffs into OpenCensus format.

func NewOcaStore

func NewOcaStore(
	ctx context.Context,
	sink consumer.Metrics,
	logger *zap.Logger,
	jobsMap *JobsMap,
	useStartTimeMetric bool,
	startTimeMetricRegex string,
	receiverID config.ComponentID,
	externalLabels labels.Labels) *OcaStore

NewOcaStore returns an ocaStore instance, which can be acted as prometheus' scrape.Appendable

func (*OcaStore) Appender added in v0.15.0

func (o *OcaStore) Appender(context.Context) storage.Appender

func (*OcaStore) Close added in v0.15.0

func (o *OcaStore) Close()

Close OcaStore as well as the internal metadataService.

func (*OcaStore) SetScrapeManager

func (o *OcaStore) SetScrapeManager(scrapeManager *scrape.Manager)

SetScrapeManager is used to config the underlying scrape.Manager as it's needed for OcaStore, otherwise OcaStore cannot accept any Appender() request

type ScrapeManager

type ScrapeManager interface {
	TargetsAll() map[string][]*scrape.Target
}

Jump to

Keyboard shortcuts

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