grafana / grafana-polystat-panel

D3-Based hexagon layout multi-stat panel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is does a JSON data shape look like to create a polystat panel from a rest api?

amalik15 opened this issue · comments

I am new to grafana and the grafana-polystat-panel. It does look interesting and fits my needs, but I am a bit unclear on how to utilize the tool and would appreciate any insight. My main goal is to try to have the panel as much data driven as possible, I would like to potentially try to avoid creating custom composites for every single hex in the honeycomb.

My main question is what does the data shape need to to be if I am using a rest API as my data source?

The look I am trying to achieve is for it to be similar to the screen shots in the documentation:
polystat-v2-agent-all-visible

I want to display the health stat of multiple applications. Each hexagon should have the name of the app as the title and some kind of stat or message underneath much like the display. Currently I am only able to achieve displaying the hex with the name.

Currently on Grafana, I am using JSON API as the source and return this data shape from my API request:
{
"app1": 0,
"app2": 0,
"app3": 1
}

I then extract the data with the following config:
Screenshot 2023-10-08 at 12 28 18 PM
Screenshot 2023-10-08 at 12 28 35 PM

This gives me this result:
Screenshot 2023-10-08 at 12 31 03 PM

This is very close to the desired appearance, but I want to add a sub stat much like the what is displayed in in the screenshots in the documentation. I have experimented with different configurations and data shapes, but I haven't achieved the desired result. It would also be great if it's also possible to have a data driven tool tip to populate different stats or messages for each hex.

I would greatly appreciate any guidance.