Skip to content
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

register pprof endpoints for allocator #1408

Merged
merged 3 commits into from
Feb 2, 2023

Conversation

seankhliao
Copy link
Contributor

These are generally useful for tracking down performance issues.
Allocator clients are generally trusted, these shouldn't need to be on a separate endpoint.

@seankhliao seankhliao requested a review from a team January 31, 2023 00:12
@@ -78,6 +79,7 @@ func NewServer(log logr.Logger, allocator allocation.Allocator, discoveryManager
router.GET("/jobs", s.JobHandler)
router.GET("/jobs/:job_id/targets", s.TargetsHandler)
router.GET("/metrics", gin.WrapH(promhttp.Handler()))
registerPprof(router.Group("/debug/pprof/"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to design the registration in a way that the end point can be switched on and off?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any reason for it? E.g. perf penalty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I'm aware, just the import has no impact on performance.
When I do see flags for controlling it, it's usually because it's run on a separate port, as the main handler is exposed to untrusted clients or has auth requirements.
The allocator runs with trusted clients, metrics are on the same listener, leading me to the conclusion that there's no need to hide it behind a flag.

@jaronoff97
Copy link
Contributor

Thanks for adding this in :) Could you fill out a changelog for this too please?

@seankhliao seankhliao requested a review from a team January 31, 2023 21:26
@seankhliao
Copy link
Contributor Author

i've added one

Copy link
Member

@pavolloffay pavolloffay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a nit for the changelog generator

component: target allocator

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: register pprof endpoints under /debug/pprof
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please start the sentence with a capital R ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@pavolloffay pavolloffay merged commit 195744f into open-telemetry:main Feb 2, 2023
@seankhliao seankhliao deleted the allocator-pprof branch February 2, 2023 11:21
ItielOlenick pushed a commit to ItielOlenick/opentelemetry-operator that referenced this pull request May 1, 2024
* register pprof endpoints for allocator

* changelog entry

* full sentence for changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants