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

Log exporter individual log splitting #389

Merged
merged 6 commits into from
May 12, 2022

Conversation

damemi
Copy link
Contributor

@damemi damemi commented May 11, 2022

This sizes and splits individual log entries based on the default maximum quotas per cloud logging

internalLogEntry.Resource = mr
if splits > 1 {
internalLogEntry.Split = &logpb.LogSplit{
Uid: entry.Timestamp.String(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs some sort of salt to add more uniqueness. audit logs use a "~unique" process id

// Calculate the size of the internal log entry so this overhead can be accounted
// for when determining the need to split based on payload size
// TODO(damemi): Find an appropriate estimated buffer to account for the LogSplit struct as well
logOverhead, err := l.logEntryToInternal(entry, logName, mr, 0, 0)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's annoying that I need a duplicate logEntryToInternal call, but we need the size of the proto before the payload is added to calculate the overhead, then we need to convert each complete logentry (w/payload) to a proto. maybe there is an optimization I'm not seeing

@damemi damemi requested a review from dashpole May 11, 2022 14:56
exporter/collector/logs.go Outdated Show resolved Hide resolved
exporter/collector/logs.go Outdated Show resolved Hide resolved
exporter/collector/logs.go Show resolved Hide resolved
continue
}
logName, err := l.getLogName(log)
splitEntries, logName, err := l.logToSplitEntries(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need to return logName from this anymore, right?

@damemi damemi merged commit b3c0533 into GoogleCloudPlatform:main May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants