prometheus/util
TJ Hoplock 6ebfbd2d54 chore!: adopt log/slog, remove go-kit/log
For: #14355

This commit updates Prometheus to adopt stdlib's log/slog package in
favor of go-kit/log. As part of converting to use slog, several other
related changes are required to get prometheus working, including:
- removed unused logging util func `RateLimit()`
- forward ported the util/logging/Deduper logging by implementing a small custom slog.Handler that does the deduping before chaining log calls to the underlying real slog.Logger
- move some of the json file logging functionality to use prom/common package functionality
- refactored some of the new json file logging for scraping
- changes to promql.QueryLogger interface to swap out logging methods for relevant slog sugar wrappers
- updated lots of tests that used/replicated custom logging functionality, attempting to keep the logical goal of the tests consistent after the transition
- added a healthy amount of `if logger == nil { $makeLogger }` type conditional checks amongst various functions where none were provided -- old code that used the go-kit/log.Logger interface had several places where there were nil references when trying to use functions like `With()` to add keyvals on the new *slog.Logger type

Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>
2024-10-07 15:58:50 -04:00
..
almost [COMMENT] Improve comment on almost.Equal; add tests 2024-08-30 10:13:00 +01:00
annotations lint: Revamp our linting rules, mostly around doc comments 2024-08-22 17:36:11 +02:00
documentcli Add support for multiple listening addresses 2024-08-20 13:09:16 +02:00
fmtutil chore: Fix typos (#14868) 2024-09-10 22:32:03 +02:00
gate Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
httputil golangci-lint: enable usestdlibvars linter 2024-04-08 19:26:23 +00:00
jsonutil Name float values as "floats", not as "values" 2023-04-13 19:25:24 +02:00
junitxml promtool: JUnit-Format XML Test Results (#14506) 2024-07-29 21:28:08 +10:00
logging chore!: adopt log/slog, remove go-kit/log 2024-10-07 15:58:50 -04:00
netconnlimit Add support for multiple listening addresses 2024-08-20 13:09:16 +02:00
notifications Move notifications in utils 2024-10-04 10:11:56 +02:00
osutil Format Go source files using 'gofumpt -w -s -extra' 2021-11-02 19:52:34 +01:00
pool Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
runtime chore: Fix typos (#14868) 2024-09-10 22:32:03 +02:00
runutil Append Created Timestamps (#12733) 2023-12-11 08:43:42 +00:00
stats Move from golang.org/x/exp/slices into slices now that we only support Go >= 1.21 2024-02-28 14:54:53 +01:00
strutil Implement SanitizeLabelName and Full variant 2023-02-03 15:28:33 +00:00
teststorage promtool: Avoid using testify for user rule tests 2024-03-21 22:08:10 +11:00
testutil chore!: adopt log/slog, remove go-kit/log 2024-10-07 15:58:50 -04:00
treecache chore!: adopt log/slog, remove go-kit/log 2024-10-07 15:58:50 -04:00
zeropool chore: Fix typos (#14868) 2024-09-10 22:32:03 +02:00