Question: Asset and Tag Cleanup?
# umh-support
t
Question: Asset and Tag Cleanup?
What would be the way to remove tags or assets? Can I just rename, or delete from postgres?
f
Yes, you can delete them from timescale. Just note that we are caching asset id's inside the kafka to postgresql bridges, so they might misbehave if you delete an asset and then send a payload for a deleted asset
t
Thank you how long does this cache live for? Will it ever purge old IDs?
j
hmm, what would be the prefered option when you want to delete a tag? that it gets purged from kafka, mqtt and timescaledb right?
t
There are going to be times that I want to purge a tag or an asset or maybe anything that is collected in timescale. If timescale was the only place to be concerned about, I don’t mind just executing queries to clean it up, but if there are other places that this data lives, than either there needs to be a command that we can execute on UMH, for example through API. Or the other places need to have a way to self recover and refresh Based on what is in timescale
j
what would happen if you delete a tag, but then some (old) microservice keeps pushing it in via MQTT?
t
What would happen now?
If it has an asset ID and it meets the schema, then it will still ingest it
I would still be fine with it automatically re-creating the asset and re-creating the tag upon a new message via MQTT as long as I still have the ability to remove it after I fix the rogue client
The scenario I’m in right now is I’ve been doing a lot of testing so I have a lot of stale assets and tags I think for anyone that is working with UMH there will be instances where a mistake will be made in a tag or asset needs to be removed or natural life cycle might create a situation where you no longer need it in UMH
j
So the solution would be a "delete" button in the tag browser, that would delete the kafka topic as well as all entries in timescaledb about that tag, correct? then one could remove rogue tags
t
Yeah, that’s fine. What about assets? How would one rename or remove?
j
would probably want to have a "remove" feature for an entire asset / multiple topics as well. not sure about the move though, that could be more complicated
t
I really was just thinking what if I need to update a name of a line or an area for example? Maybe I made it lowercase when I need it to be capitalized.
Also, we can’t delete assets if they are any foreign keys like tags
d
i agree with this.. I had several old tags which i manually deleted in timescale and some tags i have renamed.. I button to remove tags with options. Then you could choose to purge the entire tag from all services but choose to save the data or purge everything.. You could also have an option to delete data from a tag i timescale and option to delete all data, only collected data but not the asset or to delete data older than xxxx... Complete renaming of an asset would also be nice and you could maybe have an option to "block" data from that tag in case there is some service still sending data and in that case have an alarm or something that data is till coming to this tag from that service.. But i understand that this is a lot of work to do.. But it would make it easier for handling assets/tags