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

Initial implementation of offline mode #3026

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

umanwizard
Copy link
Contributor

This patch introduces offline mode, a mechanism for running the agent without a network connection.

--offline-mode-storage-path takes a path to a directory in which data will be stored; it will be created if it does not exist. Samples and stack traces are written to a file with name <current time>-<agent PID>.padata. Every 10 minutes (by default), this file is rotated and compressed with zstd.

--offline-mode-upload causes the agent to look for these files in the path passed via --offline-mode-storage-path, and upload them to the remote store configured with the usual remote store options.

Note that significant parts of log_uploader.go -- specifically the locationsReader and associated functions -- were mostly copied from Parca.

@umanwizard umanwizard requested review from gnurizen and brancz January 22, 2025 20:40
Copy link
Member

@brancz brancz left a comment

Choose a reason for hiding this comment

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

Very nice!

For a moment I was thinking that maybe we should export the things that were copied from Parca, but this is probably easier so we can evolve the wire protocol without having to first modify Parca.

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