-
Notifications
You must be signed in to change notification settings - Fork 956
chore: add profiling labels for pprof analysis #19232
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
PProf labels segment the code into groups for determing the source of cpu/memory profiles. Since the web server and background jobs share a lot of the same code (eg wsbuilder), it helps to know if the load is user induced, or background job based.
I'm sure the |
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.
Only nits, this looks rad
enterprise/coderd/coderd.go
Outdated
@@ -903,7 +903,8 @@ func (api *API) updateEntitlements(ctx context.Context) error { | |||
} | |||
|
|||
api.AGPL.PrebuildsReconciler.Store(&reconciler) | |||
go reconciler.Run(context.Background()) | |||
// TODO: Should this context be the app context? |
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.
What is the "app" referring to here?
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.
api.ctx
.
I just noticed the prebuild routine does not get the app context shutdown.
} | ||
|
||
const ( | ||
ServiceTerraformProvisioner = "terraform-provisioner" |
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.
Follow-up: would be cool to label pubsub as well.
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.
Which pubsub? The database pubsub listeners?
coder/coderd/database/pubsub/pubsub.go
Line 246 in cb1ec21
func (p *PGPubsub) subscribeQueue(event string, newQ *msgQueue) (cancel func(), err error) { |
@@ -333,6 +333,7 @@ func New(ctx context.Context, opts *Options) (*Server, error) { | |||
r.Use( | |||
// TODO: @emyrk Should we standardize these in some other package? | |||
httpmw.Recover(s.Logger), | |||
httpmw.WithProfilingLabels, |
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.
Worth discriminating on ws vs https traffic?
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.
Oh that is a really good idea. They should have that upgrade header iirc. Will add
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.
request_type: Total 730.0ms
550.0ms (75.34%): http
180.0ms (24.66%): websocket
service: Total 810.0ms
730.0ms (90.12%): http-api
80.0ms ( 9.88%): terraform-provisioner
PProf labels segment the code into groups for determing the source of cpu/memory profiles. Since the web server and background jobs share a lot of the same code (eg wsbuilder), it helps to know if the load is user induced, or background job based.
Example output: