Skip to content

Network


Net collector is used to collect host network information, such as traffic information of each network interface. For Linux, system-wide TCP and UDP statistics will be collected.

Config

After successfully installing and launching DataKit, the Net Collector is automatically enabled and does not require manual activation.

Collector Configuration

Go to the conf.d/samples directory under the DataKit installation directory, copy net.conf.sample and name it net.conf. Examples are as follows:

[[inputs.net]]
  ## (optional) collect interval, default is 10 seconds
  interval = '10s'

  ## By default, gathers stats from any up interface, but Linux does not contain virtual interfaces.
  ## Setting interfaces using regular expressions will collect these expected interfaces.
  # interfaces = ['''eth[\w-]+''', '''lo''', ]

  ## Datakit does not collect network virtual interfaces under the linux system.
  ## Setting enable_virtual_interfaces to true will collect virtual interfaces stats for linux.
  # enable_virtual_interfaces = true

  ## On linux systems also collects protocol stats.
  ## Setting ignore_protocol_stats to true will skip reporting of protocol metrics.
  # ignore_protocol_stats = false

[inputs.net.tags]
  # some_tag = "some_value"
  # more_tag = "some_other_value"

Once configured, restart DataKit 即可。

Can be turned on by ConfigMap Injection Collector Configuration or Config ENV_DATAKIT_INPUTS .

Can also be turned on by environment variables, (needs to be added as the default collector in ENV_DEFAULT_ENABLED_INPUTS):

  • ENV_INPUT_NET_INTERVAL

    Collect interval

    Type: Duration

    input.conf: interval

    Default: 10s

  • ENV_INPUT_NET_IGNORE_PROTOCOL_STATS

    Ignore reporting of protocol metrics

    Type: Boolean

    input.conf: ignore_protocol_stats

    Default: false

  • ENV_INPUT_NET_ENABLE_VIRTUAL_INTERFACES

    Enable collect virtual interfaces stats for Linux

    Type: Boolean

    input.conf: enable_virtual_interfaces

    Default: false

  • ENV_INPUT_NET_INTERFACES

    Expected interfaces (regular)

    Type: List

    input.conf: interfaces

    Example: eth[\w-]+,lo

  • ENV_INPUT_NET_TAGS

    Customize tags. If there is a tag with the same name in the configuration file, it will be overwritten

    Type: Map

    input.conf: tags

    Example: tag1=value1,tag2=value2

Metric

For all the following data collections, a global tag named host is appended by default (the tag value is the host name of the DataKit), or other tags can be specified in the configuration by [inputs.net.tags]:

 [inputs.net.tags]
  # some_tag = "some_value"
  # more_tag = "some_other_value"
  # ...

net

Tags & Fields Description
host
(tag)
System hostname.
interface
(tag)
Network interface name.
bytes_recv Cumulative bytes received by the interface.
Type: int | (count)
Unit: digital,B
bytes_recv/sec The number of bytes received by the interface per second.
Type: int | (gauge)
Unit: traffic,B/S
bytes_sent Cumulative bytes sent by the interface.
Type: int | (count)
Unit: digital,B
bytes_sent/sec The number of bytes sent by the interface per second.
Type: int | (gauge)
Unit: traffic,B/S
drop_in Cumulative received packets dropped by the interface.
Type: int | (count)
Unit: count
drop_out Cumulative transmitted packets dropped by the interface.
Type: int | (count)
Unit: count
err_in Cumulative receive errors detected by the interface.
Type: int | (count)
Unit: count
err_out Cumulative transmit errors detected by the interface.
Type: int | (count)
Unit: count
packets_recv Cumulative packets received by the interface.
Type: int | (count)
Unit: count
packets_recv/sec The number of packets received by the interface per second.
Type: int | (gauge)
Unit: count
packets_sent Cumulative packets sent by the interface.
Type: int | (count)
Unit: count
packets_sent/sec The number of packets sent by the interface per second.
Type: int | (gauge)
Unit: count
tcp_activeopens Cumulative TCP active opens, where TCP sends SYN and enters SYN-SENT. Linux only
Type: int | (count)
Unit: count
tcp_attemptfails Cumulative failed TCP connection attempts as defined by TCP-MIB AttemptFails. Linux only
Type: int | (count)
Unit: count
tcp_currestab The number of TCP connections for which the current state is either ESTABLISHED or CLOSE-WAIT. Linux only
Type: int | (gauge)
Unit: count
tcp_estabresets Cumulative TCP connections that transitioned directly to CLOSED from ESTABLISHED or CLOSE-WAIT. Linux only
Type: int | (count)
Unit: count
tcp_incsumerrors Cumulative incoming TCP segments with checksum errors. Linux only
Type: int | (count)
Unit: count
tcp_inerrs Cumulative incoming TCP segments received in error. Linux only
Type: int | (count)
Unit: count
tcp_insegs Cumulative TCP segments received by the TCP layer. Linux only
Type: int | (count)
Unit: count
tcp_insegs/sec The number of packets received by the TCP layer per second. Linux only
Type: int | (gauge)
Unit: count
tcp_maxconn The limit on the total number of TCP connections the entity can support. Linux only
Type: int | (gauge)
Unit: count
tcp_outrsts Cumulative TCP segments sent containing the RST flag. Linux only
Type: int | (count)
Unit: count
tcp_outsegs Cumulative TCP segments sent by the TCP layer. Linux only
Type: int | (count)
Unit: count
tcp_outsegs/sec The number of packets sent by the TCP layer per second. Linux only
Type: int | (gauge)
Unit: count
tcp_passiveopens Cumulative TCP passive opens, where TCP receives SYN, replies SYN+ACK, and enters SYN-RCVD. Linux only
Type: int | (count)
Unit: count
tcp_retranssegs Cumulative TCP segments retransmitted with one or more previously transmitted octets. Linux only
Type: int | (count)
Unit: count
tcp_rtoalgorithm Algorithm identifier used to determine retransmission timeout values. Linux only
Type: int | (gauge)
Unit: N/A
tcp_rtomax The maximum value permitted by a TCP implementation for the retransmission timeout, measured in milliseconds. Linux only
Type: int | (gauge)
Unit: time,ms
tcp_rtomin The minimum value permitted by a TCP implementation for the retransmission timeout, measured in milliseconds. Linux only
Type: int | (gauge)
Unit: time,ms
udp_ignoredmulti Cumulative ignored UDP multicast packets. Linux only
Type: int | (count)
Unit: count
udp_incsumerrors Cumulative incoming UDP datagrams with checksum errors. Linux only
Type: int | (count)
Unit: count
udp_indatagrams Cumulative UDP datagrams delivered to UDP users. Linux only
Type: int | (count)
Unit: count
udp_indatagrams/sec The number of UDP datagram delivered to UDP users per second. Linux only
Type: int | (gauge)
Unit: count
udp_inerrors Cumulative UDP packet receive errors. Linux only
Type: int | (count)
Unit: count
udp_memerrors Cumulative UDP memory errors. Linux only
Type: int | (count)
Unit: count
udp_noports Cumulative UDP packets received for unknown ports. Linux only
Type: int | (count)
Unit: count
udp_outdatagrams Cumulative UDP datagrams sent from this entity. Linux only
Type: int | (count)
Unit: count
udp_outdatagrams/sec The number of UDP datagram sent from this entity per second. Linux only
Type: int | (gauge)
Unit: count
udp_rcvbuferrors Cumulative UDP receive buffer errors. Linux only
Type: int | (count)
Unit: count
udp_sndbuferrors Cumulative UDP send buffer errors. Linux only
Type: int | (count)
Unit: count

More Readings

Feedback

Is this page helpful? ×