mqttwarn icon indicating copy to clipboard operation
mqttwarn copied to clipboard

Publish metric information like "messages/received" to "mqttwarn/$SYS" topic

Open amotl opened this issue 4 years ago • 4 comments

Hi again,

based on #552, which implemented status_publish and status_topic settings, I would like to see the possibility to configure a status_interval setting, defaulting to 60 seconds. Status information shall be collected and published in the configured interval.

In that manner, publishing more volatile information, like Mosquitto's $SYS/broker/load/messages/{received,sent}/+ can be implemented.

Synopsis

mqttwarn/$SYS/event/start 2021-10-17T17:49:06+02:00
mqttwarn/$SYS/messages/received 42

Requests for comments

I would like to share this idea, in order to find out if that would be a sensible feature altogether. Maybe this feature resonates with @sumnerboy12, @psyciknz and others using mqttwarn within a multicontainer Docker setup or similar environments like Kubernetes. Please let me know about anything which comes to mind.

With kind regards, Andreas.

amotl avatar Oct 17 '21 16:10 amotl

I'd support that. So start would be since running? And messages received sent would be for the life of the instance? That would make interesting viewing in grafana.

Actually does mqttwarn post an online status as LWT anywhere upon starting?

Not that I've every had to question is it up and running as it always is. But it would be good practice.

psyciknz avatar Oct 17 '21 18:10 psyciknz

There is a configurable LWT topic - see https://github.com/jpmens/mqttwarn/blob/main/HANDBOOK.md#the-defaults-section.

sumnerboy12 avatar Oct 17 '21 20:10 sumnerboy12

Can't see any harm in publishing these sorts of metrics. Might be interesting to track them although I am not sure I would have much use for them initially.

sumnerboy12 avatar Oct 17 '21 20:10 sumnerboy12

I like the idea of mqttwarn/$SYS/messages/received 42, and as @sumnerboy12 says, there's no harm in doing so. ;)

jpmens avatar Oct 18 '21 09:10 jpmens