当前位置:网站首页>Kubernetes monitoring: grafana adds datasource and dashboard through automation

Kubernetes monitoring: grafana adds datasource and dashboard through automation

2022-06-22 13:49:00 Dongcheng jueshen



Recommended sites :Ansible Official website


One 、 Background information

Due to the nature of the business , We need to deploy the business system in the local computer rooms of multiple customers , Because the customer does not have a unified monitoring system , So we need to deploy the monitoring system in the customer's computer room , The main monitoring host 、 Interface 、 Ports, etc .

For business system deployment and maintenance scenarios , We have developed operation and maintenance tools , It mainly includes early deployment 、 Two key points of post maintenance , Monitoring is an important indicator of deployment , So we need to integrate these monitoring modules into the operation and maintenance tools , The monitoring system components here include :node-exporter+blackbox-exporter+alertmanager+prometheus+grafana.

grafana As an important module in the monitoring component , Automated deployment is simple , There are many other operations besides deployment , For example, add a data source 、 Import monitoring template , These need to be operated manually . If these cannot be automated , Then your operation and maintenance tool can hardly be called an automation tool .

Here we will focus on how to add... In an automated way datasource and dashboard?


Two 、 Operation steps

Method 1 : adopt http api Interface

Grafana http_api

1、 establish API token

curl -X POST -H "Content-Type: application/json" -d '{"name":"apikeycurl", "role": "Admin"}' http://lolaage:[email protected]:3000/api/auth/keys

As shown in the figure below :
 Insert picture description here
explain : Save the key returned here in your password manager , Because you can't get it again in the future .


summary : Sorting is not easy to , If it helps you , Can you like it and pay attention to ?

For more details, please refer to :Ansible Automation operation and maintenance practice

原网站

版权声明
本文为[Dongcheng jueshen]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221242120864.html