Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-16836

"Prometheus to JSON" preprocessing rule fails on CRLF empty line

XMLWordPrintable

    • Sprint 57 (Oct 2019), Sprint 58 (Nov 2019)
    • 0.25

      Imagine please that I heed to get prometheus exporter data with headers and
      then (also) use it for LLD, using "Prometheus to JSON" preprocessing rule.

      What happens is the rule gets unsupported with this error:

      Preprocessing failed for: HTTP/1.1 200 OK..Transfer-Encoding: chunked..Content-Type: text/plain; version=0.0.4....# ...
      1. Failed: cannot convert Prometheus data to JSON: data parsing error at row 4 "
      ": cannot parse metric name
      
      HTTP/1.1 200 OK^M
      Transfer-Encoding: chunked^M
      Content-Type: text/plain; version=0.0.4^M
      ^M
      #
      

      note - '^M' characters at end of lines in this copy-pasteĀ are CRLF (0D0A) EOL, i.e. windows style EOL.

      To be precise the issue with EOL characters CRLF (0D0A) and especially last OEL (empty line after headers block).
      The line which splits headers from body.

      So the error "error at row 4" means empty line #4 after 3 headers.

      I think that the preprocessing step should be able to survive CRLF EOLs.

      To reproduce - create HTTP agent item and set "Retrieve mode" to "Body and headers"

      One more real case - obtain prometheus data using zabbix agent and "web.page.gethttp://some.lan:9100" agent's key, because the data in not available directly from zabbix server, but only by remote zabbix agent.

            vso Vladislavs Sokurenko
            zalex_ua Oleksii Zagorskyi
            Team A
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: