json-2-prom
Converts prom2json's format back to prometheus text.
The result of this function is an array containing each line of the resulting prometheus format.
Usage:
const json2Prom = const prometheusFormat = console//["# HELP cowboy_errors_total Total number of Cowboy request errors.", "# TYPE cowboy_errors_total counter"]
Custom options
It's possible to increment the resulting Prometheus format. Currently the only option available is to add constant labels to every metric:
Usage:
const json2Prom = const options = defaultLabels: 'app_name': 'my_app' another: 'label' const prometheusFormat = console//["# HELP cowboy_errors_total Total number of Cowboy request errors.", "cowboy_errors_total{app_name: \"my_app\", another: \"label\"} 10"]