scrape

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LabelStats added in v0.2.0

type LabelStats struct {
	Name           string
	DistinctValues uint
}

func (LabelStats) String added in v0.2.0

func (l LabelStats) String() string

type LabelStatsSlice added in v0.2.0

type LabelStatsSlice []LabelStats

func (LabelStatsSlice) String added in v0.2.0

func (l LabelStatsSlice) String() string

type PromScraper

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

func NewPromScraper

func NewPromScraper(scrapeURL string, logger log.Logger, opts ...ScraperOption) *PromScraper

func (*PromScraper) LastScrapeContentType

func (ps *PromScraper) LastScrapeContentType() string

func (*PromScraper) Scrape

func (ps *PromScraper) Scrape() (*Result, error)

type Result

type Result struct {
	Series          SeriesMap
	UsedContentType string
}

type ScraperOption

type ScraperOption func(*scrapeOpts)

func WithMaxBodySize

func WithMaxBodySize(maxBodySize int64) ScraperOption

func WithTimeout

func WithTimeout(timeout time.Duration) ScraperOption

type Series

type Series struct {
	Name             string
	Labels           labels.Labels
	Type             string
	CreatedTimestamp int64
}

type SeriesInfo

type SeriesInfo struct {
	Name        string
	Cardinality int
	Type        string
	Labels      string
	CreatedTS   string
}

type SeriesMap

type SeriesMap map[string]SeriesSet

func (SeriesMap) AsRows

func (s SeriesMap) AsRows() []SeriesInfo

type SeriesSet

type SeriesSet map[uint64]Series

func (SeriesSet) Cardinality

func (s SeriesSet) Cardinality() int

func (SeriesSet) CreatedTS

func (s SeriesSet) CreatedTS() int64

func (SeriesSet) LabelNames

func (s SeriesSet) LabelNames() string

func (SeriesSet) LabelStats added in v0.2.0

func (s SeriesSet) LabelStats() LabelStatsSlice

func (SeriesSet) MetricTypeString

func (s SeriesSet) MetricTypeString() string

Jump to

Keyboard shortcuts

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