json_exporter
json_exporter copied to clipboard
Iterate over map and dynamically assign key as label value
Hi, i'm wondering if this is doable? Given this json:
{
"input": {
"a": {
"foo": 2,
"bar": 0
}
},
"output": {
"a": {
"status": {
"code": 0
},
"meta": {
"foo": 0,
"bar": 0
}
},
"b": {
"status": {
"code": 1
},
"meta": {
"foo": 0,
"bar": 0
}
}
}
}
I would like to iterate over the output map, and get something like:
output_status_code{name="a"} 0
output_status_code{name="b"} 1
Is it just because of JSONPath limitation? If it's possible, what would be the config like?
I do have same problem. Can't figure out, how actually get key values itself, in order to use them as label or whatever later reference all of them later in values/labels.
Any news about this issue ?