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

一个质量监控就搭好了 .

相关推荐
奔跑中的小象4 天前
UOS V2500 沐曦mx-exporter监控加速卡(非K8S)
grafana·prometheus·uos·vllm·沐曦
Wang's Blog5 天前
Go-Zero 项目开发45: Prometheus + Grafana 安装部署与服务监控实战
golang·grafana·prometheus
行者-全栈开发10 天前
TIG 监控体系搭建:Telegraf + InfluxDB + Grafana 全链路实战
grafana·influxdb·服务器监控·tig·docker部署·监控系统·telegraf
Elastic 中国社区官方博客11 天前
将你的 Grafana Kubernetes 仪表板迁移到 Elastic Observability:相同的 PromQL,30 倍更快的查询
大数据·人工智能·elasticsearch·搜索引擎·容器·kubernetes·grafana
做个文艺程序员13 天前
Linux第24篇:Java应用监控体系搭建:Prometheus+Grafana可视化运维
java·grafana·prometheus
取谖慕12.14 天前
Prometheus+Alertmanager+node_exporter+grafana高可用
linux·运维·grafana·prometheus
爱莉希雅&&&15 天前
Prometheus高可用(alertmanager+node_exporter+grafana)
运维·服务器·grafana·prometheus
行者-全栈开发16 天前
【码动四季】Spring Boot 可观测性体系:Micrometer + OpenTelemetry + Grafana 全链路搭建
grafana·opentelemetry·micrometer·全链路追踪·分布式追踪·atomcode·spring boot可观测性
todoitbo17 天前
让数据看板随时可见:Grafana + cpolar 远程访问实战
ui·网络安全·grafana·数据看板·远程访问
维C°19 天前
Grafana实例-Gauge仪表盘面板
grafana