Bird exporter (fork)
  • Go 97.3%
  • Go Template 2.3%
  • Dockerfile 0.4%
Find a file
Tomas Jonsson 6b40766ac8
Some checks failed
Docker / build (push) Failing after 23s
Test / test (1.24.x, ubuntu-latest) (push) Successful in 2m18s
perf: optimize prefix length queries to cover real BGP table efficiently
2025-07-25 16:17:11 -04:00
.github fix cosign task 2025-05-19 18:15:35 +02:00
charts/bird-exporter Added helm chart (#83) 2023-05-09 14:31:18 +02:00
client perf: optimize prefix length queries to cover real BGP table efficiently 2025-07-25 16:17:11 -04:00
examples feat(metrics): add prefix size statistics collection 2025-07-25 12:23:33 -04:00
grafana moved image to grafana folder 2018-03-26 21:59:12 +02:00
metrics feat: add table-wide prefix statistics with count-based queries 2025-07-25 15:44:19 -04:00
parser feat(metrics): add prefix size statistics collection 2025-07-25 12:23:33 -04:00
protocol feat(metrics): add prefix size statistics collection 2025-07-25 12:23:33 -04:00
.gitignore refactoring 2017-11-30 22:35:14 +01:00
.goreleaser.yml ignore freebsd/arm64 2021-03-19 13:48:57 +01:00
bgp-prefix-length-statistics.md fix: add primary filter to count only best routes per prefix 2025-07-25 16:09:54 -04:00
bird_exporter.1.md Add basic support for the Babel protocol. 2021-09-23 13:20:19 +01:00
CLAUDE.md feat(metrics): add prefix size statistics collection 2025-07-25 12:23:33 -04:00
CODEOWNERS Create CODEOWNERS 2023-03-02 21:25:27 +01:00
Dockerfile Update Dockerfile 2020-01-10 15:48:02 +01:00
go.mod use bird_socket v1.0.0 2025-05-19 18:09:12 +02:00
go.sum use bird_socket v1.0.0 2025-05-19 18:09:12 +02:00
LICENSE Update LICENSE 2016-12-11 23:26:43 +01:00
main.go feat: add table-wide prefix statistics with count-based queries 2025-07-25 15:44:19 -04:00
metric_collector.go feat: add table-wide prefix statistics with count-based queries 2025-07-25 15:44:19 -04:00
README.md Update README.md 2023-10-26 10:35:53 +02:00

bird_exporter

Go Report Card

Metric exporter for bird routing daemon to use with Prometheus.

Remarks

Since bird_exporter uses the bird unix sockets, bird has to be installed on the same machine as bird_exporter. Also the user executing bird_exporter must have permission to access the bird socket files.

Bird configuration

To get meaningful uptime information bird has to be configured this way:

timeformat protocol     iso long;

Important information for users of bird 2.0+

Version 2.0 of bird routing daemon does support IPv4 and IPv6 in one single daemon now. For further information see here. Since version 1.1 bird_exporter can be used with bird 2.0+ using the -bird.v2 parameter. When using this parameter bird_exporter queries the same bird socket for IPv4 and IPv6. In this mode the IP protocol is determined by the channel information and parameters -bird.ipv4, -bird.ipv6 and -bird.socket6 are ignored.

Metric formats

In version 1.0 a new metric format was introduced. To prevent a breaking change the new format is optional and can be enabled by using the -format.new flag. The new format handles protocols more generic and allows a better query structure. Also it adheres more to the metric naming best practices. In both formats protocol specific metrics are prefixed with the protocol name (e.g. OSPF running metric).

Since verson 1.3 the new metric format is the default.

This is a short example of the different formats:

old format

bgp4_session_prefix_count_import{name="bgp1"} 600000
bgp6_session_prefix_count_import{name="bgp1"} 50000
ospfv3_running{name="ospf1"} 1

new format

bird_protocol_prefix_import_count{name="bgp1",proto="BGP",ip_version="4"} 600000
bird_protocol_prefix_import_count{name="bgp1",proto="BGP",ip_version="6"} 50000
bird_ospfv3_running{name="ospf1"} 1

Default Port

In version 0.7.1 the default port changed to 9324 since port 9200 is the default port of Elasticsearch. The new port is now registered in the default port allocation list (https://github.com/prometheus/prometheus/wiki/Default-port-allocations)

Sockets

In version 0.8 communication to bird changed to sockets. The default socket path is /var/run/bird.ctl (for bird) and /var/run/bird6.ctl (for bird6). In case you are using different paths in your installation, the socket path can be specified by usind the -bird.socket (for bird) and -bird.socket6 (for bird6) flag.

Install

go get -u github.com/czerwonk/bird_exporter

Usage

bird_exporter -format.new=true

BIRD RS Dashboard

this sample dashboard was created by openbsod. Thanks for contributing!

https://grafana.com/grafana/dashboards/5259-bird-rs/

alt text

Features

  • BGP session state
  • OSPF neighbor/interface count
  • imported / exported / filtered prefix counts / route state changes (BGP, OSPF, Kernel, Static, Device, Direct, Babel)
  • protocol uptimes (BGP, OSPF, BFD)
  • BFD session status

Third Party Components

This software uses components of the following projects

License

(c) Daniel Czerwonk, 2016. Licensed under MIT license.

Prometheus

see https://prometheus.io/

Bird routing daemon

see http://bird.network.cz/