tsdb.py: format metrics more idiomatically

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