Skip to content

Commit 2f21133

Browse files
authored
chore: ignore/include metrics for FreeBSD (#3242)
* chore: ignore/include metrics for FreeBSD Ignore non-deterministic metrics and include deterministic ones. Use go123 for NetBSD from upstream release channel rather than the package manager as that doesn't exist. * https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/x86_64/10.0_2024Q4/All/ --------- Signed-off-by: Pranshu Srivastava <[email protected]>
1 parent 11365f9 commit 2f21133

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

.github/workflows/bsd.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515
GNU_TAR_VERSION: "1.35"
1616
GO_VERSION_DRAGONFLY: "1.23.3"
1717
GO_VERSION_FREEBSD: "123"
18-
GO_VERSION_NETBSD: "123"
18+
GO_VERSION_NETBSD: "1.23.3"
1919
GO_VERSION_OPENBSD: "1.23.1"
2020
GO_VERSION_SOLARIS: "1.23.3"
2121

@@ -131,7 +131,6 @@ jobs:
131131
/usr/sbin/pkg_add \
132132
git \
133133
gmake \
134-
go${GO_VERSION_NETBSD} \
135134
grep \
136135
gsed \
137136
gtar-base-${GNU_TAR_VERSION}\
@@ -141,7 +140,10 @@ jobs:
141140
echo "::group::Setup prerequisites"
142141
set -eu
143142
mkdir bin
144-
ln -s $(which go${GO_VERSION_NETBSD}) $(pwd)/bin/go
143+
GOGZ="go${GO_VERSION_NETBSD}.netbsd-amd64.tar.gz"
144+
wget https://go.dev/dl/${GOGZ}
145+
gtar xzf ${GOGZ}
146+
ln -s $(pwd)/go/bin/go $(pwd)/bin/go
145147
ln -s $(which ggrep) $(pwd)/bin/grep
146148
ln -s $(which gmake) $(pwd)/bin/make
147149
ln -s $(which gsed) $(pwd)/bin/sed
@@ -187,7 +189,6 @@ jobs:
187189
echo "::group::Setup prerequisites"
188190
set -eu
189191
mkdir bin
190-
export PATH=$(pwd)/bin:$PATH
191192
GOGZ="go${GO_VERSION_DRAGONFLY}.dragonfly-amd64.tar.gz"
192193
wget https://go.dev/dl/${GOGZ}
193194
gtar xzf ${GOGZ}
@@ -197,6 +198,7 @@ jobs:
197198
ln -s $(which gsed) $(pwd)/bin/sed
198199
ln -s $(which gtar) $(pwd)/bin/tar
199200
ln -s $(which python3) $(pwd)/bin/python
201+
export PATH=$(pwd)/bin:$PATH
200202
echo "::endgroup::"
201203
202204
echo "::group::Print environment information"
@@ -237,7 +239,6 @@ jobs:
237239
echo "::group::Setup prerequisites"
238240
set -eu
239241
mkdir bin
240-
export PATH=$(pwd)/bin:$PATH
241242
GOGZ="go${GO_VERSION_SOLARIS}.solaris-amd64.tar.gz"
242243
wget https://go.dev/dl/${GOGZ}
243244
gtar xzf ${GOGZ}
@@ -246,6 +247,7 @@ jobs:
246247
ln -s $(which gmake) $(pwd)/bin/make
247248
ln -s $(which gsed) $(pwd)/bin/sed
248249
ln -s $(which gtar) $(pwd)/bin/tar
250+
export PATH=$(pwd)/bin:$PATH
249251
250252
echo ">> building promu as it is not shipped for Solaris"
251253
git clone https://github.com/prometheus/promu.git

collector/fixtures/e2e-output-darwin.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ node_memory_total_bytes 7.516192768e+09
117117
# HELP node_network_noproto_total Network device statistic noproto.
118118
# TYPE node_network_noproto_total counter
119119
node_network_noproto_total{device="lo0"} 0
120-
# HELP node_network_receive_bytes_total Network device statistic receive_bytes.
121-
# TYPE node_network_receive_bytes_total counter
122120
# HELP node_network_receive_drop_total Network device statistic receive_drop.
123121
# TYPE node_network_receive_drop_total counter
124122
node_network_receive_drop_total{device="lo0"} 0

collector/fixtures/e2e-output-dragonfly.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ node_buddyinfo_blocks{node="0",size="9",zone="DMA32"} 0
9393
node_buddyinfo_blocks{node="0",size="9",zone="Normal"} 0
9494
# 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.
9595
# TYPE node_exporter_build_info gauge
96-
# HELP node_network_receive_bytes_total Network device statistic receive_bytes.
97-
# TYPE node_network_receive_bytes_total counter
9896
# HELP node_network_receive_drop_total Network device statistic receive_drop.
9997
# TYPE node_network_receive_drop_total counter
10098
node_network_receive_drop_total{device="lo0"} 0

collector/fixtures/e2e-output-freebsd.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ node_netisr_maxthreads 1
126126
# HELP node_netisr_numthreads netisr current thread count
127127
# TYPE node_netisr_numthreads gauge
128128
node_netisr_numthreads 1
129-
# HELP node_network_receive_bytes_total Network device statistic receive_bytes.
130-
# TYPE node_network_receive_bytes_total counter
131129
# HELP node_network_receive_drop_total Network device statistic receive_drop.
132130
# TYPE node_network_receive_drop_total counter
133131
node_network_receive_drop_total{device="lo0"} 0
@@ -164,6 +162,7 @@ node_scrape_collector_success{collector="loadavg"} 1
164162
node_scrape_collector_success{collector="meminfo"} 1
165163
node_scrape_collector_success{collector="netdev"} 1
166164
node_scrape_collector_success{collector="netisr"} 1
165+
node_scrape_collector_success{collector="netstat"} 1
167166
node_scrape_collector_success{collector="os"} 1
168167
node_scrape_collector_success{collector="textfile"} 1
169168
node_scrape_collector_success{collector="time"} 1

collector/fixtures/e2e-output-openbsd.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ node_memory_swapped_out_pages_bytes_total 0
109109
# TYPE node_network_noproto_total counter
110110
node_network_noproto_total{device="lo0"} 0
111111
node_network_noproto_total{device="pflog0"} 0
112-
# HELP node_network_receive_bytes_total Network device statistic receive_bytes.
113-
# TYPE node_network_receive_bytes_total counter
114112
# HELP node_network_receive_drop_total Network device statistic receive_drop.
115113
# TYPE node_network_receive_drop_total counter
116114
node_network_receive_drop_total{device="lo0"} 0

end-to-end-test.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,8 @@ sleep 1
320320

321321
get "127.0.0.1:${port}/metrics" | grep --text -E -v "${skip_re}" > "${generated_metrics}"
322322

323+
# The following ignore-list is only applicable to the VMs used to run E2E tests on platforms for which containerized environments are not available.
324+
# 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.
323325
non_deterministic_metrics=$(cat << METRICS
324326
node_boot_time_seconds
325327
node_cpu_frequency_hertz
@@ -356,6 +358,9 @@ non_deterministic_metrics=$(cat << METRICS
356358
node_memory_swapped_in_bytes_total
357359
node_memory_swapped_out_bytes_total
358360
node_memory_wired_bytes
361+
node_netstat_tcp_receive_packets_total
362+
node_netstat_tcp_transmit_packets_total
363+
node_network_receive_bytes_total
359364
node_network_receive_multicast_total
360365
node_network_transmit_multicast_total
361366
METRICS

0 commit comments

Comments
 (0)