grafana api创建dashboard 记录

文章目录


json model导入

直接在ui通过json model 导入,开发自己用还好,但对非开发人员不太友好,故考虑通过api后台自动创建

api doc : https://grafana.com/docs/grafana/v9.3/developers/http_api/dashboard/

申请api key

复制代码
$ curl -X POST -H "Content-Type: application/json" -d '{"name":"apikeycurl", "role": "Admin"}' http://admin:admin@127.0.0.1/api/auth/keys
{"name":"apikeycurl","key":"eyJrIjoiSUt3WUpaMlRRSnM3ZW1xM3hDbFFKbjM5WVBJRkdtYW8iLCJuIjoiYXBpa2V5Y3VybCIsImlkIjoxfQ=="}

创建dashboard

复制代码
curl -H "Content-Type: application/json" -X POST -d @/usr/local/dashboards/dashboard1.json \
"http://admin:admin@127.0.0.1/api/dashboards/db"

删除dashboard

复制代码
DELETE /api/dashboards/uid/cIBgcSjkk HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

一个质量监控就搭好了 .

相关推荐
Elastic 中国社区官方博客11 小时前
使用 Observability Migration Platform 将 Datadog 和 Grafana 的仪表板与告警迁移到 Kibana
大数据·elasticsearch·搜索引擎·信息可视化·全文检索·grafana·datalog
sitellla11 小时前
Grafana Loki 入门:高效日志聚合系统
其他·grafana
日取其半万世不竭16 小时前
用 Netdata 实时监控服务器,比 Prometheus + Grafana 轻量得多
linux·服务器·网络·系统架构·负载均衡·zabbix·grafana
梵得儿SHI3 天前
(第二篇)Spring AI 架构设计与优化:可观察性体系,打造全链路可视化的 AI 运维方案
人工智能·微服务·grafana·prometheus·监控·可观察性·spring ai
何中应4 天前
Grafana如何给列表设置别名
运维·grafana·监控
xmlhcxr7 天前
基于 HAProxy+Keepalived 构建高可用 ZrLog 博客系统及监控平台实现(Prometheus + Grafana)
架构·grafana·prometheus
川石课堂软件测试7 天前
软件测试:典型面试题库
数据库·python·功能测试·mysql·单元测试·grafana·prometheus
杜子不疼.9 天前
无需公网 IP!Grafana+内网穿透轻松实现数据看板远程访问
网络协议·tcp/ip·grafana
川石课堂软件测试13 天前
requests接口自动化测试
数据库·python·功能测试·测试工具·单元测试·grafana·prometheus
自不量力的A同学13 天前
Grafana 13.0.1 发布
grafana