Skip to content

Conversation

@leoparente
Copy link
Contributor

This pull request improves the configuration handling and process monitoring of several backend components in the agent. The main changes include making port configuration more robust by accepting any value type, enhancing process readiness checks to handle unexpected process exits, and improving logging for debugging purposes.

Configuration improvements:

  • Updated the Configure methods in multiple backends (deviceDiscoveryBackend, networkDiscoveryBackend, openTelemetryBackend, snmpDiscoveryBackend, workerBackend, pktvisorBackend) to accept the port configuration as any value type, converting it to a string using fmt.Sprintf. This makes the configuration more flexible and prevents type assertion errors if the port is not provided as a string. [1] [2] [3] [4] [5] [6]

Process monitoring and error handling:

  • Enhanced the Start methods in several backends (deviceDiscoveryBackend, networkDiscoveryBackend, openTelemetryBackend) to check if the managed process has exited unexpectedly during readiness checks. If so, the process is stopped, an error is logged, and a descriptive error is returned. This improves reliability and error reporting. [1] [2] [3]

Logging and debugging:

  • Added additional logging in the pktvisorBackend readiness check to log process status and the URL being checked, aiding in debugging startup issues.

Startup timing adjustment:

  • Increased the initial sleep duration in networkDiscoveryBackend's Start method from 1 second to 4 seconds to allow more time for the process to start up before checking its status.

@leoparente leoparente self-assigned this Oct 8, 2025
@github-actions
Copy link

github-actions bot commented Oct 8, 2025

Go test coverage

STATUS ELAPSED PACKAGE COVER PASS FAIL SKIP
🟢 PASS 0.01s github.com/netboxlabs/orb-agent/agent 0.0% 0 0 0
🟢 PASS 0.01s github.com/netboxlabs/orb-agent/agent/backend 0.0% 0 0 0
🟢 PASS 4.03s github.com/netboxlabs/orb-agent/agent/backend/devicediscovery 79.4% 2 0 0
🟢 PASS 0.00s github.com/netboxlabs/orb-agent/agent/backend/mocks 0.0% 0 0 0
🟢 PASS 4.03s github.com/netboxlabs/orb-agent/agent/backend/networkdiscovery 80.6% 2 0 0
🟢 PASS 4.02s github.com/netboxlabs/orb-agent/agent/backend/opentelemetryinfinity 74.1% 2 0 0
🟢 PASS 4.03s github.com/netboxlabs/orb-agent/agent/backend/pktvisor 71.7% 2 0 0
🟢 PASS 4.02s github.com/netboxlabs/orb-agent/agent/backend/snmpdiscovery 80.2% 2 0 0
🟢 PASS 5.03s github.com/netboxlabs/orb-agent/agent/backend/worker 80.6% 3 0 0
🟢 PASS 1.02s github.com/netboxlabs/orb-agent/agent/config 100.0% 6 0 0
🟢 PASS 31.18s github.com/netboxlabs/orb-agent/agent/configmgr 51.5% 13 0 0
🟢 PASS 4.41s github.com/netboxlabs/orb-agent/agent/configmgr/fleet 61.9% 52 0 0
🟢 PASS 1.01s github.com/netboxlabs/orb-agent/agent/policies 100.0% 15 0 0
🟢 PASS 1.04s github.com/netboxlabs/orb-agent/agent/policymgr 70.3% 10 0 0
🟢 PASS 26.87s github.com/netboxlabs/orb-agent/agent/secretsmgr 48.9% 54 0 0
🟢 PASS 1.01s github.com/netboxlabs/orb-agent/agent/version 100.0% 1 0 0

Total coverage: 61.6%

@leoparente leoparente marked this pull request as ready for review October 8, 2025 20:10
Copy link
Contributor

@jajeffries jajeffries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@leoparente leoparente merged commit ca99120 into develop Oct 9, 2025
5 checks passed
@leoparente leoparente deleted the feat/support-int-port-and-proper-backoff branch October 9, 2025 13:51
@github-actions
Copy link

github-actions bot commented Nov 3, 2025

🎉 This PR is included in version 2.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Nov 4, 2025

🎉 This PR is included in version 2.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants