-
Notifications
You must be signed in to change notification settings - Fork 901
feat: add metrics to workspace agent scripts #11132
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
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
2f978c3
wip: work on agent script metrics
Emyrk c567eab
push startup script metrics to agent
Emyrk 5d39495
Add metrics pushing to prometheus
Emyrk 07fe74a
make metric a normal prom metric exported, rather than a first class
Emyrk 753f1a6
linting/fmt/naming
Emyrk aafd29e
add template_name label to workspace agent stats
Emyrk 6c5a560
Fix prom tests
Emyrk ad3f47f
Update prom docs
Emyrk 19428fa
seed template id in test
Emyrk 8bfa9ad
fixup! seed template id in test
Emyrk 044b942
PR feedback, _s -> seconds, start -> startup
Emyrk 2db41b6
change string params to a struct
Emyrk dd32401
Change the name of the labels argument struct
Emyrk b4a3607
Clarify comment
Emyrk c5da250
Remove extra words
Emyrk eb1d173
measure workspace startup closer to script finish in lines of code
Emyrk e803436
Fix unit test call args
Emyrk 99483fe
Make gen
Emyrk 2f89b62
Formatting
Emyrk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add metrics pushing to prometheus
- Loading branch information
commit 5d39495eceb7a16c7166b540bb4860c801361ec1
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
coderd/database/migrations/000176_agent_startup_script_stats.down.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALTER TABLE workspace_agent_stats DROP COLUMN startup_script_ns; | ||
ALTER TABLE workspace_agent_stats DROP COLUMN startup_script_success; |
5 changes: 5 additions & 0 deletions
5
coderd/database/migrations/000176_agent_startup_script_stats.up.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ALTER TABLE workspace_agent_stats ADD COLUMN startup_script_ns BIGINT NOT NULL DEFAULT 0; | ||
ALTER TABLE workspace_agent_stats ADD COLUMN startup_script_success BOOL NOT NULL DEFAULT false; | ||
|
||
COMMENT ON COLUMN workspace_agent_stats.startup_script_ns IS 'The time it took to run the startup script in nanoseconds. If set to 0, the startup script was not run.'; | ||
COMMENT ON COLUMN workspace_agent_stats.startup_script_success IS 'Whether the startup script was run successfully. Will be false if the duration is 0, but the script has not been run.'; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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: many of these changes are sneaking in, should we adjust our linter?
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 just added this to my editor config, maybe that will fix it:
coder/.golangci.yaml
Line 126 in 8bfa9ad
The issue is that imports are not deterministic for the fmt from my experience. Both this in the PR, and grouping them is valid. There are packages like https://github.com/daixiang0/gci that make import ordering deterministic. Would prevent this, but require us to setup an extra tool.