当前位置:网站首页>《Kubernetes监控篇:Grafana通过自动化方式添加datasource和dashboard》
《Kubernetes监控篇:Grafana通过自动化方式添加datasource和dashboard》
2022-06-22 12:42:00 【东城绝神】
一、背景信息
由于业务性质原因,我们需要将业务系统部署在多个客户本地机房,由于客户没有一个统一的监控系统,所以我们需要在客户机房部署监控系统,主要监控主机、接口、端口等方面。
针对业务系统部署及维护场景,我们开发了运维工具,主要包括前期部署、后期维护两大核心要点,监控作为部署环节比较重要的一项指标,所以我们需要将这些监控模块融合到运维工具中,这里的监控系统组件包括:node-exporter+blackbox-exporter+alertmanager+prometheus+grafana。
grafana作为监控组件中比较重要的一个模块,要想实现自动化部署其实是很简单,除了部署完之后还有很多其它操作,比如添加数据源、导入监控模板,这些需要人工手动来操作。如果这些无法实现自动化的话,那么你这个运维工具就很难称得上是自动化工具。
这里就着重介绍一下如何通过自动化的方式来添加datasource和dashboard?
二、操作步骤
方法一:通过http api接口
1、创建API令牌
curl -X POST -H "Content-Type: application/json" -d '{"name":"apikeycurl", "role": "Admin"}' http://lolaage:[email protected]:3000/api/auth/keys
如下图所示:
说明:将此处返回的密钥保存在您的密码管理器中,因为将来无法再次获取它。
总结:整理不易,如果对你有帮助,可否点赞关注一下?
更多详细内容请参考:Ansible自动化运维实战
边栏推荐
- Interpretation of the paper -- scalable collaborative filtering with jointly derived neighborhood interpolation weights
- Rigid demand of robot direction → personal thinking ←
- Istio服务网格中的流量复制
- leetcode-子序列/子串问题
- Run sqoop1.4.5 to report warning: does not exist! HCatalog jobs will fail.
- leetcode-背包问题
- Summary of patent blog writing
- JSP based library management system, including source code, database script, video tutorial for project operation, and video tutorial for thesis writing
- leetcode每日一题202110
- leetcode 32. Longest valid bracket
猜你喜欢
随机推荐
190. Reverse Bits
[Nacos cloud native] the first step of reading the source code is to start Nacos locally
Record of problems encountered in dual network card binding
HW is around the corner. Can't you read the danger message?
Detailed explanation of rules and ideas for advance sale of deposit
What you must understand before you are 30
934. Shortest Bridge
简简单单的科研秘籍
Instanceinforeplicator class of Eureka (service registration auxiliary class)
47. Permutations II
MySQL中的视图
Microservice test efficiency governance
Processing statement on price selection of several manufacturers
Stored procedures in MySQL
30岁之前一定要明白的道理
leetcode-区间dp
聊一聊数据库的行存与列存
Oracle's skills in dealing with inserting duplicate records
12306 ticket grabbing tutorial
Mysql中的锁



![[Nacos cloud native] the first step of reading the source code is to start Nacos locally](/img/f8/d9b848593cf7380a6c99ee0a8158f8.png)





