Search code examples
prometheusgrafanapromql

How to deals with big number with PromQL


I'm building a dashboard on Grafana from Prometheus datasource.

This dashboard deals with filesystem capacity. I'need some PromQL queries to be parametrized with these capacity, which are big numbers:

node_filesystem_size{env="dev", mountpoint="/sx/bddv2"} < 100000000000

It's quite annoying to deals with all that zero, is there any way to use SI suffixe (G, M, K)?


Solution

  • Prometheus supports scientific notation for big number. For example, you can write 1e9 instead of 1000000000:

    node_filesystem_size{env="dev", mountpoint="/sx/bddv2"} < 100e9
    

    P.S. VictoriaMetrics - Prometheus-like monitoring system I work on - additionally supports K, M, G and T suffixes (powers or 1000) alongside Ki, Mi, Gi and Ti suffixes (these are powers of 1024) for numeric constants in its MetricsQL query language:

    node_filesystem_size{env="dev", mountpoint="/sx/bddv2"} < 100G