License
Unknown
v0.1.1 · public · Published almost 4 years ago
The Sensu AWS Timestream Handler is a Sensu Handler that sends metrics to
the AWS Timestream time series database service.
The Sensu AWS Timestream Handler is a Sensu plugin that requires a valid Sensu
license to run. Sensu Go >= 5.21 will add the SENSU_LICENSE_FILE
environment variable to the handler execution. To run the plugin independently
of Sensu (e.g. test/dev), you must set the environment variable:
SENSU_LICENSE_FILE=$(sensuctl license info --format json)
Sensu Assets are the best way to make use of this plugin. If you're not
using an asset, please consider doing so! If you're using sensuctl 5.13 with
Sensu Backend 5.13 or later, you can use the following command to add the asset:
sensuctl asset add nixwiz/sensu-aws-timestream-handler
If you're using an earlier version of sensuctl, you can find the asset on the
Bonsai Asset Index.
---
type: Handler
api_version: core/v2
metadata:
name: sensu-aws-timestream-handler
namespace: default
spec:
command: sensu-aws-timestream-handler --database sensu --table sensu_metrics
type: pipe
runtime_assets:
- nixwiz/sensu-aws-timestream-handler
filters:
- has_metrics
This handler supports the use of the environment variables HTTP_PROXY,
HTTPS_PROXY, and NO_PROXY (or the lowercase versions thereof). HTTPS_PROXY takes
precedence over HTTP_PROXY for https requests. The environment values may be
either a complete URL or a "host[:port]", in which case the "http" scheme is
assumed.
This plugin makes use of the AWS SDK for Go. The SDK uses the
default credential provider chain to find AWS credentials. The SDK uses
the first provider in the chain that returns credentials without an error.
The default provider chain looks for credentials in the following order:
Environment variables (AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY_ID, and AWS_REGION).
Shared credentials file (typically ~/.aws/credentials).
If your application is running on an Amazon EC2 instance, IAM role for Amazon EC2.
If your application uses an ECS task definition or RunTask API operation, IAM role for tasks.
The SDK detects and uses the built-in providers automatically, without
requiring manual configurations. For example, if you use IAM roles for Amazon
EC2 instances, your applications automatically use the instance’s credentials.
You don’t need to manually configure credentials in your application.
Source: Configuring the AWS SDK for Go
If you go the route of using environment variables, it is highly suggested you
use them via the Env secrets provider.
Sensu AWS Timestream Handler
Usage:
sensu-aws-timestream-handler [flags]
sensu-aws-timestream-handler [command]
Available Commands:
help Help about any command
version Print the version number of this plugin
Flags:
-d, --database string Timestream Database to use
-t, --table string Timestream Database Table to use
-r, --region string AWS Region for Timestream Database (default "us-east-1")
-c, --check-labels Include check labels in Timestream dimensions
-m, --max-write-records int The maximum number of records in a WriteRecords API request (default 100)
-D, --debug Enable debug output
-h, --help help for sensu-aws-timestream-handler
Use "sensu-aws-timestream-handler [command] --help" for more information about a command.
Most arguments for this handler are available to be set via environment
variables. However, any arguments specified directly on the command line
override the corresponding environment variable.
Argument | Environment Variable |
---|---|
--database | TIMESTREAM_DATABASE |
--table | TIMESTREAM_TABLE |
--region | AWS_REGION |
--check-labels | TIMESTREAM_CHECK_LABELS |
--max-write-records | TIMESTREAM_MAX_WRITE_RECORDS |
--debug | TIMESTREAM_DEBUG |
All arguments for this handler are tunable on a per entity or check basis based
on annotations. The annotations keyspace for this handler is
sensu.io/plugins/sensu-aws-timestream-handler/config
.
To change the table argument for a particular check, for that checks's
metadata add the following:
type: CheckConfig
api_version: core/v2
metadata:
annotations:
sensu.io/plugins/sensu-aws-timestream-handler/config/table: "sensu_check_table"
[...]
AWS limits the number of records per WriteRecords API request. The
default limit is 100. If you have requested an increase to this limit
you can provide your new limit as an argument to the --max-write-records
option.
Dimensions for each metrics point are created from the following:
--check-labels
argument. The defaultIf no dimensions are defined from the above, a default dimension named
entity_name
is created using the entity name.
Notes:
The preferred way of installing and deploying this plugin is to use it as an
Asset. If you would like to compile and install the plugin from source or
contribute to it, download the latest version or create an executable from this
source.
From the local path of the sensu-aws-timestream-handler repository:
go build
For more information about contributing to this plugin, see Contributing.
Please describe the reason for reporting this asset. Our moderators will be notified and will disable the asset if it is found to be inappropriate.
×