Are gNMI deletes not supported in gnmi.input plugin?

Hey guys, quick question on inputs.gnmi with an on_change subscription:

When a subscribed gNMI path is deleted on the target, the device sends an event indicating the deletion. I confirmed this using gNMIC. However, Telegraf doesn’t seem to emit any corresponding message to the output. Am I missing a configuration setting or does Telegraf not support emitting “delete” events from gNMI subscriptions?

[[outputs.file]]
  files = ["stdout"]
  data_format = "json"
  json_timestamp_units = "1s"

[[inputs.gnmi]]
  addresses = ["srl1:57401"]
  username = "admin"
  password = "NokiaSrl1!"
  encoding = "json_ietf"
  tls_enable = false

  [[inputs.gnmi.subscription]]
    name = "gnmi.test"
    origin = "srl_nokia-interfaces"
    path = "/interface[name=ethernet-1/1]/description"
    subscription_mode = "on_change"

In this minimal example I am trying to get notified when the description of the interface ethernet-1/1 of host srl1 changes and also when it gets deleted. However deletion doesn’t emit anything even though there is an event. My outputs seem to never contain something like “update” or “delete” anyway (even though the gNMI message includes this), so I don’t even know how I would go about distinguishing between updates and deletes in the first place.

I think this might be the same question as Gnmi plugin - notifications from 2021 but it was never answered unfortunately…

Thank you for your help!

A simple yes or no would be much appreciated :sweat_smile:

@kvn299 Sorry, I don’t know the answer to your question. This may be something to file as an issue or feature request on the Telegraf repo.

I could be wrong, but isn’t that what the redial option is for?

I don’t think so. In the gNMI input plugin documentation it says:

## redial in case of failures after
# redial = "10s"

so Telegraf will wait the specified redial duration before attempting to reconnect if the connection is lost.

It seems like such a basic feature that shouldn’t be missing from this product but maybe I overlooked something. I didn’t read the full code but I found some passages skimming through it that might be the reason why deletes are not handled (at the very least in my case).

Decided to move to gNMIc because I couldn’t figure it out…

@kvn299 we certainly can add this feature. You just need to open a feature-request

The reason why we did not add this yet is because nobody described how the resulting metric should look like! So if you do have an idea, I’m all ears…

1 Like

I have an idea for what it should look like… and if you need me to come up with a better one, let me know.

Maybe deletion should be handled as an update, but with all fields blank or removed to overwrite InfluxDB entries. I attempted to create an execd that does something similar using windowed set comparison; that is, until I read this topic (thank you kvn299) and realized gnmi has deletes. This feature, or a correct variation of it, would be really helpful to my team so we can migrate from POC to full-scale deployment. I will try to investigate how gnmic does it and hopefully share some insights soon as to what the best approach is here.
Introduction - gNMIc .

1 Like

Here’s your feature request

1 Like