Running Telegraf with the Timestream for LiveAnalytics output plugin
You can follow the instructions below to run Telegraf with the Timestream for LiveAnalytics plugin.
-
Generate an example configuration using Telegraf.
telegraf --section-filter agent:inputs:outputs --input-filter cpu:mem --output-filter timestream config > example.config
-
Create a database in Timestream using the management console, CLI, or SDKs.
-
In the
example.config
file, add your database name by editing the following key under the[[outputs.timestream]]
section.database_name = "yourDatabaseNameHere"
-
By default, Telegraf will create a table. If you wish create a table manually, set
create_table_if_not_exists
tofalse
and follow the instructions to create a table using the management console, CLI, or SDKs. -
In the example.config file, configure credentials under the
[[outputs.timestream]]
section. The credentials should allow the following operations.timestream:DescribeEndpoints timestream:WriteRecords
Note
If you leave
create_table_if_not_exists
set totrue
, include:timestream:CreateTable
Note
If you set
describe_database_on_start
totrue
, include the following.timestream:DescribeDatabase
-
You can edit the rest of the configuration according to your preferences.
-
When you have finished editing the config file, run Telegraf with the following.
./telegraf --config example.config
-
Metrics should appear within a few seconds, depending on your agent configuration. You should also see the new tables, cpu and mem, in the Timestream console.