retrieval

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadProgressFile

func ReadProgressFile(dir string) (offset int, err error)

ReadPRogressFile reads the progress file in the given directory and returns the saved offset.

func SaveProgressFile

func SaveProgressFile(dir string, offset int) error

SaveProgressFile saves a progress file with the given offset in directory.

Types

type Appender

type Appender interface {
	Append(ctx context.Context, hash uint64, s *metric_pb.ResourceMetrics) error
}

Appender appends a time series with exactly one data point. A hash for the series (but not the data point) must be provided. The client may cache the computed hash more easily, which is why its part of the call and not done by the Appender's implementation.

type MetadataGetter

type MetadataGetter interface {
	Get(ctx context.Context, job, instance, metric string) (*metadata.Entry, error)
}

type PrometheusReader

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

func NewPrometheusReader

func NewPrometheusReader(
	logger log.Logger,
	walDirectory string,
	tailer *tail.Tailer,
	filters [][]*labels.Matcher,
	metricRenames map[string]string,
	targetGetter TargetGetter,
	metadataGetter MetadataGetter,
	appender Appender,
	metricsPrefix string,
	maxPointAge time.Duration,
) *PrometheusReader

NewProemtheusReader is the PrometheusReader constructor

func (*PrometheusReader) Run

func (r *PrometheusReader) Run(ctx context.Context, startOffset int) error

type TargetGetter added in v0.1.0

type TargetGetter interface {
	Get(ctx context.Context, lset labels.Labels) (*targets.Target, error)
}

Jump to

Keyboard shortcuts

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