Skip to content

Conversation

@leoparente
Copy link
Contributor

This pull request refactors the log parsing and logging logic in the runner package to improve log structure, enable better log level handling, and streamline message extraction. The main change is that log lines from the collector are now parsed to extract the log message, log level, and attributes, which are then passed to the logger in a more structured way.

Log parsing and logging improvements:

  • Refactored the parseCollectorLog function to return the log message, log level (slog.Level), and a slice of attributes, enabling more structured log handling. [1] [2]
  • Updated the log handling in the Runner.Start method to use the new parseCollectorLog signature, passing the message, level, and attributes directly to r.logger.LogAttrs for improved clarity and log level support.
  • Improved extraction of the log message and structured data from the collector logs, including attempting to unmarshal JSON messages and mapping collector log levels to slog.Level. [1] [2]

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

Go test coverage

STATUS ELAPSED PACKAGE COVER PASS FAIL SKIP
🟢 PASS 6.55s github.com/netboxlabs/opentelemetry-infinity/otlpinf 79.5% 4 0 0
🟢 PASS 3.57s github.com/netboxlabs/opentelemetry-infinity/runner 64.2% 5 0 0

Total coverage: 72.1%

@leoparente leoparente merged commit 67ce6ea into main Oct 17, 2025
6 checks passed
@leoparente leoparente deleted the chore/improve-logs branch October 17, 2025 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants