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

Add experimental toggle to disable the profiling native extension #1594

Merged
merged 1 commit into from
Jul 15, 2021

Conversation

ivoanjo
Copy link
Member

@ivoanjo ivoanjo commented Jul 14, 2021

In #1584 I identified that users of dd-trace-rb on Linux/macOS needed to have a working build environment to compile msgpack and ffi, and so installing our gem would be no different.

I've since identified a possible corner case: in the reliability environment, we use the GitLab omnibus distribution
(https://docs.gitlab.com/omnibus/), which already ships pre-compiled versions of msgpack and ffi, but does not include a compiler nor the Ruby headers required for compiling extensions.

Thus, up until now it was trivial to add dd-trace-rb (and profiling) to these images, but the addition of the native extension complicates things a lot.

Since the native extension is still in the "we're evaluating and learning about the downsides/sharp edges of having it" phase, I decided to add a DD_PROFILING_NO_EXTENSION environment variable, that for now can be used to disable building and usage of the extension.

Because the extension is currently empty, doing this is is harmless, but in the future, the use of DD_PROFILING_NO_EXTENSION will lead to the profiler being disabled as well, once the profiler code starts requiring the native extension to be available. For that reason, I documented this toggle as experimental, and added a warning whenever the app is loaded with it.

For users reading this (if any!): if you needed to use this option, please tell us why on
https://github.com/DataDog/dd-trace-rb/issues/new as we want to accommodate your use cases.

In #1584 I identified that users of dd-trace-rb on Linux/macOS
needed to have a working build environment to compile msgpack and ffi,
and so installing our gem would be no different.

I've since identified a possible corner case: in the reliability
environment, we use the GitLab omnibus distribution
(<https://docs.gitlab.com/omnibus/>), which already ships
pre-compiled versions of msgpack and ffi, but does not include a
compiler nor the Ruby headers required for compiling extensions.

Thus, up until now it was trivial to add dd-trace-rb (and profiling)
to these images, but the addition of the native extension complicates
things a lot.

Since the native extension is still in the "we're evaluating and
learning about the downsides/sharp edges of having it" phase, I
decided to add a `DD_PROFILING_NO_EXTENSION` environment variable,
that for now can be used to disable building and usage of the
extension.

Because the extension is currently empty, doing this is is harmless,
but in the future, the use of `DD_PROFILING_NO_EXTENSION` will lead
to the profiler being disabled as well, once the profiler code
starts requiring the native extension to be available. For that
reason, I documented this toggle as experimental, and added a
warning whenever the app is loaded with it.

For users reading this (if any!): if you needed to use this option,
please tell us why on
<https://github.com/DataDog/dd-trace-rb/issues/new> as we want to
acommodate your use cases.
@ivoanjo ivoanjo requested a review from a team July 14, 2021 10:30
@ivoanjo ivoanjo merged commit 4e0c2ef into master Jul 15, 2021
@ivoanjo ivoanjo deleted the ivoanjo/allow-skipping-native-extension branch July 15, 2021 07:29
@github-actions github-actions bot added this to the 0.52.0 milestone Jul 15, 2021
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.

None yet

2 participants