I would like to create a dynamic dashboard of my cluster nodes. this dashboard will be composed of multiple single state panels. each one shows the status and name of a node
So this what I have done:
create a template variable list_of_vm = label_values(up{job="node_exporter"},instance) by checking multi-value combo
the result of this is something like ip1:port, ip2:port, ... , ip7:port
create un single state panel with repeat panel set to list_of_vm. And in metrics I set up{instance="$list_of_vm",job="node_exporter"}
After checking all instances in the template variable, the panels are correctly duplicated, but their value is wrong because in metric the query is evaluated as : up{instance="$list_of_vm",job="node_exporter"}
when list_of_vm = "ip1:port+ip2:port+..+ip7:port"
And I am expecting to have ip1:port for the first panel, ip2:port for the second one...
Do you have any idea to fix this problem
Related
I'm using Grafana with Prometheus as a Datasource.
I'm trying to create a variable with a filtered list of servers and I want to use this list to fix list of servers to display in my Dashboard.
My variable, named servers_front, is a query (label_values(info_fqdn)) with a regex to choose my servers /.*_front/
I want to use this full list of servers by default without displaying a combobox to choose which one I want to display.
Another requirement : If a new server that matches /.*_front/ is created, I want the list is automatically updated
Edit the variable
Variables > Edit > Selection Options >enable Include All option >Custom all value>.*
When saving dashboard you have an option to "save current variables", which means that currently selected value will be stored as a default when dashboard is loaded.
So if you have a templating variable with enabled "All" option you can save your dashboard ensuring "All" is selected (with option mentioned above enabled) and it should work.
Note that what is stored in dashboard is real "all" option and not an expanded list of all currently present values, so it should be dynamically expanded.
If you want that variable hidden then either you can hide the variable and save again after changing and saving its value or (if you have variable hidden from the start you can open url for dashboard with "&var-servers_front=All" appended (which will force variable to have "All" value and save dashboard with "save current variables".
I'm currently building a component that has TouchUI configuration properties separated with three tabs (Standard, CASL, GDPR). Each tab has the same set of options available and my current config names are similar to the following:
./standardMarketingText
./standardThirdpartyText
./gdprMarketingText
./gdprThirdpartyText
./caslMarketingText
./caslThirdpartyText
(There are several other options for standard,gdpr,casl but I left them out for brevity)
While this works, I'm hoping to instead store the values in the JCR as a JSON node per category. For example:
casl = {"marketingText"="m test", "thirdpartyText"="tp test"}
gdpr = {"marketingText"="gdpr m test", "thirdpartyText"="gdpr tp test"}
This way I can load all "casl" (or others) options at once when I need them (there isn't a case where I would only load one "casl" option)
I have attempted using granite/ui/components/foundation/form/multifield however, it asks to "Add field". I only want one set of each, and not provide the ability to add another set of properties under each tab. Is there a way to accomplish this without overriding the multifield resourceType?
There are multiple ways to achieve what you are looking at, I would look at the reusability as there are similar named properties for different categories (in your case tabs). To group them you could do that at node level by correctly defining the name property for each tab.
For above provided values, you could do something like -
./standard/marketingText
./standard/thirdpartyText
./gdpr/marketingText
./gdpr/thirdpartyText
./casl/marketingText
./casl/thirdpartyText
Your each tab stores the properties in named node (standard, gdpr, casl). In addition you could have a single SlingModel/WCMUsePojo that can adapt to these nodes to provide the Pojo with accessor to property values.
As far as getting JSON is concerned, your SlingModel or WCMUsePojo can provide a method to return JSON based string for the values.
I want to hide some panel by specific condition in graphana.
For instance, I have some variable in my dashboard and I want to change visibility of some graph if my variable is equal to some specific value.
Is there any way to do this?
UPD: Using repeat panel option is not solution in my case, because this option just dynamically creates new panels. But I want to hide some panel by specific value of my variable, if variable is not equal to this value then the panel should not be hidden.
I dont see an option to hide/show a panel with template variable, but instead you can create two dashboards and use dashboard links.
For example:
First Dashboard (Type A)
Second Dashboard (Type B)
Create a Dashboard link "Type B" in First Dashboard pointing to second Dashboard.
Similarly Create a Dashboard link "Type A" in Second Dashboard and point it to First dashboard.
Settings -> Link -> New Link -> Choose "Include time range" & "Include template variable value"
I have actually used this option because mine was just two variables so it was duplicating the dashboard to two and linking eachother.
If it is multiple values to show/hide, i recommend to achieve it via repeat options some how linking that variable in your query.
I am trying to make a detailed dashboard in grafana that opens on click. I do it by passing a variable to the dashboard debending on the clicked facility. When the dashboard opens it needs to display value using the passed url variable inst. I just cannot seem to get it working. Here is an example of my dashboard link.
How can i use the variable inst?
I will add gogibogi4's correct answer. The Grafana documentation is lacking on this.
In your drill-down dashboard, add a constant variable. To be retrieved in Grafana, you need the prefix var- then the name of the variable in the query string. Let's assume the variable is "region." The URL coming into the drilldown dashboard should look similar to the following:
/drilldowndashboard/?var-region=NorthWest
Drilldown Dashboard Settings:
In the drilldown dashboard settings, create a variable. The Name in this example is "region" Make the type Constant. Under Hide, you can just leave that unselected. Under Constant options, you can write the word "blank" The preview of values will just show the word "blank" but go ahead and save it as it will be replaced in the query.
Query:
You can refer to the variable using [[region]] in your data query.
Parent Dashboard:
The parent dashboard merely needs to refer to the drilldown dashboard with var-region as a query parameter.
I figured out the solution on my own. The variable that i wanted to pass was var-inst, the trick to use it is to create a custom template variable named inst and give it a dummy value. After that is done i can use the passed value by using $inst. Note that in order for the variable to be passed i had to go back to my primary dashboard and then i had to click my link again. After that the value got passed and is working perfectly.
just referred above answer by gogibogi4 and it worked for me but when I tried to see variable information then I saw I have selected constant as a type but automatically it got converted into datasource and type is selected grafana. when I try to select them manually it didn't worked. this is some kind of bug of grafana I guess.
I am building Grafana (4.1.1) graphs with a Prometheus (1.1.2) backend, and am trying to use Templates to select/deselect certain sub-sets of metrics on a dashboard. I have a template variable called "$POP" which describes my city locations, and a template variable called "$Resolver" which describes the type of resolver I am using ("unbound" or "pdns" are the possible string results.)
I have these two metrics like this that work quite well currently selecting on the various values in $POP:
irate(dnsdist_recursor_main_servers_unbound_drops{env="prod",loc=~"$POP"}[1m]) > 0
irate(dnsdist_recursor_main_servers_pdns_drops{env="prod",loc=~"$POP"}[1m]) > 0
Putting aside for the moment that instead of labels the selection criteria are embedded in the metric name (I know it's not ideal but this is just an example of larger problem sets so please do not suggest how I can use labels) I would like the following results:
When (~"$Resolver" == "unbound") I would like to show the first metric (dnsdist_recursor_main_servers_unbound_drops) and when (~"$Resolver" == "pdns") I would like to show the second one (dnsdist_recursor_main_servers_pdns_drops) and when both are selected I'd like to show both metric set data. Basically, I hope to have an on/off visibility trigger for a metric that is keyed to my $Resolver template value.
How do I create a boolean such that the metric is shown or not shown based on the setting of the string value in the templated setting of $Resolver? The trick here is that the selection criteria is in the metric name, not a label, which is really stumping me. I tried "bool" modifiers but was never able to get anything to work on string equality tests. I'm sure it's just a syntax issue but examples are thin on the ground.
What you can take advantage of here is that there's no uniqueness restriction on label selectors, so you can do {resolver="$resolver",resolver="unbound"}