Documentation ¶
Index ¶
- Constants
- Variables
- func UpdateMetrics(ctx context.Context, logger logging.Logger, jobsCfg model.JobsConfig, ...) error
- type OptionsFunc
- func CloudWatchAPIConcurrency(maxConcurrency int) OptionsFunc
- func CloudWatchPerAPILimitConcurrency(listMetrics, getMetricData, getMetricStatistics int) OptionsFunc
- func EnableFeatureFlag(flags ...string) OptionsFunc
- func LabelsSnakeCase(labelsSnakeCase bool) OptionsFunc
- func MetricsPerQuery(metricsPerQuery int) OptionsFunc
- func TaggingAPIConcurrency(maxConcurrency int) OptionsFunc
Constants ¶
const ( DefaultMetricsPerQuery = 500 DefaultLabelsSnakeCase = false DefaultTaggingAPIConcurrency = 5 )
Variables ¶
var DefaultCloudwatchConcurrency = cloudwatch.ConcurrencyConfig{ SingleLimit: 5, PerAPILimitEnabled: false, ListMetrics: 5, GetMetricData: 5, GetMetricStatistics: 5, }
var Metrics = []prometheus.Collector{ promutil.CloudwatchAPIErrorCounter, promutil.CloudwatchAPICounter, promutil.CloudwatchGetMetricDataAPICounter, promutil.CloudwatchGetMetricDataAPIMetricsCounter, promutil.CloudwatchGetMetricStatisticsAPICounter, promutil.ResourceGroupTaggingAPICounter, promutil.AutoScalingAPICounter, promutil.TargetGroupsAPICounter, promutil.APIGatewayAPICounter, promutil.Ec2APICounter, promutil.DmsAPICounter, promutil.StoragegatewayAPICounter, promutil.DuplicateMetricsFilteredCounter, }
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