Ad Widget

Collapse

preprocessing to JSON not accepting regular expression for metric in discovery rule

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fbijma
    Junior Member
    • Mar 2024
    • 1

    #1

    preprocessing to JSON not accepting regular expression for metric in discovery rule

    Hi,

    I am new to this forum, and have a question. I am using Prometheus Node Exporter for monitoring inodes in filsets.
    I have different metrics for filesets and those look very similar. Here an example of what I like to accomplish:
    gpfs_fileset_alloc_inodes{fileset="da-kligen01",fs="prd01"} 1.8612224e+07
    gpfs_fileset_free_inodes{fileset="da-kligen01",fs="prd01"} 3.756478e+06
    gpfs_fileset_max_inodes{fileset="da-kligen01",fs="prd01"} 1.43285248e+08

    As you can see these are all almost the same, and I would like to have these all in one LLD discovery rule. My idea was that I
    could do this by using a Prometheus to JSON preprocessing step looking like this: {__name__=~"gpfs_fileset_.*_inodes"}{fileset=~".*" ,fs=~".*"}
    In this way I could also use an Item prototype to calculate the percentage used. But the regular expression returns an error: Incorrect value for field "params": invalid Prometheus pattern.
    What am I doing wrong. As far as I read the documentation, this should work... What am I overlooking?
    Using this same prepocessing without regular expressions for the metric works fine.

    Hope someone can help out here.
    Frans.
Working...