- Link Telegraf to your : create a Telegraf configuration
- View the metrics collected by Telegraf: connect to your and query the metrics table
Prerequisites
Best practice is to use an Ubuntu EC2 instance hosted in the same region as your as a migration machine. That is, the machine you run the commands on to move your data from your source database to your target . Before you migrate your data:- Create a target . Each has a single database that supports the most popular extensions. s do not support tablespaces, and there is no superuser associated with a . Best practice is to create a with at least 8 CPUs for a smoother experience. A higher-spec instance can significantly reduce the overall migration window.
- To ensure that maintenance does not run during the process, adjust the maintenance window.
Link Telegraf to your service
To create a Telegraf configuration that exports data to a in your :-
Set up your connection string
This variable holds the connection information for the target .
In the terminal on the source machine, set the following:
See where to find your connection details.
-
Generate a Telegraf configuration file
In Terminal, run the following:
telegraf.confconfigures a CPU input plugin that samples various metrics about CPU usage, and the output plugin.telegraf.confalso includes all available input, output, processor, and aggregator plugins. These are commented out by default. -
Test the configuration
You see an output similar to the following:
-
Configure the output plugin
-
In
telegraf.conf, in the[[outputs.postgresql]]section, setconnectionto the value of $TARGET. -
Use s when Telegraf creates a new table:
In the section that begins with the comment
## Templated statements to execute when creating a new table, add the following template:Theby_rangedimension builder was added to 2.13.
-
In
View the metrics collected by Telegraf
This section shows you how to generate system metrics using Telegraf, then connect to your and query the metrics .-
Collect system metrics using Telegraf
Run the following command for a 30 seconds:
Telegraf uses loaded inputs
cpuand outputspostgresqlalong withglobal tags, the intervals when the agent collects data from the inputs, and flushes to the outputs. -
View the metrics
-
Connect to your :
-
View the metrics collected in the
cputable intsdb:You see something like:To view the average usage per CPU core, useSELECT cpu, avg(usage_user) FROM cpu GROUP BY cpu;.
-
Connect to your :