Skip to content

Prometheus scraping fails with negative untyped values #11944

@boomer41

Description

@boomer41

Bug Report

Describe the bug

The following happens with both prometheus_textfile and prometheus_scrape inputs.
When having untyped metrics, parsing the prometheus text fails when said metrics have negative values.

Example:

# HELP node_zfs_arc_memory_available_bytes kstat.zfs.misc.arcstats.memory_available_bytes
# TYPE node_zfs_arc_memory_available_bytes untyped
node_zfs_arc_memory_available_bytes -8.58914944e+08

fluent-bit outputs:

[error] [input:prometheus_textfile:prometheus_textfile.0] error parsing file prom.txt: 'cmt_untyped_set failed'

To Reproduce

  • Put above prometheus text in a file called prom.txt
  • Use the following configuration:
service:
  log_level: debug
  daemon: off

pipeline:
  inputs:
    - name: prometheus_textfile
      tag: prom
      path: prom.txt
      scrape_interval: 1

  outputs:
    - name: stdout
      match: '*'

Expected behavior

Metrics to be successfully scraped.

Screenshots

Your Environment

  • Version used: 5.0.7
  • Configuration: YAML, see above
  • Environment name and version: Debian Package on Trixie
  • Server type and version: Debian
  • Operating System and version: Trixie
  • Filters and plugins: prometheus_textfile

Additional context

We are using Fluent Bit to scrape local metrics and push them via Open Telemetry to a central monitoring instance.
When a single metric with above values exist, the whole exporter fails causing our Monitoring to go haywire.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions