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

Configure zap EncoderConfig for operator #268

Closed
kaskavalci opened this issue May 10, 2021 · 11 comments · Fixed by #2927
Closed

Configure zap EncoderConfig for operator #268

kaskavalci opened this issue May 10, 2021 · 11 comments · Fixed by #2927
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@kaskavalci
Copy link

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"
}
@jpkrohling
Copy link
Member

Yes, please!

@jpkrohling jpkrohling added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels May 10, 2021
@kaskavalci
Copy link
Author

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

@jpkrohling
Copy link
Member

Are you still interested in this one, @kaskavalci?

@kaskavalci
Copy link
Author

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.

@jpkrohling
Copy link
Member

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

@kaskavalci
Copy link
Author

@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!

@yuriolisa
Copy link
Contributor

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

@yuriolisa
Copy link
Contributor

@jpkrohling.

@yuriolisa
Copy link
Contributor

@kaskavalci do you have any updates regarding this issue?

@yuriolisa yuriolisa self-assigned this Oct 19, 2023
@crossoverJie
Copy link
Contributor

crossoverJie commented Mar 12, 2024

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

@yuriolisa
Copy link
Contributor

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

I did a misinterpretation about that issue, but you're right. It's exactly what's expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants