-
Notifications
You must be signed in to change notification settings - Fork 438
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
proposal: adding DD_PROFILING_ENABLED environment variable to control profiling #2834
Comments
@korECM thanks for raising this issue and offering your help. We should definitely implement this. The fact that it was never implemented is a historical accident. @nsrip-dd what do you think about this in the light of DataDog/orchestrion#178 ? I would assume that there is no harm in checking for |
TBH I'm not sure it makes much sense to me for this library. As it stands, |
Half-baked idea: Maybe it'd be better if we had a simpler API for setting up profiling? Like, you underscore-import it and it adds an
For users who are okay with the default configuration for everything, using just a few env vars to set their |
I suspect that's the use case. But maybe @korECM can confirm?
Yes, I think that would make sense.
That sounds interesting, but I think that would be an orthogonal topic. For now I see this issue more about bringing the Go profiler in line with our other profilers as well as the Go tracer (see DD_TRACE_ENABLED env var). |
As @felixge mentioned, I indeed want behavior similar to the The link provided explains it as follows:
Using this environment variable allows the application code to always However, for the profiler, there is no such variable, so the application needs to separately receive an environment variable and decide whether to Start based on its value. This becomes quite cumbersome and tedious when using the profiler in multiple applications. Ultimately, the desired behavior, as @nsrip-dd mentioned, is as follows: The default value of If the user sets This allows the application code to specify what to profile and always call I've confirmed that this environment variable already exists in orchestrion, but I'm not sure whether |
Okay, this sounds reasonable to me. Please feel free to send a PR. Thanks! |
I propose adding a DD_PROFILING_ENABLED environment variable to control profiling, similar to how DD_TRACE_ENABLED works for tracing.
Currently, there is no official environment variable to control profiling. This means that applications need to receive a configuration setting and decide whether to start profiling based on that setting in the application code. I believe adding a DD_PROFILING_ENABLED environment variable, like the one used in Python dd-trace, would be very helpful.
Has there been any previous discussion on this topic? If not, would it be alright if I take on the task of adding this feature?
This addition would allow users to easily enable or disable profiling without modifying application code, providing more flexibility and consistency with other Datadog environment variables.
If this proposal is accepted, I'd be happy to work on implementing this feature.
The text was updated successfully, but these errors were encountered: