opentelemetry-operator
opentelemetry-operator copied to clipboard
Configure zap EncoderConfig for operator
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"
}
Yes, please!
Awesome! My schedule is bit busy, I'll pick this up on the next availability within 3 weeks.
Are you still interested in this one, @kaskavalci?
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.
It's not prioritized, I would love to have you do it whenever you have time for it.
@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!
@jpkrohling, @kaskavalci. Could you please clarify what the expected results in this issue are?
@jpkrohling.
@kaskavalci do you have any updates regarding this issue?
@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"}