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

Version 1.2.6 does not provide metrics and version 1.4.1 or 1.4.3 do not exist as container image #110

Open telmich opened 2 months ago

telmich commented 2 months ago

Hello,

I am trying to use bird_exporter with bird 2.15.1. I created a k8s manifest as follows:

      containers:
        - name: bird
          image: "ungleich/bird:{{ .Chart.AppVersion }}"
          command:
            - /bin/sh
            - -c
            - "sh /scripts/rp_filter_forward.sh && /usr/sbin/bird -f -c /bird/bird.conf"
          securityContext:
            privileged: true
            capabilities:
              add:
                - NET_BIND_SERVICE
                - NET_RAW
                - NET_ADMIN
          volumeMounts:
            - name: birdconfig
              mountPath: "/bird"
            - name: varrun
              mountPath: "/var/run"
        - name: bird-exporter
          image: czerwonk/bird_exporter:v1.2.6
          args: ["-format.new=true", "-bird.socket=/var/run/bird.ctl"]
          resources:
            limits:
              cpu: 100m
              memory: 32Mi
            requests:
              cpu: 100m
              memory: 32Mi
          volumeMounts:
            - name: varrun
              mountPath: "/var/run"
              readOnly: true

The curl on :9324/metrics results into an empty reply:

% curl -v http://sfpapu1:9324/metrics                                        
* Host sfpapu1:9324 was resolved.
* IPv6: 2a0a:e5c0:10:1:...
* IPv4: (none)
*   Trying [2a0a:e5c0:10:1:...]:9324...
* Connected to sfpapu1.place10.ungleich.ch (2a0a:e5c0:10:1:...) port 9324
> GET /metrics HTTP/1.1
> Host: sfpapu1:9324
> User-Agent: curl/8.9.1
> Accept: */*
> 
* Request completely sent off
< HTTP/1.1 200 OK
< Content-Type: text/plain; version=0.0.4; charset=utf-8
< Date: Tue, 03 Sep 2024 13:55:04 GMT
< Content-Length: 0
< 
* Connection #0 to host sfpapu1 left intact

Trying to use newer versions such as 1.4.1 (mentioned in sample chart) or 1.4.3 (tag exists) does not seem to have a corresponding image on https://hub.docker.com/r/czerwonk/bird_exporter/tags.

Are there any plans for pushing out newer images and am I doing something totally wrong with 1.2.6 that it does not respond to metrics?

telmich commented 2 months ago

I just build and pushed ungleich/bird_exporter:1.4.3-9-gea10eb5 (build process works flawlessly!) and now I get:

bird_socket_query_success 0

which is a bit better than before.

telmich commented 2 months ago

Just checked, the unix socket communication works:

socat - UNIX-CONNECT:/var/run/bird.ctl
0001 BIRD 2.15.1 ready.
show protocols
2002-Name       Proto      Table      State  Since         Info
1002-device1    Device     ---        up     14:05:18.084  
 bfd1       BFD        ---        up     14:05:18.084  
 babel1     Babel      ---        up     14:05:18.084  
 kernel_v6  Kernel     master6    up     14:05:18.084  
 kernel_v4  Kernel     master4    up     14:05:18.084  
 p10siit_v6 Static     master6    up     14:05:18.084  
 p10siit_v4 Static     master4    up     14:05:18.084  
 thisrouter Static     master6    up     14:05:18.084  
 ibgp_server122 BGP        ---        up     14:05:19.225  Established   
 ibgp_server123 BGP        ---        up     14:05:18.752  Established   
 ibgp_server141 BGP        ---        up     14:05:22.526  Established   
 ibgp_server143 BGP        ---        up     14:05:18.519  Established   
 ibgp_sfpapu2 BGP        ---        up     14:05:21.912  Established   
 ibgp_sfpapu3 BGP        ---        up     14:05:21.775  Established   
 ibgp_sfpapu4 BGP        ---        up     14:05:18.787  Established   
 ibgp_vigir28 BGP        ---        start  14:05:18.084  Connect       
 ibgp_vigir29 BGP        ---        start  14:05:18.084  Connect       
0000 

Checking the args, I think I see the bug..."-bird.v2" might be the missing part... and it indeed is:

bird_socket_query_success 1