01-telegraf.md 4.5 KB
Newer Older
D
dingbo 已提交
1 2
---
sidebar_label: TDengine + Telegraf + Grafana
3
title: Quickly Build IT DevOps Visualization System with TDengine + Telegraf + Grafana
D
dingbo 已提交
4 5
---

6
## Background
D
dingbo 已提交
7

8
TDengine is a big data platform designed and optimized for IoT (Internet of Things), Vehicle Telemetry, Industrial Internet, IT DevOps and other applications. Since it was open-sourced in July 2019, it has won the favor of a large number of time-series data developers with its innovative data modeling design, convenient installation, easy-to-use programming interface, and powerful data writing and query performance.
D
dingbo 已提交
9

10
IT DevOps metric data usually are time sensitive, for example:
D
dingbo 已提交
11

12 13
- System resource metrics: CPU, memory, IO, bandwidth, etc.
- Software system metrics: health status, number of connections, number of requests, number of timeouts, number of errors, response time, service type, and other business-related metrics.
D
dingbo 已提交
14

15
Current mainstream IT DevOps system usually include a data collection module, a data persistent module, and a visualization module; Telegraf and Grafana are one of the most popular data collection modules and visualization modules, respectively. The data persistence module is available in a wide range of options, with OpenTSDB or InfluxDB being the most popular. TDengine, as an emerging time-series big data platform, has the advantages of high performance, high reliability, easy management and easy maintenance.
D
dingbo 已提交
16

17
This article introduces how to quickly build a TDengine + Telegraf + Grafana based IT DevOps visualization system without writing even a single line of code and by simply modifying a few lines in configuration files. The architecture is as follows.
D
dingbo 已提交
18

D
dingbo 已提交
19
![TDengine Database IT-DevOps-Solutions-Telegraf](./IT-DevOps-Solutions-Telegraf.webp)
D
dingbo 已提交
20

21
## Installation steps
D
dingbo 已提交
22

23
### Installing Telegraf, Grafana and TDengine
D
dingbo 已提交
24

25
To install Telegraf, Grafana, and TDengine, please refer to the relevant official documentation.
D
dingbo 已提交
26 27 28

### Telegraf

29
Please refer to the [official documentation](https://portal.influxdata.com/downloads/).
D
dingbo 已提交
30 31 32

### Grafana

33
Please refer to the [official documentation](https://grafana.com/grafana/download).
D
dingbo 已提交
34 35 36

### TDengine

37
Download the latest TDengine-server 2.4.0.x or above from the [Downloads](http://taosdata.com/cn/all-downloads/) page on the TAOSData website and install it.
D
dingbo 已提交
38

39
## Data Connection Setup
D
dingbo 已提交
40

41
### Download TDengine plug-in to grafana plug-in directory
D
dingbo 已提交
42 43 44 45 46 47 48 49 50

```bash
1. wget -c https://github.com/taosdata/grafanaplugin/releases/download/v3.1.3/tdengine-datasource-3.1.3.zip
2. sudo unzip tdengine-datasource-3.1.3.zip -d /var/lib/grafana/plugins/
3. sudo chown grafana:grafana -R /var/lib/grafana/plugins/tdengine
4. echo -e "[plugins]\nallow_loading_unsigned_plugins = tdengine-datasource\n" | sudo tee -a /etc/grafana/grafana.ini
5. sudo systemctl restart grafana-server.service
```

51
### Modify /etc/telegraf/telegraf.conf
D
dingbo 已提交
52

53
For the configuration method, add the following text to `/etc/telegraf/telegraf.conf`, where `database name` should be the name where you want to store Telegraf data in TDengine, `TDengine server/cluster host`, `username` and `password` please fill in the actual TDengine values.
D
dingbo 已提交
54

55
```text
D
dingbo 已提交
56 57 58 59 60 61 62 63 64 65
[[outputs.http]]
  url = "http://<TDengine server/cluster host>:6041/influxdb/v1/write?db=<database name>"
  method = "POST"
  timeout = "5s"
  username = "<TDengine's username>"
  password = "<TDengine's password>"
  data_format = "influx"
  influx_max_line_bytes = 250
```

66
Then restart telegraf:
D
dingbo 已提交
67 68 69 70 71

```bash
sudo systemctl start telegraf
```

72
### Importing the Dashboard
D
dingbo 已提交
73

74 75
Log in to the Grafana interface using a web browser at `IP:3000`, with the system's initial username and password being `admin/admin`.
Click on the gear icon on the left and select `Plugins`, you should find the TDengine data source plugin icon.
D
dingbo 已提交
76
Click on the plus icon on the left and select `Import` to get the data from `https://github.com/taosdata/grafanaplugin/blob/master/examples/telegraf/grafana/dashboards/telegraf-dashboard-v0.1.0.json`, download the dashboard JSON file and import it. You will then see the dashboard in the following screen.
D
dingbo 已提交
77

D
dingbo 已提交
78
![TDengine Database IT-DevOps-Solutions-telegraf-dashboard](./IT-DevOps-Solutions-telegraf-dashboard.webp)
D
dingbo 已提交
79

80
## Wrap-up
D
dingbo 已提交
81

82
The above demonstrates how to quickly build a IT DevOps visualization system. Thanks to the new schemaless protocol parsing feature in TDengine version 2.4.0.0 and ability to integrate easily with a large software ecosystem, users can build an efficient and easy-to-use IT DevOps visualization system in just a few minutes.
83
Please refer to the official documentation and product implementation cases for other features.