It would be nice for some testing suites to be able to send Prometheus text-formatted metrics into node-artedi and get back an object that represents a metric.
For example:
var artedi = require('artedi');
var my_count = artedi.deserialize(artedi.FMT_PROM, 'my_metric{"hello"="world"} 100');
console.log(my_count);
/*
Prints:
{
name: 'my_metric',
labels: {
'hello': 'world'
},
value: 100
}
*/
I don't think that we should make any assumptions about the type of the metric (gauge vs counter vs histogram vs something else).
Some questions:
- Should we allow the user to pass in an array of metrics to deserialize?
- Should the output of the
deserialize function be able to be passed directly into another collector function? (e.g. counter.add(artedi.deserialize(FMT_PROM, my_string_metric)) ). If so, we could probably assert that the collector names are the same.
It would be nice for some testing suites to be able to send Prometheus text-formatted metrics into node-artedi and get back an object that represents a metric.
For example:
I don't think that we should make any assumptions about the type of the metric (gauge vs counter vs histogram vs something else).
Some questions:
deserializefunction be able to be passed directly into another collector function? (e.g.counter.add(artedi.deserialize(FMT_PROM, my_string_metric))). If so, we could probably assert that the collector names are the same.