exporter

package
v0.61.2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultMetricsPerQuery       = 500
	DefaultLabelsSnakeCase       = false
	DefaultTaggingAPIConcurrency = 5
)

Variables

View Source
var DefaultCloudwatchConcurrency = cloudwatch.ConcurrencyConfig{
	SingleLimit:        5,
	PerAPILimitEnabled: false,

	ListMetrics:         5,
	GetMetricData:       5,
	GetMetricStatistics: 5,
}

Metrics is a slice of prometheus metrics specific to the scraping process such API call counters

Functions

func UpdateMetrics

func UpdateMetrics(
	ctx context.Context,
	logger logging.Logger,
	jobsCfg model.JobsConfig,
	registry *prometheus.Registry,
	factory clients.Factory,
	optFuncs ...OptionsFunc,
) error

UpdateMetrics is the entrypoint to scrape metrics from AWS on demand.

Parameters are: - `ctx`: a context for the request - `config`: this is the struct representation of the configuration defined in top-level configuration - `logger`: any implementation of the `logging.Logger` interface - `registry`: any prometheus compatible registry where scraped AWS metrics will be written - `factory`: any implementation of the `clients.Factory` interface - `optFuncs`: (optional) any number of options funcs

You can pre-register any of the default metrics from `Metrics` with the provided `registry` if you want them included in the AWS scrape results. If you are using multiple instances of `registry` it might make more sense to register these metrics in the application using YACE as a library to better track them over the lifetime of the application.

Types

type OptionsFunc added in v0.50.0

type OptionsFunc func(*options) error

func CloudWatchAPIConcurrency added in v0.50.0

func CloudWatchAPIConcurrency(maxConcurrency int) OptionsFunc

func CloudWatchPerAPILimitConcurrency added in v0.56.0

func CloudWatchPerAPILimitConcurrency(listMetrics, getMetricData, getMetricStatistics int) OptionsFunc

func EnableFeatureFlag added in v0.50.0

func EnableFeatureFlag(flags ...string) OptionsFunc

EnableFeatureFlag is an option that enables a feature flag on the YACE's entrypoint.

func LabelsSnakeCase added in v0.50.0

func LabelsSnakeCase(labelsSnakeCase bool) OptionsFunc

func MetricsPerQuery added in v0.50.0

func MetricsPerQuery(metricsPerQuery int) OptionsFunc

func TaggingAPIConcurrency added in v0.50.0

func TaggingAPIConcurrency(maxConcurrency int) OptionsFunc

Jump to

Keyboard shortcuts

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