Early Adopter
Telegraf is a plugin-driven server agent for collecting, processing, aggregating, and writing metrics. Telegraf comes with the Dynatrace Output Plugin that enables you to easily send Telegraf metrics to Dynatrace.
Enable Telegraf ingestion
Telegraf metric ingestion comes with OneAgent version 1.201+. The easiest scenario is to have Telegraf installed on the host alongside OneAgent. You only need to enable the Dynatrace Output Plugin in your Telegraf configuration (Telegraf version 1.16+) and enable Telgraf metric ingestion at the environment or host level in your Dynatrace configuration. Note that the host-level configuration overrides the environment configuration.
Enable the Dynatrace Output Plugin in Telegraf configuration
Telegraf and OneAgent on the same host
- Edit
telegraf.conf
, the Telegraf configuration file.
- Uncomment the
[[outputs.dynatrace]]
line.
-
optional
Uncomment the
prefix = "telegraf."
line and set the prefix to easily find the Telegraf ingested metrics. The prefix will also be visible in the Dynatrace metric key.
- Save the file.
No OneAgent on the host
If for some reason you can't install OneAgent on the Telegraf monitored host, you can configure the Dynatrace Output Plugin to push metrics directly to your Dynatrace environment through Metrics API v2.
Prerequisites
- Edit
telegraf.conf
, the Telegraf configuration file.
- Uncomment the
# [[outputs.dynatrace]]
line.
-
optional
Uncomment the
# prefix = "telegraf."
line and set the prefix to easily find the Telegraf ingested metrics. The prefix will also be visible in the Dynatrace metric key.
- Uncomment the
# api_token = ""
line and add your API token, for example api_token = "abcdefjhij1234567890"
- Uncomment the
# url = ""
line and add your Dynatrace metric API endpoint. For example,
- Dynatrace SaaS
url = "https://{your-environment-id}.live.dynatrace.com/api/v2/metrics/ingest"
- Dynatrace Managed
https://{your-domain}/e/{your-environment-id}/api/v2/metrics/ingest
- Save the file.
Enable at the environment level
- Go to Settings > Monitoring > Monitored technologies.
- In the list of supported technologies, search for the Dynatrace OneAgent StatsD, Pipe, HTTP Metric API entry.
- Select Edit.
- Turn on Enable Extensions Execution Controller on every host.
- Turn on Enable local PIPE/HTTP metric API on every host.
Disable on selected hosts
When enabled at the environment level, you can disable ingestion for selected hosts.
5. From the navigation menu, select Hosts, and select your host.
6. Open the browse menu (...) and select Settings.
7. In the Monitored technologies table, search for the PIPE/HTTP entry. You can sort by Type and look for the Infrastructure insights type.
8. Edit the entry:
- Turn on Use host configuration.
- Turn off Enable on this host.
Enable for a single host
- Go to Settings > Monitoring > Monitored technologies.
- In the list of supported technologies, search for the Dynatrace OneAgent StatsD, Pipe, HTTP Metric API entry.
- Select Edit.
- Turn off Extension Execution Controller.
- From the navigation menu, select Hosts, and select your host.
- Open the browse menu (...) and select Settings.
- In the Monitored technologies table, search for the Extensions Execution Controller entry. You can sort by Type and look for the Infrastructure insights type. Select Edit and turn on Use host configuration and Enable on this host.
- Search for PIPE/HTTP. Select Edit and turn on Use host configuration and Enable on this host.
Communication port
The Telegraf Dynatrace Output Plugin sends metrics to the OneAgent metric API endpoint.
The default metric ingestion port is 14499
. If necessary, you can use oneagentctl command-line interface to check or change the port. Changing the metric ingestion port requires restart of OneAgent. Add --restart-service to the command to restart OneAgent automatically.
Check the ingestion port
Use the --get-extensions-ingest-port
parameter to show the current local ingestion port, 14499
by default.
- Linux:
./oneagentctl --get-extensions-ingest-port
- Windows:
.\oneagentctl.exe --get-extensions-ingest-port
Set a custom ingestion port
Use the --set-extensions-ingest-port=<arg>
parameter to set a custom local ingestion port.
- Linux:
./oneagentctl --set-extensions-ingest-port=14499 --restart-service
- Windows:
.\oneagentctl.exe --set-extensions-ingest-port=14499 --restart-service
If you change the default OneAgent communication port, make sure you also update the Telegraf configuration.
- Edit
telegraf.conf
, the Telegraf configuration file.
- Set the
url
property to url = "http://127.0.0.1:<your-custom-port>/metrics/ingest"
.
- Save the file.
Note that changing the port for Telegraf ingested metrics also affects OneAgent REST API and Scripting integration.
Topology awareness
When OneAgent and Telegraf are installed on the same host, the host ID and host name context are automatically added to each metric as dimensions. For more information, see Metric ingestion.
Provided data points must follow the Metrics ingestion protocol.