influxdata / influxdb

Scalable datastore for metrics, events, and real-time analytics
https://influxdata.com
Apache License 2.0
28.51k stars 3.53k forks source link

Gauge: Units of measure #19880

Open BondAnthony opened 3 years ago

BondAnthony commented 3 years ago

Proposal: Gauge units of measure should scale based on the data.

Current behavior: Today the units of measure need to be set by the user as a suffix. This means the user will be required to convert their data to the correct unit of measure to fit the defined suffix.

Desired behavior: The gauge unit of measure should be able to scale with the data. Example of scaling the unit of measure would be network throughput. Network traffic can range from 0 bytes to 10s of gigabytes or even terabytes of throughput. The gauge should be able to convert a base measurement for the users. Within the customization panel users should be able to select a unit prefix such as SI, Binary or None. This would be a similar pattern to our graph visualization today. While this would work well for simple cases all data inputs would need to be in bytes format. Grafana handles this presentation by providing the users with a large section of preset data rate units.

Use case: By implementing the ability to change the unit of measures and dynamically converting the gauge suffix, users are provided with a cleaner UI that scales well. I have a use case that would benefit from this change. Within my system I have multiple environments producing metrics around network throughput. One environment is relatively active which produces mb/s of network traffic. While the other environment is only producing kb/s of network traffic. This forces me to decide if I should present my data in Kb/s or Mb/s. Scaling unit of measure would handle this presentation decision for me. Since my data input is bytes I could easily set the upper bounds and allow the UI to handle converting the output to something that is presentable.

Examples of this problem.

Gauge where my upper limit is 1 Gb/s. Screen Shot 2020-11-02 at 1 42 14 PM

Same gauge but looking at a different environment that is less utilized. I would expect the gauge to present the data in KB instead of MB. image

Grafana has some nice presets that allow users to easily select which unit of measure to produce. Screen Shot 2020-11-02 at 1 31 14 PM

Also having the ability to remove the threshold numbers from the gauge output would be nice.

BondAnthony commented 3 years ago

This would probably benefit from https://github.com/influxdata/giraffe/issues/343

zoesteinkamp commented 3 years ago

This issue is a proof of concept for some of these ideas in giraffe

580

If we want to see this work fully it will take more time than we are currently willing to dedicate to it.