Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LabelsToResource ¶
func LabelsToResource(labels labels.Labels) *resource_pb.Resource
func ReadProgressFile ¶
ReadProgressFile reads the progress file in the given directory and returns the saved offset.
func SaveProgressFile ¶
SaveProgressFile saves a progress file with the given offset in directory.
Types ¶
type Appender ¶
type Appender interface {
Append(s SizedMetric)
}
Appender appends a time series with exactly one data point.
type MetadataGetter ¶
type PrometheusReader ¶
type PrometheusReader struct {
// contains filtered or unexported fields
}
func NewPrometheusReader ¶
func NewPrometheusReader( logger log.Logger, walDirectory string, tailer tail.WalTailer, filters [][]*labels.Matcher, metricRenames map[string]string, metadataGetter MetadataGetter, appender Appender, metricsPrefix string, maxPointAge time.Duration, scrapeConfig []*promconfig.ScrapeConfig, failingReporter common.FailingReporter, leaderCandidate leader.Candidate, ) *PrometheusReader
NewPrometheusReader is the PrometheusReader constructor
func (*PrometheusReader) CurrentSegment ¶
func (r *PrometheusReader) CurrentSegment() int
func (*PrometheusReader) Next ¶
func (r *PrometheusReader) Next()
func (*PrometheusReader) Run ¶
func (r *PrometheusReader) Run(ctx context.Context, startOffset int) error
Run starts the main read loop, that reads the prometheus' WAL log to find and parse Series and Samples.
Series read are used to update an internal time series cache, containing metadata, labels and reset times.
Samples read are transformed by the retrieval.sampleBuilder into OTLP metrics and forwarded to the PrometheusReader.appender, generally a otlp.QueueManager.
type SizedMetric ¶ added in v0.24.0
type SizedMetric struct {
// contains filtered or unexported fields
}
SizedMetric encapsulates a small number of points w/ precomputed approximate size.
func NewSizedMetric ¶ added in v0.24.0
func NewSizedMetric(metric *metric_pb.Metric, count, size int) SizedMetric
func (SizedMetric) Count ¶ added in v0.24.0
func (s SizedMetric) Count() int
func (SizedMetric) Metric ¶ added in v0.24.0
func (s SizedMetric) Metric() *metric_pb.Metric
func (SizedMetric) Size ¶ added in v0.24.0
func (s SizedMetric) Size() int