All Products
Search
Document Center

Lindorm:Use Telegraf to write data to LindormTSDB

Last Updated:Jul 12, 2024

Telegraf is an open source agent that is used to collect and monitor data. You can use the plug-ins provided by Telegraf to build services and collect metrics from different third-party components. You can connect Telegraf to LindormTSDB and use the InfluxDB plug-in provided by Telegraf to report data to LindormTSDB. This topic describes how to use Telegraf to report data to LindormTSDB.

Prerequisites

Install Telegraf

Install Telegraf by using a method that is suitable to your operating system. For more information about how to select a suitable installation method, see Telegraf documentation.

Connect Telegraf to LindormTSDB

Modify the content in the OUTPUT PLUGINS section of the telegraf.conf configuration file.

Enable the outputs.influxdb plug-in by removing the comment signs (#) and specify the information used to connect to LindormTSDB in the configurations of the plug-in. The following example shows how to configure connection information in the configuration file:

[[outputs.influxdb]]
......
#   ## Multiple URLs can be specified for a single cluster, only ONE of the
#   ## urls will be written to each interval.
urls = ["http://ld-bp1jyu376daqi****-proxy-tsdb-pub.lindorm.aliyuncs.com:8242"]
......
database = "default"
...... 
## HTTP Basic Auth
username = "test"
password = "test"

Parameters

Parameter

Description

urls

The Internet LindormTSDB endpoint for HTTP. For more information about how to obtain the endpoint, see View endpoints.

database

The name of the database that you want to connect.

username

The username and password that are used to connect to LindormTSDB.

Note

If the user authentication and permission verification feature is not enabled for the Lindorm instance, you do not need to specify the username and password parameters. For more information, see Enable the user authentication and permission verification feature.

password

For more information about other configuration items, see Telegraf documentation.

Report data to LindormTSDB

Start the Telegraf service. The following command shows how to start Telegraf in Linux:

sudo systemctl start telegraf

After Telegraf is started, it automatically reports data written by using the InfluxDB line protocol to LindormTSDB. For more information about the InfluxDB line protocol, see Write data by using the InfluxDB line protocol.

Monitor data

You can view the data written to LindormTSDB in the CloudMonitor console.

  1. Log on to the Lindorm console. In the upper-left corner of the page, select the region where the instance is deployed. On the Instances page, click the ID of the instance that you want to manage or click Manage in the Actions column corresponding to the instance.

  2. In the left-side navigation pane, click Instance Monitoring.

  3. On the page that appears, click CloudMonitor.image

  4. On the CloudMonitor page, view the metrics related to LindormTSDB.image