You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
All log messages produced by Prometheus code imported by Prometheus receiver print "level" field twice, e.g.:
{"level":"info","ts":1596545757.1352987,"caller":"scrape/scrape.go:962","msg":"","level":"debug","scrape_pool":"target2","target":"http://127.0.0.1:38363/target2/metrics","msg":"Scrape failed","err":"server returned HTTP status 404 Not Found"}
What did you expect to see?
A single "level" field (probably the one produced by Prometheus code / go-kit)
To implement this fix we need to improve the function
Describe the bug
All log messages produced by Prometheus code imported by Prometheus receiver print "level" field twice, e.g.:
The problem is in the zap -> go-kit log adapter:
opentelemetry-collector/receiver/prometheusreceiver/internal/logger.go
Line 37 in bd921af
l.Infow()
produces the first"level":"info"
field"level":"debug"
in the example above is produced by go-kit logger (https://github.com/go-kit/kit/blob/556100560949062d23fe05d9fda4ce173c30c59f/log/level/level.go#L178-L188) and passed as part of "keyvals" to the adapter linked above.Steps to reproduce
zap.NewProduction()
inopentelemetry-collector/receiver/prometheusreceiver/metrics_receiver_test.go
Line 45 in bd921af
opentelemetry-collector/receiver/prometheusreceiver/metrics_receiver_test.go
Lines 928 to 929 in bd921af
What did you expect to see?
A single "level" field (probably the one produced by Prometheus code / go-kit)
To implement this fix we need to improve the function
opentelemetry-collector/receiver/prometheusreceiver/internal/logger.go
Line 34 in bd921af
level
is one of the fields inkeyvals
and respect it for using appropriate zap level, and then drop the go-kit one.What did you see instead?
Two "level" fields in JSON output
The text was updated successfully, but these errors were encountered: