diff options
| author | Paul Buetow <paul@buetow.org> | 2025-12-30 22:29:41 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-12-30 22:29:41 +0200 |
| commit | 24592b36da26e7c6ef30aca3017f9da6ceb2f086 (patch) | |
| tree | 231c6abb8cdb5c2e9d56d708bebbf55c57b72fa2 /f3s/prometheus-pusher/coverage.out | |
| parent | 88075b925598f438d15a352364ce17c302a21351 (diff) | |
Refactor prometheus-pusher following Go best practices
Major refactoring to improve code organization and follow Go conventions:
- Moved main entry point to cmd/prometheus-pusher/main.go
- Organized code into internal packages (config, metrics, parser, ingester, version)
- Implemented proper dependency injection (no package-level variables)
- Added context.Context to all blocking operations
- Used value semantics where feasible (Sample, Config, Ingesters)
- Proper error wrapping with %w throughout
- All functions under 50 lines, focused and single-purpose
- Consistent ordering: constants, types, constructors, public, private
- Added -version flag to display version from internal/version package
Package structure:
- cmd/prometheus-pusher: Main entry point with flag parsing and mode routing
- internal/config: Configuration types and constants
- internal/version: Version constant (0.0.0)
- internal/metrics: Sample type and Collectors for metric generation
- internal/parser: CSV/JSON parsers with context support
- internal/ingester: Pushgateway, RemoteWrite, and Auto ingesters
All modes tested and working: realtime, historic, backfill, auto
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'f3s/prometheus-pusher/coverage.out')
0 files changed, 0 insertions, 0 deletions
