Skip to content

feat: wire structured logger (slog) throughout detection pipeline#16

Open
Kiran01bm wants to merge 1 commit intoblock:mainfrom
Kiran01bm:kiran01bm-logging-todo
Open

feat: wire structured logger (slog) throughout detection pipeline#16
Kiran01bm wants to merge 1 commit intoblock:mainfrom
Kiran01bm:kiran01bm-logging-todo

Conversation

@Kiran01bm
Copy link
Copy Markdown
Contributor

@Kiran01bm Kiran01bm commented Apr 15, 2026

What and Why ?

Address pending TODO related to structured logging - Replaces log.Printf calls with structured logging using Go's log/slog package. Adds logger fields to detector, inventory, and EOL provider components with consistent nil-safe defaults.

Changes

  • Detectors: Add logger field to EKS and Aurora detectors
  • Inventory: Add logger parameter to Wiz inventory sources (EKS, Aurora, ElastiCache) and parsing helpers
  • EOL Provider: Add logger field to endoflife.date provider with warning logs for skipped cycles
  • Main: Initialize JSON logger at startup and wire through all components
  • Tests: Update all test constructors to pass nil logger (uses slog.Default())

Benefits

  • Structured JSON logging for production observability
  • Context-aware log messages with typed fields
  • Consistent logging pattern across codebase
  • All TODO comments for logging addressed

All tests pass ✅

@Kiran01bm Kiran01bm requested a review from bakayolo as a code owner April 15, 2026 06:44
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

❌ Patch coverage is 52.94118% with 16 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/inventory/wiz/helpers.go 0.00% 4 Missing and 1 partial ⚠️
pkg/eol/endoflife/provider.go 50.00% 4 Missing ⚠️
pkg/inventory/wiz/eks.go 0.00% 4 Missing ⚠️
pkg/detector/eks/detector.go 50.00% 3 Missing ⚠️
Files with missing lines Coverage Δ
pkg/detector/aurora/detector.go 84.90% <100.00%> (ø)
pkg/inventory/wiz/aurora.go 84.90% <100.00%> (ø)
pkg/inventory/wiz/elasticache.go 86.95% <100.00%> (ø)
pkg/detector/eks/detector.go 81.81% <50.00%> (ø)
pkg/eol/endoflife/provider.go 83.54% <50.00%> (ø)
pkg/inventory/wiz/eks.go 0.00% <0.00%> (ø)
pkg/inventory/wiz/helpers.go 75.22% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant