Skip to content

Commit 332232c

Browse files
authored
Add new collector and metrics for XFRM (#2544) (#2866)
Signed-off-by: Gavin Lam <[email protected]>
1 parent e508aff commit 332232c

File tree

7 files changed

+579
-0
lines changed

7 files changed

+579
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ sysctl | Expose sysctl values from `/proc/sys`. Use `--collector.sysctl.include(
205205
systemd | Exposes service and system status from [systemd](http://www.freedesktop.org/wiki/Software/systemd/). | Linux
206206
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
207207
wifi | Exposes WiFi device and station statistics. | Linux
208+
xfrm | Exposes statistics from `/proc/net/xfrm_stat` | Linux
208209
zoneinfo | Exposes NUMA memory zone metrics. | Linux
209210

210211
### Deprecated

collector/fixtures/e2e-64k-page-output.txt

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2944,6 +2944,7 @@ node_scrape_collector_success{collector="time"} 1
29442944
node_scrape_collector_success{collector="udp_queues"} 1
29452945
node_scrape_collector_success{collector="vmstat"} 1
29462946
node_scrape_collector_success{collector="wifi"} 1
2947+
node_scrape_collector_success{collector="xfrm"} 1
29472948
node_scrape_collector_success{collector="xfs"} 1
29482949
node_scrape_collector_success{collector="zfs"} 1
29492950
node_scrape_collector_success{collector="zoneinfo"} 1
@@ -3265,6 +3266,90 @@ node_wifi_station_transmit_failed_total{device="wlan0",mac_address="aa:bb:cc:dd:
32653266
# TYPE node_wifi_station_transmit_retries_total counter
32663267
node_wifi_station_transmit_retries_total{device="wlan0",mac_address="01:02:03:04:05:06"} 20
32673268
node_wifi_station_transmit_retries_total{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 10
3269+
# HELP node_xfrm_acquire_error_packets_total State hasn’t been fully acquired before use
3270+
# TYPE node_xfrm_acquire_error_packets_total counter
3271+
node_xfrm_acquire_error_packets_total 24532
3272+
# HELP node_xfrm_fwd_hdr_error_packets_total Forward routing of a packet is not allowed
3273+
# TYPE node_xfrm_fwd_hdr_error_packets_total counter
3274+
node_xfrm_fwd_hdr_error_packets_total 6654
3275+
# HELP node_xfrm_in_buffer_error_packets_total No buffer is left
3276+
# TYPE node_xfrm_in_buffer_error_packets_total counter
3277+
node_xfrm_in_buffer_error_packets_total 2
3278+
# HELP node_xfrm_in_error_packets_total All errors not matched by other
3279+
# TYPE node_xfrm_in_error_packets_total counter
3280+
node_xfrm_in_error_packets_total 1
3281+
# HELP node_xfrm_in_hdr_error_packets_total Header error
3282+
# TYPE node_xfrm_in_hdr_error_packets_total counter
3283+
node_xfrm_in_hdr_error_packets_total 4
3284+
# 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
3285+
# TYPE node_xfrm_in_no_pols_packets_total counter
3286+
node_xfrm_in_no_pols_packets_total 65432
3287+
# 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
3288+
# TYPE node_xfrm_in_no_states_packets_total counter
3289+
node_xfrm_in_no_states_packets_total 3
3290+
# HELP node_xfrm_in_pol_block_packets_total Policy discards
3291+
# TYPE node_xfrm_in_pol_block_packets_total counter
3292+
node_xfrm_in_pol_block_packets_total 100
3293+
# HELP node_xfrm_in_pol_error_packets_total Policy error
3294+
# TYPE node_xfrm_in_pol_error_packets_total counter
3295+
node_xfrm_in_pol_error_packets_total 10000
3296+
# HELP node_xfrm_in_state_expired_packets_total State is expired
3297+
# TYPE node_xfrm_in_state_expired_packets_total counter
3298+
node_xfrm_in_state_expired_packets_total 7
3299+
# HELP node_xfrm_in_state_invalid_packets_total State is invalid
3300+
# TYPE node_xfrm_in_state_invalid_packets_total counter
3301+
node_xfrm_in_state_invalid_packets_total 55555
3302+
# HELP node_xfrm_in_state_mismatch_packets_total State has mismatch option e.g. UDP encapsulation type is mismatch
3303+
# TYPE node_xfrm_in_state_mismatch_packets_total counter
3304+
node_xfrm_in_state_mismatch_packets_total 23451
3305+
# HELP node_xfrm_in_state_mode_error_packets_total Transformation mode specific error
3306+
# TYPE node_xfrm_in_state_mode_error_packets_total counter
3307+
node_xfrm_in_state_mode_error_packets_total 100
3308+
# HELP node_xfrm_in_state_proto_error_packets_total Transformation protocol specific error e.g. SA key is wrong
3309+
# TYPE node_xfrm_in_state_proto_error_packets_total counter
3310+
node_xfrm_in_state_proto_error_packets_total 40
3311+
# HELP node_xfrm_in_state_seq_error_packets_total Sequence error i.e. Sequence number is out of window
3312+
# TYPE node_xfrm_in_state_seq_error_packets_total counter
3313+
node_xfrm_in_state_seq_error_packets_total 6000
3314+
# HELP node_xfrm_in_tmpl_mismatch_packets_total No matching template for states e.g. Inbound SAs are correct but SP rule is wrong
3315+
# TYPE node_xfrm_in_tmpl_mismatch_packets_total counter
3316+
node_xfrm_in_tmpl_mismatch_packets_total 51
3317+
# HELP node_xfrm_out_bundle_check_error_packets_total Bundle check error
3318+
# TYPE node_xfrm_out_bundle_check_error_packets_total counter
3319+
node_xfrm_out_bundle_check_error_packets_total 555
3320+
# HELP node_xfrm_out_bundle_gen_error_packets_total Bundle generation error
3321+
# TYPE node_xfrm_out_bundle_gen_error_packets_total counter
3322+
node_xfrm_out_bundle_gen_error_packets_total 43321
3323+
# HELP node_xfrm_out_error_packets_total All errors which is not matched others
3324+
# TYPE node_xfrm_out_error_packets_total counter
3325+
node_xfrm_out_error_packets_total 1e+06
3326+
# HELP node_xfrm_out_no_states_packets_total No state is found
3327+
# TYPE node_xfrm_out_no_states_packets_total counter
3328+
node_xfrm_out_no_states_packets_total 869
3329+
# HELP node_xfrm_out_pol_block_packets_total Policy discards
3330+
# TYPE node_xfrm_out_pol_block_packets_total counter
3331+
node_xfrm_out_pol_block_packets_total 43456
3332+
# HELP node_xfrm_out_pol_dead_packets_total Policy is dead
3333+
# TYPE node_xfrm_out_pol_dead_packets_total counter
3334+
node_xfrm_out_pol_dead_packets_total 7656
3335+
# HELP node_xfrm_out_pol_error_packets_total Policy error
3336+
# TYPE node_xfrm_out_pol_error_packets_total counter
3337+
node_xfrm_out_pol_error_packets_total 1454
3338+
# HELP node_xfrm_out_state_expired_packets_total State is expired
3339+
# TYPE node_xfrm_out_state_expired_packets_total counter
3340+
node_xfrm_out_state_expired_packets_total 565
3341+
# HELP node_xfrm_out_state_invalid_packets_total State is invalid, perhaps expired
3342+
# TYPE node_xfrm_out_state_invalid_packets_total counter
3343+
node_xfrm_out_state_invalid_packets_total 28765
3344+
# HELP node_xfrm_out_state_mode_error_packets_total Transformation mode specific error
3345+
# TYPE node_xfrm_out_state_mode_error_packets_total counter
3346+
node_xfrm_out_state_mode_error_packets_total 8
3347+
# HELP node_xfrm_out_state_proto_error_packets_total Transformation protocol specific error
3348+
# TYPE node_xfrm_out_state_proto_error_packets_total counter
3349+
node_xfrm_out_state_proto_error_packets_total 4542
3350+
# HELP node_xfrm_out_state_seq_error_packets_total Sequence error i.e. Sequence number overflow
3351+
# TYPE node_xfrm_out_state_seq_error_packets_total counter
3352+
node_xfrm_out_state_seq_error_packets_total 543
32683353
# HELP node_xfs_allocation_btree_compares_total Number of allocation B-tree compares for a filesystem.
32693354
# TYPE node_xfs_allocation_btree_compares_total counter
32703355
node_xfs_allocation_btree_compares_total{device="sda1"} 0

collector/fixtures/e2e-output.txt

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2966,6 +2966,7 @@ node_scrape_collector_success{collector="time"} 1
29662966
node_scrape_collector_success{collector="udp_queues"} 1
29672967
node_scrape_collector_success{collector="vmstat"} 1
29682968
node_scrape_collector_success{collector="wifi"} 1
2969+
node_scrape_collector_success{collector="xfrm"} 1
29692970
node_scrape_collector_success{collector="xfs"} 1
29702971
node_scrape_collector_success{collector="zfs"} 1
29712972
node_scrape_collector_success{collector="zoneinfo"} 1
@@ -3287,6 +3288,90 @@ node_wifi_station_transmit_failed_total{device="wlan0",mac_address="aa:bb:cc:dd:
32873288
# TYPE node_wifi_station_transmit_retries_total counter
32883289
node_wifi_station_transmit_retries_total{device="wlan0",mac_address="01:02:03:04:05:06"} 20
32893290
node_wifi_station_transmit_retries_total{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 10
3291+
# HELP node_xfrm_acquire_error_packets_total State hasn’t been fully acquired before use
3292+
# TYPE node_xfrm_acquire_error_packets_total counter
3293+
node_xfrm_acquire_error_packets_total 24532
3294+
# HELP node_xfrm_fwd_hdr_error_packets_total Forward routing of a packet is not allowed
3295+
# TYPE node_xfrm_fwd_hdr_error_packets_total counter
3296+
node_xfrm_fwd_hdr_error_packets_total 6654
3297+
# HELP node_xfrm_in_buffer_error_packets_total No buffer is left
3298+
# TYPE node_xfrm_in_buffer_error_packets_total counter
3299+
node_xfrm_in_buffer_error_packets_total 2
3300+
# HELP node_xfrm_in_error_packets_total All errors not matched by other
3301+
# TYPE node_xfrm_in_error_packets_total counter
3302+
node_xfrm_in_error_packets_total 1
3303+
# HELP node_xfrm_in_hdr_error_packets_total Header error
3304+
# TYPE node_xfrm_in_hdr_error_packets_total counter
3305+
node_xfrm_in_hdr_error_packets_total 4
3306+
# 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
3307+
# TYPE node_xfrm_in_no_pols_packets_total counter
3308+
node_xfrm_in_no_pols_packets_total 65432
3309+
# 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
3310+
# TYPE node_xfrm_in_no_states_packets_total counter
3311+
node_xfrm_in_no_states_packets_total 3
3312+
# HELP node_xfrm_in_pol_block_packets_total Policy discards
3313+
# TYPE node_xfrm_in_pol_block_packets_total counter
3314+
node_xfrm_in_pol_block_packets_total 100
3315+
# HELP node_xfrm_in_pol_error_packets_total Policy error
3316+
# TYPE node_xfrm_in_pol_error_packets_total counter
3317+
node_xfrm_in_pol_error_packets_total 10000
3318+
# HELP node_xfrm_in_state_expired_packets_total State is expired
3319+
# TYPE node_xfrm_in_state_expired_packets_total counter
3320+
node_xfrm_in_state_expired_packets_total 7
3321+
# HELP node_xfrm_in_state_invalid_packets_total State is invalid
3322+
# TYPE node_xfrm_in_state_invalid_packets_total counter
3323+
node_xfrm_in_state_invalid_packets_total 55555
3324+
# HELP node_xfrm_in_state_mismatch_packets_total State has mismatch option e.g. UDP encapsulation type is mismatch
3325+
# TYPE node_xfrm_in_state_mismatch_packets_total counter
3326+
node_xfrm_in_state_mismatch_packets_total 23451
3327+
# HELP node_xfrm_in_state_mode_error_packets_total Transformation mode specific error
3328+
# TYPE node_xfrm_in_state_mode_error_packets_total counter
3329+
node_xfrm_in_state_mode_error_packets_total 100
3330+
# HELP node_xfrm_in_state_proto_error_packets_total Transformation protocol specific error e.g. SA key is wrong
3331+
# TYPE node_xfrm_in_state_proto_error_packets_total counter
3332+
node_xfrm_in_state_proto_error_packets_total 40
3333+
# HELP node_xfrm_in_state_seq_error_packets_total Sequence error i.e. Sequence number is out of window
3334+
# TYPE node_xfrm_in_state_seq_error_packets_total counter
3335+
node_xfrm_in_state_seq_error_packets_total 6000
3336+
# HELP node_xfrm_in_tmpl_mismatch_packets_total No matching template for states e.g. Inbound SAs are correct but SP rule is wrong
3337+
# TYPE node_xfrm_in_tmpl_mismatch_packets_total counter
3338+
node_xfrm_in_tmpl_mismatch_packets_total 51
3339+
# HELP node_xfrm_out_bundle_check_error_packets_total Bundle check error
3340+
# TYPE node_xfrm_out_bundle_check_error_packets_total counter
3341+
node_xfrm_out_bundle_check_error_packets_total 555
3342+
# HELP node_xfrm_out_bundle_gen_error_packets_total Bundle generation error
3343+
# TYPE node_xfrm_out_bundle_gen_error_packets_total counter
3344+
node_xfrm_out_bundle_gen_error_packets_total 43321
3345+
# HELP node_xfrm_out_error_packets_total All errors which is not matched others
3346+
# TYPE node_xfrm_out_error_packets_total counter
3347+
node_xfrm_out_error_packets_total 1e+06
3348+
# HELP node_xfrm_out_no_states_packets_total No state is found
3349+
# TYPE node_xfrm_out_no_states_packets_total counter
3350+
node_xfrm_out_no_states_packets_total 869
3351+
# HELP node_xfrm_out_pol_block_packets_total Policy discards
3352+
# TYPE node_xfrm_out_pol_block_packets_total counter
3353+
node_xfrm_out_pol_block_packets_total 43456
3354+
# HELP node_xfrm_out_pol_dead_packets_total Policy is dead
3355+
# TYPE node_xfrm_out_pol_dead_packets_total counter
3356+
node_xfrm_out_pol_dead_packets_total 7656
3357+
# HELP node_xfrm_out_pol_error_packets_total Policy error
3358+
# TYPE node_xfrm_out_pol_error_packets_total counter
3359+
node_xfrm_out_pol_error_packets_total 1454
3360+
# HELP node_xfrm_out_state_expired_packets_total State is expired
3361+
# TYPE node_xfrm_out_state_expired_packets_total counter
3362+
node_xfrm_out_state_expired_packets_total 565
3363+
# HELP node_xfrm_out_state_invalid_packets_total State is invalid, perhaps expired
3364+
# TYPE node_xfrm_out_state_invalid_packets_total counter
3365+
node_xfrm_out_state_invalid_packets_total 28765
3366+
# HELP node_xfrm_out_state_mode_error_packets_total Transformation mode specific error
3367+
# TYPE node_xfrm_out_state_mode_error_packets_total counter
3368+
node_xfrm_out_state_mode_error_packets_total 8
3369+
# HELP node_xfrm_out_state_proto_error_packets_total Transformation protocol specific error
3370+
# TYPE node_xfrm_out_state_proto_error_packets_total counter
3371+
node_xfrm_out_state_proto_error_packets_total 4542
3372+
# HELP node_xfrm_out_state_seq_error_packets_total Sequence error i.e. Sequence number overflow
3373+
# TYPE node_xfrm_out_state_seq_error_packets_total counter
3374+
node_xfrm_out_state_seq_error_packets_total 543
32903375
# HELP node_xfs_allocation_btree_compares_total Number of allocation B-tree compares for a filesystem.
32913376
# TYPE node_xfs_allocation_btree_compares_total counter
32923377
node_xfs_allocation_btree_compares_total{device="sda1"} 0

collector/fixtures/proc/net/xfrm_stat

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
XfrmInError 1
2+
XfrmInBufferError 2
3+
XfrmInHdrError 4
4+
XfrmInNoStates 3
5+
XfrmInStateProtoError 40
6+
XfrmInStateModeError 100
7+
XfrmInStateSeqError 6000
8+
XfrmInStateExpired 7
9+
XfrmInStateMismatch 23451
10+
XfrmInStateInvalid 55555
11+
XfrmInTmplMismatch 51
12+
XfrmInNoPols 65432
13+
XfrmInPolBlock 100
14+
XfrmInPolError 10000
15+
XfrmOutError 1000000
16+
XfrmOutBundleGenError 43321
17+
XfrmOutBundleCheckError 555
18+
XfrmOutNoStates 869
19+
XfrmOutStateProtoError 4542
20+
XfrmOutStateModeError 8
21+
XfrmOutStateSeqError 543
22+
XfrmOutStateExpired 565
23+
XfrmOutPolBlock 43456
24+
XfrmOutPolDead 7656
25+
XfrmOutPolError 1454
26+
XfrmFwdHdrError 6654
27+
XfrmOutStateInvalid 28765
28+
XfrmAcquireError 24532

0 commit comments

Comments
 (0)