Reporting table size to grafana
pg_total_relation_size is definitely the way to go. It gets the size of the involved files from the file system, which is fast and not invasive.

If my monitoring system would regularly run SELECT count(*) on by big tables, I would kill it. It does a sequential scan and uses lots of resources.

For monitoring, I would not use pg_size_pretty. That is good for human readers, but automatic processing will be easier in bytes.