mtr-exporter: MTR Exporter returns no metrics when Max TTL is reached
When a host is not reachable due to very long routing(max 30 hops), often seen in VPN networks, but not exclusively:
> traceroute 100.100.100.100
traceroute to 100.100.100.100 (100.100.100.100), 30 hops max, 60 byte packets
1 * * *
2 * * *
...
29 * * *
30 * * *
MTR returns a very sparse response with hubs being an empty list, and provides no failure exit code:
> mtr -j -c2 100.100.100.100
{
"report": {
"mtr": {
"src": "example-host",
"dst": "100.100.100.100",
"tos": 0,
"tests": 2,
"psize": "64",
"bitpattern": "0x00"
},
"hubs": []
}
}
Which results in mtr-exporter returning no metrics for the defined job. This means no alerts can be created for such a failure mode.
While this is understandable for other metrics even mtr_report_count_hubs does not show up with value of 0, it simply does not exist.
In a perfect world mtr_report_loss would also return 100% packet loss, but I understand that would have to be a manufactured metric, since it couldn’t be generated from hubs from the mtr response, but would be the more correct thing to do.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 23 (20 by maintainers)
@jakubgs
I am looking at the code:
https://github.com/mgumz/mtr-exporter/blob/61e7b738b81140e32b0c29ff18cd06d1838de76f/pkg/job/prometheus.go#L78-L79 - “mtr_report_count_hubs” is reported with
0https://github.com/mgumz/mtr-exporter/blob/61e7b738b81140e32b0c29ff18cd06d1838de76f/pkg/job/prometheus.go#L81-L83 - no hubs, no need to report them
Isn’t that your case?
I can imagine a
mtr_report_min_losswhich is by default set to100%and then picking the smallest available loss number from the available hubs. 0 hubs -> 100%, at least 1 regular hub -> a value way below 100%. Could work.If you are in the mood: try #34
Thank you, that’s amazing. Appreciate your fast responses man. I love this software.
@jakubgs I released mtr-exporter:0.6.0, it includes
mtr_report_min_loss.@jakubgs Yes. Or … I mean, we know:
-m Ndefines the maximum hopsmtrfinished as intendedmtrprobed up to-m N: it sends a packet, no answer -> ttl increase -> retry -> no answer.Mhh. The “bug” / area to improve in
mtritself is not so much that it can’t say “I reached IP a.b.c.d”. It should just state in the result the-m Nvalue:The
mtrobject in the report should contain that maximum TTL. And then I can built something around that.Yes, doable.
Darn.
Maybe time for a social-engineering competition thingy 😃 You create also a bug on trippy and see which one delivers first =)
@jakubgs Yah, any indication on which … hops were checked or an indication of “tried with ttl of 1: nothing, tried 2: nothing, tried 3: yeah, here some numbers” and encoded into JSON or alike, then I can work with that.
Lets see the decision over at
mtr.In the meantime: https://github.com/mgumz/speedtest-exporter needs an beta-tester =)
Pretty sure, for example
google.comis available for me after 9 hops, out of which first 4 are non-discoverable.So if I use
--max-ttl 4I get nothing inhubs:But if I increase it to 5 I get something:
Since the 5th hop responds.
I believe this is at least partially an MTR bug, because it returns no failure exit code, so I opened an issue: