|
|
@ -21,7 +21,7 @@ def json_to_prom(json, prefix, instance):
|
|
|
|
prefix = prefix + "_" + v.index(item)
|
|
|
|
prefix = prefix + "_" + v.index(item)
|
|
|
|
if type(item) is bool:
|
|
|
|
if type(item) is bool:
|
|
|
|
outlines += '{}_{}{{instance="{}"}} {}\n'.format(prefix, k, instance, 1 if item else 0)
|
|
|
|
outlines += '{}_{}{{instance="{}"}} {}\n'.format(prefix, k, instance, 1 if item else 0)
|
|
|
|
if type(item) in [int, str]:
|
|
|
|
if type(item) in [int, float]:
|
|
|
|
outlines += '{}_{}{{instance="{}"}} {}\n'.format(prefix, k, instance,item)
|
|
|
|
outlines += '{}_{}{{instance="{}"}} {}\n'.format(prefix, k, instance,item)
|
|
|
|
if type(item) is dict:
|
|
|
|
if type(item) is dict:
|
|
|
|
outlines += json_to_prom(item, "{}_{}".format(prefix, k), instance)
|
|
|
|
outlines += json_to_prom(item, "{}_{}".format(prefix, k), instance)
|
|
|
|