Skip to content

Conversation

@leoparente
Copy link
Contributor

This pull request adds support for exporting logs from the agent to an OTLP (OpenTelemetry Protocol) endpoint via gRPC, enabling better observability and integration with telemetry systems. It introduces a new telemetry logging module, updates configuration to allow enabling OTLP log export, and ensures proper lifecycle management of the OTLP exporter. Additionally, it updates dependencies to include OpenTelemetry packages and fixes a minor typo in the configuration struct.

OTLP Telemetry Logging Integration:

  • Added a new telemetry package with logs.go and logs_test.go, implementing an OTLP log exporter for slog and providing unit tests for endpoint normalization and exporter creation. [1] [2]
  • Integrated OTLP log exporter initialization and shutdown in the agent lifecycle (agent.go), including safe shutdown on backend restart or agent stop, and conditional activation based on configuration. [1] [2] [3] [4] [5] [6]

Configuration Changes:

  • Added a new TelemetryLogs boolean field to the agent configuration to control whether OTLP log export is enabled.
  • Fixed a typo in the configuration struct: renamed SecretsManger to SecretsManager. [1] [2]

Dependency Updates:

  • Added OpenTelemetry and related packages to go.mod to support OTLP log export. [1] [2] [3] [4]
  • Updated existing dependencies to newer versions for improved compatibility and security. [1] [2] [3]

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

github-actions bot commented Oct 13, 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 1.11s github.com/netboxlabs/orb-agent/agent/backend 33.3% 30 0 0
🟢 PASS 4.03s github.com/netboxlabs/orb-agent/agent/backend/devicediscovery 79.4% 2 0 0
🟢 PASS 0.01s github.com/netboxlabs/orb-agent/agent/backend/mocks 0.0% 0 0 0
🟢 PASS 4.02s 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.04s github.com/netboxlabs/orb-agent/agent/backend/pktvisor 71.7% 2 0 0
🟢 PASS 4.03s 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.01s github.com/netboxlabs/orb-agent/agent/config 100.0% 6 0 0
🟢 PASS 31.19s github.com/netboxlabs/orb-agent/agent/configmgr 49.8% 14 0 0
🟢 PASS 4.53s github.com/netboxlabs/orb-agent/agent/configmgr/fleet 70.8% 121 0 0
🟢 PASS 1.02s github.com/netboxlabs/orb-agent/agent/policies 100.0% 15 0 0
🟢 PASS 1.03s github.com/netboxlabs/orb-agent/agent/policymgr 71.2% 10 0 0
🟢 PASS 30.25s github.com/netboxlabs/orb-agent/agent/secretsmgr 48.9% 54 0 0
🟢 PASS 1.02s github.com/netboxlabs/orb-agent/agent/telemetry 81.0% 19 0 0
🟢 PASS 1.01s github.com/netboxlabs/orb-agent/agent/version 100.0% 1 0 0

Total coverage: 63.2%

@leoparente leoparente marked this pull request as ready for review October 14, 2025 16:40
@leoparente leoparente merged commit 47896f2 into develop Oct 14, 2025
5 checks passed
@leoparente leoparente deleted the feat/add-log-exporter branch October 14, 2025 18:58
@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.

4 participants