-
Notifications
You must be signed in to change notification settings - Fork 44
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
Periodically capture resource metrics for every sandbox #216
base: main
Are you sure you want to change the base?
Periodically capture resource metrics for every sandbox #216
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Key Issues
Reducing the HTTP client timeout to 1 second may lead to frequent timeouts in network-dependent functions, potentially affecting reliability under network latency or high load conditions.
…ally-capture-resource-metrics-for-every-sandbox-e2b-1024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also remove the old method for getting metrics (stats)?
Co-authored-by: Jakub Novák <jakub@e2b.dev>
Co-authored-by: Jakub Novák <jakub@e2b.dev>
Ok, i was thinking maybe we could compare side by side but if you're confident that it won't be useful, ill remove it. |
…ally-capture-resource-metrics-for-every-sandbox-e2b-1024
It should be basically the same and the new ones are shinny and better |
Co-authored-by: Jakub Novák <jakub@e2b.dev>
Co-authored-by: Jakub Novák <jakub@e2b.dev>
Co-authored-by: Jakub Novák <jakub@e2b.dev>
…ally-capture-resource-metrics-for-every-sandbox-e2b-1024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Key Issues
The internal variable memoryMB
still uses the old name and potentially wrong unit, which can lead to incorrect calculations when compared with l.memoryMiBMax
due to the difference between MiB and MB units.
…ally-capture-resource-metrics-for-every-sandbox-e2b-1024
@@ -152,6 +152,41 @@ components: | |||
items: | |||
$ref: "#/components/schemas/SandboxLog" | |||
|
|||
SandboxMetric: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed in RPC, add total CPU 🙏🏻
I changed the base branch to |
Description
Periodically call a
envd
's/metrics
endpoint fromorchestrator
to get basic resource usage metrics. Calls it on start, on 5s interval and on end ofSandbox
lifecycleenvd
version and check that version is gte this version to call this new endpointtime.After
in check loop withtime.Ticker
to avoid allocating a new time on every iterationTest
Let's test this manually for now
✨
Description by Callstackai
This PR introduces a new feature to periodically capture resource metrics for every sandbox by calling the
/metrics
endpoint ofenvd
. It includes new types for metrics, updates to the API, and logging enhancements.Diagrams of code changes
Files Changed
This PR includes files in programming languages that we currently do not support. We have not reviewed files with the extensions
.go
,.tf
,.yml
. See list of supported languages.