exporter

package
v0.62.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Copyright 2024 The Prometheus Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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

type OptionsFunc func(*options) error

func CloudWatchAPIConcurrency

func CloudWatchAPIConcurrency(maxConcurrency int) OptionsFunc

func CloudWatchPerAPILimitConcurrency

func CloudWatchPerAPILimitConcurrency(listMetrics, getMetricData, getMetricStatistics int) OptionsFunc

func EnableFeatureFlag

func EnableFeatureFlag(flags ...string) OptionsFunc

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

func LabelsSnakeCase

func LabelsSnakeCase(labelsSnakeCase bool) OptionsFunc

func MetricsPerQuery

func MetricsPerQuery(metricsPerQuery int) OptionsFunc

func TaggingAPIConcurrency

func TaggingAPIConcurrency(maxConcurrency int) OptionsFunc

Jump to

Keyboard shortcuts

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