Skip to content

feat(codersdk): add debug handlers for logs, manifest, and token to agent #12593

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

Merged
merged 3 commits into from
Mar 14, 2024

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented Mar 14, 2024

Part of #12161

Adds the following debug handlers to the agent API:

  • /debug/manifest: returns the in-memory agent manifest
  • /debug/token: returns the in-memory agent session token
  • /debug/logs: returns up to the last 10MB of the agent log.

We can technically get these by connecting to the agent over SSH but this seems to be a better way overall.

@johnstcn johnstcn self-assigned this Mar 14, 2024
@johnstcn johnstcn marked this pull request as ready for review March 14, 2024 15:01
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

LGTM

}
defer f.Close()

// Limit to 10MB.
Copy link
Member

Choose a reason for hiding this comment

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

Should we limit this in the head or tail-end? A workspace running for a long time could have more relevant information towards the end. Then again, we seem to rotate at 5 MB so this will essentially always give the tail.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, this was my thinking. I was thinking about tailing but the fact that we rotate makes this not as important.

@johnstcn johnstcn merged commit 63696d7 into main Mar 14, 2024
@johnstcn johnstcn deleted the cj/agent-add-debug-handlers branch March 14, 2024 15:36
@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants