Skip to content

"memory exceeds quota" log better to be formatted to JSON #10870

Open
@zz-jason

Description

When the memory threshold is reached, a "memory exceeds quota" log is printed:

 40 // Action logs a warning only once when memory usage exceeds memory quota.
 41 func (a *LogOnExceed) Action(t *Tracker) {
 42     a.mutex.Lock()
 43     defer a.mutex.Unlock()
 44     if !a.acted {
 45         a.acted = true
 46         logutil.Logger(context.Background()).Warn("memory exceeds quota",
 47             zap.Error(errMemExceedThreshold.GenWithStackByArgs(t.label, t.BytesConsumed(), t.bytesLimit, t.String())))
 48     }
 49 }

If we print the tracker tree in JSON format, we can parse and read it easier.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions