tsdb.py: format metrics more idiomatically

allow metric format to be user controllable
set tag with hostname
allow tags to be configured and passed through