본문 바로가기
Programming/Etc

Grafana API - export grafana dashboard to PNG

by guru_k 2019. 6. 26.
728x90
반응형

1. Create API Key

Click Configuration > API Keys

Click +New API Key

Add API Key name

Click Add 

You can see the API Key and http call.

2. Get Url

Click on the name of graph  > share

Copy the url of "Direct link rendered image".

ex) http://localhost:3000/render/d-solo/000000005/monitor?refresh=5s&orgId=1&panelId=1&from=1561524840788&to=1561526640788&width=1000&height=500

3. Excute export command

Execute the command with the API Key you got when you created the API Keys.

curl -s -k -H "Authorization: Bearer <API Key>" "http://localhost:3000/render/d-solo/000000005/monitor?refresh=5s&orgId=1&panelId=1&from=1561524840788&to=1561526640788&width=1000&height=500" > dashboard.png
 

 

728x90
반응형

댓글