Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prometheus receiver prints "level" field twice in log messages #1486

Closed
nilebox opened this issue Aug 4, 2020 · 1 comment · Fixed by #1493
Closed

Prometheus receiver prints "level" field twice in log messages #1486

nilebox opened this issue Aug 4, 2020 · 1 comment · Fixed by #1493
Assignees
Labels
bug Something isn't working

Comments

@nilebox
Copy link
Member

nilebox commented Aug 4, 2020

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"}

The problem is in the zap -> go-kit log adapter:

Steps to reproduce

  1. Replace logger with zap.NewProduction() in
  2. Run EndToEndTest:
    // TestEndToEnd end to end test executor
    func TestEndToEnd(t *testing.T) {

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

func (w *zapToGokitLogAdapter) Log(keyvals ...interface{}) error {
, which should check if level is one of the fields in keyvals 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

@nilebox nilebox added the bug Something isn't working label Aug 4, 2020
@nilebox nilebox self-assigned this Aug 4, 2020
@nilebox
Copy link
Member Author

nilebox commented Aug 5, 2020

There are other duplicate fields in the log:

  • "msg":"" and "msg":"Scrape failed"
  • "ts":1596117234.8600261 and "timestamp":1596117234850

hughesjj pushed a commit to hughesjj/opentelemetry-collector that referenced this issue Apr 27, 2023
…y#1486)

Bumps [boto3](https://github.com/boto/boto3) from 1.21.43 to 1.21.44.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](boto/boto3@1.21.43...1.21.44)

---
updated-dependencies:
- dependency-name: boto3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Troels51 pushed a commit to Troels51/opentelemetry-collector that referenced this issue Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant