1
0
Fork 0
mirror of https://github.com/imjasonh/snoop synced 2026-07-15 04:35:26 +00:00
Commit graph

3 commits

Author SHA1 Message Date
Jason Hall
2dd10e3e1e Add structured logging with clog
Implement context-aware structured logging throughout the codebase using
chainguard-dev/clog. This provides better observability with configurable
log levels and structured output.

- Add -log-level flag to control verbosity (debug, info, warn, error)
- Replace all log.Println/Printf calls with structured clog logging
- Thread context through NewProbe, NewProcessor, and NewFileReporter
- Add detailed debug logging for eBPF tracepoint attachment
- Add debug logging for file operations in reporter
- Change "new file" messages to debug level to reduce noise
- Update all tests to pass context.Background()

Default log level is "info" which provides operational visibility without
excessive verbosity. Debug level shows detailed event processing.

Signed-off-by: Jason Hall <jason@chainguard.dev>
2026-01-14 10:27:27 -05:00
Jason Hall
5fc1a6dea1 Add Prometheus metrics endpoint for production observability
- Add pkg/metrics package with snoop-specific metrics:
  - Event counters (received, processed, excluded, duplicate)
  - Unique files gauge
  - Report write counters
- Expose /metrics endpoint on port 9090 (configurable via -metrics-addr flag)
- Include process and Go runtime metrics via default collectors
- Add unit tests for metrics package

Signed-off-by: Jason Hall <jason@chainguard.dev>
2026-01-14 10:21:17 -05:00
Jason Hall
f793a98161 initial commit
Signed-off-by: Jason Hall <jason@chainguard.dev>
2026-01-14 09:55:28 -05:00