prometheus

package
v1.87.5 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*tsdb.DBReadOnly
	// contains filtered or unexported fields
}

Client is a wrapper over Prometheus tsdb.DBReader

func NewClient

func NewClient(cfg Config) (*Client, error)

NewClient creates and validates new Client with given Config

func (*Client) Explore

func (c *Client) Explore() ([]tsdb.BlockReader, error)

Explore fetches all available blocks from a snapshot and collects the Meta() data from each block. Explore does initial filtering by time-range for snapshot blocks but does not take into account label filters.

func (*Client) Read

func (c *Client) Read(block tsdb.BlockReader) (storage.SeriesSet, error)

Read reads the given BlockReader according to configured time and label filters.

type Config

type Config struct {
	// Path to snapshot directory
	Snapshot string

	Filter Filter
}

Config contains a list of params needed for reading Prometheus snapshots

type Filter

type Filter struct {
	TimeMin    string
	TimeMax    string
	Label      string
	LabelValue string
}

Filter contains configuration for filtering the timeseries

type Stats

type Stats struct {
	Filtered      bool
	MinTime       int64
	MaxTime       int64
	Samples       uint64
	Series        uint64
	Blocks        int
	SkippedBlocks int
}

Stats represents data migration stats.

func (Stats) String

func (s Stats) String() string

String returns string representation for s.

Jump to

Keyboard shortcuts

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