Skip to content

feat: improve resources_monitoring for OOM & OOD monitoring #16241

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 28 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9c4071e
work on resources monitoring
defelmnq Jan 23, 2025
5609041
work on migrations and db
defelmnq Jan 23, 2025
fd2dbe7
work on database integration
defelmnq Jan 23, 2025
d2b42b7
add metadata logic to db
defelmnq Jan 27, 2025
893c54c
add metadata logic to db
defelmnq Jan 27, 2025
15a3837
revert formatting
defelmnq Jan 27, 2025
de9e73a
improve errors handling
defelmnq Jan 27, 2025
d8568a3
work on fake db
defelmnq Jan 27, 2025
87737eb
work on db
defelmnq Jan 27, 2025
5cd023f
update provisioner version
defelmnq Jan 27, 2025
25aedf0
work on testdata
defelmnq Jan 28, 2025
a5f44aa
merge
defelmnq Jan 29, 2025
6f0373f
work on resources monitor
defelmnq Jan 29, 2025
4bfb4cb
worked on dbmem and dbauthz
defelmnq Jan 29, 2025
68b022f
add dbauthz tests
defelmnq Jan 29, 2025
5bc849e
work on errors message improvement
defelmnq Jan 31, 2025
8a79421
improve database indexes
defelmnq Feb 3, 2025
7d9a05b
Merge remote-tracking branch 'origin/main' into agent_resource_monito…
defelmnq Feb 3, 2025
93609ca
merge main and rename migration
defelmnq Feb 3, 2025
1bf0866
fix resources volumes allocation
defelmnq Feb 3, 2025
ffb6f91
regenerate
defelmnq Feb 3, 2025
aacc294
rename fixture
defelmnq Feb 3, 2025
961ab25
use agent_id uuid
defelmnq Feb 3, 2025
d7f57d7
work on tests
defelmnq Feb 3, 2025
401b000
work on tests
defelmnq Feb 3, 2025
930bfbb
add tests on provisionerserver
defelmnq Feb 3, 2025
fae8dc9
remove unrequired test case
defelmnq Feb 3, 2025
d98ea6f
Merge remote-tracking branch 'origin/main' into agent_resource_monito…
defelmnq Feb 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
work on db
  • Loading branch information
defelmnq committed Jan 27, 2025
commit 87737eb27b6e43bd13fd0a54ab21bce2fb589e31
4 changes: 2 additions & 2 deletions coderd/database/dbmem/dbmem.go
Original file line number Diff line number Diff line change
Expand Up @@ -2356,7 +2356,7 @@ func (q *FakeQuerier) FavoriteWorkspace(_ context.Context, arg uuid.UUID) error
return nil
}

func (q *FakeQuerier) FetchAgentResourceMonitorsByAgentID(ctx context.Context, agentID uuid.UUID) ([]database.WorkspaceAgentResourceMonitor, error) {
func (q *FakeQuerier) FetchAgentResourceMonitorsByAgentID(_ context.Context, agentID uuid.UUID) ([]database.WorkspaceAgentResourceMonitor, error) {
q.mutex.RLock()
defer q.mutex.RUnlock()

Expand Down Expand Up @@ -8540,7 +8540,7 @@ func (q *FakeQuerier) InsertWorkspaceAgentMetadata(_ context.Context, arg databa
return nil
}

func (q *FakeQuerier) InsertWorkspaceAgentResourceMonitor(ctx context.Context, arg database.InsertWorkspaceAgentResourceMonitorParams) (database.WorkspaceAgentResourceMonitor, error) {
func (q *FakeQuerier) InsertWorkspaceAgentResourceMonitor(_ context.Context, arg database.InsertWorkspaceAgentResourceMonitorParams) (database.WorkspaceAgentResourceMonitor, error) {
err := validateDatabaseType(arg)
if err != nil {
return database.WorkspaceAgentResourceMonitor{}, err
Expand Down
2 changes: 1 addition & 1 deletion coderd/provisionerdserver/acquirer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ func TestAcquirer_MatchTags(t *testing.T) {
lines = append(lines, s)
}
t.Logf("You can paste this into docs/admin/provisioners.md")
t.Log("%s", strings.Join(lines, "\n"))
t.Logf(strings.Join(lines, "\n"))
})
}

Expand Down
1 change: 1 addition & 0 deletions coderd/provisionerdserver/provisionerdserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1934,6 +1934,7 @@ func InsertWorkspaceResource(ctx context.Context, db database.Store, jobID uuid.
Rtype: database.WorkspaceAgentMonitoredResourceTypeMemory,
Enabled: prAgent.ResourcesMonitoring.Memory.Enabled,
Threshold: prAgent.ResourcesMonitoring.Memory.Threshold,
Metadata: []byte("{}"),
CreatedAt: dbtime.Now(),
})
if err != nil {
Expand Down
Loading