grafana-zabbix icon indicating copy to clipboard operation
grafana-zabbix copied to clipboard

Return change in query name in "TRIGGERS" mode

Open daniloaacb opened this issue 2 years ago • 4 comments

You could somehow change the json response structure for Grafana in “TRIGGERS” mode. If possible, match the structure mode that is returned in the “Metrics” query model In the example below I create 2 queries, for demonstration purposes: As you can see, in “Metrics” mode, 1 “OBJECT” and 3 “Fields” are returned, 1 being time and 2 from the respective queries

image

The return of the 3 columns, both of which can think about using the “time” masses, then turning to the transformation of GRAFANA into objects. And the query name is established by the host and item name.

image

image

image

The “TRIGGERS” query mode already returns 2 objects and 2 fields each query. Since the name returned is “triggers count” for both queries, making it impossible for me to disassociate the two in a specific view panel.

image

I ask first for the possibility of being able to set the query return name in “triggers” mode as “$hostname_application”, and if possible change the structure as it is in “METRICS” mode.

daniloaacb avatar May 02 '22 11:05 daniloaacb

Hi! Could you describe your use case? I consider triggers mode as legacy and going to completely switch to the Problems mode.

alexanderzobnin avatar May 06 '22 09:05 alexanderzobnin

So, I'm using your plugin together with the "FLOWCHARTING" visualization plugin, and within this there is the option to map this query in a graph, but I am unable to do more than one mapping because the queries use the same title name, with no possibility of differentiation.

Example: In the "METRICS" query mode I can use the queries normally after setting only one transformation(multi-frame-time-series), which basically transforms 3 "FIEDS" (time, and the two queries) into two "OBJECT" (each object with time and a query) and turns one table into two.

image

image

Unlike the "TRIGGERS" query mode option that generates the same names, making it impossible to use the plugin. since I need to differentiate each count query, as the idea is that each one has its mapping

image

daniloaacb avatar May 06 '22 11:05 daniloaacb

Ok, got it!

alexanderzobnin avatar May 11 '22 07:05 alexanderzobnin

It would be interesting if the return had the same structure as the "METRICS" mode, in this case "$host : $application "

daniloaacb avatar May 11 '22 12:05 daniloaacb

I'm not sure how exactly flowcharting plugin handles data frames, but I anyway want to refactor all returning data to data frames since it's a new standard in Grafana. Hopefully it will work.

alexanderzobnin avatar Dec 16 '22 11:12 alexanderzobnin

I added simple "Count <refId>" name, that should be enough.

alexanderzobnin avatar Mar 21 '23 11:03 alexanderzobnin