grafana / grafana-zabbix

Zabbix plugin for Grafana dashboard
http://play.grafana-zabbix.org
Apache License 2.0
2.07k stars 457 forks source link

Units of data item received from Zabbix to be overridden by that maintained on Grafana Field Tab #1189

Open jinucompute opened 3 years ago

jinucompute commented 3 years ago

Is your feature request related to a problem? Please describe. I am try to capture the UPS load. The device provides the load in terms of percentage. In Zabbix the item is defined with units as %. Now in Grafana when i show the load, it shows with the percent sign (%). This is fine when i show the load, but from the load percentage i can compute the electrical load in watts. The calculation i can do in Grafana using scale function. But the value always shows the % sign even if i provide Watt as the unit in the Field tab in Grafana.

So in the plugin i need an option to strip the unit received from Zabbix and override with the Unit defined in Grafana - field tab

Describe the solution you'd like The units (eg Percentage, Degrees etc) value received from Zabbix should be overriden with the Unit defined in Grafana - field tab

Describe alternatives you've considered Only alternative would be to have a derived data item in Zabbix, which is not advisable as that will consume more data storage.

Additional context Add any other context or screenshots about the feature request here. SCRSHOT

alexanderzobnin commented 3 years ago

This behavior can be overwritten with panel overrides:

Screenshot from 2021-04-26 10-40-45

Probably, I can add toggle for disabling fetching units from Zabbix since it's hard to overwrite it in Grafana (it's possible, but not intuitive).

jinucompute commented 3 years ago

Your suggestion is more apt, to have a feature to fetch raw data from Zabbix instead of with units

k-korn commented 3 years ago

There definitely should be an option to disable fetching units, as it's pretty much guesswork. In Zabbix, "unit" is just a string, while in Grafana the system is much more sophisticated.

So, for example, I have couple of items in Zabbix which are storing length, in meters ("m"). This plugin (and Grafana) interprets this "m" as "minutes", and as a result I have graphs with remaining driving range measured in hours

neothematrix commented 3 years ago

got caught with this today, I wasn't aware the datasource was passing the units to Grafana, rendering the "standard option -> unit" not functional if a unit is returned by the datasource, the only option is the override as suggested by @alexanderzobnin. It worked for me. to answer @k-korn , it's not exactly guesswork, as I found out today, there's a defined mapping between zabbix returned units and grafana used units in this plugin sourcecode: here. In your case it wouldn't work, of course, because there's an overlapping of meaning between meters and minutes (although minutes should be referenced as "min").

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had activity in the last 2 years. It will be closed in 60 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions!