Skip to content

Commit

Permalink
Add new collector and metrics for XFRM (#2544) (#2866)
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Lam <gavin.oss@tutamail.com>
  • Loading branch information
gavinkflam authored Dec 3, 2023
1 parent e508aff commit 332232c
Show file tree
Hide file tree
Showing 7 changed files with 579 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ sysctl | Expose sysctl values from `/proc/sys`. Use `--collector.sysctl.include(
systemd | Exposes service and system status from [systemd](http://www.freedesktop.org/wiki/Software/systemd/). | Linux
tcpstat | Exposes TCP connection status information from `/proc/net/tcp` and `/proc/net/tcp6`. (Warning: the current version has potential performance issues in high load situations.) | Linux
wifi | Exposes WiFi device and station statistics. | Linux
xfrm | Exposes statistics from `/proc/net/xfrm_stat` | Linux
zoneinfo | Exposes NUMA memory zone metrics. | Linux

### Deprecated
Expand Down
85 changes: 85 additions & 0 deletions collector/fixtures/e2e-64k-page-output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2944,6 +2944,7 @@ node_scrape_collector_success{collector="time"} 1
node_scrape_collector_success{collector="udp_queues"} 1
node_scrape_collector_success{collector="vmstat"} 1
node_scrape_collector_success{collector="wifi"} 1
node_scrape_collector_success{collector="xfrm"} 1
node_scrape_collector_success{collector="xfs"} 1
node_scrape_collector_success{collector="zfs"} 1
node_scrape_collector_success{collector="zoneinfo"} 1
Expand Down Expand Up @@ -3265,6 +3266,90 @@ node_wifi_station_transmit_failed_total{device="wlan0",mac_address="aa:bb:cc:dd:
# TYPE node_wifi_station_transmit_retries_total counter
node_wifi_station_transmit_retries_total{device="wlan0",mac_address="01:02:03:04:05:06"} 20
node_wifi_station_transmit_retries_total{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 10
# HELP node_xfrm_acquire_error_packets_total State hasn’t been fully acquired before use
# TYPE node_xfrm_acquire_error_packets_total counter
node_xfrm_acquire_error_packets_total 24532
# HELP node_xfrm_fwd_hdr_error_packets_total Forward routing of a packet is not allowed
# TYPE node_xfrm_fwd_hdr_error_packets_total counter
node_xfrm_fwd_hdr_error_packets_total 6654
# HELP node_xfrm_in_buffer_error_packets_total No buffer is left
# TYPE node_xfrm_in_buffer_error_packets_total counter
node_xfrm_in_buffer_error_packets_total 2
# HELP node_xfrm_in_error_packets_total All errors not matched by other
# TYPE node_xfrm_in_error_packets_total counter
node_xfrm_in_error_packets_total 1
# HELP node_xfrm_in_hdr_error_packets_total Header error
# TYPE node_xfrm_in_hdr_error_packets_total counter
node_xfrm_in_hdr_error_packets_total 4
# HELP node_xfrm_in_no_pols_packets_total No policy is found for states e.g. Inbound SAs are correct but no SP is found
# TYPE node_xfrm_in_no_pols_packets_total counter
node_xfrm_in_no_pols_packets_total 65432
# HELP node_xfrm_in_no_states_packets_total No state is found i.e. Either inbound SPI, address, or IPsec protocol at SA is wrong
# TYPE node_xfrm_in_no_states_packets_total counter
node_xfrm_in_no_states_packets_total 3
# HELP node_xfrm_in_pol_block_packets_total Policy discards
# TYPE node_xfrm_in_pol_block_packets_total counter
node_xfrm_in_pol_block_packets_total 100
# HELP node_xfrm_in_pol_error_packets_total Policy error
# TYPE node_xfrm_in_pol_error_packets_total counter
node_xfrm_in_pol_error_packets_total 10000
# HELP node_xfrm_in_state_expired_packets_total State is expired
# TYPE node_xfrm_in_state_expired_packets_total counter
node_xfrm_in_state_expired_packets_total 7
# HELP node_xfrm_in_state_invalid_packets_total State is invalid
# TYPE node_xfrm_in_state_invalid_packets_total counter
node_xfrm_in_state_invalid_packets_total 55555
# HELP node_xfrm_in_state_mismatch_packets_total State has mismatch option e.g. UDP encapsulation type is mismatch
# TYPE node_xfrm_in_state_mismatch_packets_total counter
node_xfrm_in_state_mismatch_packets_total 23451
# HELP node_xfrm_in_state_mode_error_packets_total Transformation mode specific error
# TYPE node_xfrm_in_state_mode_error_packets_total counter
node_xfrm_in_state_mode_error_packets_total 100
# HELP node_xfrm_in_state_proto_error_packets_total Transformation protocol specific error e.g. SA key is wrong
# TYPE node_xfrm_in_state_proto_error_packets_total counter
node_xfrm_in_state_proto_error_packets_total 40
# HELP node_xfrm_in_state_seq_error_packets_total Sequence error i.e. Sequence number is out of window
# TYPE node_xfrm_in_state_seq_error_packets_total counter
node_xfrm_in_state_seq_error_packets_total 6000
# HELP node_xfrm_in_tmpl_mismatch_packets_total No matching template for states e.g. Inbound SAs are correct but SP rule is wrong
# TYPE node_xfrm_in_tmpl_mismatch_packets_total counter
node_xfrm_in_tmpl_mismatch_packets_total 51
# HELP node_xfrm_out_bundle_check_error_packets_total Bundle check error
# TYPE node_xfrm_out_bundle_check_error_packets_total counter
node_xfrm_out_bundle_check_error_packets_total 555
# HELP node_xfrm_out_bundle_gen_error_packets_total Bundle generation error
# TYPE node_xfrm_out_bundle_gen_error_packets_total counter
node_xfrm_out_bundle_gen_error_packets_total 43321
# HELP node_xfrm_out_error_packets_total All errors which is not matched others
# TYPE node_xfrm_out_error_packets_total counter
node_xfrm_out_error_packets_total 1e+06
# HELP node_xfrm_out_no_states_packets_total No state is found
# TYPE node_xfrm_out_no_states_packets_total counter
node_xfrm_out_no_states_packets_total 869
# HELP node_xfrm_out_pol_block_packets_total Policy discards
# TYPE node_xfrm_out_pol_block_packets_total counter
node_xfrm_out_pol_block_packets_total 43456
# HELP node_xfrm_out_pol_dead_packets_total Policy is dead
# TYPE node_xfrm_out_pol_dead_packets_total counter
node_xfrm_out_pol_dead_packets_total 7656
# HELP node_xfrm_out_pol_error_packets_total Policy error
# TYPE node_xfrm_out_pol_error_packets_total counter
node_xfrm_out_pol_error_packets_total 1454
# HELP node_xfrm_out_state_expired_packets_total State is expired
# TYPE node_xfrm_out_state_expired_packets_total counter
node_xfrm_out_state_expired_packets_total 565
# HELP node_xfrm_out_state_invalid_packets_total State is invalid, perhaps expired
# TYPE node_xfrm_out_state_invalid_packets_total counter
node_xfrm_out_state_invalid_packets_total 28765
# HELP node_xfrm_out_state_mode_error_packets_total Transformation mode specific error
# TYPE node_xfrm_out_state_mode_error_packets_total counter
node_xfrm_out_state_mode_error_packets_total 8
# HELP node_xfrm_out_state_proto_error_packets_total Transformation protocol specific error
# TYPE node_xfrm_out_state_proto_error_packets_total counter
node_xfrm_out_state_proto_error_packets_total 4542
# HELP node_xfrm_out_state_seq_error_packets_total Sequence error i.e. Sequence number overflow
# TYPE node_xfrm_out_state_seq_error_packets_total counter
node_xfrm_out_state_seq_error_packets_total 543
# HELP node_xfs_allocation_btree_compares_total Number of allocation B-tree compares for a filesystem.
# TYPE node_xfs_allocation_btree_compares_total counter
node_xfs_allocation_btree_compares_total{device="sda1"} 0
Expand Down
85 changes: 85 additions & 0 deletions collector/fixtures/e2e-output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2966,6 +2966,7 @@ node_scrape_collector_success{collector="time"} 1
node_scrape_collector_success{collector="udp_queues"} 1
node_scrape_collector_success{collector="vmstat"} 1
node_scrape_collector_success{collector="wifi"} 1
node_scrape_collector_success{collector="xfrm"} 1
node_scrape_collector_success{collector="xfs"} 1
node_scrape_collector_success{collector="zfs"} 1
node_scrape_collector_success{collector="zoneinfo"} 1
Expand Down Expand Up @@ -3287,6 +3288,90 @@ node_wifi_station_transmit_failed_total{device="wlan0",mac_address="aa:bb:cc:dd:
# TYPE node_wifi_station_transmit_retries_total counter
node_wifi_station_transmit_retries_total{device="wlan0",mac_address="01:02:03:04:05:06"} 20
node_wifi_station_transmit_retries_total{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 10
# HELP node_xfrm_acquire_error_packets_total State hasn’t been fully acquired before use
# TYPE node_xfrm_acquire_error_packets_total counter
node_xfrm_acquire_error_packets_total 24532
# HELP node_xfrm_fwd_hdr_error_packets_total Forward routing of a packet is not allowed
# TYPE node_xfrm_fwd_hdr_error_packets_total counter
node_xfrm_fwd_hdr_error_packets_total 6654
# HELP node_xfrm_in_buffer_error_packets_total No buffer is left
# TYPE node_xfrm_in_buffer_error_packets_total counter
node_xfrm_in_buffer_error_packets_total 2
# HELP node_xfrm_in_error_packets_total All errors not matched by other
# TYPE node_xfrm_in_error_packets_total counter
node_xfrm_in_error_packets_total 1
# HELP node_xfrm_in_hdr_error_packets_total Header error
# TYPE node_xfrm_in_hdr_error_packets_total counter
node_xfrm_in_hdr_error_packets_total 4
# HELP node_xfrm_in_no_pols_packets_total No policy is found for states e.g. Inbound SAs are correct but no SP is found
# TYPE node_xfrm_in_no_pols_packets_total counter
node_xfrm_in_no_pols_packets_total 65432
# HELP node_xfrm_in_no_states_packets_total No state is found i.e. Either inbound SPI, address, or IPsec protocol at SA is wrong
# TYPE node_xfrm_in_no_states_packets_total counter
node_xfrm_in_no_states_packets_total 3
# HELP node_xfrm_in_pol_block_packets_total Policy discards
# TYPE node_xfrm_in_pol_block_packets_total counter
node_xfrm_in_pol_block_packets_total 100
# HELP node_xfrm_in_pol_error_packets_total Policy error
# TYPE node_xfrm_in_pol_error_packets_total counter
node_xfrm_in_pol_error_packets_total 10000
# HELP node_xfrm_in_state_expired_packets_total State is expired
# TYPE node_xfrm_in_state_expired_packets_total counter
node_xfrm_in_state_expired_packets_total 7
# HELP node_xfrm_in_state_invalid_packets_total State is invalid
# TYPE node_xfrm_in_state_invalid_packets_total counter
node_xfrm_in_state_invalid_packets_total 55555
# HELP node_xfrm_in_state_mismatch_packets_total State has mismatch option e.g. UDP encapsulation type is mismatch
# TYPE node_xfrm_in_state_mismatch_packets_total counter
node_xfrm_in_state_mismatch_packets_total 23451
# HELP node_xfrm_in_state_mode_error_packets_total Transformation mode specific error
# TYPE node_xfrm_in_state_mode_error_packets_total counter
node_xfrm_in_state_mode_error_packets_total 100
# HELP node_xfrm_in_state_proto_error_packets_total Transformation protocol specific error e.g. SA key is wrong
# TYPE node_xfrm_in_state_proto_error_packets_total counter
node_xfrm_in_state_proto_error_packets_total 40
# HELP node_xfrm_in_state_seq_error_packets_total Sequence error i.e. Sequence number is out of window
# TYPE node_xfrm_in_state_seq_error_packets_total counter
node_xfrm_in_state_seq_error_packets_total 6000
# HELP node_xfrm_in_tmpl_mismatch_packets_total No matching template for states e.g. Inbound SAs are correct but SP rule is wrong
# TYPE node_xfrm_in_tmpl_mismatch_packets_total counter
node_xfrm_in_tmpl_mismatch_packets_total 51
# HELP node_xfrm_out_bundle_check_error_packets_total Bundle check error
# TYPE node_xfrm_out_bundle_check_error_packets_total counter
node_xfrm_out_bundle_check_error_packets_total 555
# HELP node_xfrm_out_bundle_gen_error_packets_total Bundle generation error
# TYPE node_xfrm_out_bundle_gen_error_packets_total counter
node_xfrm_out_bundle_gen_error_packets_total 43321
# HELP node_xfrm_out_error_packets_total All errors which is not matched others
# TYPE node_xfrm_out_error_packets_total counter
node_xfrm_out_error_packets_total 1e+06
# HELP node_xfrm_out_no_states_packets_total No state is found
# TYPE node_xfrm_out_no_states_packets_total counter
node_xfrm_out_no_states_packets_total 869
# HELP node_xfrm_out_pol_block_packets_total Policy discards
# TYPE node_xfrm_out_pol_block_packets_total counter
node_xfrm_out_pol_block_packets_total 43456
# HELP node_xfrm_out_pol_dead_packets_total Policy is dead
# TYPE node_xfrm_out_pol_dead_packets_total counter
node_xfrm_out_pol_dead_packets_total 7656
# HELP node_xfrm_out_pol_error_packets_total Policy error
# TYPE node_xfrm_out_pol_error_packets_total counter
node_xfrm_out_pol_error_packets_total 1454
# HELP node_xfrm_out_state_expired_packets_total State is expired
# TYPE node_xfrm_out_state_expired_packets_total counter
node_xfrm_out_state_expired_packets_total 565
# HELP node_xfrm_out_state_invalid_packets_total State is invalid, perhaps expired
# TYPE node_xfrm_out_state_invalid_packets_total counter
node_xfrm_out_state_invalid_packets_total 28765
# HELP node_xfrm_out_state_mode_error_packets_total Transformation mode specific error
# TYPE node_xfrm_out_state_mode_error_packets_total counter
node_xfrm_out_state_mode_error_packets_total 8
# HELP node_xfrm_out_state_proto_error_packets_total Transformation protocol specific error
# TYPE node_xfrm_out_state_proto_error_packets_total counter
node_xfrm_out_state_proto_error_packets_total 4542
# HELP node_xfrm_out_state_seq_error_packets_total Sequence error i.e. Sequence number overflow
# TYPE node_xfrm_out_state_seq_error_packets_total counter
node_xfrm_out_state_seq_error_packets_total 543
# HELP node_xfs_allocation_btree_compares_total Number of allocation B-tree compares for a filesystem.
# TYPE node_xfs_allocation_btree_compares_total counter
node_xfs_allocation_btree_compares_total{device="sda1"} 0
Expand Down
28 changes: 28 additions & 0 deletions collector/fixtures/proc/net/xfrm_stat
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
XfrmInError 1
XfrmInBufferError 2
XfrmInHdrError 4
XfrmInNoStates 3
XfrmInStateProtoError 40
XfrmInStateModeError 100
XfrmInStateSeqError 6000
XfrmInStateExpired 7
XfrmInStateMismatch 23451
XfrmInStateInvalid 55555
XfrmInTmplMismatch 51
XfrmInNoPols 65432
XfrmInPolBlock 100
XfrmInPolError 10000
XfrmOutError 1000000
XfrmOutBundleGenError 43321
XfrmOutBundleCheckError 555
XfrmOutNoStates 869
XfrmOutStateProtoError 4542
XfrmOutStateModeError 8
XfrmOutStateSeqError 543
XfrmOutStateExpired 565
XfrmOutPolBlock 43456
XfrmOutPolDead 7656
XfrmOutPolError 1454
XfrmFwdHdrError 6654
XfrmOutStateInvalid 28765
XfrmAcquireError 24532
Loading

0 comments on commit 332232c

Please sign in to comment.