grafana / mqtt-datasource

MQTT Datasource for Grafana allows streaming data from any MQTT broker running either locally or remotely.
Apache License 2.0
175 stars 51 forks source link

Non ASCII characters in topic names not handled well when creating datasource channel id #87

Open barskern opened 1 year ago

barskern commented 1 year ago

If a topic contains a non-ascii character, that character has to be removed or changed prior to creating a channel id. When the topic is used directly that means that any topic with such characters is invalid. Particularly, this is annoying if you want to monitor any builtin topics from MQTT such as $SYS/broker/....

Channel ID requirements detailed here.

Location in this codebase where invalid channel ID is created.

Nocccer commented 9 months ago

The problem is that grafana query to backend datasources do not allow this characters. They also do not allow + and #.

I added support for this two characters by changing them in the frontend to something like __PLUS and __HASH and in the backend reverted this.