Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feat: integrate agentAPI with resources monitoring logic #16438
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
feat: integrate agentAPI with resources monitoring logic #16438
Changes from 1 commit
9d42cad
7b2d19e
0124d60
3661e8c
a5a788e
91d1515
0bc7632
3085041
120a37b
dd8ed40
0a8941b
f3388b4
523f6fd
06adbf7
c7b03d0
2c3d171
18b65e0
c95b05a
c79b6cb
b28d4fa
7701624
5fad903
b611ae5
3c65b8a
63c5869
2d3eeb5
e17aafc
c5a4201
262a672
dbca96e
3145eab
3bec324
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check failure on line 788 in agent/agent.go
Check failure on line 788 in agent/agent.go
Check failure on line 788 in agent/agent.go
Check failure on line 788 in agent/agent.go
Check failure on line 788 in agent/agent.go
Check failure on line 788 in agent/agent.go
Check failure on line 788 in agent/agent.go
Check failure on line 788 in agent/agent.go
Check failure on line 788 in agent/agent.go
Check failure on line 788 in agent/agent.go
Check failure on line 788 in agent/agent.go
Check failure on line 788 in agent/agent.go
Check failure on line 788 in agent/agent.go
Check failure on line 788 in agent/agent.go
Check failure on line 788 in agent/agent.go
Check failure on line 788 in agent/agent.go
Check failure on line 788 in agent/agent.go
Check failure on line 788 in agent/agent.go
Check failure on line 788 in agent/agent.go
Check failure on line 788 in agent/agent.go
Check failure on line 788 in agent/agent.go
Large diffs are not rendered by default.
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.
nit:
I think we could avoid using the
AgentFn
pattern here. We only need the Agent's ID, but this function makes a call to the database, using the Agent's ID, to fetch the agent. We could instead have theResourcesMonitoringAPI
have anAgentID
field and just pass in theAgentID
fromOptions
.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.
A bit surprised there's a so simple option , but makes sense and changed - Thanks ! ✅
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.
I'm confused about something, please help me understand:
If someone has configured a resources monitor like this:
It looks like we'll still be collecting the memory datapoints.
I don't see any mechanism in this PR to disable collection of memory stats.
Ditto for volumes.
Is this by design?
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.
Yep - I indeed skipped this one on the first proto version which I just changed. New payload seem way better.
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.
It would be useful to reviewers to understand when and how this will be set to
true
, and why it'sfalse
by default now.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.
You're right -
To clarify, this boolean defines if the monitoring is enabled or not - which means are we starting the ticker that will fetch the resources and push it back to coderd.
As the agent PR is part of a bigger topic, including another PR worked on by Danielle - for now monitoring should be turned off.
Once everything merged and we're ready to deploy, we'll just have to turn this one on with the release of coder/coder.
Edit : The logic changed a bit since the globally enabled field has since then been removed as discussed in another topic.
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.
self review : This function is just here as a placeholder - we are fine keeping it this way for now as it will be replaced by @DanielleMaywood PR.