-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: add continuous profiler instrumentation #178
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #178 +/- ##
=======================================
Coverage 65.08% 65.08%
=======================================
Files 76 76
Lines 3993 3993
=======================================
Hits 2599 2599
Misses 1124 1124
Partials 270 270
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
2291890
to
7a1483b
Compare
Add continuous profiling to instrumented applications. The profiler gets basically the default configuration, and is activated at run time by setting the environment variable DD_PROFILING_ENABLED to any of "1", "true", or "auto".
7a1483b
to
da7d13d
Compare
Signed-off-by: github-actions on behalf of RomainMuller <[email protected]>
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.
Thank you so much 🙇 . This LGTM.
PROF-10258 ### What does this PR do? Add profiling, enabled manually by setting `DD_PROFILING_ENABLED=true` at run time. The profiler has roughly the default configuration, with a few non-default profile types which should be low-enough overhead and sufficiently useful to enable for recent Go releases. There are not currently any other configuration knobs. If enabled this way, the profiles will be tagged with `orchestrion:true`. This PR also accepts the value `DD_PROFILING_ENABLED=auto` to enable profiling. This can be provided via the [Datadog Admission Controller](https://docs.datadoghq.com/containers/cluster_agent/admission_controller) (see [this PR](DataDog/datadog-agent#27185)). Some languages/runtimes use heuristics to decide whether to enable profiling when `auto` is provided, to avoid profiling short-lived or non-instrumented applications. We assume the application is meant to be instrumented by virtue of the user building with Orchestrion. And the Go profiler won't send any data until at least one minute has passed. So, we treat `auto` the same as `true`. TODO - document this once it's released TODO - this has only been manually tested. That's probably okay for now; there's not much to this code. But we can investigate ways to automatically test it. ### Motivation If somebody uses Orchestrion to add APM instrumentation, and they also want profiling, Orchestrion should be able to add it so the user doesn't have to separately modify their code to get profiling. ### Reviewer's Checklist <!-- * Authors can use this list as a reference to ensure that there are no problems during the review but the signing off is to be done by the reviewer(s). --> - [ ] Changed code has unit tests for its functionality. --------- Signed-off-by: github-actions on behalf of RomainMuller <[email protected]> Co-authored-by: Romain Marcadier <[email protected]> Co-authored-by: github-actions on behalf of RomainMuller <[email protected]> Co-authored-by: Romain Marcadier <[email protected]>
PROF-10258
What does this PR do?
Add profiling, enabled manually by setting
DD_PROFILING_ENABLED=true
at run time.The profiler has roughly the default configuration, with a few non-default profile types which
should be low-enough overhead and sufficiently useful to enable for recent Go releases.
There are not currently any other configuration knobs.
If enabled this way, the profiles will be tagged with
orchestrion:true
.This PR also accepts the value
DD_PROFILING_ENABLED=auto
to enable profiling.This can be provided via the Datadog Admission Controller (see this PR).
Some languages/runtimes use heuristics to decide whether to enable profiling when
auto
is provided, to avoid profiling short-lived or non-instrumented applications.We assume the application is meant to be instrumented by virtue of the user building
with Orchestrion. And the Go profiler won't send any data until at least one minute has
passed. So, we treat
auto
the same astrue
.TODO - document this once it's released
TODO - this has only been manually tested. That's probably okay for now; there's not
much to this code. But we can investigate ways to automatically test it.
Motivation
If somebody uses Orchestrion to add APM instrumentation, and they also want
profiling, Orchestrion should be able to add it so the user doesn't have to
separately modify their code to get profiling.
Reviewer's Checklist