Application to servers mapping

Hi Team,

I have around 20 servers and they all belong to 10 applications so each application 2 servers.
I wanted to add a filter on the dashboard which populates the application name. So, when I choose the application, it should populate the metrics for 2 servers which are part of that application.

I am find to maintain that static mapping as its a limited list.

Can someone please shed some light on how to create this mapping and pass the value to query of the panel.

In the current set-up I have hostname as a filter so the server metrics are populated for each host upon selection.


Do you need something like shown here?

server variable is populated based on the value of app variable there

thank you foe the replay. I have seen that. It looks like it uses graphite datasource. But I really don’t want to set-up another data source just for the purpose of this static data mapping.

If I want to represent my data mapping, please see below in JSON format

“applications”: [
“name”: “APP_1”,
“servers”: [“dsyn2app01w”, “dsyn2db01w”,“dsyn2app01u”]
“name”: “APP_2”,
“servers”: [“dsyn2app02w”, “dsyn2db02w”,“dsyn2app02u”]

If you see I have 2 applications APP_1, APP_2 which I want them to show on dashboard UI for selection.
Each APP have its underlying servers mapped. So if I choose APP_1 I want to the panel query to display the server metrics for each server as per mapping.


Where do you get your data from? May be your datasource supports regular expressions?

You may try to declare your variables like this:

Or you want user to be able to filter by particular server when application is selected? What is your datasource?


One possible option is to use Infinity plugin for that:

| scope "applications"
| where "name" in ('${Application:text}')
| mv-expand "server"="servers"
| project "server"="server"

1 Like

thank you @ebabeshko for the response. Let me share the bit more background on this.

I get the server metrics for many servers via Telegraf into InfluxDB which I can show on the Grafana dashboard multiple panels like CPU, RAM , Disk usage … etc .

  • So I can have one variable defined to get list of the servers from Influxdb as a data source.
  • On the dashboard I will have this displayed for the user to select server and then shown the panels for metrics for the selected server. (selected server will be passed into Panel query which also extracts metrics from InfluxDB)

But what I am trying is to build a customised dashboard for a set of applications to show the metrics for the servers belongs to those applications.

In this use-case, my servers and apps list is fixed like I have shown in json representation in my previous message. (Example: APP_1 : server01, server02, server03 APP_2 : server04, server05, server,06 APP_3: server07, server08, server09)

The above mapping of applications to the servers is fixed which I am looking an easy way to maintain as a variable.

So I wanted to show only the APP names on the dashboard UI. If I choose the APP name I wanted the all the 3 servers metrics to be displayed as panels

Example: Select APP_1 on the UI, then it should display RAM, CPU, DISK metric panels for all the three servers server01, server02, server03 which belong to the APP_1

If I choose multiple applications, then the Dashboard should be grouped per application and inside the row all those respective servers metrics to be displayed.

Thank you again.


ok, but rather solutions above don’t fit your tasks?

I will give a try and let you know. thank you for your help.

thanks @ebabeshko it worked with the infinity plugin with json data.

MILES_ENV is my app name where I have two values as shows below. If I select AUTST, I get servers as per mapping in json.

But Some have If I select both the applications, the SERVER is getting blank, not sure what I am missing here.

In the single selection of APP name, all my panels getting loaded for each server properly. I have added a repeat to each panel type based on SERVER variable. Also I have added row to these group of panels which I wanted to repeat per application.

If I choose both the apps, the whole dashboard is not rendering properly… Row is getting repeated per application, but the metrics are some have messed-up. All the the servers metrics are combined.

What I am expecting is Row per application to be repeated and the panels in that row should only show the metrics for the servers belongs to that application. (they way they are loading when I choose single application.)

Please let me know if you have any clue on this any direction to tacle this ?

Thanks for all the help.


hi @ebabeshko hope you are doing well. just checking if you got an opportunity to look into my question in the post.

thank you again.

hi @dumpalap , look into changing JSON parsing/filtering approach from example into one that meets your needs. May be using jsonata would fit better.

Check documentation: