Ad Widget

Collapse

Items with scientific notation values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zabbixuserfk
    Member
    • Apr 2020
    • 37

    #1

    Items with scientific notation values

    Hello,

    I'm trying to get metrics from a Prometheus which give me values in scientific notation. For example :

    1.5617497e+07
    5.959396e+06
    2.10485483778921e+14
    3.3065225158656e+14

    When I set my item in Numeric (float), it gets unsupported with the following error :
    Value 214207150043136 is too small or too large.

    When I set my item in Numeric (unsigned), it gets most of the time unsupported with the following error :
    Value "2.14207150043136e+14" of type "string" is not suitable for value type "Numeric (unsigned)"

    Indeed from time to time, some items will display a value before returning unsupported :
    (FYI, they're all dependent items created by a LLD from the same master item)
    Click image for larger version

Name:	scientificnotation2022-01-20 15_41_43-Window.png
Views:	1038
Size:	111.1 KB
ID:	438389

    The documentation says it should be supported :
    Type of information Type of data as stored in the database after performing conversions, if any.
    Numeric (unsigned) - 64bit unsigned integer
    Numeric (float) - 64bit floating point number
    This type will allow precision of approximately 15 digits and range from approximately -1.79E+308 to 1.79E+308 (with exception of PostgreSQL 11 and earlier versions).
    Receiving values in scientific notation is also supported. E.g. 1.23E+7, 1e308, 1.1E-4.
    Can someone explain this to me please ? Is it a limit in the number of digits, cause some of the values don't seem so big though...

    Thank you !
  • Semiadmin
    Senior Member
    • Oct 2014
    • 1625

    #2
    Try a simple trick: Numeric (unsigned) and custom multiplier 1 in preprocessing

    Comment

    • zabbixuserfk
      Member
      • Apr 2020
      • 37

      #3
      Originally posted by Semiadmin
      Try a simple trick: Numeric (unsigned) and custom multiplier 1 in preprocessing
      Simple but effective ! Thank you very much and have a nice day !

      Comment

      Working...