-
Notifications
You must be signed in to change notification settings - Fork 887
feat: expose agent stats via Prometheus endpoint #7115
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
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.
Looks good, had a few comments and observations but nothing critical.
|
||
stat.Username = user.Username | ||
|
||
workspace, err := q.GetWorkspaceByID(ctx, agentStat.WorkspaceID) |
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.
These can be called whilst holding mutex? Wondering since the above call is to a nolock method.
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 is RWMutex, and we're using here only RLocks, so I guess that is's safe?
@mafredri I addressed your suggestions regarding cancellation vs. closing, but now the code is flaky. I'm not sure what is wrong here: https://github.com/coder/coder/actions/runs/4699908242/jobs/8333944515 Would you mind throwing an eye on the output? It looks like it complains about dbauthz. |
Ok, it looks like it's fixed now 👍 |
Related: #6724
This PR exposes agent stats stored in the database via the Prometheus endpoint.