Add --prefix to os-collect-counters

Sets it in __meta__ for use when feeding counters into statsd.
This commit is contained in:
Clint Byrum 2015-11-12 14:34:35 -08:00
parent 7dc93aa35f
commit 1916c7fce7
1 changed files with 3 additions and 0 deletions

View File

@ -52,6 +52,7 @@ def main(argv=None, stdout=None):
"otherwise 'counters.json' will be used")
parser.add_argument('--output', help="Write JSON here. Does not disable "
"stdout.")
parser.add_argument('--meta-prefix', help="Set a prefix in __meta__")
args = parser.parse_args(argv[1:])
logging.basicConfig(
format='%(asctime)-15s %(levelname)s %(threadName)s: %(message)s')
@ -68,6 +69,8 @@ def main(argv=None, stdout=None):
log.debug('threads all returned')
meta = {'unixtime': time.time()}
if args.meta_prefix:
meta['prefix'] = args.meta_prefix
collected = {
'__meta__': meta,