scrape

package
v0.0.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StatisticSeries added in v0.0.5

func StatisticSeries(b []byte, contentType string, rc []*relabel.Config) (total int64, err error)

StatisticSeries statistic load from metrics raw data

Types

type JobInfo

type JobInfo struct {
	// Config is the origin scrape config in config file
	Config *config.ScrapeConfig
	// Cli is the http.Cli for scraping
	// all scraping request will be proxy to env SCRAPE_PROXY if it is not empty
	Cli *http.Client
	// contains filtered or unexported fields
}

JobInfo contains http client for scraping target, and the origin scrape config

func (*JobInfo) Scrape

func (j *JobInfo) Scrape(url string) ([]byte, string, error)

Scrape scrape a url and return origin metrics data and contentType

type Manager

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

Manager includes all jobs

func New

func New() *Manager

New create a Manager with specified Cli set

func (*Manager) ApplyConfig

func (s *Manager) ApplyConfig(cfg *prom.ConfigInfo) error

ApplyConfig update Manager from config

func (*Manager) GetJob

func (s *Manager) GetJob(job string) *JobInfo

GetJob search job by job name, nil will be return if job not exist

Jump to

Keyboard shortcuts

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