Back to

package internal

Latest Go to latest
Published: Jun 16, 2020 | License: Apache-2.0 | Module:


func NewZapToGokitLogAdapter

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

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

type JobsMap

type JobsMap struct {
	// 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 MetadataService

type MetadataService interface {
	Get(job, instance string) (MetadataCache, error)

MetadataService is an adapter to ScrapeManager 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 values 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 values based on the initial and previous points in the timeseriesMap. If the metric is the first point in the timeseries, or the timeseries has been reset, it is removed from the sequence and added to the timeseriesMap. Additionally returns the total number of timeseries dropped from the metrics.

type OcaStore

type OcaStore interface {

OcaStore is an interface combines io.Closer and prometheus' scrape.Appendable

func NewOcaStore

func NewOcaStore(ctx context.Context, sink consumer.MetricsConsumerOld, logger *zap.Logger, jobsMap *JobsMap, useStartTimeMetric bool, receiverName string) OcaStore

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

type ScrapeManager

type ScrapeManager interface {
	TargetsAll() map[string][]*scrape.Target
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier