victronenergy / venus-influx-loader

NodeJS server that takes from MQTT into Influx, and config UI and still more
MIT License
12 stars 4 forks source link

Feature Request: Support dotted syntax in measurement name #82

Open mman opened 2 months ago

mman commented 2 months ago

As suggested in the PR: https://github.com/victronenergy/venus-influx-loader/pull/69

It may be a nice addition to support storing the measurements into InfluxDB with dotted syntax which then allows to dynamically access parts of the measurement name within the query itself.

so the pvinverter/Ac/L1/Power would become pvinverter.Ac.L1.Power.

Since all measurements are properly tagged with portalId, and instanceNumber, the immediate benefit I can see at the moment is to group by a phase in all three phase measurements where each phase is represented separately. So one query can be used to easily visualise voltate/amperage/power of a three phase measurement as opposed to three queries required currently.

Since the change would break all existing dashboards out there, it must be an opt in. My suggesting would be to add it as an option to the Admin Dashboard Settings/InfluxDB page. Something along the lines of

Measurement Separator: Slash (/) - Example: pvinverter/Ac/L1/Power
Measurement Separator: Dot (.) - Example: pvinverter.Ac.L1.Power

with proper explanation of how the dotted format can be used later in the InfluxDB query.

Screenshot 2024-04-22 at 12 06 54
kvesterling commented 2 months ago

"with proper explanation of how the dotted format can be used later in the InfluxDB query." I'm not sure what you mean by this, it's functionality in Grafana is why I'm requesting the "feature". It's merely a measurement name, influx would care less if it were dots, slash, or otherwise. If you're concerned about regex for the measurement, simply escape the dot with \.

mman commented 1 month ago

@kvesterling Any comments about the PR and how I propose the feature to be implemented? It's not gonna be ON by default due to compatibility reasons, so it will be opt-in for now... what do you think: https://github.com/victronenergy/venus-influx-loader/pull/98

mman commented 3 weeks ago

Possibly/Probably related to https://github.com/victronenergy/venus-influx-loader/issues/114

kvesterling commented 3 weeks ago

Thanks! I don't have any comments to say, I'd be happy to contribute my dashboards with the feature enabled to make it easy for those whom would like the dot formatted.