We are trying to develop some queries to run against Tableau's internal Postgres "workgroup" database that lives within our 9.1.4 Tableau server instance.
These queries, once we manage to get them to a point that they are returning the results that we are looking for, would be added to our monitoring system, so that we can remotely query the workgroup database.
Something that we are specifically interested in monitoring would be how long it takes background tasks to run. If we know which background tasks are taking the longest to run, then we will be able to figure out which published/embedded datasources to focus our SQL tuning efforts on. I believe that it should be possible to develop a query against Tableau's internal Postgres "workgroup" that will return the run times of background tasks. I'm not sure at the moment how far back we would want to go in pulling this historical information, but in looking at the "_background_tasks" view, I think it would be possible to go back as much as 30 days, as I think that many days of information is kept here.
As an explanation of why we don't just periodically log into Tableau server's web based GUI and look for long-running background tasks on the "Status" page, instead of developing this query - We would like to have monitoring kept in one central place, and after this query has been developed and plugged into our monitoring systen, we would be able to make it so that if the delta between when the background task started and when it finished is too high, an alert email will be generated by our monitoring system, which is something that Tableau server cannot be configured to do.
I have somewhat of an understanding of the tables/views in the workgroup database and have previously been able to write queries to pull useful information from it.
Unfortunately, thus far I have not yet been able to figure out how to pull exactly what I am looking for from the database.
I know that it would be possible to pull this information. I know this because the "Status" page for both the Tableau server as a whole, and for individual sites can display this information, as shown in the attached screenshot.
And I'm certain that the "_background_tasks" view would have something to do with where the information I'm looking for would come from. There is a "started_at" column, and a "completed_at" column, both of which are likely good columns to use for the query that I am trying to write. However, not all of the information I need is in this table and I am having trouble figuring out exactly what tables/views need to be joined that will return what I am looking for.
If anybody has an experience with developing a query like this and/or can point me in the right direction, I would highly appreciate it.