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

Send client logs with the cloud logging library #474

Merged
merged 50 commits into from
Oct 23, 2024
Merged

Send client logs with the cloud logging library #474

merged 50 commits into from
Oct 23, 2024

Conversation

jessieqliu
Copy link
Contributor

@jessieqliu jessieqliu commented Aug 9, 2024

Replaces our existing logging (with the "log" package) with a custom logging library that wraps (1) the Cloud Logging library (for logging to Cloud Logs) and (2) slog (for logging to the serial console). Using the Cloud Logging library allows for structured payloads and properly displayed severity (ex. ERROR logs) in the logging UI.

Note this does NOT include logging redirection from the workload - that is still sent via StdOut (in the case of Cloud Logging).

Examples

Cloud Logs
Screenshot 2024-10-11 3 05 42 PM
image

Serial Logs
Screenshot 2024-10-11 3 05 17 PM

Breaking Changes

  • Changes *log.Logger type to logging.Logger in agent.CreateAttestationAgent(), agent.fetchContainerimageSignatures(), ContainerRunner.logger, runner.NewRunner(), spec.GetLaunchSpec(), spec.fetchExperiments(), and teeserver.New()

@jessieqliu
Copy link
Contributor Author

/gcbrun

4 similar comments
@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu jessieqliu changed the title Testing migration to slog Use slog for logging Aug 15, 2024
@jessieqliu jessieqliu requested a review from jkl73 August 15, 2024 23:53
@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

5 similar comments
@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

if err != nil {
return fmt.Errorf("failed to convert %v into uint64, got: %v", devShmSizeKey, val)
}
s.DevShmSize = int64(size)

Check failure

Code scanning / CodeQL

Incorrect conversion between integer types High test

Incorrect conversion of an unsigned 64-bit integer from
strconv.ParseUint
to a lower bit size type int64 without an upper bound check.
@jessieqliu
Copy link
Contributor Author

/gcbrun

4 similar comments
@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu jessieqliu changed the title Use slog for logging Add proper cloud logging Sep 26, 2024
@jessieqliu
Copy link
Contributor Author

/gcbrun

2 similar comments
@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu jessieqliu changed the title Add proper cloud logging Log with the cloud logging library Oct 1, 2024
@jessieqliu
Copy link
Contributor Author

/gcbrun

Copy link
Contributor

@jkl73 jkl73 left a comment

Choose a reason for hiding this comment

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

Mostly nits, feel free to submit

launcher/container_runner.go Outdated Show resolved Hide resolved
launcher/internal/logging/logging.go Show resolved Hide resolved
launcher/internal/logging/logging.go Outdated Show resolved Hide resolved
launcher/internal/logging/logging.go Show resolved Hide resolved
@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu jessieqliu merged commit c891518 into main Oct 23, 2024
13 checks passed
@jessieqliu jessieqliu deleted the logging branch October 23, 2024 01:16
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.

3 participants