metrics

package
v0.0.0-...-2215086 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// OnDemandPriceGauge collects metrics for the prometheus
	OnDemandPriceGauge = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: "cloudinfo",
		Name:      "on_demand_price",
		Help:      "On demand price for each instance type",
	},
		[]string{"provider", "region", "instanceType"},
	)
)

Functions

func GetPriceGatherers

func GetPriceGatherers() prometheus.Gatherers

func GetSpotPriceGatherers

func GetSpotPriceGatherers() prometheus.Gatherers

func ReportAlibabaSpotPrice

func ReportAlibabaSpotPrice(region, zone, instanceType string, price float64)

func ReportAmazonSpotPrice

func ReportAmazonSpotPrice(region, zone, instanceType string, price float64)

func ReportAzureSpotPrice

func ReportAzureSpotPrice(region, instanceType string, price float64)

func ReportGoogleSpotPrice

func ReportGoogleSpotPrice(region, zone, instanceType string, price float64)

Types

type DefaultMetricsReporter

type DefaultMetricsReporter struct {
	// Collectors holds application metric collector references for "bulk" operations
	Collectors []*prometheus.Collector
}

DefaultMetricsReporter default metrics source for the application

func (*DefaultMetricsReporter) ReportScrapeFailure

func (ms *DefaultMetricsReporter) ReportScrapeFailure(provider, service, region string)

func (*DefaultMetricsReporter) ReportScrapeProviderCompleted

func (ms *DefaultMetricsReporter) ReportScrapeProviderCompleted(provider string, startTime time.Time)

func (*DefaultMetricsReporter) ReportScrapeProviderShortLivedCompleted

func (ms *DefaultMetricsReporter) ReportScrapeProviderShortLivedCompleted(provider string, startTime time.Time)

func (*DefaultMetricsReporter) ReportScrapeRegionCompleted

func (ms *DefaultMetricsReporter) ReportScrapeRegionCompleted(provider, service, region string, startTime time.Time)

func (*DefaultMetricsReporter) ReportScrapeRegionShortLivedCompleted

func (ms *DefaultMetricsReporter) ReportScrapeRegionShortLivedCompleted(provider, region string, startTime time.Time)

func (*DefaultMetricsReporter) ReportScrapeShortLivedFailure

func (ms *DefaultMetricsReporter) ReportScrapeShortLivedFailure(provider, region string)

type Reporter

type Reporter interface {
	// ReportScrapeProviderCompleted registers the event of a successful scrape completion
	ReportScrapeProviderCompleted(provider string, startTime time.Time)

	// ReportScrapeRegionCompleted registers the completion of a successful scrape for the service, region and provider
	ReportScrapeRegionCompleted(provider, service, region string, startTime time.Time)

	// ReportScrapeFailure reports a scraping failure
	ReportScrapeFailure(provider, service, region string)

	// ReportScrapeProviderShortLivedCompleted reports a successful short lived information scrape for the provider
	ReportScrapeProviderShortLivedCompleted(provider string, startTime time.Time)

	// ReportScrapeRegionShortLivedCompleted reports a successful scrape for short lived information for the given region
	ReportScrapeRegionShortLivedCompleted(provider, region string, startTime time.Time)

	// ReportScrapeShortLivedFailure reports the failure of scraping short lived information
	ReportScrapeShortLivedFailure(provider, region string)
}

Defines application specific operations for collecting metrics

func NewDefaultMetricsReporter

func NewDefaultMetricsReporter() Reporter

NewMetricsSource assembles a Reporter with custom collectors

func NewNoOpMetricsReporter

func NewNoOpMetricsReporter() Reporter

Jump to

Keyboard shortcuts

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