Closed protonmarco closed 1 year ago
@protonmarco seems like I misunderstood your issue... Sorry for that! To your problem: And empty metric name is not allowed in Telegraf! While the actual behavior is unexpected and should be fixed (e.g. by checking that name is not-empty or by using a default name like gnmi
) we always need a metric name!
However, we might add an option to outputs.prometheus_client
to not prefix the field with the metric name!
no problem :)
we always need a metric name!
Then I think the best solution would be for us to keep the name
field not empty and fill it with "gnmi"
or something else of our choice.
I fear that removing the prefix indiscriminately on the outputs side opens to edge cases where you have the prefix removed from everywhere but maybe it is only needed for certain devices etc.. I would close this issue as I don't think we want to pursue this path and using a custom prefix is an easy fix.
I think we should keep this open as currently the produced GNMI name is unexpected at best. :-) I will change the issue a bit but there is an issue so let's track it.
Regarding the output, we could have a flag, say omit_metric_name_prefix
that you can set... Not sure if you want this or live with the name prefix...
alright. I think it's fine to live with the name prefix set, putting a flag on the outputs side to be used just for gnmi inputs without the ability to apply it only to a selected set of .conf doesn't sound good imo, especially because we can bypass this problem setting a name. I'm thinking at my implementation where I have a .conf file for each device
Ok. Will try to get this done...
This is a follow-up of #12352 where the metric name produced by
or
is set to the last path element. This is unexpected as we should either error out on an empty name or use a default name such as
gnmi
.