AWS Cloudwatch Metrics Sink
The Vector aws_cloudwatch_metrics
sink
sends metrics to AWS Cloudwatch
metrics.
Warnings
Configuration
- Common
- Advanced
- vector.toml
- vector.yaml
- vector.json
[sinks.my_sink_id]# Generaltype = "aws_cloudwatch_metrics" # requiredinputs = ["my-source-or-transform-id", "prefix-*"] # requiredcompression = "none" # optional, defaultdefault_namespace = "service" # requiredregion = "us-east-1" # required, required when endpoint = null# Healthcheckhealthcheck.enabled = true # optional, default
- optionaltable
auth
Options for the authentication strategy.
- optionalstring
access_key_id
The AWS access key id. Used for AWS authentication when communicating with AWS services. See AWS Authentication for more info.
- Syntax:
literal
- View examples
- Syntax:
- optionalstring
assume_role
The ARN of an IAM role to assume at startup. See AWS Authentication for more info.
- Syntax:
literal
- View examples
- Syntax:
- optionalstring
secret_access_key
The AWS secret access key. Used for AWS authentication when communicating with AWS services. See AWS Authentication for more info.
- Syntax:
literal
- View examples
- Syntax:
- optionaltable
batch
Configures the sink batching behavior.
- commonoptionaluint
max_events
The maximum size of a batch, in events, before it is flushed.
- Default:
20
(events)
- Default:
- commonoptionaluint
timeout_secs
The maximum age of a batch before it is flushed.
- Default:
1
(seconds)
- Default:
- enumcommonoptionalstring
compression
The compression strategy used to compress the encoded event data before transmission.
- Syntax:
literal
- Default:
"none"
- Enum, must be one of:
"none"
"gzip"
"syntax"
- View examples
- Syntax:
- commonrequiredstring
default_namespace
A namespace that will isolate different metrics from each other. Used as a namespace for metrics that don't have it.
- Syntax:
literal
- View examples
- Syntax:
- optionalstring
endpoint
Custom endpoint for use with AWS-compatible services. Providing a value for this option will make
region
moot.- Syntax:
literal
- Only relevant when: region = null
- View examples
- Syntax:
- commonoptionaltable
healthcheck
Health check options for the sink. See Health checks for more info.
- commonoptionalbool
enabled
Enables/disables the healthcheck upon Vector boot.
- Default:
true
- View examples
- Default:
- commonrequired*string
region
The AWS region of the target service. If
endpoint
is provided it will override this value since the endpoint includes the region.- Syntax:
literal
- Only required when: endpoint = null
- View examples
- Syntax:
Env Vars
- commonoptionalstring
AWS_ACCESS_KEY_ID
The AWS access key id. Used for AWS authentication when communicating with AWS services. See AWS Authentication for more info.
- Syntax:
literal
- View examples
- Syntax:
- commonoptionalstring
AWS_CONFIG_FILE
Specifies the location of the file that the AWS CLI uses to store configuration profiles.
- Syntax:
literal
- Default:
"~/.aws/config"
- Syntax:
- commonoptionalstring
AWS_CREDENTIAL_EXPIRATION
Expiration time in RFC 3339 format. If unset, credentials won't expire.
- Syntax:
literal
- View examples
- Syntax:
- commonoptionalstring
AWS_DEFAULT_REGION
The default AWS region.
- Syntax:
literal
- Only relevant when: endpoint = null
- View examples
- Syntax:
- commonoptionalstring
AWS_PROFILE
Specifies the name of the CLI profile with the credentials and options to use. This can be the name of a profile stored in a credentials or config file.
- Syntax:
literal
- Default:
"default"
- View examples
- Syntax:
- commonoptionalstring
AWS_ROLE_SESSION_NAME
Specifies a name to associate with the role session. This value appears in CloudTrail logs for commands performed by the user of this profile.
- Syntax:
literal
- View examples
- Syntax:
- commonoptionalstring
AWS_SECRET_ACCESS_KEY
The AWS secret access key. Used for AWS authentication when communicating with AWS services. See AWS Authentication for more info.
- Syntax:
literal
- View examples
- Syntax:
- commonoptionalstring
AWS_SESSION_TOKEN
The AWS session token. Used for AWS authentication when communicating with AWS services.
- Syntax:
literal
- View examples
- Syntax:
- commonoptionalstring
AWS_SHARED_CREDENTIALS_FILE
Specifies the location of the file that the AWS CLI uses to store access keys.
- Syntax:
literal
- Default:
"~/.aws/credentials"
- Syntax:
Telemetry
This component provides the following metrics that can be retrieved through
the internal_metrics
source. See the
metrics section in the
monitoring page for more info.
- counter
events_in_total
The total number of events accepted by this component. This metric includes the following tags:
component_kind
- The Vector component kind.component_name
- The Vector component ID.component_type
- The Vector component type.instance
- The Vector instance identified by host and port.job
- The name of the job producing Vector metrics.
- counter
events_out_total
The total number of events emitted by this component. This metric includes the following tags:
component_kind
- The Vector component kind.component_name
- The Vector component ID.component_type
- The Vector component type.instance
- The Vector instance identified by host and port.job
- The name of the job producing Vector metrics.
How It Works
AWS Authentication
Vector checks for AWS credentials in the following order:
- Options
access_key_id
andsecret_access_key
. - Environment variables
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
. - The
credential_process
command in the AWS config file. (usually located at~/.aws/config
) - The AWS credentials file. (usually located at
~/.aws/credentials
) - The IAM instance profile. (will only work if running on an EC2 instance with an instance profile/role)
If credentials are not found the healtcheck will fail and an error will be logged.
Obtaining an access key
In general, we recommend using instance profiles/roles whenever possible. In
cases where this is not possible you can generate an AWS access key for any user
within your AWS account. AWS provides a detailed guide on
how to do this. Such created AWS access keys can be used via access_key_id
and secret_access_key
options.
Assuming roles
Vector can assume an AWS IAM role via the assume_role
option. This is an
optional setting that is helpful for a variety of use cases, such as cross
account access.
Health checks
Health checks ensure that the downstream service is accessible and ready to accept data. This check is performed upon sink initialization. If the health check fails an error will be logged and Vector will proceed to start.
Require health checks
If you'd like to exit immediately upon a health
check failure, you can pass the
--require-healthy
flag:
vector --config /etc/vector/vector.toml --require-healthy
Disable health checks
If you'd like to disable health checks for this
sink you can set the healthcheck
option to
false
.
State
This component is stateless, meaning its behavior is consistent across each input.