Skip to content

JSON logs need level/log_level/severity attribute in the structure #8302

Open
@doctornkz-intelas

Description

@doctornkz-intelas

Which component are you using?:
I am using cluster-autoscaler

/area cluster-autoscaler

Is your feature request designed to solve a problem? If so describe the problem this feature should solve.:

After activation JSON logging feature, I got too much noise in my DataDog Logs:

Image It's because DataDog can't interpret log_level from the current data structure:
{
caller | core/static_autoscaler.go:532
ts | 1751908991159.8137
v | 1
}

I disabled this parameter because I am following the zero-false-error way of working.

Describe the solution you'd like.:
The solution seems very simple, but I know there are some issues regarding the log library (metrics-server is suffering from the same issue ).
Somehow, we should convert the text field, like I0708 (meaning %LEVEL%%CODE%, INFO 0708), to a JSON attribute like {'level': 'info', 'code': '0708'} or similar.

Describe any alternative solutions you've considered.:
I disabled JSON logging and am using a very frustrating way to render logs - Grok processor, and it's a pain.

Additional context.:

The same issue in metrics-server community - kubernetes-sigs/metrics-server#1426

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions