cloudwatch

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToYACE

func ConvertToYACE(a Arguments) (yaceConf.ScrapeConf, error)

ConvertToYACE converts the Alloy config into YACE config model. Note that the conversion is not direct, some values have been opinionated to simplify the config model Alloy exposes for this integration.

Types

type Arguments

type Arguments struct {
	STSRegion             string                `alloy:"sts_region,attr"`
	FIPSDisabled          bool                  `alloy:"fips_disabled,attr,optional"`
	Debug                 bool                  `alloy:"debug,attr,optional"`
	DiscoveryExportedTags TagsPerNamespace      `alloy:"discovery_exported_tags,attr,optional"`
	Discovery             []DiscoveryJob        `alloy:"discovery,block,optional"`
	Static                []StaticJob           `alloy:"static,block,optional"`
	DecoupledScrape       DecoupledScrapeConfig `alloy:"decoupled_scraping,block,optional"`
}

Arguments are the Alloy based options to configure the embedded CloudWatch exporter.

func (*Arguments) SetToDefault

func (a *Arguments) SetToDefault()

SetToDefault implements syntax.Defaulter.

type DecoupledScrapeConfig

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

DecoupledScrapeConfig is the configuration for decoupled scraping feature.

type Dimensions

type Dimensions map[string]string

Dimensions are the label values used to identify a unique metric stream in CloudWatch. Each key value pair in the dictionary corresponds to a label value pair.

type DiscoveryJob

type DiscoveryJob struct {
	Auth                      RegionAndRoles `alloy:",squash"`
	CustomTags                Tags           `alloy:"custom_tags,attr,optional"`
	SearchTags                Tags           `alloy:"search_tags,attr,optional"`
	Type                      string         `alloy:"type,attr"`
	DimensionNameRequirements []string       `alloy:"dimension_name_requirements,attr,optional"`
	Metrics                   []Metric       `alloy:"metric,block"`
	NilToZero                 *bool          `alloy:"nil_to_zero,attr,optional"`
}

DiscoveryJob configures a discovery job for a given service.

type Metric

type Metric struct {
	Name       string        `alloy:"name,attr"`
	Statistics []string      `alloy:"statistics,attr"`
	Period     time.Duration `alloy:"period,attr"`
	Length     time.Duration `alloy:"length,attr,optional"`
	NilToZero  *bool         `alloy:"nil_to_zero,attr,optional"`
}

type RegionAndRoles

type RegionAndRoles struct {
	Regions []string `alloy:"regions,attr"`
	Roles   []Role   `alloy:"role,block,optional"`
}

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

type Role

type Role struct {
	RoleArn    string `alloy:"role_arn,attr"`
	ExternalID string `alloy:"external_id,attr,optional"`
}

type StaticJob

type StaticJob struct {
	Name       string         `alloy:",label"`
	Auth       RegionAndRoles `alloy:",squash"`
	CustomTags Tags           `alloy:"custom_tags,attr,optional"`
	Namespace  string         `alloy:"namespace,attr"`
	Dimensions Dimensions     `alloy:"dimensions,attr"`
	Metrics    []Metric       `alloy:"metric,block"`
	NilToZero  *bool          `alloy:"nil_to_zero,attr,optional"`
}

StaticJob will scrape metrics that match all defined dimensions.

type Tags

type Tags map[string]string

Tags represents a series of tags configured on an AWS resource. Each tag is a key value pair in the dictionary.

Jump to

Keyboard shortcuts

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