Skip to content

Instantly share code, notes, and snippets.

@lusis lusis/README.md
Created Apr 10, 2019

Embed
What would you like to do?
exabgp promethues exporter

Current metrics at startup

root@node1:~# curl -s http://localhost:9569/metrics  | grep peer
# HELP peer_route_state shows the current peer state for a given route
# TYPE peer_route_state gauge
peer_route_state{family="ipv4 unicast",peer_asn="64496",peer_ip="192.168.1.2",route="192.168.88.2/32",self_asn="64496",self_ip="192.168.1.184"} 1
# HELP peer_state shows the current peer state
# TYPE peer_state gauge
peer_state{peer_asn="64496",peer_ip="192.168.1.2",self_asn="64496",self_ip="192.168.1.184"} 1

stop haproxy which triggers a withdraw

root@node1:~# service haproxy stop
root@node1:~# curl -s http://localhost:9569/metrics  | grep peer
# HELP peer_route_state shows the current peer state for a given route
# TYPE peer_route_state gauge
peer_route_state{family="ipv4 unicast",peer_asn="64496",peer_ip="192.168.1.2",route="192.168.88.2/32",self_asn="64496",self_ip="192.168.1.184"} 0
# HELP peer_state shows the current peer state
# TYPE peer_state gauge
peer_state{peer_asn="64496",peer_ip="192.168.1.2",self_asn="64496",self_ip="192.168.1.184"} 1

Note that the peer_route_state is now 0

neighbor 192.168.1.2 {
local-as 64496;
peer-as 64496;
router-id 192.168.1.184;
local-address 192.168.1.184;
group-updates false;
capability {
graceful-restart;
route-refresh;
}
family {
ipv4 unicast;
}
api routing {
processes [ watch-haproxy ];
}
api logging {
processes [ golang-test ];
neighbor-changes;
signal;
receive {
parsed;
notification;
update;
refresh;
keepalive;
open;
operational;
}
send {
parsed;
notification;
update;
refresh;
keepalive;
open;
operational;
}
}
}
process watch-haproxy {
run python3 -m exabgp healthcheck -F /etc/exabgp/haproxy.cfg;
encoder json;
}
process golang-test {
run /tmp/exabgp_exporter;
encoder json;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.