cloudwatch_exporter

package
v0.36.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCloudwatchExporter added in v0.35.0

func NewCloudwatchExporter(name string, logger log.Logger, conf yaceConf.ScrapeConf, fipsEnabled, debug bool) *exporter

NewCloudwatchExporter creates a new YACE wrapper, that implements Integration

func NewDecoupledCloudwatchExporter added in v0.36.0

func NewDecoupledCloudwatchExporter(name string, logger log.Logger, conf yaceConf.ScrapeConf, scrapeInterval time.Duration, fipsEnabled, debug bool) *asyncExporter

NewDecoupledCloudwatchExporter creates a new YACE wrapper, that implements Integration. The decouple feature spawns a background go-routine to perform YACE metric collection allowing for a decoupled collection of AWS metrics from the ServerHandler.

func PatchYACEDefaults added in v0.35.0

func PatchYACEDefaults(yc *yaceConf.ScrapeConf)

PatchYACEDefaults overrides some default values YACE applies after validation.

func ToYACEConfig

func ToYACEConfig(c *Config) (yaceConf.ScrapeConf, bool, error)

ToYACEConfig converts a Config into YACE's config model. Note that the conversion is not direct, some values have been opinionated to simplify the config model the agent exposes for this integration. The returned boolean is whether or not AWS FIPS endpoints will be enabled.

Types

type Config

type Config struct {
	STSRegion       string                `yaml:"sts_region"`
	FIPSDisabled    bool                  `yaml:"fips_disabled"`
	Discovery       DiscoveryConfig       `yaml:"discovery"`
	Static          []StaticJob           `yaml:"static"`
	Debug           bool                  `yaml:"debug"`
	DecoupledScrape DecoupledScrapeConfig `yaml:"decoupled_scraping"`
}

Config is the configuration for the CloudWatch metrics integration

func (*Config) InstanceKey

func (c *Config) InstanceKey(agentKey string) (string, error)

func (*Config) Name

func (c *Config) Name() string

Name returns the name of the integration this config is for.

func (*Config) NewIntegration

func (c *Config) NewIntegration(l log.Logger) (integrations.Integration, error)

NewIntegration creates a new integration from the config.

type DecoupledScrapeConfig added in v0.36.0

type DecoupledScrapeConfig struct {
	Enabled bool `yaml:"enabled"`
	// ScrapeInterval defines the decoupled scraping interval. If left empty, a default interval of 5m is used
	ScrapeInterval *time.Duration `yaml:"scrape_interval,omitempty"`
}

DecoupledScrapeConfig is the configuration for decoupled scraping feature.

type Dimension

type Dimension struct {
	Name  string `yaml:"name"`
	Value string `yaml:"value"`
}

type DiscoveryConfig

type DiscoveryConfig struct {
	ExportedTags TagsPerNamespace `yaml:"exported_tags"`
	Jobs         []*DiscoveryJob  `yaml:"jobs"`
}

DiscoveryConfig configures scraping jobs that will auto-discover metrics dimensions for a given service.

type DiscoveryJob

type DiscoveryJob struct {
	InlineRegionAndRoles      `yaml:",inline"`
	InlineCustomTags          `yaml:",inline"`
	SearchTags                []Tag    `yaml:"search_tags"`
	Type                      string   `yaml:"type"`
	DimensionNameRequirements []string `yaml:"dimension_name_requirements"`
	Metrics                   []Metric `yaml:"metrics"`
}

DiscoveryJob configures a discovery job for a given service.

type InlineCustomTags

type InlineCustomTags struct {
	CustomTags []Tag `yaml:"custom_tags"`
}

type InlineRegionAndRoles

type InlineRegionAndRoles struct {
	Regions []string `yaml:"regions"`
	Roles   []Role   `yaml:"roles"`
}

InlineRegionAndRoles exposes for each supported job, the AWS regions and IAM roles in which the agent should perform the scrape.

type Metric

type Metric struct {
	Name       string        `yaml:"name"`
	Statistics []string      `yaml:"statistics"`
	Period     time.Duration `yaml:"period"`
	Length     time.Duration `yaml:"length"`
}

type Role

type Role struct {
	RoleArn    string `yaml:"role_arn"`
	ExternalID string `yaml:"external_id"`
}

type StaticJob

type StaticJob struct {
	InlineRegionAndRoles `yaml:",inline"`
	InlineCustomTags     `yaml:",inline"`
	Name                 string      `yaml:"name"`
	Namespace            string      `yaml:"namespace"`
	Dimensions           []Dimension `yaml:"dimensions"`
	Metrics              []Metric    `yaml:"metrics"`
}

StaticJob will scrape metrics that match all defined dimensions.

type Tag

type Tag struct {
	Key   string `yaml:"key"`
	Value string `yaml:"value"`
}

type TagsPerNamespace

type TagsPerNamespace map[string][]string

TagsPerNamespace represents for each namespace, a list of tags that will be exported as labels in each metric.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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