metric

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

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

Collector is a collector for prometheus

func NewCollector

func NewCollector(ctx context.Context, ds datastore.Datastore) *Collector

NewCollector create a collector

func (*Collector) Collect

func (c *Collector) Collect(ch chan<- prometheus.Metric)

Collect collect metrics

func (*Collector) Describe

func (c *Collector) Describe(ch chan<- *prometheus.Desc)

Describe describe metrics

type Metrics

type Metrics struct {
	TotalScrapes prometheus.Counter
	ScrapeErrors *prometheus.CounterVec
	Error        prometheus.Gauge
}

Metrics is data in scraper

func NewMetrics

func NewMetrics() Metrics

NewMetrics create a metrics

type Scraper

type Scraper interface {
	Name() string
	Help() string
	Scrape(ctx context.Context, ds datastore.Datastore, ch chan<- prometheus.Metric) error
}

Scraper is interface for scraping

func NewScrapers

func NewScrapers() []Scraper

NewScrapers return list of scraper

type ScraperDatastore

type ScraperDatastore struct{}

ScraperDatastore is scraper implement for datastore.Datastore

func (ScraperDatastore) Help

func (ScraperDatastore) Help() string

Help return help

func (ScraperDatastore) Name

func (ScraperDatastore) Name() string

Name return name

func (ScraperDatastore) Scrape

Scrape scrape metrics

type ScraperGitHub added in v1.15.1

type ScraperGitHub struct{}

ScraperGitHub is scraper implement for GitHub

func (ScraperGitHub) Help added in v1.15.1

func (ScraperGitHub) Help() string

Help return help

func (ScraperGitHub) Name added in v1.15.1

func (ScraperGitHub) Name() string

Name return name

func (ScraperGitHub) Scrape added in v1.15.1

func (s ScraperGitHub) Scrape(ctx context.Context, ds datastore.Datastore, ch chan<- prometheus.Metric) error

Scrape scrape metrics

type ScraperMemory added in v1.9.10

type ScraperMemory struct{}

ScraperMemory is scraper implement for memory

func (ScraperMemory) Help added in v1.9.10

func (ScraperMemory) Help() string

Help return help

func (ScraperMemory) Name added in v1.9.10

func (ScraperMemory) Name() string

Name return name

func (ScraperMemory) Scrape added in v1.9.10

Scrape scrape metrics

Jump to

Keyboard shortcuts

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