MQTT Engine: auto-prune removed metrics?

@wes0johnson Given the following scenario:

  1. Node provides a birth certificate with 5 metrics
  2. Node software is updated and 1 metric is removed
  3. Node software is started and issues a birth certificate without the removed metric
  4. Ignition MQTT Engine tag provider continues to show the removed metric as bad/offline

Is there an option in the MQTT Engine to prune the tag provider, where it would remove metrics if the incoming birth certification of a node does not include them?

This is an existing backlog item for us. However, we haven’t implemented it or scheduled it for development yet. I’ve added a +1 based on your request. For now, the deletion at the Engine side must happen manually.

I think you already knew I was a +1 on this, Wes.

But as an added bit of confusion, I’ve noticed that the bad/offline tags do disappear when the MQTT Engine is restarted, which is beneficial in some cases and just confusing in others.

If we truly were done with the tag and didn’t want it anymore, :partying_face:

But if the tag is important and expected to be there but that device hasn’t reported in for some reason (offline for maintenance, etc), it can confuse any scripts that browse for it or try to read it via normal methods since it doesn’t quite exist. You can access it properly via the history methods, but not normal tag read/write or config methods.

My ideal solution would be if MQTT Engine didn’t forget any tags on restart, but instead had a general “delete tag if offline longer than” config setting, that could be set to some number of hours up to a year.

I also see that restarting the MQTT Engine purges “Bad_Stale” tags.

It’s interesting that the folder structure is retained (groupID/nodeID/Node Info, etc) but the tags representing the metrics themselves are not retained across restarts.

The removal of tags across restarts is sort of historical. In Ignition7, this was/is how the SimpleTagProvider in the Ignition API behaves. There is no way to retain tags across a module restart. However, the underlying config for all of those tags is retained. They’re just not visible in the tag browser.

In Ignition8, we have some more control. But, to stay consistent with the Ignition7 behavior we kept it the same. We had a lot of feedback (mostly negative) when we left them there across restarts in the initial versions of MQTT Engine for Ignition8. So, this is largely why it is that way now. It may be possible to make this configurable in Engine - I’ll add another backlog item for this.

Thanks for the context, Wes. I appreciate the consideration.