If you’re having trouble getting the /ui/api/stats info programmatically, you can use this script. Its ill-advised as they may change those APIs at any time; but as some of the UI stats are better/more correct than prometheus stats, you may need them as we did.
% COOKIE_VALUE=$(curl --location --request POST 'https://some.company.com/ui/login' \
--data-urlencode 'username=john.humphreys' \
--data-urlencode 'password=<password>' --cookie-jar - --output /dev/null --silent | awk '{print $7}' | tail -1l)
curl 'https://some.company.com/ui/api/stats' -H $''"Cookie: Presto-UI-Token=$COOKIE_VALUE"'' | jq --color-output
{
"runningQueries": 8,
"blockedQueries": 0,
"queuedQueries": 0,
"activeCoordinators": 1,
"activeWorkers": 35,
"runningDrivers": 3957,
"totalAvailableProcessors": 2450,
"reservedMemory": 2770000473,
"totalInputRows": 1133212564136,
"totalInputBytes": 10872687401451,
"totalCpuTimeSecs": 777021
}