NLnetLabs / routinator

An RPKI Validator and RTR server written in Rust
https://nlnetlabs.nl/projects/routing/routinator/
BSD 3-Clause "New" or "Revised" License
465 stars 70 forks source link

Differences between vrps_total values in metrics file and AS/prefix pairs in csv file #370

Closed fendemann closed 4 years ago

fendemann commented 4 years ago

Hi, can u please explain the following differences:

While monitoring the Routinator metrics I found differences between the vrps values in the metrics file and the line count [grep on tals] in the csv file.

As far a I understand a vrp (validated roas payload) value is a one-to-one mapping between an ASN and an ip address and the csv file is an export of these mappings. So counting the lines in the csv file should bring up the same values, or not !?

VRPS per TAL info from routinator.status file :
vrps-per-tal: afrinic=1375 ripe=95178 apnic=49097 lacnic=11045 arin=17981 
-----------------

VRPS per TAL info from routinator.metrics file :
# HELP routinator_vrps_total total number of VRPs seen
# TYPE routinator_vrps_total gauge
routinator_vrps_total{tal="afrinic"} 1375
routinator_vrps_total{tal="ripe"} 95178
routinator_vrps_total{tal="apnic"} 49097
routinator_vrps_total{tal="lacnic"} 11045
routinator_vrps_total{tal="arin"} 17981
-----------------

Line grep and count on routinator.csv :
[afrinic] :  1359
[ripe]    :  95178
[apnic]   :  49059
[lacnic]  :  10057
[arin]    :  15861

Frank

partim commented 4 years ago

It turns out that there are duplicate VRPs. That’s not really surprising in hindsight, but I didn’t consider that. So now the metrics counts all VRPs while duplicates are filtered out in all output formats.

The difference is actually kind of interesting, so I think I will keep the current vrps_total as it is and add a new unique_vrps metric that only counts unique VRPs.

fendemann commented 4 years ago

Sounds good. Will it be provided with 0.7.2 ??

partim commented 4 years ago

I would have waited to 0.8 but that may still be a bit away. If you would like a fix now, I am happy to make an intermediary 0.7.2 pretty much now.

fendemann commented 4 years ago

I would very much like to start monitoring the unique_vrps metrics, but only have the next 5 days. After that, I'm not in the office for 3 weeks. If the 0.8 is planned for the end of September, I can wait for it too.

partim commented 4 years ago

Then let’s fix it in 0.8. I’d rather no rush a release.

reschke commented 3 years ago

I just checked "/metrics" on a routinator 0.8.3, and can't see "unique_vrps". Was this really added? Or should I lokk for something else?

partim commented 3 years ago

0.8 only has the overall number of unique VRPs in routinator_vrps_final.

reschke commented 3 years ago

But that doesn't provide stats separated by TA, right?

partim commented 3 years ago

Correct. You could determine them by subtracting routinator_vrps_duplicate and routinator_vrps_filtered_locally from routinator_vrps_total. Unless you have changed the unsafe_vrps policy to reject, in which case you would also need to subtract routinator_vrps_unsafe.

Current main doesn’t have routinator_vrps_final per TAL either, that should be part of #494.