czerwonk / bird_exporter

Bird protocol state exporter for bird routing daemon to use with https://prometheus.io/
MIT License
176 stars 45 forks source link

state label in bird_protocol_up leads to unique time serie for each state #63

Open sgrade opened 2 years ago

sgrade commented 2 years ago

Overview

In Prometheus, every time series is UNIQuely identified by its metric name and set of LABELS (source). So, when a state (label) changes in bird_protocol_up metric, new time series is created in addition to the one with previous state. This ruins the metric: instead of one bird_protocol_up time series per BIRD protocol we see several in parallel. And when the state changes regularly (e.g. flap), we have gaps in the series.

How to replicate

If a BGP peer on other side becomes unavailable, BIRD tries to reconnect (goes through different states). In the example below, in Prometheus we see three different bird_protocol_up time series for one peer. They correspond to the BGP states (state labels):

All three exist in the TSDB in parallel.

Problems this approach creates

Suggestion

Who will do it

I can implement it myself if the agreement is made.

dmitry-sinina commented 1 year ago

I am faced same problem. Variable state label in bird_protocol_up metric doesn't look right.