diff --git a/docs-en/08-third-party/01-grafana.md b/docs-en/08-third-party/01-grafana.md index f9a8e7c40d6db91ba35d10780380fd2388f758aa..1870bbdbb0cb4978182bbe7da1efd54b7089e3a2 100644 --- a/docs-en/08-third-party/01-grafana.md +++ b/docs-en/08-third-party/01-grafana.md @@ -1 +1,99 @@ -# Grafana \ No newline at end of file +--- +sidebar_label: Grafana +title: Grafana for TDengine Cloud +--- + +TDengine can be quickly integrated with the open-source data visualization system [Grafana](https://www.grafana.com/) to build a data monitoring and alerting system. The whole process does not require any code development. And you can visualize the contents of the data tables in TDengine on a dashboard. + +You can learn more about using the TDengine plugin on [GitHub](https://github.com/taosdata/grafanaplugin/blob/master/README.md). + +## Prerequisites + +In order for Grafana to add the TDengine data source successfully, the following preparations are required: + +1. The TDengine cluster is deployed and functioning properly +2. taosAdapter is installed and running properly. Please refer to the taosAdapter manual for details. + +## Installing Grafana + +TDengine currently supports Grafana versions 7.5 and above. Users can go to the Grafana official website to download the installation package and execute the installation according to the current operating system. The download address is as follows: . + +## Configuring Grafana + +Follow the installation steps in [Grafana](https://grafana.com/grafana/plugins/tdengine-datasource/?tab=installation) with the [``grafana-cli`` command-line tool](https://grafana.com/docs/grafana/latest/administration/cli/) for plugin installation. + +```bash +grafana-cli plugins install tdengine-datasource +# with sudo +sudo -u grafana grafana-cli plugins install tdengine-datasource +``` + +Alternatively, you can manually download the .zip file from [GitHub](https://github.com/taosdata/grafanaplugin/releases/tag/latest) or [Grafana](https://grafana.com/grafana/plugins/tdengine-datasource/?tab=installation) and unpack it into your grafana plugins directory. + +```bash +GF_VERSION=3.2.3 +# from GitHub +wget https://github.com/taosdata/grafanaplugin/releases/download/v$GF_VERSION/tdengine-datasource-$GF_VERSION.zip +# from Grafana +wget -O tdengine-datasource-$GF_VERSION.zip https://grafana.com/api/plugins/tdengine-datasource/versions/$GF_VERSION/download +``` + +Take CentOS 7.2 for example, extract the plugin package to /var/lib/grafana/plugins directory, and restart grafana. + +```bash +sudo unzip tdengine-datasource-$GF_VERSION.zip -d /var/lib/grafana/plugins/ +``` + +If Grafana is running in a Docker environment, the TDengine plugin can be automatically installed and set up using the following environment variable settings: + +```bash +GF_INSTALL_PLUGINS=tdengine-datasource +``` + +## Using Grafana + +### Configuring Data Sources + +Users can log in to the Grafana server (username/password: admin/admin) directly through the URL `http://localhost:3000` and add a datasource through `Configuration -> Data Sources` on the left side, as shown in the following figure. + +![TDengine Database TDinsight plugin add datasource 1](./grafana/add_datasource1.webp) + +Click `Add data source` to enter the Add data source page, and enter TDengine in the query box to add it, as shown in the following figure. + +![TDengine Database TDinsight plugin add datasource 2](./grafana/add_datasource2.webp) + +Enter the datasource configuration page, and follow the default prompts to modify the corresponding configuration. + +![TDengine Database TDinsight plugin add database 3](./grafana/add_datasource3.webp) + +- Host: The URL string the TDengine Cloud assigns for the registered user. +- User: leave it as default. +- Password: leave it as default. +- Cloud Token: The token string the TDengine Cloud assigns for the registered user. + +Click `Save & Test` to test. You should see a success message if the test worked. + +![TDengine Database TDinsight plugin add database 4](./grafana/add_datasource4.webp) + +### Create Dashboard + +Go back to the main interface to create a dashboard and click Add Query to enter the panel query page: + +![TDengine Database TDinsight plugin create dashboard 1](./grafana/create_dashboard1.webp) + +As shown above, select the `TDengine` data source in the `Query` and enter the corresponding SQL in the query box below for query. + +- INPUT SQL: enter the statement to be queried (the result set of the SQL statement should be two columns and multiple rows), for example: `select avg(mem_system) from log.dn where ts >= $from and ts < $to interval($interval)`, where, from, to and interval are built-in variables of the TDengine plugin, indicating the range and time interval of queries fetched from the Grafana plugin panel. In addition to the built-in variables, custom template variables are also supported. +- ALIAS BY: This allows you to set the current query alias. +- GENERATE SQL: Clicking this button will automatically replace the corresponding variables and generate the final executed statement. + +Follow the default prompt to query the average system memory usage for the specified interval on the server where the current TDengine deployment is located as follows. + +![TDengine Database TDinsight plugin create dashboard 2](./grafana/create_dashboard2.webp) + +> For more information on how to use Grafana to create the appropriate monitoring interface and for more details on using Grafana, refer to the official Grafana [documentation](https://grafana.com/docs/). + +### Importing the Dashboard + +In version 2.3.3.0 and above, you can import the TDinsight Dashboard (Grafana Dashboard ID: [15167](https://grafana.com/grafana/dashboards/15167)) as a monitoring visualization tool for TDengine clusters. You can find installation and usage instructions in the TDinsight User Manual (/reference/tdinsight/). + diff --git a/docs-en/08-third-party/grafana/add_datasource1.webp b/docs-en/08-third-party/grafana/add_datasource1.webp new file mode 100644 index 0000000000000000000000000000000000000000..211edc4457abd0db6b0ef64636d61d65b5f43db6 Binary files /dev/null and b/docs-en/08-third-party/grafana/add_datasource1.webp differ diff --git a/docs-en/08-third-party/grafana/add_datasource2.webp b/docs-en/08-third-party/grafana/add_datasource2.webp new file mode 100644 index 0000000000000000000000000000000000000000..8ab547231fee4d3b0874fcfe08c0ce152b0c53a1 Binary files /dev/null and b/docs-en/08-third-party/grafana/add_datasource2.webp differ diff --git a/docs-en/08-third-party/grafana/add_datasource3.webp b/docs-en/08-third-party/grafana/add_datasource3.webp new file mode 100644 index 0000000000000000000000000000000000000000..ae2e265044e61ff40ac42eabb64fc378c17b4a56 Binary files /dev/null and b/docs-en/08-third-party/grafana/add_datasource3.webp differ diff --git a/docs-en/08-third-party/grafana/add_datasource4.webp b/docs-en/08-third-party/grafana/add_datasource4.webp new file mode 100644 index 0000000000000000000000000000000000000000..b1e0fc6e2b27df4af1bb5ad92756bcb5d4fda63e Binary files /dev/null and b/docs-en/08-third-party/grafana/add_datasource4.webp differ diff --git a/docs-en/08-third-party/grafana/create_dashboard1.webp b/docs-en/08-third-party/grafana/create_dashboard1.webp new file mode 100644 index 0000000000000000000000000000000000000000..55eb388833e4df2a46f4d1cf6d346aa11429385d Binary files /dev/null and b/docs-en/08-third-party/grafana/create_dashboard1.webp differ diff --git a/docs-en/08-third-party/grafana/create_dashboard2.webp b/docs-en/08-third-party/grafana/create_dashboard2.webp new file mode 100644 index 0000000000000000000000000000000000000000..bb40e407187718c52e9f617d8ebd3d25fd14b56b Binary files /dev/null and b/docs-en/08-third-party/grafana/create_dashboard2.webp differ