Hi,
Is there any Rest Api which gives all the queries which are fires by particular user within particular duration.
Okay, So is it possible to create a custom dashboard in Dremio web portal , using which i can see how many users logged in and which user executed which query?
Or is there any query which can be executed in Dremio, which shows users who logged in and which users fired which query?
I don’t know how about “logged in” because Dremio basically use async API which every logged in user get their own login token until it expired. So, even if you manage to extract every user with non-expired token, you can’t be sure if those users are currently connected to Dremio until they issued an SQL.
To list a running job, Dremio use API URL
/apiv2/jobs
This is somehow undocumented, and you can only find it by tracing it when you open Dremio UI with chrome dev-tool. An example of this URL, for showing currently running and enqueued job
/apiv2/jobs?sort=st&order=ASCENDING&filter=(qt==“UI”,qt==“EXTERNAL”);(jst==“RUNNING”,jst==“ENQUEUED”)
or in encoded looks
/apiv2/jobs?sort=st&order=ASCENDING&filter=(qt%3D%3D%22UI%22%2Cqt%3D%3D%22EXTERNAL%22)%3B(jst%3D%3D%22RUNNING%22%2Cjst%3D%3D%22ENQUEUED%22)
You can find queries.json
in the log directory that will tell you who ran what queries.
The v2 APIs are considered internal and therefore unstable and may change at any given time. We do not have a stable API (v3) for queries jobs other than getting an individual job.
@doron then how is it possible to get the jobId?
I am running the job from the UI, but I want to query the results from my server. is there a way to do it in the public API ?
It would be easier if you submit the job using our REST API, that way you get the jobid always.
But that would mean that I cannot work with the UI to make any changes
In 4.1 you can click on the Running
state and click on View Details
, which will take you to the Jobs page and select the job you are running. The job id is listed on the right hand side, which you can then plug into the REST API.