From 6e9b85ad67a2f74aeb0b18f92a85fe8563e21d16 Mon Sep 17 00:00:00 2001 From: Pranshu Srivastava Date: Tue, 11 Feb 2025 14:14:17 +0530 Subject: [PATCH] chore: ignore/include metrics for FreeBSD Ignore non-deterministic metrics and include deterministic ones. Signed-off-by: Pranshu Srivastava --- collector/fixtures/e2e-64k-page-output.txt | 2 -- collector/fixtures/e2e-output-darwin.txt | 2 -- collector/fixtures/e2e-output-dragonfly.txt | 2 -- collector/fixtures/e2e-output-freebsd.txt | 3 +-- collector/fixtures/e2e-output-openbsd.txt | 2 -- end-to-end-test.sh | 5 +++++ 6 files changed, 6 insertions(+), 10 deletions(-) diff --git a/collector/fixtures/e2e-64k-page-output.txt b/collector/fixtures/e2e-64k-page-output.txt index 030fa88e..6f42f4e0 100644 --- a/collector/fixtures/e2e-64k-page-output.txt +++ b/collector/fixtures/e2e-64k-page-output.txt @@ -2484,8 +2484,6 @@ node_network_net_dev_group{device="eth0"} 0 # TYPE node_network_protocol_type gauge node_network_protocol_type{device="bond0"} 1 node_network_protocol_type{device="eth0"} 1 -# HELP node_network_receive_bytes_total Network device statistic receive_bytes. -# TYPE node_network_receive_bytes_total counter # HELP node_network_receive_compressed_total Network device statistic receive_compressed. # TYPE node_network_receive_compressed_total counter node_network_receive_compressed_total{device="lo"} 0 diff --git a/collector/fixtures/e2e-output-darwin.txt b/collector/fixtures/e2e-output-darwin.txt index 2197a9ef..77eb45cb 100644 --- a/collector/fixtures/e2e-output-darwin.txt +++ b/collector/fixtures/e2e-output-darwin.txt @@ -117,8 +117,6 @@ node_memory_total_bytes 7.516192768e+09 # HELP node_network_noproto_total Network device statistic noproto. # TYPE node_network_noproto_total counter node_network_noproto_total{device="lo0"} 0 -# HELP node_network_receive_bytes_total Network device statistic receive_bytes. -# TYPE node_network_receive_bytes_total counter # HELP node_network_receive_drop_total Network device statistic receive_drop. # TYPE node_network_receive_drop_total counter node_network_receive_drop_total{device="lo0"} 0 diff --git a/collector/fixtures/e2e-output-dragonfly.txt b/collector/fixtures/e2e-output-dragonfly.txt index aef68e2a..b6a828ad 100644 --- a/collector/fixtures/e2e-output-dragonfly.txt +++ b/collector/fixtures/e2e-output-dragonfly.txt @@ -93,8 +93,6 @@ node_buddyinfo_blocks{node="0",size="9",zone="DMA32"} 0 node_buddyinfo_blocks{node="0",size="9",zone="Normal"} 0 # HELP node_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, goversion from which node_exporter was built, and the goos and goarch for the build. # TYPE node_exporter_build_info gauge -# HELP node_network_receive_bytes_total Network device statistic receive_bytes. -# TYPE node_network_receive_bytes_total counter # HELP node_network_receive_drop_total Network device statistic receive_drop. # TYPE node_network_receive_drop_total counter node_network_receive_drop_total{device="lo0"} 0 diff --git a/collector/fixtures/e2e-output-freebsd.txt b/collector/fixtures/e2e-output-freebsd.txt index 82b388b5..e7b1dd50 100644 --- a/collector/fixtures/e2e-output-freebsd.txt +++ b/collector/fixtures/e2e-output-freebsd.txt @@ -126,8 +126,6 @@ node_netisr_maxthreads 1 # HELP node_netisr_numthreads netisr current thread count # TYPE node_netisr_numthreads gauge node_netisr_numthreads 1 -# HELP node_network_receive_bytes_total Network device statistic receive_bytes. -# TYPE node_network_receive_bytes_total counter # HELP node_network_receive_drop_total Network device statistic receive_drop. # TYPE node_network_receive_drop_total counter node_network_receive_drop_total{device="lo0"} 0 @@ -164,6 +162,7 @@ node_scrape_collector_success{collector="loadavg"} 1 node_scrape_collector_success{collector="meminfo"} 1 node_scrape_collector_success{collector="netdev"} 1 node_scrape_collector_success{collector="netisr"} 1 +node_scrape_collector_success{collector="netstat"} 1 node_scrape_collector_success{collector="os"} 1 node_scrape_collector_success{collector="textfile"} 1 node_scrape_collector_success{collector="time"} 1 diff --git a/collector/fixtures/e2e-output-openbsd.txt b/collector/fixtures/e2e-output-openbsd.txt index 1afdad59..96d2109d 100644 --- a/collector/fixtures/e2e-output-openbsd.txt +++ b/collector/fixtures/e2e-output-openbsd.txt @@ -109,8 +109,6 @@ node_memory_swapped_out_pages_bytes_total 0 # TYPE node_network_noproto_total counter node_network_noproto_total{device="lo0"} 0 node_network_noproto_total{device="pflog0"} 0 -# HELP node_network_receive_bytes_total Network device statistic receive_bytes. -# TYPE node_network_receive_bytes_total counter # HELP node_network_receive_drop_total Network device statistic receive_drop. # TYPE node_network_receive_drop_total counter node_network_receive_drop_total{device="lo0"} 0 diff --git a/end-to-end-test.sh b/end-to-end-test.sh index 04cab1d8..944bdc0e 100755 --- a/end-to-end-test.sh +++ b/end-to-end-test.sh @@ -320,6 +320,8 @@ sleep 1 get "127.0.0.1:${port}/metrics" | grep --text -E -v "${skip_re}" > "${generated_metrics}" +# The following ignore-list is only applicable to the VMs used to run E2E tests on platforms for which containerized environments are not available. +# However, owing to this, there are some non-deterministic metrics that end up generating samples, unlike their containerized counterparts, for e.g., node_network_receive_bytes_total. non_deterministic_metrics=$(cat << METRICS node_boot_time_seconds node_cpu_frequency_hertz @@ -356,6 +358,9 @@ non_deterministic_metrics=$(cat << METRICS node_memory_swapped_in_bytes_total node_memory_swapped_out_bytes_total node_memory_wired_bytes + node_netstat_tcp_receive_packets_total + node_netstat_tcp_transmit_packets_total + node_network_receive_bytes_total node_network_receive_multicast_total node_network_transmit_multicast_total METRICS