Drop metrics based on value?

27 views
Skip to first unread message

Elliott Balsley

unread,
Apr 1, 2025, 1:40:34 AMApr 1
to Prometheus Users
Many SNMP devices return bogus numbers for sensors that don't exist.  For example a Dataprobe iBoot PDU shows a temperature value of 99999 celsius if you don't buy the optional temperature sensor.  Is it possible to configure the prometheus scrape to drop metrics with a certain value like this?

Google Gemini suggested using relabel_configs with source_labels = ["__value__"] but I don't think that internal label actually exists.

In Telegraf I do this with a starlark processor:
def apply(metric):
    for field, value in metric.fields.items():
        if value == 999.99:
            metric.fields.pop(field)
    return metric

Ben Kochie

unread,
Apr 1, 2025, 1:49:39 AMApr 1
to Elliott Balsley, Prometheus Users
No, there is not.

There is a proposal for at-scrape-time rule evaluations which may help with this.

But unless it were tens to hundreds of thousands of series I just ignore these kinds of things in the TSDB. It's just not worth my time to worry about a few megabytes of memory to store the data.

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/prometheus-users/82ed74d8-c44e-42f7-9006-5849013c5651n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages