Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: decouple IPInfo from the service handlers (#200)
* Add structure logging with `slog`. * Structure forgotten log. * Another forgotten log. * Remove IPInfo logic from TCP and UDP handling into the metrics collector. * Refactor metrics into separate collectors. * Rename some types to remove `Collector` suffix. * Use an LRU cache to manage the ipInfos for Prometheus metrics. * Use `nil` instead of `context.TODO()`. * Use `LogAttrs` for `debug...()` log functions. * Update logging in `metrics.go`. * Fix another race condition. * Revert renaming. * Replace LRU cache with a simpler map that expires unused items. * Move `SetBuildInfo()` call up. * refactor: change `outlineMetrics` to implement the `prometheus.Collector` interface * Address review comments. * Refactor collectors so the connections/associations keep track of the connection metrics. * Address review comments. * Make metrics interfaces for bytes consistently use `int64`. * Rename `Collector` to `Metrics`.
- Loading branch information