Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set data frame name in triggers query mode #1441

Closed
daniloaacb opened this issue May 2, 2022 · 6 comments
Closed

Set data frame name in triggers query mode #1441

daniloaacb opened this issue May 2, 2022 · 6 comments

Comments

@daniloaacb
Copy link

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.

@alexanderzobnin
Copy link
Collaborator

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

@daniloaacb
Copy link
Author

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

@alexanderzobnin
Copy link
Collaborator

Ok, got it!

@daniloaacb
Copy link
Author

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

@alexanderzobnin
Copy link
Collaborator

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 added a commit that referenced this issue Jan 20, 2023
* Problems count mode

* Use tooltip from grafana ui

* Add editors for new modes

* Fix macro mode

* Fix bugs

* Unify editors to use one Triggers editor for all count queries

* Use time range toggle for triggers query, #918

* Add item tags suport for triggers count mode

* Fix triggers count by items

* Use data frames for triggers data, #1441

* Return empty result if no items found

* Add migration for problems count mode

* bump version to 4.3.0-pre

* Add zip task to makefile

* Add schema to query model

* Minor refactor

* Refactor: move components to separate files

* Minor refactor

* Support url in event tags

* Add tooltip with link url

* Update grafana packages

* Fix adding new problems panel

* ProblemDetails: rewrite as a functional component

* minor refactor
@alexanderzobnin
Copy link
Collaborator

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

@alexanderzobnin alexanderzobnin changed the title Return change in query name in "TRIGGERS" mode Set data frame name in triggers query mode Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants