open-telemetry / opentelemetry-collector

OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
4.08k stars 1.36k forks source link

Duplicate field `"level"` in json logs #10537

Closed jo-goro closed 22 hours ago

jo-goro commented 5 days ago

Describe the bug

Enabling json logging with internal metrics enabled will produce a log line which contains the field "level" twice.

{
  "level": "info",
  "ts": 1720086435.41712,
  "caller": "service@v0.104.0/telemetry.go:96",
  "msg": "Serving metrics",
  "address": "10.0.0.41:8888",
  "level": "Detailed"
}

Steps to reproduce Enable json logging and internal metrics. Look for a log with "msg": "Serving metrics". Should be among the first few lines after startup.

What version did you use? Version: v0.104.0

What config did you use?

service:
  telemetry:
    logs:
      encoding: json
      level: INFO
      disable_stacktrace: true
      sampling:
        enabled: false
    metrics:
      level: detailed
mx-psi commented 4 days ago

Please take a look at #10547