Skip to content

Commit

Permalink
Merge pull request #331 from napalm-automation/prom-bgp-state
Browse files Browse the repository at this point in the history
Remove previous_state and current_state labels from the BGP metrics
  • Loading branch information
mirceaulinic committed Apr 27, 2020
2 parents f112cb4 + ebdc2e2 commit 43059bc
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions napalm_logs/transport/prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,16 +305,14 @@ def _parse_bgp_neighbor_state_changed(self, msg):
self.metrics['BGP_NEIGHBOR_STATE_CHANGED'] = Counter(
'napalm_logs_bgp_neighbor_state_changed',
'Counter for BGP_NEIGHBOR_STATE_CHANGED notifications',
['host', 'neighbor', 'peer_as', 'current_state', 'previous_state']
['host', 'neighbor', 'peer_as']
)
neigh_dict = msg['yang_message']['bgp']['neighbors']['neighbor']
neighbor = list(neigh_dict.keys())[0]
self.metrics['BGP_NEIGHBOR_STATE_CHANGED'].labels(
host=msg['host'],
neighbor=neighbor,
peer_as=neigh_dict[neighbor]['state']['peer_as'],
current_state=neigh_dict[neighbor]['state']['session-state'],
previous_state=neigh_dict[neighbor]['state']['session-state-old']
).inc()

def _parse_bgp_md5_incorrect(self, msg):
Expand Down

0 comments on commit 43059bc

Please sign in to comment.