Repository navigation
Fix external loggers respecting configured format - #7699
Rohithmatham12 wants to merge 4 commits into
Conversation
Signed-off-by: Rohithmatham12 <rohithmatham@gmail.com>
e0e6dac to
9999625
Compare
Signed-off-by: Rohithmatham12 <rohithmatham@gmail.com>
1fb1c7c to
9a62f5d
Compare
Signed-off-by: Rohithmatham12 <rohithmatham@gmail.com>
9a62f5d to
1497c2d
Compare
There was a problem hiding this comment.
I am not sure the automaxprocs package is needed after 1.26.
There is conflicting information uber-go/automaxprocs#98 (comment)
we can decide later after some testing
@Rohithmatham12 good work though
sandy2008
left a comment
There was a problem hiding this comment.
LGTM, this fixes both lines from #7697. I checked it end to end: with -log.format=json, a grpclog.Component("transport").Errorf(...) now comes out as {"level":"error","msg":"[transport] Client received GoAway ..."}. gRPC info/warning logs stay hidden unless GRPC_GO_LOG_SEVERITY_LEVEL asks for them, and the maxprocs: line goes through the same logger at info. Nit: a CHANGELOG entry under ## master / unreleased ending with #7699 would be good, and it could mention that gRPC errors now go through the Cortex logger, so they also count toward log_messages_total{level="error"}.
|
Added the unreleased CHANGELOG entry, including that gRPC errors count toward |
What this changes
server.log_format.maxprocs.Set(...)after Cortex initializes logging, so maxprocs messages also use the configured format.GRPC_GO_LOG_SEVERITY_LEVELasks for warning/info.Fixes #7697.
Testing
GOCACHE=/private/tmp/cortex-go-cache GOMODCACHE=/private/tmp/cortex-go-mod-cache go test ./pkg/util/logGOCACHE=/private/tmp/cortex-go-cache GOMODCACHE=/private/tmp/cortex-go-mod-cache go test ./cmd/cortex