Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileScraper ¶
type FileScraper struct {
// contains filtered or unexported fields
}
FileScraper custom type for scraping a file that contains the data from a prometheus metrics endpoint
func NewFileScraper ¶
func NewFileScraper(path string) (*FileScraper, error)
NewFileScraper returns a new file scraper instance from a given filepath
func (*FileScraper) CloseFileScraper ¶
func (s *FileScraper) CloseFileScraper() error
CloseFileScraper closes the file scraper gracefully
func (*FileScraper) ScrapeFile ¶
func (s *FileScraper) ScrapeFile() (*ScrapeData, error)
ScrapeFile scrapes the file owned by a FileScraper instance and returns some ScrapeData
type MetricType ¶
type MetricType string
MetricType represents the type of prometheus metric for a timeseries
const ( // PrometheusGauge a gauge metric type name PrometheusGauge MetricType = "gauge" // PrometheusCounter a counter metric type name PrometheusCounter MetricType = "counter" // PrometheusHistogram a histogram metric type name PrometheusHistogram MetricType = "histogram" // PrometheusSummary a summary metric type name PrometheusSummary MetricType = "summary" )
type PrometheusCounterMetric ¶
PrometheusCounterMetric represents the data contained in an individual counter metric timeseries
type PrometheusGaugeMetric ¶
PrometheusGaugeMetric represents the data contained in an individual gauge metric timeseries
type PrometheusHistogramMetric ¶
PrometheusHistogramMetric represents the data contained in an individual histogram metric timeseries TODO -- fix to represent an actual histogram metric's data
type PrometheusSummaryMetric ¶
PrometheusSummaryMetric represents the data contained in an individual summary metric timeseries TODO -- fix to represent an actual summary metric's data
type ScrapeData ¶
type ScrapeData struct { Gauges []PrometheusGaugeMetric Counters []PrometheusCounterMetric // contains filtered or unexported fields }
ScrapeData contains all the serialized data from a prometheus compatible metrics endpoint
func (*ScrapeData) GetHelp ¶
func (d *ScrapeData) GetHelp(metric string) string
GetHelp returns the help message for a given metric name. Returns a blank string if the metric had no help message
func (*ScrapeData) GetHelps ¶
func (d *ScrapeData) GetHelps() map[string]string
GetHelps returns a map[string]string of key metric names and value metric help messages
func (*ScrapeData) GetType ¶
func (d *ScrapeData) GetType(metric string) MetricType
GetType returns the type for a given metric name
func (*ScrapeData) GetTypes ¶
func (d *ScrapeData) GetTypes() map[string]MetricType
GetTypes returns a map[string]MetricType of key metric names and value metric types
type WebScraper ¶
type WebScraper struct {
// contains filtered or unexported fields
}
WebScraper custom type for scraping an http endpoint that contains the data from a prometheus metrics endpoint
func NewWebScraper ¶
func NewWebScraper(urlStr string) (*WebScraper, error)
NewWebScraper returns a new web scraper instance from a given url
func (*WebScraper) ScrapeWeb ¶
func (s *WebScraper) ScrapeWeb() (*ScrapeData, error)
ScrapeWeb scrapes the url owned by the WebScraper instance and returns some ScrapeData