mirror of
https://github.com/prometheus/prometheus.git
synced 2025-10-03 11:41:00 +02:00
Add comments clarifying why promql.Querylogger exists (#17231)
And why we only have one implementation in this code base. Fixes: https://github.com/prometheus/prometheus/issues/15869 Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
This commit is contained in:
parent
e697dfa3ff
commit
c9e0e36701
@ -125,6 +125,8 @@ var _ QueryLogger = (*logging.JSONFileLogger)(nil)
|
|||||||
|
|
||||||
// QueryLogger is an interface that can be used to log all the queries logged
|
// QueryLogger is an interface that can be used to log all the queries logged
|
||||||
// by the engine.
|
// by the engine.
|
||||||
|
// logging.JSONFileLogger implements this interface, downstream users may use
|
||||||
|
// different implementations.
|
||||||
type QueryLogger interface {
|
type QueryLogger interface {
|
||||||
slog.Handler
|
slog.Handler
|
||||||
io.Closer
|
io.Closer
|
||||||
|
@ -27,8 +27,8 @@ var _ slog.Handler = (*JSONFileLogger)(nil)
|
|||||||
|
|
||||||
var _ io.Closer = (*JSONFileLogger)(nil)
|
var _ io.Closer = (*JSONFileLogger)(nil)
|
||||||
|
|
||||||
// JSONFileLogger represents a logger that writes JSON to a file. It implements
|
// JSONFileLogger represents a logger that writes JSON to a file.
|
||||||
// the slog.Handler interface, as well as the io.Closer interface.
|
// It implements the promql.QueryLogger interface.
|
||||||
type JSONFileLogger struct {
|
type JSONFileLogger struct {
|
||||||
handler slog.Handler
|
handler slog.Handler
|
||||||
file *os.File
|
file *os.File
|
||||||
|
Loading…
x
Reference in New Issue
Block a user