Use several tables from the same query in State Timeline panel

Could you expound? there should 0 difference in behavior

With the JSON query and ‘api-key’, ‘logs’, and ‘search’ as params (, I get the answer I want with search and logs params applied.

With UQL-type query and the exact same parameters, api-key is still accepted but ‘search’ and ‘logs’ don’t work.

for both :

it is url parameters as you can see all of it is stuffed in the url itself with

api.com//blah&search=union&api=wjw93495893485

I’m sorry, i don’t get it. How would that create a difference between JSON query and UQL query?

In both case parameters are added to the url.

this works :

this doesn’t even compute the api_key :

the only difference I see is the presence of -H ‘Content-Type: application/json’

I dont get it

Which one is which? you have pasted 2 images but cant be sure which one is json and which one is UQL. Also please share the config you used?

first one is json, second one is UQL.

which config?

grafana.ini?

The infinity configuration. :face_with_monocle: where are you setting the values api_key, logs and search?

Allright!
I finally have an answer to the UQL query.
I added the ‘Content-Type: application/json’ manualy in the headers and it finaly gave me the answer I wanted!

1 Like

so you must be using query parameters. because this is what the docu says

Headers in the URL
You can configure the headers required for the URL in the datasource config and also in the query headers. By default infinity datasource automatically sets two headers. Header User-Agent : Grafana will be set for all requests and Content-Type : application/json. You can override these headers in the datasource configuration page.

This is what I get when using URL parameter

###############

Curl Command

###############

curl -X ‘GET’ -H ‘Content-Type: application/json’ ‘https://jsonplaceholder.typicode.com/users?api_key=xxxxxxxx&logs=xxxxxxxx&search=xxxxxxxx

If you use this then you will have to manually provide ‘Content-Type: application/json’

2 Likes

You really helped me out, I am extremenly gratefull.

but for some reason, the panel still says ‘no data’!

Do you know why?

I think the object returned is no longer the same so the UQL might not be working. save and close. go to another dashboard refresh and go back to this dashboard.

@yosiasz was right. You need to set the api key as url param in config. Delete the api key in the query body. That should work. Your last screenshot says you are still using it as body.

Hi!
Thanks a lot to you both.
The problem was the ‘scope’ part of the UQL body.
It seems that with the query response, I didn’t have to specify the whole path to get to monitors.

Now I just have to figure out how to rename the individual series.
Thanks a lot!

Rename by regex worked!

It’s perfect, thank you both for all your help, I don’t think I could have done it without you :grin:

Have a nice day!

1 Like

Here is the final result on a larger panel :

Thanks again !

3 Likes