Skip to content

Conversation

@tempusfrangit
Copy link
Member

The mirror logging to stdout/err was including the context prefix from python of [pid=<prediction_id] this PR eliminates that problem and restores proper logging to console.

This PR elmintes the utils package by moving the functionality to where
it is used. This is more in-line with idiomatic go (no non-descriptive
package names). As part of the elimination we moved to a custom slice
for logs that elminates the majority of the Custom Marshal/Unmarshal
code.

Identified in this change, the metrics emission was no longer wired up
and has been restored to functionality.

  Key improvements:
  - Introduce LogsSlice type with proper JSON marshaling/unmarshaling
    - Implements Stringer interface for consistent log formatting
    - Handles newline-delimited string conversion automatically
    - Eliminates need for custom PredictionResponse marshal/unmarshal
  - Move metrics functionality from dead util/metrics.go to runner.go
    - Restore sendRunnerMetric() function that was never called
    - Inline HTTPClientWithRetry() using httpclient.ApplyRetryPolicy
    - Fix missing imports and undefined references
  - Remove util.JoinLogs() dependency by using LogsSlice.String()
  - Consolidate logging utilities into appropriate packages

  Technical details:
  - LogsSlice.String() preserves util.JoinLogs() behavior (joins with \n, ensures trailing \n)
  - LogsSlice.MarshalJSON/UnmarshalJSON handles string ↔ []string conversion
  - All util package imports removed across codebase
  - Metrics sending now properly integrated into runner lifecycle

  This eliminates the "terrible util package" while restoring previously
  broken metrics functionality and improving type safety for log handling.
The mirror logging to stdout/err was including the context prefix from
python of `[pid=<prediction_id]` this PR eliminates that problem and
restores proper logging to console.
meatballhat
meatballhat previously approved these changes Sep 16, 2025
Base automatically changed from no-more-utils to main September 16, 2025 15:39
@tempusfrangit tempusfrangit dismissed meatballhat’s stale review September 16, 2025 15:39

The base branch was changed.

@tempusfrangit tempusfrangit merged commit 7312e5e into main Sep 16, 2025
19 checks passed
@tempusfrangit tempusfrangit deleted the logging branch September 16, 2025 15:40
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.

3 participants