Bug 275792 - net-mgmt/netdata: Update to v2.2.3
Summary: net-mgmt/netdata: Update to v2.2.3
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Daniel Engberg
URL:
Keywords:
Depends on: 283745
Blocks:
  Show dependency treegraph
 
Reported: 2023-12-16 19:04 UTC by Namkhai B.
Modified: 2025-02-02 20:28 UTC (History)
6 users (show)

See Also:
diizzy: maintainer-feedback+


Attachments
net-mgmt/netdata: Update to v1.44.1 (16.99 KB, patch)
2023-12-16 19:04 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v1.44.2 (19.61 KB, patch)
2024-02-07 17:08 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v1.44.3 (19.61 KB, patch)
2024-02-12 19:40 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v1.45.5 (87.79 KB, patch)
2024-05-26 18:02 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v1.45.6 (87.87 KB, patch)
2024-06-19 00:31 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v1.46.1 (94.42 KB, patch)
2024-06-21 20:20 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v1.46.2 (94.50 KB, patch)
2024-07-15 18:36 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v1.46.2 (94.49 KB, patch)
2024-07-16 17:49 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v1.46.3 (94.49 KB, patch)
2024-07-25 17:08 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v1.47.0 (96.72 KB, patch)
2024-08-24 19:29 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v1.47.0 (96.80 KB, patch)
2024-09-04 02:47 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v1.47.3 (96.80 KB, patch)
2024-10-02 15:53 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v1.47.4 (98.05 KB, patch)
2024-10-11 18:03 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v1.47.5 (91.78 KB, patch)
2024-10-24 15:10 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v2.0.3 (81.34 KB, patch)
2024-12-08 18:51 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v2.0.3 (115.42 KB, patch)
2024-12-08 18:51 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v2.1.0 (131.17 KB, patch)
2024-12-29 17:30 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v2.1.0 (131.73 KB, patch)
2025-01-02 17:59 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v2.1.1 (131.73 KB, patch)
2025-01-09 22:26 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v2.2.0 (132.46 KB, patch)
2025-01-22 23:47 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v2.2.0 (132.57 KB, patch)
2025-01-24 03:48 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v2.2.1 (132.62 KB, patch)
2025-01-30 03:16 UTC, Namkhai B.
no flags Details | Diff
net-mgmt/netdata: Update to v2.2.3 (116.06 KB, patch)
2025-02-02 19:44 UTC, Namkhai B.
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Namkhai B. 2024-02-07 17:08:20 UTC
Created attachment 248237 [details]
net-mgmt/netdata: Update to v1.44.2
Comment 2 Namkhai B. 2024-02-12 19:40:18 UTC
Created attachment 248402 [details]
net-mgmt/netdata: Update to v1.44.3
Comment 3 Namkhai B. 2024-03-27 17:44:35 UTC
Working on the CMake switch right now
Comment 4 Daniel Engberg freebsd_committer freebsd_triage 2024-03-29 13:59:44 UTC
Sounds great, thanks!
Comment 6 Mohamed Akram 2024-05-10 10:19:01 UTC
Any update on this?
Comment 7 Namkhai B. 2024-05-11 01:10:18 UTC
(In reply to Mohamed Akram from comment #6)

We are still working on final details, see also https://github.com/netdata/netdata/issues/17632
Comment 8 Mohamed Akram 2024-05-11 09:09:33 UTC
Per that issue looks like it's using c-rbuf and c_rhash through mqtt_websockets. I imagine passing -DENABLE_MQTTWEBSOCKETS=ON fixes it - https://github.com/netdata/netdata/blob/v1.45.4/CMakeLists.txt#L1625 (that's what happens when H2O or ACLK are enabled). Or maybe the rbuf/rhash files can be moved from `MQTT_WEBSOCKETS_FILES` to `ACLK_ALWAYS_BUILD` as a patch in CMakeLists.txt since that's why they're needed if enabling MQTT websockets is not an option.
Comment 9 Namkhai B. 2024-05-16 22:42:51 UTC
Waiting on https://github.com/netdata/netdata/pull/17673 now (and potentially a v1.45.5 release)
Comment 10 Namkhai B. 2024-05-26 18:02:13 UTC
Created attachment 250991 [details]
net-mgmt/netdata: Update to v1.45.5
Comment 11 Jordan Ostreff 2024-06-07 12:17:01 UTC
I have successful build of 1.45.5 on freebsd stable/14 with small patches of provided diff. 

now I have both go.d and god.d plugins running :( 

Anyway netdata works somehow.
Comment 12 Jordan Ostreff 2024-06-07 12:20:36 UTC
In my situation
14888  -  IN        0:12,70 /usr/local/sbin/netdata -P /var/db/netdata/netdata.pid
14890  -  IN        0:00,03 /usr/local/sbin/netdata --special-spawn-server
14936  -  IN        0:03,47 /usr/local/libexec/netdata/plugins.d/go.d.plugin 1
14938  -  SN        0:00,94 /usr/local/libexec/netdata/plugins.d/apps.plugin 1
14939  -  SN        0:01,35 /usr/local/bin/python3.11 /usr/local/libexec/netdata/plugins.d/pyt
14942  -  IN        0:01,38 /usr/local/libexec/netdata/plugins.d/god.plugin 1


# pkg which /usr/local/libexec/netdata/plugins.d/god.plugin
/usr/local/libexec/netdata/plugins.d/god.plugin was installed by package netdata-go-0.58.1_4

# pkg which /usr/local/libexec/netdata/plugins.d/go.d.plugin
/usr/local/libexec/netdata/plugins.d/go.d.plugin was installed by package netdata-1.45.5


maybe it's time to deinstall netdata-go-0.58.1_4?
Comment 13 Jordan Ostreff 2024-06-10 10:04:16 UTC
new defect of the port:

# /usr/local/libexec/netdata/plugins.d/alarm-notify.sh test

# SENDING TEST WARNING ALARM TO ROLE: sysadmin
/usr/local/libexec/netdata/plugins.d/alarm-notify.sh: line 144: systemd-cat-native: command not found
/usr/local/libexec/netdata/plugins.d/alarm-notify.sh: line 144: systemd-cat-native: command not found
/usr/local/libexec/netdata/plugins.d/alarm-notify.sh: line 144: systemd-cat-native: command not found
# OK

# SENDING TEST CRITICAL ALARM TO ROLE: sysadmin
/usr/local/libexec/netdata/plugins.d/alarm-notify.sh: line 144: systemd-cat-native: command not found
/usr/local/libexec/netdata/plugins.d/alarm-notify.sh: line 144: systemd-cat-native: command not found
/usr/local/libexec/netdata/plugins.d/alarm-notify.sh: line 144: systemd-cat-native: command not found
# OK

# SENDING TEST CLEAR ALARM TO ROLE: sysadmin
/usr/local/libexec/netdata/plugins.d/alarm-notify.sh: line 144: systemd-cat-native: command not found
/usr/local/libexec/netdata/plugins.d/alarm-notify.sh: line 144: systemd-cat-native: command not found
/usr/local/libexec/netdata/plugins.d/alarm-notify.sh: line 144: systemd-cat-native: command not found
# OK
Comment 14 Namkhai B. 2024-06-19 00:31:38 UTC
Created attachment 251553 [details]
net-mgmt/netdata: Update to v1.45.6

Added back systemd-cat-native as it seems to be required by some modules.
Updated to v1.45.6, runtime looks OK
Comment 15 Namkhai B. 2024-06-21 20:20:22 UTC
Created attachment 251609 [details]
net-mgmt/netdata: Update to v1.46.1
Comment 16 Mohamed Akram 2024-07-15 14:00:21 UTC
Anything blocking this?
Comment 17 Namkhai B. 2024-07-15 18:36:24 UTC
Created attachment 252085 [details]
net-mgmt/netdata: Update to v1.46.2
Comment 18 Namkhai B. 2024-07-15 18:36:58 UTC
Waiting on a review from Daniel, but he is currently busy.
Comment 19 Jordan Ostreff 2024-07-16 10:17:07 UTC
(In reply to Namkhai B. from comment #17)
Hi,
I will be really grateful to your work. Can you suggest to me fastest way to test your proposed change inside my ports tree? 
Currently I'm running metadata 1.46.1 which was your previous patch, but with new version after git restore net-mgmt/netdata I can't apply with patch -p1 < {your-patch} correctly.
Comment 20 Namkhai B. 2024-07-16 17:49:04 UTC
Created attachment 252110 [details]
net-mgmt/netdata: Update to v1.46.2

Rebased patch over the latest ports tree
Comment 21 Jordan Ostreff 2024-07-17 09:12:30 UTC
(In reply to Namkhai B. from comment #20)
I confirm that provided patch was applied fine on main /usr/ports tree.
Comment 22 Jordan Ostreff 2024-07-17 09:12:48 UTC
(In reply to Namkhai B. from comment #20)
I confirm that provided patch was applied fine on main /usr/ports tree.
Comment 23 Namkhai B. 2024-07-25 17:08:10 UTC
Created attachment 252282 [details]
net-mgmt/netdata: Update to v1.46.3
Comment 24 Jordan Ostreff 2024-08-11 10:22:20 UTC
(In reply to Namkhai B. from comment #23)
I confirm that provided patch was applied fine on main /usr/ports tree.
Comment 25 Jordan Ostreff 2024-08-11 10:22:28 UTC
(In reply to Namkhai B. from comment #23)
I confirm that provided patch was applied fine on main /usr/ports tree.
Comment 26 Jordan Ostreff 2024-08-24 12:09:05 UTC
anything developed for 1.47.0?
Comment 27 Namkhai B. 2024-08-24 19:29:23 UTC
Created attachment 253063 [details]
net-mgmt/netdata: Update to v1.47.0

Preliminary v1.47.0 patch, runtime looks OK so far
Comment 28 Namkhai B. 2024-09-04 02:47:18 UTC
Created attachment 253314 [details]
net-mgmt/netdata: Update to v1.47.0

Added setuid bit needed by freeipmi.plugin
Comment 29 Jordan Ostreff 2024-10-01 10:06:08 UTC
1.47.2 is now available.
Comment 30 Namkhai B. 2024-10-02 15:53:23 UTC
Created attachment 253965 [details]
net-mgmt/netdata: Update to v1.47.3
Comment 31 Jordan Ostreff 2024-10-03 15:18:32 UTC
is it really needs lang/go122 or it can work also with lang/go123?

I have DEFAULT_VERSIONS+=go=1.23 in /etc/make.conf already.
Comment 32 Namkhai B. 2024-10-03 16:59:00 UTC
(In reply to Jordan Ostreff from comment #31)

I'll test with 1.23, but go.d.plugin needs at least v1.22 and lang/go is at 1.21. So I have to make a choice to either depend on 1.22 or 1.23
Comment 33 Jordan Ostreff 2024-10-04 07:33:51 UTC
I have played with Makefile just to not strictly require 1.22.x go version, but the result I have is not promising, but I'm not good in general with makefiles. My result is:
-- Determining minimum required version of Go for this build
-- Minimum required Go version determined to be 1.22.0
CMake Error at /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find Go (missing: GO_EXECUTABLE GO_ROOT) (Required is at least
  version "1.22.0")
Call Stack (most recent call first):
  /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  packaging/cmake/Modules/FindGo.cmake:64 (find_package_handle_standard_args)
  CMakeLists.txt:212 (find_package)


-- Configuring incomplete, errors occurred!

Meanwhile I have following result:
# go version
go version go1.23.1 freebsd/amd64
Comment 34 Jordan Ostreff 2024-10-05 18:47:14 UTC
Same result also from 
# go version
go version go1.23.2 freebsd/amd64


===>  Cleaning for netdata-1.47.3
===>  License GPLv3 accepted by the user
===>   netdata-1.47.3 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by netdata-1.47.3 for building
===>  Extracting for netdata-1.47.3
=> SHA256 Checksum OK for netdata-v1.47.3.tar.gz.
===>  Patching for netdata-1.47.3
===>  Applying FreeBSD patches for netdata-1.47.3 from /usr/ports/net-mgmt/netdata/files
====>   IGNORING patchfile patch-CMakeLists.txt.orig
====>   IGNORING patchfile patch-Makefile.am.orig
====>   IGNORING patchfile patch-collectors_python.d.plugin_Makefile.am.orig
====>   IGNORING patchfile patch-collectors_python.d.plugin_python.d.plugin.in.orig
====>   IGNORING patchfile patch-collectors_python.d.plugin_python__modules_bases_loaders.py.orig
====>   IGNORING patchfile patch-configure.ac.orig
====>   IGNORING patchfile patch-daemon_analytics.c.orig
====>   IGNORING patchfile patch-daemon_main.c.orig
====>   IGNORING patchfile patch-packaging_cmake_Modules_FindGo.cmake.orig
====>   IGNORING patchfile patch-packaging_cmake_Modules_NetdataVersion.cmake.orig
====>   IGNORING patchfile patch-src_collectors_freebsd.plugin_freebsd_kstat_zfs.c.orig
====>   IGNORING patchfile patch-src_collectors_proc.plugin_zfs_common.c.orig
====>   IGNORING patchfile patch-src_collectors_proc.plugin_zfs_common.h.orig
====>   IGNORING patchfile patch-src_collectors_python.d.plugin_python.d.plugin.in.orig
====>   IGNORING patchfile patch-src_ml_ml-private.h.orig
====>   IGNORING patchfile patch-src_ml_ml.cc.orig
===>   netdata-1.47.3 depends on file: /usr/local/bin/mmv - found
===>   netdata-1.47.3 depends on package: go>=1.22 - found
===>   netdata-1.47.3 depends on file: /usr/local/include/dlib/matrix.h - found
===>   netdata-1.47.3 depends on file: /usr/local/bin/cmake - found
===>   netdata-1.47.3 depends on executable: ninja - found
===>   netdata-1.47.3 depends on package: pkgconf>=1.3.0_1 - found
===>   netdata-1.47.3 depends on file: /usr/local/bin/python3.11 - found
===>   netdata-1.47.3 depends on shared library: libbrotlicommon.so - found (/usr/local/lib/libbrotlicommon.so)
===>   netdata-1.47.3 depends on shared library: libjson-c.so - found (/usr/local/lib/libjson-c.so)
===>   netdata-1.47.3 depends on shared library: libpcre2-8.so - found (/usr/local/lib/libpcre2-8.so)
===>   netdata-1.47.3 depends on shared library: libuuid.so - found (/usr/local/lib/libuuid.so)
===>   netdata-1.47.3 depends on shared library: libuv.so - found (/usr/local/lib/libuv.so)
===>   netdata-1.47.3 depends on shared library: libyaml.so - found (/usr/local/lib/libyaml.so)
===>   netdata-1.47.3 depends on shared library: libzstd.so - found (/usr/local/lib/libzstd.so)
===>   netdata-1.47.3 depends on shared library: libabsl_base.so - found (/usr/local/lib/libabsl_base.so)
===>   netdata-1.47.3 depends on shared library: libprotobuf.so - found (/usr/local/lib/libprotobuf.so)
===>   netdata-1.47.3 depends on shared library: libcups.so - found (/usr/local/lib/libcups.so)
===>   netdata-1.47.3 depends on shared library: liblz4.so - found (/usr/local/lib/liblz4.so)
===>   netdata-1.47.3 depends on shared library: libfreeipmi.so - found (/usr/local/lib/libfreeipmi.so)
===>   netdata-1.47.3 depends on shared library: libsnappy.so - found (/usr/local/lib/libsnappy.so)
===>   netdata-1.47.3 depends on shared library: libabsl_base.so - found (/usr/local/lib/libabsl_base.so)
===>   netdata-1.47.3 depends on shared library: libprotobuf.so - found (/usr/local/lib/libprotobuf.so)
===>  Configuring for netdata-1.47.3
===>  Performing out-of-source build
/bin/mkdir -p /usr/ports/net-mgmt/netdata/work/.build
-- The C compiler identification is Clang 18.1.6
-- The CXX compiler identification is Clang 18.1.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/local/bin/pkgconf (found version "2.3.0")
-- Performing Test HAVE_C__ffunction_sections
-- Performing Test HAVE_C__ffunction_sections - Success
-- Performing Test HAVE_CXX__ffunction_sections
-- Performing Test HAVE_CXX__ffunction_sections - Success
-- Performing Test HAVE_C__fdata_sections
-- Performing Test HAVE_C__fdata_sections - Success
-- Performing Test HAVE_CXX__fdata_sections
-- Performing Test HAVE_CXX__fdata_sections - Success
-- Performing Test HAVE_C__Wno_builtin_macro_redefined
-- Performing Test HAVE_C__Wno_builtin_macro_redefined - Success
-- Performing Test HAVE_CXX__Wno_builtin_macro_redefined
-- Performing Test HAVE_CXX__Wno_builtin_macro_redefined - Success
-- Performing Test HAVE_C__fexceptions
-- Performing Test HAVE_C__fexceptions - Success
-- Performing Test HAVE_CXX__fexceptions
-- Performing Test HAVE_CXX__fexceptions - Success
-- Searching for MOLD linker
-- Searching for MOLD linker - failed
--  Compiling for FreeBSD... 
-- Determining minimum required version of Go for this build
-- Minimum required Go version determined to be 1.22.0
CMake Error at /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find Go (missing: GO_EXECUTABLE GO_ROOT) (Required is at least
  version "1.22.0")
Call Stack (most recent call first):
  /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  packaging/cmake/Modules/FindGo.cmake:64 (find_package_handle_standard_args)
  CMakeLists.txt:212 (find_package)


-- Configuring incomplete, errors occurred!
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/net-mgmt/netdata
*** Error code 1

Stop.
make: stopped in /usr/ports/net-mgmt/netdata
Comment 35 Jordan Ostreff 2024-10-05 19:05:47 UTC
I have found that inside files/patch-packaging_cmake_Modules_FindGo.cmake the go version is hardcoded to be go122. I removed this patch on my ports tree.

Also inside Makefile this line must look like main I believe:
GOPLUGIN_BUILD_DEPENDS= go>=1.22:lang/go123
Comment 36 Namkhai B. 2024-10-11 18:02:46 UTC
I think the safe choice will be to wait for bug #281773 and depend on lang/go.
I'll post a patch with USES=go, it won't build unless DEFAULT_VERSIONS includes go=1.22 or higher in /etc/make.conf
Comment 37 Namkhai B. 2024-10-11 18:03:54 UTC
Created attachment 254164 [details]
net-mgmt/netdata: Update to v1.47.4

This patch USES=go, and as go.d.plugin needs go>1.21, it won't build with port's default go version.
Comment 38 Jordan Ostreff 2024-10-13 12:19:34 UTC
(In reply to Namkhai B. from comment #37)
It doesn't work for me with my system which has go default to be go123. 


So in Makefile I have:
#GOPLUGIN_USES=         go>=go122,no_targets
GOPLUGIN_BUILD_DEPENDS= go>=1.22:lang/go122

in files/patch-packaging_cmake_Modules_FindGo.cmake I have:
@@ -29,9 +29,9 @@
     find_program(GO_EXECUTABLE go PATHS /c/go/bin "/c/Program Files/go/bin" /mingw64/lib/go/bin /ucrt64/lib/go/bin /clang64/lib/go/bin DOC "Go toolchain" NO_DEFAULT_PATH)
   endif()
 else()
-  find_program(GO_EXECUTABLE go PATHS /usr/local/go/bin DOC "Go toolchain" NO_DEFAULT_PATH)
+  find_program(GO_EXECUTABLE go PATHS /usr/local/go/bin DOC "Go toolchain" NO_DEFAULT_PATH)
 endif()
-find_program(GO_EXECUTABLE go DOC "Go toolchain")
+find_program(GO_EXECUTABLE go DOC "Go toolchain")
 
 if (GO_EXECUTABLE)
   execute_process(

and it works fine for me if I have only go123 or if I have both go122 and go123.
Comment 39 Namkhai B. 2024-10-24 15:10:53 UTC
Created attachment 254484 [details]
net-mgmt/netdata: Update to v1.47.5

Now depending on go 1.23 until it's the port's default.
v1.47.5 will also fix bug #278066.
Comment 40 Jordan Ostreff 2024-10-25 11:17:28 UTC
(In reply to Namkhai B. from comment #39)
From my point of view the port works as expected on all my machines. Including the places where go123 is missing.

Thanks!
Comment 41 Daniel Engberg freebsd_committer freebsd_triage 2024-10-26 20:16:36 UTC
GOPLUGIN option fails in poudriere because it tried to download during build,
https://pdr2.bofh.network/data/133-diizzy/2024-10-26_15h00m54s/logs/errors/netdata-1.47.5.log

Thanks for all your work and effort put into this port!
Comment 42 Namkhai B. 2024-11-07 22:33:33 UTC
I'm looking into the go build issue and also netdata v2.0, unfortunately I'm away from home until the 18th so progress will be slow until then.
Comment 43 Jordan Ostreff 2024-11-08 23:37:19 UTC
(In reply to Namkhai B. from comment #42)
netdata 2.0 released. So we are expecting port for freebsd too :)
Comment 44 Jordan Ostreff 2024-11-29 15:50:07 UTC
Is there some ongoing development for netadata 2.0 port?
Comment 45 Namkhai B. 2024-11-29 15:52:52 UTC
(In reply to Jordan Ostreff from comment #44)

Yes, unfortunately I've encountered some issues.

I still have to figure out how to make go.d not download deps when building, and netdata v2 bundles the dashboard at build time (cmake downloads a proprietary agent.gz file).

This file is not versioned, so every build could have a different agent with different files.
Comment 46 Namkhai B. 2024-12-08 18:51:02 UTC
Created attachment 255719 [details]
net-mgmt/netdata: Update to v2.0.3

Initial v2.0.3 patch.

I believe the go build issue is fixed, but I would like some feedback on how to handle the new dashboard.
With DASHBOARD=on, netdata will download the proprietary v3 agent dashboard from http://app.netdata.cloud/agent.tar.gz and install it (at build time). This presents three problems:

1. the proprietary dashboard is licensed under the NCUL1 license and not GPLv3: https://app.netdata.cloud/LICENSE.txt
2. this file is not versioned, so pkg-plist can become outdated at any time
3. cmake will download this file at build time (fixable by patching the cmake build process and manually downloading the dashboard as a distfile)
Comment 47 Namkhai B. 2024-12-08 18:51:49 UTC
Created attachment 255720 [details]
net-mgmt/netdata: Update to v2.0.3

uploaded the latest patch
Comment 48 Jordan Ostreff 2024-12-08 21:28:15 UTC
(In reply to Namkhai B. from comment #47)
For me on my system provided patch works perfectly.
Comment 49 Jordan Ostreff 2024-12-20 15:40:03 UTC
New 2.1 is out. With improvements in streaming.
Comment 50 Namkhai B. 2024-12-20 22:33:17 UTC
(In reply to Jordan Ostreff from comment #49)

Seen. I'm traveling until the 23rd, so that'll be the earliest timeline for a new patch.
Comment 51 Namkhai B. 2024-12-29 17:30:11 UTC
Created attachment 256272 [details]
net-mgmt/netdata: Update to v2.1.0

Update to v2.1.0.
Tested on 14.2-RELEASE, runtime looks OK
Comment 52 Jordan Ostreff 2024-12-29 21:39:01 UTC
(In reply to Namkhai B. from comment #51)
Thanks, it works perfect also for me on 14-STABLE.


Merry Christmas and Happy New 2025 Year!
Comment 53 Jordan Ostreff 2024-12-29 23:17:52 UTC
(In reply to Jordan Ostreff from comment #52)
I've found following problem - if building system has access to internet only via proxy, cmake doesn't respect http_proxy/https_proxy environment variables, and generates following error:

-- Checking for module 'libmongoc-1.0>=1.7'
--   Found libmongoc-1.0, version 1.25.4
-- Checking for module 'snappy'
--   Found snappy, version 1.2.1
-- Checking for module 'libpcre2-8'
--   Found libpcre2-8, version 10.43
-- Preparing local agent dashboard code
--   Fetching https://app.netdata.cloud/agent.tar.gz
CMake Error at packaging/cmake/Modules/NetdataDashboard.cmake:46 (message):
  Failed to fetch dashboard code
Call Stack (most recent call first):
  CMakeLists.txt:3368 (bundle_dashboard)


-- Configuring incomplete, errors occurred!
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/net-mgmt/netdata
*** Error code 1

Stop.
make: stopped in /usr/ports/net-mgmt/netdata


Also it looks that check for go123 doesn't work well too.
Comment 54 Jordan Ostreff 2024-12-30 12:17:44 UTC
have opened https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=283745 regarding http_proxy && cmake .
Comment 55 Namkhai B. 2025-01-02 15:31:08 UTC
I'm working on fetching the agent via a extra DISTFILE and either patching cmake or manually extracting the dashboard in the port Makefile.

The other issue is that the dashboard is fetched from http://app.netdata.cloud/agent.tar.gz. This *will* break the port every time netdata updates their agent.

The only workaround I see at the moment is hosting the agent code at a different MASTER_SITE.
I'd be willing to host it at dl.nkeor.me/freebsd/netdata if that's a possibility the port committers agree with.
Otherwise, I'm open to suggestions.

Another possibility is either dropping OPTION=DASHBOARD or marking it as broken.
Comment 56 Namkhai B. 2025-01-02 17:59:42 UTC
Created attachment 256350 [details]
net-mgmt/netdata: Update to v2.1.0

Initial patch fetching and building the dashboard with the port system.
As stated previously, it's fetched from dl.nkeor.me/freebsd/netdata, subject to change if there's a better option.

Also ran portlint and portclippy, so it looks a bit bigger than previous patches.
Comment 57 Jordan Ostreff 2025-01-02 20:05:17 UTC
(In reply to Namkhai B. from comment #56)
it build fine on machine which doesn't have internet connectivity without proxy.
Comment 58 Namkhai B. 2025-01-09 22:26:05 UTC
Created attachment 256591 [details]
net-mgmt/netdata: Update to v2.1.1
Comment 59 Namkhai B. 2025-01-22 23:47:46 UTC
Created attachment 256923 [details]
net-mgmt/netdata: Update to v2.2.0
Comment 60 lysfjord.daniel 2025-01-23 23:29:26 UTC
(In reply to Namkhai B. from comment #59)

Poudriere build failed with:

=======================<phase: fetch          >============================
===== env: NO_DEPENDS=yes USER=root UID=0 GID=0
=> netdata-v2.2.0.tar.gz doesn't seem to exist in /portdistfiles/netdata.
=> Attempting to fetch https://github.com/netdata/netdata/releases/download/v2.2.0/netdata-v2.2.0.tar.gz
netdata-v2.2.0.tar.gz                                   48 MB   18 MBps    03s
=> go.mod doesn't seem to exist in /portdistfiles/netdata.
=> Attempting to fetch https://raw.githubusercontent.com/netdata/netdata/refs/tags/v2.2.0/src/go/go.mod
go.mod                                                7534  B   32 MBps    00s
===> Fetching all distfiles required by netdata-2.2.0 for building
env: /usr/local/bin/go123: No such file or directory
*** Error code 127

Stop.
make: stopped in /usr/ports/net-mgmt/netdata
build of net-mgmt/netdata | netdata-2.2.0 ended at 2025-01-24T00:18:25+01:00


It did build go123 just before this port:
build of lang/go123 | go123-1.23.5 ended at 2025-01-24T00:18:20+01:00
Comment 61 lysfjord.daniel 2025-01-23 23:48:17 UTC
Seems to also be missing a build dependency: curl>0:ftp/curl


=======================<phase: configure      >============================
===== env: NO_DEPENDS=yes USER=root UID=0 GID=0
===>  Configuring for netdata-2.2.0
===>  Performing out-of-source build
/bin/mkdir -p /wrkdirs/usr/ports/net-mgmt/netdata/work/.build
-- The C compiler identification is Clang 18.1.6
-- The CXX compiler identification is Clang 18.1.6
-----8<-------SNIP------->8-------

-- Checking for module 'libcurl>=7.21'
--   Package 'libcurl' not found
CMake Error at /usr/local/share/cmake/Modules/FindPkgConfig.cmake:645 (message):
  The following required packages were not found:

   - libcurl>=7.21

Call Stack (most recent call first):
  /usr/local/share/cmake/Modules/FindPkgConfig.cmake:873 (_pkg_check_modules_internal)
  CMakeLists.txt:321 (pkg_check_modules)


-- Configuring incomplete, errors occurred!
*** Error code 1

Stop.
make: stopped in /usr/ports/net-mgmt/netdata
=>> Cleaning up wrkdir
===>  Cleaning for netdata-2.2.0
build of net-mgmt/netdata | netdata-2.2.0 ended at 2025-01-24T00:40:02+01:00
Comment 62 lysfjord.daniel 2025-01-23 23:56:56 UTC
Also, seems horribly angry about me not building the go plugin?

=======================<phase: package        >============================
===== env: 'PKG_NOTES=build_timestamp ports_top_git_hash ports_top_checkout_unclean port_git_hash port_checkout_unclean built_by' 'PKG_NOTE_build_timestamp=2025-01-23T23:47:24+00:00' 'PKG_NOTE_ports_top_git_hash=66808f308f5' 'PKG_NOTE_ports_top_checkout_unclean=yes' 'PKG_NOTE_port_git_hash=94829e74ad8' 'PKG_NOTE_port_checkout_unclean=yes' 'PKG_NOTE_built_by=poudriere-git-3.4.99.20250115' PKG_NO_VERSION_FOR_DEPS=1 NO_DEPENDS=yes USER=root UID=0 GID=0
===>  Building packages for netdata-2.2.0
===>   Building netdata-2.2.0
pkg-static: Unable to access file /wrkdirs/usr/ports/net-mgmt/netdata/work/stage/usr/local/libexec/netdata/plugins.d/ndsudo:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/net-mgmt/netdata/work/stage/usr/local/etc/netdata/go.d/:No such file or directory
*** Error code 1

Stop.
make: stopped in /usr/ports/net-mgmt/netdata
=>> Cleaning up wrkdir
===>  Cleaning for netdata-2.2.0
build of net-mgmt/netdata | netdata-2.2.0 ended at 2025-01-24T00:48:30+01:00
Comment 63 Namkhai B. 2025-01-24 03:48:32 UTC
Created attachment 256948 [details]
net-mgmt/netdata: Update to v2.2.0

* Added %%GOPLUGIN%% prefix to libexec/netdata/plugins.d/ndsudo and %%ETCDIR%%/go.d
* moved curl dependency from RUN_DEPENDS to LIB_DEPENDS

Not sure what's going on with go and poudriere, the makefile depends on go with GOPLUGIN_USES=go:1.23
We could rewrite it to just USES=go:1.23 but then go would be a dependency whether go.d is enabled or not.
Comment 64 lysfjord.daniel 2025-01-26 13:53:14 UTC
(In reply to Namkhai B. from comment #63)

with the following in the Makefile:

GOPLUGIN_FETCH_DEPENDS= go123:lang/go123

as an additional line around the GOPLUGIN lines, poudriere does indeed build and install go123 for fetching the related go-files if GOPLUGIN is enabled..

if only go123 could stop being rebuilt due to the following:
[00:00:15] [02] [00:00:00] Warning: go123-1.23.5 will be rebuilt as it misses libc.so.6:32

*every* time I build a package, I would be pretty happy..
Comment 65 Namkhai B. 2025-01-30 03:16:02 UTC
Created attachment 257107 [details]
net-mgmt/netdata: Update to v2.2.1

Updated patch to v2.2.1 & agent to 20250129
Comment 66 Daniel Engberg freebsd_committer freebsd_triage 2025-02-01 19:41:11 UTC
(In reply to Namkhai B. from comment #63)
Go is only a build dependency and while not optimal its better than nothing?
Comment 67 lysfjord.daniel 2025-02-02 00:10:43 UTC
(In reply to Daniel Engberg from comment #66)

That's a solved issue with GOPLUGIN_FETCH_DEPENDS= go123:lang/go123 (already in the latest patch)
Comment 68 Daniel Engberg freebsd_committer freebsd_triage 2025-02-02 17:55:42 UTC
Looks good and tests fine in Poudriere on my end, bump it to 2.2.3 before committing?

Fedora seems to do some stuff with the web frontend which might be of interest?

https://src.fedoraproject.org/rpms/netdata/blob/rawhide/f/netdata.spec#_228
https://src.fedoraproject.org/rpms/netdata/blob/rawhide/f/netdata.spec#_357

Great work!
Comment 69 Namkhai B. 2025-02-02 18:22:42 UTC
(In reply to Daniel Engberg from comment #68)

Updating the patch to 2.2.3 at the moment.

What I understand from fedora's build is they [1] completely disable the proprietary v3 dashboard; and instead link v1 as the default [2]

Right now the port bundles the v3 dashboard only when DASHBOARD is enabled (default)

I'll add the necessary steps to use dashboard v1 when DASHBOARD=off 
I could also disable DASHBOARD by default

[1]: https://src.fedoraproject.org/rpms/netdata/blob/rawhide/f/netdata-remove-web-v2.patch
[2]: https://src.fedoraproject.org/rpms/netdata/blob/rawhide/f/netdata.spec#_357
Comment 70 Daniel Engberg freebsd_committer freebsd_triage 2025-02-02 18:56:58 UTC
Sounds great, thanks! :-)
Comment 71 Namkhai B. 2025-02-02 19:44:20 UTC
Created attachment 257188 [details]
net-mgmt/netdata: Update to v2.2.3


Renamed DASHBOARD to CLOUD_DASHBOARD.
Now using the v1 dashboard when CLOUD_DASHBOARD is off (fedora's approach).

I'm open to suggestions on the naming scheme.
Comment 72 Daniel Engberg freebsd_committer freebsd_triage 2025-02-02 20:28:11 UTC
Fixed a typo, awesome work and thanks for all contributors too!
Comment 73 commit-hook freebsd_committer freebsd_triage 2025-02-02 20:28:15 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=07cc225b4106ac0eb09b92ff4e9ebf6d16643817

commit 07cc225b4106ac0eb09b92ff4e9ebf6d16643817
Author:     Namkhai Bourquin <nk@nkeor.me>
AuthorDate: 2025-02-02 20:21:55 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2025-02-02 20:27:22 +0000

    net-mgmt/netdata: Update to 2.2.3

    Changelog: https://github.com/netdata/netdata/releases/tag/v2.2.3

    Thanks to Namkhai and contributors for the time consuming effort to
    make it suitable for packaging and testing

    PR:             275792

 net-mgmt/netdata/Makefile                          | 163 ++--
 net-mgmt/netdata/distinfo                          |  10 +-
 net-mgmt/netdata/files/netdata.conf.sample.in      |   1 +
 net-mgmt/netdata/files/patch-CMakeLists.txt (new)  | 105 +++
 net-mgmt/netdata/files/patch-Makefile.am (gone)    |  29 -
 ...h-collectors_python.d.plugin_Makefile.am (gone) | 111 ---
 ...ctors_python.d.plugin_python.d.plugin.in (gone) |  10 -
 ....plugin_python__modules_bases_loaders.py (gone) |  14 -
 net-mgmt/netdata/files/patch-configure.ac (gone)   |  81 --
 .../netdata/files/patch-daemon_analytics.c (gone)  |  15 -
 net-mgmt/netdata/files/patch-daemon_main.c (gone)  |  12 -
 ...kaging_cmake_Modules_NetdataGoTools.cmake (new) |  11 +
 ...kaging_cmake_Modules_NetdataVersion.cmake (new) |  40 +
 ...ectors_python.d.plugin_python.d.plugin.in (new) |  10 +
 .../patch-src_ml_ml__calculated__number.h (new)    |  11 +
 .../netdata/files/patch-src_ml_ml__kmeans.cc (new) |  11 +
 net-mgmt/netdata/pkg-plist                         | 886 +++++++++++----------
 17 files changed, 772 insertions(+), 748 deletions(-)