Skip to content

Fix #64: Omit empty steps and errors from wide event logs#65

Merged
mishankov merged 1 commit intomainfrom
issue-64-omit-empty-steps-errors
Mar 2, 2026
Merged

Fix #64: Omit empty steps and errors from wide event logs#65
mishankov merged 1 commit intomainfrom
issue-64-omit-empty-steps-errors

Conversation

@mishankov
Copy link
Member

Summary

Closes #64

Modifies the wide event logging to omit steps and errors fields when they are empty arrays, reducing log noise and improving readability.

Before

{"level":"DEBUG","name":"http.request","timestamp":"2026-03-01T19:38:32.602385+03:00","duration":195040541,"steps":[],"errors":[],"request.remoteAddr":"127.0.0.1:60449","tokens.type":"bearer","request.method":"GET","request.status":301,"serviceName":"http server"}

After

{"level":"DEBUG","name":"http.request","timestamp":"2026-03-01T19:38:32.602385+03:00","duration":195040541,"request.remoteAddr":"127.0.0.1:60449","tokens.type":"bearer","request.method":"GET","request.status":301,"serviceName":"http server"}

Changes

  • Modified log/event.go: toAttrs() method now conditionally appends steps and errors attributes only when they contain data

Testing & Validation

  • All existing tests pass (task test)
  • Linter passes with 0 issues (task lint)
  • No race conditions detected

Code Review Summary

Blockers: None (P0/P1)
Findings: No material issues identified
Risk: Minor - downstream log parsers may need to handle missing fields instead of empty arrays

Breaking Changes

Log entries will no longer contain steps: [] or errors: [] when empty. Systems parsing these logs should be updated to handle missing keys.

@platforma-dev platforma-dev deleted a comment from coderabbitai bot Mar 1, 2026
@mishankov mishankov force-pushed the issue-64-omit-empty-steps-errors branch from 575c3f4 to 2e99d69 Compare March 1, 2026 19:33
@mishankov mishankov merged commit 61c0738 into main Mar 2, 2026
6 checks passed
@mishankov mishankov deleted the issue-64-omit-empty-steps-errors branch March 2, 2026 04:39
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.

Do not log empty values in wide event

1 participant