Warning when recorder queue becomes high

Would it be possible to change the loglevel from debug to warning when the queue is reaching critical values ? Right now the message is debug until it reaches the limit, and then recording stops. If we could set the queue log to warning when e.g. 50% of the maximum has been reached this would easy troubleshooting. Especially now the database keeps growing with the long term statistics.

Not sure what LTS has to do with it. Or what queue you are talking about, but you can change the default logging level with an automation. See: Logger - Home Assistant

You know, recorder keeps state updates and events in the memory before writing into database and if database is not accessible or not fast enough, new data arrives to recorder queue faster than writing speed/intervals. When queue reaches a limit, recorder turns off itself with a message.

I was having this issue when my maria db was being locked for 90 minutes at night throughout backing up and recorder was getting angry because 90 minutes long enough to keep unwritten data in memory. Keeping recorder size is off off topic here but might be relevant for interested parties.

So all you would need is a sensor to expose the queue fill ratio. Then you could automate it. Perhaps a command line sensor?

I know that I can update the logger to debug for the recorder, but this is only something I would only want to do for a small period, since every state is handled by the recorder (hence the queue-size. ) I recently found out that one ibeacon went berserk and had 50% of all states in the database (ca 1 mln over 7 days) . my remove db (mariadb on synology NAS) could not perform anymore and recorder filled. Only when I suspected the queue-size to be an issue I set this to debug, and found it was continuously going up. I have no idea how to make a sensor of the recorder queue size. I’m running Hassos.

No, that is not what my link above leads to. It is a service you can use to dynamically change the default logging level using an automation. So you can change it, then a short time later change it back, all with automations.

You just need a sensor to trigger the automation on,