Repository navigation
netstat: Add new FreeBSD metrics - #3334
Merged
Merged
Conversation
daniloegea
force-pushed
the
netstat_freebsd
branch
from
May 16, 2025 10:53
304a3b0 to
4bb3f03
Compare
Contributor
Author
daniloegea
force-pushed
the
netstat_freebsd
branch
from
April 25, 2026 15:23
4bb3f03 to
1d23883
Compare
Contributor
|
@daniloegea Sure, as you want. |
SuperQ
requested changes
Jul 10, 2026
SuperQ
left a comment
Member
There was a problem hiding this comment.
Please update the end-to-end test fixture with the new metrics.
Contributor
Author
|
Hi, as they are non-deterministic network metrics, should I add them to the |
Member
|
Yes, add them to the non-deterministic list. |
Make the code testable and more maintainable: - Encapsulate all the CGO code so it can be tested - Fix the test file (it wasn't compiling) and improve tests - Mock the data returned by unix.SysctlRaw so the code can be tested without actually calling sysctl. No change in behavior intended Signed-off-by: Danilo Egea Gondolfo <[email protected]>
Metrics added: - ip4_transmit_packets_total - ip4_transmit_raw_packets_total - ip4_receive_packets_total - ip4_receive_fragments_total - ip4_forward_total - ip4_fast_forward_total - ip4_delivered_total Signed-off-by: Danilo Egea Gondolfo <[email protected]>
Metrics added: - ip6_transmit_packets_total - ip6_transmit_raw_packets_total - ip6_receive_packets_total - ip6_receive_fragments_total - ip6_forward_total - ip6_delivered_total Signed-off-by: Danilo Egea Gondolfo <[email protected]>
Metrics added: - udp_transmit_packets_total - udp_receive_packets_total Signed-off-by: Danilo Egea Gondolfo <[email protected]>
Metric added (gauge):
node_netstat_tcp_connections{state="CLOSED"}
node_netstat_tcp_connections{state="CLOSE_WAIT"}
node_netstat_tcp_connections{state="CLOSING"}
node_netstat_tcp_connections{state="ESTABLISHED"}
node_netstat_tcp_connections{state="FIN_WAIT_1"}
node_netstat_tcp_connections{state="FIN_WAIT_2"}
node_netstat_tcp_connections{state="LAST_ACK"}
node_netstat_tcp_connections{state="LISTEN"}
node_netstat_tcp_connections{state="SYN_RCVD"}
node_netstat_tcp_connections{state="SYN_SENT"}
node_netstat_tcp_connections{state="TIME_WAIT"}
Signed-off-by: Danilo Egea Gondolfo <[email protected]>
The new metrics are non-deterministic so add them to the non_deterministic_metrics list in the end-to-end-test.sh script. Signed-off-by: Danilo Egea Gondolfo <[email protected]>
daniloegea
force-pushed
the
netstat_freebsd
branch
from
July 12, 2026 13:19
09ca4bc to
0c2b72a
Compare
Merged
SuperQ
added a commit
that referenced
this pull request
Nov 18, 2026
The behavior of `node_cpu_frequency_hertz` has changed. There are two different sources of data for this metric. One from the `cpu` collector, one from the `cpufreq` collector. Due to historical feature migrations the `cpufreq` collector shares the same subsystem as the `cpu` collector. This caused conflicting data behavior. An attempt to fix this was introduced in #3318. This behavior has been reverted to the previous behavior in #3795. A new flag (`--collector.cpufreq.enable-cpufreq-prefix`) has been introduced that gives the `cpufreq` a dedicated metric name subsystem (`node_cpufreq_...`). This will likely be the default in v2. * [CHANGE] netstat: Use procfs parsers for netstat, snmp and snmp6 #3796 * [CHANGE] edac: Fix no data results #3863 * [CHANGE] nvme: Deprecate metric nvme_namespace_capacity_bytes #3899 * [FEATURE] Add tainted collector for /proc/sys/kernel/tainted #3745 * [FEATURE] Add resctrl collector #3797 * [ENHANCEMENT] netstat: Add new FreeBSD metrics #3334 * [ENHANCEMENT] Add `chip` label to DRM metrics #3572 * [ENHANCEMENT] diskstats: add device-mapper backing device info metric #3676 * [ENHANCEMENT] textfile: support UTF-8 metric and label names #3729 * [ENHANCEMENT] ksmd: add general_profit metric #3778 #3894 * [BUGFIX] edac: Fix printf-style formatting in slog call #3759 * [BUGFIX] fibre_channel: fix crash when attempting to dereference invalid counters #3573 * [BUGFIX] thermal: Fix collecting Darwin temperatures without CPU power status #3767 * [BUGFIX] fibrechannel: Fix for ppc64le #3769 * [BUGFIX] cpu: Revert dup cpu frequency, add node_cpufreq flag #3795 * [BUGFIX] infiniband: skip sysfs reads for excluded devices #3824 * [BUGFIX] bcache: Fix btree_read_average_duration_seconds unit #3828 Signed-off-by: Ben Kochie <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a number of new metrics to the
netstat_freebsdmodule.The first commit is a refactoring to make it easier to add new metrics. It also fixes the netstat_freebsd tests, which were completely broken. I added a function to return fake raw data so the code can be tested without calling the low level functions.
The new metrics are:
IPv4
IPv6
UDP
TCP states
Each commit has the list of metrics added, but here is the full list (including the ones that already existed):