json_exporter icon indicating copy to clipboard operation
json_exporter copied to clipboard

Jsonpath in name:

Open scorpey opened this issue 3 years ago • 1 comments
trafficstars

Hi!

How can i use Jsonpath to generate name: ???

example:

path: '{ .components }'

i have same components and use labels: status: '{.status}'

if i have 10 components i must write to config 10 metrics.

But i whount use path to write name of metric

may be:

name: anycomponenname-'{ .components }'

and have generate metrics:

anycomponenname-name1 anycomponenname-name2 anycomponenname-name3 ...

help PLS

scorpey avatar Mar 30 '22 16:03 scorpey

I don't understand your use case clearly, but it seems like you should use labels to differentiate between your metrics. Keep the metric name constant (because it is the information of same type/source) and attach labels for providing additional information.

rustycl0ck avatar Nov 30 '22 10:11 rustycl0ck