Collect Redis monitoring data by using Telegraf and Logtail, upload the data to a Metricstore, and build a visual monitoring solution for Redis in Simple Log Service.
Prerequisites
-
The server where Telegraf is installed can connect to the Redis server over an internal network.
-
You have created a project and a Metricstore. For more information, see Manage projects and Create a Metricstore.
Limits
Only Logtail for Linux 0.16.48 or later can collect Redis monitoring data. If an earlier version of Logtail is installed on your server, you must upgrade it. For more information, see Install Logtail on a Linux server.
Procedure
Log on to the Simple Log Service console.
-
In the Import Data section, on the Monitoring Data tab, select Redis Monitoring.
-
Select the target Project and MetricStore, and click Next. In the Select Log Space step, select an existing Project and MetricStore, or click Create Now on the right to create new ones, and then click Next.
-
On the Create Machine Group tab:
-
If you have an available machine group, click Use Existing Machine Groups. Select Host scenario and ECS. From the source machine group list, select the target machine group and click > to move it to the applied machine group list. Then, click Next.
-
If no machine groups are available, perform the following steps to create a machine group. In this example, an Elastic Compute Service (ECS) instance is used.
-
On the ECS Instance tab, in the Manually select instances section, select the target ECS instance and click Create.
For more information, see Install Logtail on ECS instances.
ImportantIf you want to collect logs from an ECS instance that belongs to a different Alibaba Cloud account than Simple Log Service, a server in a data center, or a server of a third-party cloud service provider, you must manually install Logtail. For more information, see Install Logtail on a Linux server. After you manually install Logtail, you must configure a user identifier for the server. For more information, see Configure a user identifier.
-
After the installation is complete, click Complete Installation.
-
On the Create Machine Group page, enter a Name and click Next.
In Simple Log Service, you can create IP address-based machine groups and custom identifier-based machine groups. For more information, see Create a machine group.
-
-
-
Confirm that the machine group is displayed in the Applied Server Groups section and click Next.
ImportantIf you apply a machine group immediately after you create the machine group, the heartbeat status of the machine group may be FAIL. This issue occurs because the machine group is not connected to Simple Log Service. To resolve this issue, you can click Automatic Retry. If the issue persists, see What do I do if no heartbeat connections are detected on Logtail?
-
On the Data Source Settings tab, configure the following parameters.
Parameter
Description
Configuration Name
Enter a custom name for the Logtail collection configuration.
Cluster Name
Enter a custom name for the Redis cluster.
After you set this parameter, Simple Log Service adds the cluster=cluster name tag to the Redis monitoring data collected by this Logtail configuration.
ImportantEnsure that the cluster name is unique to avoid data conflicts.
Servers
The connection details for the Redis database. Configure the following parameters:
-
Address: The address of the Redis database. You can use an IP address, a hostname, or a domain name.
-
Port: The port number of the Redis database. The default value is 6379.
You can add multiple Redis databases.
Password
If authentication is enabled for the target Redis database, you must enter the database password.
Custom Tag
Add custom tags to the collected Redis metrics. A custom tag is a key-value pair.
After you set this parameter, Simple Log Service adds tags to the Redis monitoring data that is collected by using the Logtail configuration.
Custom Telegraf Configurations
Simple Log Service uses Telegraf, an open-source metric collection agent, to collect Redis metrics. If the default parameters do not meet your requirements, you can use the Custom Telegraf Configurations feature for advanced settings. For configuration examples, see Configuration.
For a list of supported metrics, see Metrics.
-
FAQ
How can I check whether Telegraf collects data as expected?
You can check the logs of the /etc/ilogtail/telegraf/telegraf.log file on your server. You can also collect this log file to Log Service and search for the required information.
What to do next
-
Query and analyze data
After the configuration is complete, Telegraf uploads the collected monitoring data through Logtail to the specified Metricstore. You can then query and analyze the metric data. For more information, see Query and analyze metric data.
-
Visualization
After the configuration is complete, Simple Log Service automatically creates a dashboard named Redis Monitoring_<Cluster Name> in the project. You can use the dashboard to view monitoring data and configure alerts.