1. Write Dockerfile
FROM ubuntu
RUN apt-get update \
&& apt-get install -y wget sudo \
&& apt-get install --reinstall systemd --assume-yes \
&& apt-get install -y adduser libfontconfig1 --assume-yes \
&& wget https://dl.grafana.com/enterprise/release/grafana-enterprise_9.2.1_amd64.deb \
&& dpkg -i grafana-enterprise_9.2.1_amd64.deb \
# && /bin/systemctl daemon-reload \
# && /bin/systemctl enable grafana-server \
# && /bin/systemctl enable grafana-server \
&& grafana-cli plugins install tencentcloud-monitor-app \
&& service start grafana-server \
&& rm -f grafana-enterprise_9.2.1_amd64.deb
2. Package image
sudo docker build -t grafana_tencent_monitor:v1 .
3. Deploy the container
sudo docker run -itd -p 33000:3000 grafana_tencent_monitor:v1 /bin/bash
4. Visit http://ip:33000 to add Tencent Cloud data source. Hover the gear icon on the left navigation bar with the mouse , Plugins
and click Options to enter the Plugins management page. If Tencent Cloud Monitor
the App plugin is normally displayed in the plugin list, it means that the plugin is installed successfully.
Click Enable
the button, and after the activation is successful, you can use the Tencent Cloud monitoring application plug-in in Grafana.
Hover the gear icon on the left navigation bar with the mouse , and click the Data Sources option to enter the data source management page;
Name
The data source name, which can be any name, defaults toTencent Cloud Monitoring
;SecretId
andSecretKey
are the security certificate information necessary to call CloudMonitor API, which can be obtained through the cloud API key page of Tencent Cloud console ;- Select the cloud product that needs to obtain monitoring data;
- Click Save & Test to test whether the configuration information of the data source is correct. After the configuration is successful, the data source can be used in the Dashboard.
final effect: