opentelemetry-operator icon indicating copy to clipboard operation
opentelemetry-operator copied to clipboard

Configure zap EncoderConfig for operator

Open kaskavalci opened this issue 3 years ago • 7 comments

Operator uses default configuration for zap encoder configuration. levelKey in this config defaults to level. This creates an issue in GCP Logging as it expects severity for log level. Below is an example of a log level interpreted as error.

I've noticed operator uses sigs.k8s.io/controller-runtime/pkg/log/zap package to bind directly from environment variables. As far as I can see, that function does not support full configuration of zapcore.EncoderConfig. But, it seems it is possible to configure zap completely by using the zap package from controller-runtime.

If such a feature is reasonable, I'm happy to pick it up to contribute.

{
  "insertId": "z96t3fg2d841ax",
  "jsonPayload": {
    "opentelemetry-collector": "0.24.0",
    "go-os": "linux",
    "opentelemetry-operator": "0.24.0",
    "build-date": "2021-04-22T20:20:45Z",
    "go-version": "go1.15.11",
    "ts": 1620630610.4453816,
    "msg": "Starting the OpenTelemetry Operator",
    "go-arch": "amd64",
    "level": "info"
  },
  "timestamp": "2021-05-10T07:10:10.445834703Z",
  "severity": "ERROR",
  "receiveTimestamp": "2021-05-10T07:10:16.030283595Z"
}

kaskavalci avatar May 10 '21 07:05 kaskavalci

Yes, please!

jpkrohling avatar May 10 '21 08:05 jpkrohling

Awesome! My schedule is bit busy, I'll pick this up on the next availability within 3 weeks.

kaskavalci avatar May 11 '21 13:05 kaskavalci

Are you still interested in this one, @kaskavalci?

jpkrohling avatar Aug 03 '21 10:08 jpkrohling

I do but it's been difficult to integrate this work with summer plans. I put a self imposed deadline but that didn't work either :) Is the issue prioritized? I'm happy to leave it to others or pick it up ASAP I find some time on my hands.

kaskavalci avatar Aug 03 '21 11:08 kaskavalci

It's not prioritized, I would love to have you do it whenever you have time for it.

jpkrohling avatar Aug 03 '21 14:08 jpkrohling

@jpkrohling I'm sorry to keep this holding on me. It seems I cannot allocate any time to ship this feature. So, it's open for grabs!

kaskavalci avatar Mar 28 '22 09:03 kaskavalci

@jpkrohling, @kaskavalci. Could you please clarify what the expected results in this issue are?

yuriolisa avatar Apr 06 '22 11:04 yuriolisa

@jpkrohling.

yuriolisa avatar Sep 29 '22 11:09 yuriolisa

@kaskavalci do you have any updates regarding this issue?

yuriolisa avatar Oct 19 '23 15:10 yuriolisa

@yuriolisa Is this the expected outcome of the issue?

Current:

{"level":"info","ts":"2024-03-12T14:39:02+08:00","msg":"test"}

Expect:

{"severity":"info","ts":"2024-03-12T14:41:24+08:00","msg":"test"}

crossoverJie avatar Mar 12 '24 06:03 crossoverJie