Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in_node_exporter_metrics: Initial support for macOS metrics #7947

Merged
merged 8 commits into from
Oct 16, 2023

Conversation

cosmo0920
Copy link
Contributor

@cosmo0920 cosmo0920 commented Sep 20, 2023

At the initial support for macOS, I implemented cpu,loadavg,meminfo,diskstats,uname, and netdev metrics.
Note that diskstats metrics depend on IOKit and Foundation frameworks which could introduces binary incompatibilities for macOS 12.0 (Monterey) or older.

In macOS, meminfo and vmstat metrics should be overlapped their information. So, I decided to provide meminfo metrics and not to provide vmstat metrics.

No referred issues for this PR. This is started for a researching task to support macOS metrics.


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
$ bin/fluent-bit -i node_exporter_metrics -o stdout
  • Debug log output from testing the change
$ bin/fluent-bit -i node_exporter_metrics -o stdout -v 
Fluent Bit v2.1.10
* Copyright (C) 2015-2022 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io

[2023/09/20 12:23:12] [ info] Configuration:
[2023/09/20 12:23:12] [ info]  flush time     | 1.000000 seconds
[2023/09/20 12:23:12] [ info]  grace          | 5 seconds
[2023/09/20 12:23:12] [ info]  daemon         | 0
[2023/09/20 12:23:12] [ info] ___________
[2023/09/20 12:23:12] [ info]  inputs:
[2023/09/20 12:23:12] [ info]      node_exporter_metrics
[2023/09/20 12:23:12] [ info] ___________
[2023/09/20 12:23:12] [ info]  filters:
[2023/09/20 12:23:12] [ info] ___________
[2023/09/20 12:23:12] [ info]  outputs:
[2023/09/20 12:23:12] [ info]      stdout.0
[2023/09/20 12:23:12] [ info] ___________
[2023/09/20 12:23:12] [ info]  collectors:
[2023/09/20 12:23:12] [ info] [fluent bit] version=2.1.10, commit=814ebc7613, pid=50527
[2023/09/20 12:23:12] [debug] [engine] coroutine stack size: 36864 bytes (36.0K)
[2023/09/20 12:23:12] [ info] [storage] ver=1.2.0, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2023/09/20 12:23:12] [ info] [cmetrics] version=0.6.3
[2023/09/20 12:23:12] [ info] [ctraces ] version=0.3.1
[2023/09/20 12:23:12] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] initializing
[2023/09/20 12:23:12] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] storage_strategy='memory' (memory only)
[2023/09/20 12:23:12] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] path.procfs = /proc
[2023/09/20 12:23:12] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] path.sysfs  = /sys
[2023/09/20 12:23:12] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] enabled metrics cpu
[2023/09/20 12:23:12] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] enabled metrics loadavg
[2023/09/20 12:23:12] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] enabled metrics meminfo
[2023/09/20 12:23:12] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] enabled metrics diskstats
[2023/09/20 12:23:12] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] enabled metrics uname
[2023/09/20 12:23:12] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] enabled metrics netdev
[2023/09/20 12:23:12] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] [thread init] initialization OK
[2023/09/20 12:23:12] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] thread instance initialized
[2023/09/20 12:23:12] [debug] [node_exporter_metrics:node_exporter_metrics.0] created event channels: read=30 write=31
[2023/09/20 12:23:12] [debug] [stdout:stdout.0] created event channels: read=34 write=35
[2023/09/20 12:23:12] [ info] [sp] stream processor started
[2023/09/20 12:23:12] [ info] [output:stdout:stdout.0] worker #0 started
[2023/09/20 12:23:17] [debug] [input chunk] update output instances with new chunk size diff=22341, records=0, input=node_exporter_metrics.0
[2023/09/20 12:23:18] [debug] [task] created task=0x600003e28000 id=0 OK
[2023/09/20 12:23:18] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="0",mode="user"} = 667708.14000000001
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="0",mode="system"} = 392925.53999999998
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="0",mode="nice"} = 0
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="0",mode="idle"} = 1982380.45
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="1",mode="user"} = 642047.5
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="1",mode="system"} = 369402.82000000001
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="1",mode="nice"} = 0
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="1",mode="idle"} = 2034817.54
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="2",mode="user"} = 605171.13
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="2",mode="system"} = 340369.28000000003
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="2",mode="nice"} = 0
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="2",mode="idle"} = 2104214.4500000002
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="3",mode="user"} = 576161.73999999999
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="3",mode="system"} = 316135.79999999999
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="3",mode="nice"} = 0
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="3",mode="idle"} = 2160464.9900000002
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="4",mode="user"} = 460472.82000000001
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="4",mode="system"} = 185250.67999999999
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="4",mode="nice"} = 0
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="4",mode="idle"} = 2413174.6200000001
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="5",mode="user"} = 404359.22999999998
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="5",mode="system"} = 158002.89999999999
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="5",mode="nice"} = 0
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="5",mode="idle"} = 2499017.2999999998
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="6",mode="user"} = 332925.14000000001
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="6",mode="system"} = 111099.46000000001
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="6",mode="nice"} = 0
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="6",mode="idle"} = 2619695.1800000002
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="7",mode="user"} = 284181.39000000001
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="7",mode="system"} = 88389.039999999994
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="7",mode="nice"} = 0
2023-09-20T03:23:17.688371015Z node_cpu_seconds_total{cpu="7",mode="idle"} = 2692875.0299999998
2023-09-20T03:23:17.688558053Z node_meminfo_pageins_bytes = 1.7311766598867993e+19
2023-09-20T03:23:17.688558053Z node_meminfo_pageouts_bytes = 0
2023-09-20T03:23:17.688558053Z node_meminfo_total_bytes = 25769803776
2023-09-20T03:23:17.690263570Z node_disk_reads_completed_total{device="disk0"} = 610913653
2023-09-20T03:23:17.690276236Z node_disk_reads_sectors_total{device="disk0"} = 149148.84106445312
2023-09-20T03:23:17.690306403Z node_disk_read_time_seconds_total{device="disk0"} = 195616.31283863899
2023-09-20T03:23:17.690282570Z node_disk_writes_completed_total{device="disk0"} = 397308507
2023-09-20T03:23:17.690288736Z node_disk_written_sectors_total{device="disk0"} = 96999.147216796875
2023-09-20T03:23:17.690312152Z node_disk_write_time_seconds_total{device="disk0"} = 19525.649975291999
2023-09-20T03:23:17.690294694Z node_disk_read_bytes_total{device="disk0"} = 19109322174464
2023-09-20T03:23:17.690300361Z node_disk_written_bytes_total{device="disk0"} = 16367758921728
2023-09-20T03:23:17.690318361Z node_disk_read_errors_total{device="disk0"} = 0
2023-09-20T03:23:17.690324361Z node_disk_write_errors_total{device="disk0"} = 0
2023-09-20T03:23:17.690329777Z node_disk_read_retries_total{device="disk0"} = 0
2023-09-20T03:23:17.690335486Z node_disk_write_retries_total{device="disk0"} = 0
2023-09-20T03:23:17.688529637Z node_load1 = 2.6552734375
2023-09-20T03:23:17.688529637Z node_load5 = 2.93408203125
2023-09-20T03:23:17.688529637Z node_load15 = 3.0810546875
2023-09-20T03:23:17.688558053Z node_meminfo_free_bytes = 73482240
2023-09-20T03:23:17.688558053Z node_meminfo_active_bytes = 5017600000
2023-09-20T03:23:17.688558053Z node_meminfo_compressed_bytes = 0
2023-09-20T03:23:17.688558053Z node_meminfo_inactive_bytes = 4996071424
2023-09-20T03:23:17.688558053Z node_meminfo_internal_bytes = 0
2023-09-20T03:23:17.688558053Z node_meminfo_wired_bytes = 3405168640
2023-09-20T03:23:17.688558053Z node_meminfo_purgeable_bytes = 29522175721472
2023-09-20T03:23:17.688558053Z node_meminfo_swap_used_bytes = 10545659904
2023-09-20T03:23:17.688558053Z node_meminfo_swap_total_bytes = 11811160064
2023-09-20T03:23:17.690385360Z node_uname_info{sysname="Darwin",release="22.5.0",version="Darwin Kernel Version 22.5.0: Thu Jun  8 22:21:34 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T8112",machine="arm64",nodename="Hiroshi-no-MacBook-Air-M2",domainname="local"} = 1
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="lo0"} = 10461471
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="gif0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="stf0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="anpi0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="anpi1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="en3"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="en4"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="en1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="en2"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="ap1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="en0"} = 436432101
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="bridge0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="awdl0"} = 35411
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="llw0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="utun0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="utun1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="utun2"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="vmenet0"} = 21727
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="bridge100"} = 2069502
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="vmenet1"} = 40
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="bridge101"} = 80
2023-09-20T03:23:17.690396235Z node_network_receive_packets{device="vmenet2"} = 32164
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="lo0"} = 10461471
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="gif0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="stf0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="anpi0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="anpi1"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="en3"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="en4"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="en1"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="en2"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="ap1"} = 132479
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="en0"} = 433493595
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="bridge0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="awdl0"} = 39256
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="llw0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="utun0"} = 34
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="utun1"} = 33
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="utun2"} = 34
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="vmenet0"} = 15354
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="bridge100"} = 2130295
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="vmenet1"} = 2482
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="bridge101"} = 4964
2023-09-20T03:23:17.690396235Z node_network_transmit_packets{device="vmenet2"} = 58026
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="lo0"} = 4725012275
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="gif0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="stf0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="anpi0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="anpi1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="en3"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="en4"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="en1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="en2"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="ap1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="en0"} = 163382617148
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="bridge0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="awdl0"} = 10142113
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="llw0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="utun0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="utun1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="utun2"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="vmenet0"} = 25718339
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="bridge100"} = 2093202904
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="vmenet1"} = 4400
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="bridge101"} = 8240
2023-09-20T03:23:17.690396235Z node_network_receive_bytes{device="vmenet2"} = 3849429
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="lo0"} = 4725012275
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="gif0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="stf0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="anpi0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="anpi1"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="en3"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="en4"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="en1"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="en2"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="ap1"} = 66133666
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="en0"} = 82520601925
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="bridge0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="awdl0"} = 11376637
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="llw0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="utun0"} = 3848
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="utun1"} = 3788
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="utun2"} = 3848
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="vmenet0"} = 2993272
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="bridge100"} = 2127749880
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="vmenet1"} = 1361458
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="bridge101"} = 2722916
2023-09-20T03:23:17.690396235Z node_network_transmit_bytes{device="vmenet2"} = 67522412
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="lo0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="gif0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="stf0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="anpi0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="anpi1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="en3"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="en4"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="en1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="en2"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="ap1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="en0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="bridge0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="awdl0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="llw0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="utun0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="utun1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="utun2"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="vmenet0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="bridge100"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="vmenet1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="bridge101"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_errors{device="vmenet2"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="lo0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="gif0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="stf0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="anpi0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="anpi1"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="en3"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="en4"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="en1"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="en2"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="ap1"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="en0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="bridge0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="awdl0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="llw0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="utun0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="utun1"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="utun2"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="vmenet0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="bridge100"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="vmenet1"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="bridge101"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_errors{device="vmenet2"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="lo0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="gif0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="stf0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="anpi0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="anpi1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="en3"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="en4"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="en1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="en2"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="ap1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="en0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="bridge0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="awdl0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="llw0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="utun0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="utun1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="utun2"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="vmenet0"} = 53762968941078
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="bridge100"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="vmenet1"} = 114532461200
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="bridge101"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_dropped{device="vmenet2"} = 89368247817960
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="lo0"} = 1517211
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="gif0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="stf0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="anpi0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="anpi1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="en3"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="en4"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="en1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="en2"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="ap1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="en0"} = 2946861
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="bridge0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="awdl0"} = 20154
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="llw0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="utun0"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="utun1"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="utun2"} = 0
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="vmenet0"} = 42
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="bridge100"} = 17062
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="vmenet1"} = 40
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="bridge101"} = 80
2023-09-20T03:23:17.690396235Z node_network_receive_multicast{device="vmenet2"} = 1258
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="lo0"} = 1517211
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="gif0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="stf0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="anpi0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="anpi1"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="en3"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="en4"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="en1"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="en2"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="ap1"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="en0"} = 2946861
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="bridge0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="awdl0"} = 20154
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="llw0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="utun0"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="utun1"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="utun2"} = 0
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="vmenet0"} = 42
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="bridge100"} = 17062
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="vmenet1"} = 40
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="bridge101"} = 80
2023-09-20T03:23:17.690396235Z node_network_transmit_multicast{device="vmenet2"} = 1258
2023-09-20T03:23:17.690396235Z node_network_collisions{device="lo0"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="gif0"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="stf0"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="anpi0"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="anpi1"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="en3"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="en4"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="en1"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="en2"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="ap1"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="en0"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="bridge0"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="awdl0"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="llw0"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="utun0"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="utun1"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="utun2"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="vmenet0"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="bridge100"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="vmenet1"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="bridge101"} = 0
2023-09-20T03:23:17.690396235Z node_network_collisions{device="vmenet2"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="lo0"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="gif0"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="stf0"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="anpi0"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="anpi1"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="en3"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="en4"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="en1"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="en2"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="ap1"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="en0"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="bridge0"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="awdl0"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="llw0"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="utun0"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="utun1"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="utun2"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="vmenet0"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="bridge100"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="vmenet1"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="bridge101"} = 0
2023-09-20T03:23:17.690396235Z node_network_noproto{device="vmenet2"} = 0
[2023/09/20 12:23:18] [debug] [out flush] cb_destroy coro_id=0
[2023/09/20 12:23:18] [debug] [task] destroy task=0x600003e28000 (task_id=0)
^C[2023/09/20 12:23:19] [engine] caught signal (SIGINT)
[2023/09/20 12:23:19] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] thread pause instance
[2023/09/20 12:23:19] [ info] [output:stdout:stdout.0] thread worker #0 stopping...
[2023/09/20 12:23:19] [ info] [output:stdout:stdout.0] thread worker #0 stopped
[2023/09/20 12:23:19] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] thread exit instance
  • Attached Valgrind output that shows no leaks or memory corruption was found

In macOS, valgrind is not runnable but leaks command can be used for leak detection:

$ leaks --atExit -- bin/fluent-bit -i node_exporter_metrics -o stdout -vv
# long running and sending TERM signal with another terminal
Process 50270 is not debuggable. Due to security restrictions, leaks can only show or save contents of readonly memory of restricted processes.

Process:         fluent-bit [50270]
Path:            /Users/USER/*/fluent-bit
Load Address:    0x100970000
Identifier:      fluent-bit
Version:         0
Code Type:       ARM64
Platform:        macOS
Parent Process:  leaks [50269]

Date/Time:       2023-09-20 12:18:56.342 +0900
Launch Time:     2023-09-20 11:59:10.111 +0900
OS Version:      macOS 13.4.1 (22F82)
Report Version:  7
Analysis Tool:   /Applications/Xcode.app/Contents/Developer/usr/bin/leaks
Analysis Tool Version:  Xcode 14.3.1 (14E300c)

Physical footprint:         8050K
Physical footprint (peak):  8130K
Idle exit:                  untracked
----

leaks Report Version: 4.0, multi-line stacks
Process 50270: 756 nodes malloced for 93 KB
Process 50270: 0 leaks for 0 total leaked bytes.

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

fluent/fluent-bit-docs#1197

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

@cosmo0920 cosmo0920 temporarily deployed to pr September 20, 2023 03:28 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 temporarily deployed to pr September 20, 2023 03:28 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 temporarily deployed to pr September 20, 2023 03:28 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 force-pushed the cosmo0920-node_exporter_metrics-on-macOS branch from 814ebc7 to 613dede Compare September 20, 2023 03:34
@cosmo0920 cosmo0920 temporarily deployed to pr September 20, 2023 03:34 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 temporarily deployed to pr September 20, 2023 03:34 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 temporarily deployed to pr September 20, 2023 03:34 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 force-pushed the cosmo0920-node_exporter_metrics-on-macOS branch from 613dede to 4cde143 Compare September 20, 2023 03:38
@cosmo0920 cosmo0920 temporarily deployed to pr September 20, 2023 03:39 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 temporarily deployed to pr September 20, 2023 03:39 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 temporarily deployed to pr September 20, 2023 03:39 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 temporarily deployed to pr September 20, 2023 03:55 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 temporarily deployed to pr September 20, 2023 03:56 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 temporarily deployed to pr September 20, 2023 03:56 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 temporarily deployed to pr September 20, 2023 04:21 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 changed the title in_node_exporter_metrics: Initial suppport for macOS metrics in_node_exporter_metrics: Initial support for macOS metrics Sep 20, 2023
@edsiper edsiper merged commit a826eac into master Oct 16, 2023
43 of 45 checks passed
@edsiper edsiper deleted the cosmo0920-node_exporter_metrics-on-macOS branch October 16, 2023 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants