Skip to content

Deprecate the timeline_enabled option which is redundant with gvl_enabled#5750

Merged
eregon merged 2 commits into
masterfrom
no-disable-gvl-profiling-if-no-timeline
May 28, 2026
Merged

Deprecate the timeline_enabled option which is redundant with gvl_enabled#5750
eregon merged 2 commits into
masterfrom
no-disable-gvl-profiling-if-no-timeline

Conversation

@eregon

@eregon eregon commented May 13, 2026

Copy link
Copy Markdown
Member

What does this PR do?

What the title says.

Motivation:

Correctness.

Change log entry

Yes. The profiling.advanced.timeline_enabled setting has been deprecated for removal and no longer does anything. Please remove it from your Datadog.configure block and do not set DD_PROFILING_TIMELINE_ENABLED.

Additional Notes:

How to test the change?

@eregon
eregon requested review from a team as code owners May 13, 2026 11:07
@dd-octo-sts dd-octo-sts Bot added the profiling Involves Datadog profiling label May 13, 2026
@eregon
eregon requested a review from ivoanjo May 13, 2026 11:08

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d1039f70d9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread lib/datadog/profiling/component.rb
@pr-commenter

pr-commenter Bot commented May 13, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-05-28 09:39:33

Comparing candidate commit 2b1ec6f in PR branch no-disable-gvl-profiling-if-no-timeline with baseline commit ca31d4d in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 44 metrics, 2 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

@Strech Strech left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure about the timeline_enabled being removed from condition

@eregon

eregon commented May 13, 2026

Copy link
Copy Markdown
Member Author

Right, I'll discuss with @ivoanjo what's the right fix here.
Currently the GVL metric won't be emitted if timeline is disabled, which is wrong.
But maybe we should check if timeline is enabled/disabled inside GVL hooks and e.g. don't sample in GVL hooks if timeline disabled.
OTOH that's extra complexity and it's gonna get more complicated with an upcoming optimization doing a 3rd thing with GVL hooks, and timeline disabled is meant only as a escape hatch IIUC. So I'm thinking this PR is the right way but let's discuss when you are back Ivo.

@eregon
eregon force-pushed the no-disable-gvl-profiling-if-no-timeline branch from d1039f7 to 2da61c0 Compare May 21, 2026 09:50
@dd-octo-sts dd-octo-sts Bot added the core Involves Datadog core libraries label May 21, 2026
@dd-octo-sts

dd-octo-sts Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

Typing analysis

Note: Ignored files are excluded from the next sections.

Untyped methods

This PR introduces 19 partially typed methods, and clears 19 partially typed methods.

Partially typed methods (+19-19)Introduced:
sig/datadog/profiling/collectors/thread_context.rbs:26
└── def self.for_testing: (
          recorder: Datadog::Profiling::StackRecorder,
          ?max_frames: ::Integer,
          ?tracer: Datadog::Tracing::Tracer?,
          ?endpoint_collection_enabled: bool,
          ?waiting_for_gvl_threshold_ns: ::Integer,
          ?otel_context_enabled: (::Symbol? | bool),
          ?native_filenames_enabled: bool,
          **untyped
        ) -> Datadog::Profiling::Collectors::ThreadContext
sig/datadog/profiling/collectors/thread_context.rbs:47
└── def safely_extract_context_key_from: (untyped tracer) -> ::Symbol?
sig/datadog/profiling/component.rbs:11
└── def self.build_thread_context_collector: (
        untyped settings,
        Datadog::Profiling::StackRecorder recorder,
        Datadog::Tracing::Tracer? optional_tracer,
      ) -> Datadog::Profiling::Collectors::ThreadContext
sig/datadog/profiling/component.rbs:17
└── def self.build_profiler_exporter: (
        untyped settings,
        Datadog::Profiling::StackRecorder recorder,
        Datadog::Profiling::Collectors::CpuAndWallTimeWorker worker,
        internal_metadata: ::Hash[::Symbol, ::String | bool | ::Numeric],
      ) -> Datadog::Profiling::Exporter
sig/datadog/profiling/component.rbs:24
└── def self.build_profiler_transport: (
        untyped settings,
        Datadog::Core::Configuration::AgentSettings agent_settings
      ) -> untyped
sig/datadog/profiling/component.rbs:29
└── def self.enable_gc_profiling?: (untyped settings, Datadog::Core::Logger logger) -> bool
sig/datadog/profiling/component.rbs:30
└── def self.enable_allocation_profiling?: (untyped settings, Datadog::Core::Logger logger) -> bool
sig/datadog/profiling/component.rbs:31
└── def self.get_heap_sample_every: (untyped settings) -> ::Integer
sig/datadog/profiling/component.rbs:32
└── def self.enable_heap_profiling?: (
        untyped settings,
        bool allocation_profiling_enabled,
        ::Integer heap_sample_every,
        Datadog::Core::Logger logger,
      ) -> bool
sig/datadog/profiling/component.rbs:38
└── def self.enable_heap_size_profiling?: (untyped settings, bool heap_profiling_enabled, Datadog::Core::Logger logger) -> bool
sig/datadog/profiling/component.rbs:40
└── def self.no_signals_workaround_enabled?: (untyped settings, Datadog::Core::Logger logger) -> bool
sig/datadog/profiling/component.rbs:41
└── def self.incompatible_libmysqlclient_version?: (untyped settings, Datadog::Core::Logger logger) -> bool
sig/datadog/profiling/component.rbs:43
└── def self.flush_interval: (untyped settings) -> ::Numeric
sig/datadog/profiling/component.rbs:47
└── def self.dir_interruption_workaround_enabled?: (untyped settings, bool no_signals_workaround_enabled) -> bool
sig/datadog/profiling/component.rbs:48
└── def self.can_apply_exec_monkey_patch?: (untyped settings) -> bool
sig/datadog/profiling/component.rbs:49
└── def self.enable_gvl_profiling?: (untyped settings, Datadog::Core::Logger logger) -> bool
sig/datadog/profiling/stack_recorder.rbs:23
└── def self.for_testing: (
        ?alloc_samples_enabled: bool,
        ?heap_samples_enabled: bool,
        ?heap_size_enabled: bool,
        ?heap_sample_every: Integer,
        ?heap_clean_after_gc_enabled: bool,
        **untyped
      ) -> Datadog::Profiling::StackRecorder
sig/datadog/profiling/stack_recorder.rbs:51
└── def stats: () -> ::Hash[::Symbol, untyped]
sig/datadog/profiling/stack_recorder.rbs:52
└── def self._native_stats: (Datadog::Profiling::StackRecorder recorder_instance) -> ::Hash[::Symbol, untyped]
Cleared:
sig/datadog/profiling/collectors/thread_context.rbs:28
└── def self.for_testing: (
          recorder: Datadog::Profiling::StackRecorder,
          ?max_frames: ::Integer,
          ?tracer: Datadog::Tracing::Tracer?,
          ?endpoint_collection_enabled: bool,
          ?timeline_enabled: bool,
          ?waiting_for_gvl_threshold_ns: ::Integer,
          ?otel_context_enabled: (::Symbol? | bool),
          ?native_filenames_enabled: bool,
          **untyped
        ) -> Datadog::Profiling::Collectors::ThreadContext
sig/datadog/profiling/collectors/thread_context.rbs:50
└── def safely_extract_context_key_from: (untyped tracer) -> ::Symbol?
sig/datadog/profiling/component.rbs:11
└── def self.build_thread_context_collector: (
        untyped settings,
        Datadog::Profiling::StackRecorder recorder,
        Datadog::Tracing::Tracer? optional_tracer,
        bool timeline_enabled,
      ) -> Datadog::Profiling::Collectors::ThreadContext
sig/datadog/profiling/component.rbs:18
└── def self.build_profiler_exporter: (
        untyped settings,
        Datadog::Profiling::StackRecorder recorder,
        Datadog::Profiling::Collectors::CpuAndWallTimeWorker worker,
        internal_metadata: ::Hash[::Symbol, ::String | bool | ::Numeric],
      ) -> Datadog::Profiling::Exporter
sig/datadog/profiling/component.rbs:25
└── def self.build_profiler_transport: (
        untyped settings,
        Datadog::Core::Configuration::AgentSettings agent_settings
      ) -> untyped
sig/datadog/profiling/component.rbs:30
└── def self.enable_gc_profiling?: (untyped settings, Datadog::Core::Logger logger) -> bool
sig/datadog/profiling/component.rbs:31
└── def self.enable_allocation_profiling?: (untyped settings, Datadog::Core::Logger logger) -> bool
sig/datadog/profiling/component.rbs:32
└── def self.get_heap_sample_every: (untyped settings) -> ::Integer
sig/datadog/profiling/component.rbs:33
└── def self.enable_heap_profiling?: (
        untyped settings,
        bool allocation_profiling_enabled,
        ::Integer heap_sample_every,
        Datadog::Core::Logger logger,
      ) -> bool
sig/datadog/profiling/component.rbs:39
└── def self.enable_heap_size_profiling?: (untyped settings, bool heap_profiling_enabled, Datadog::Core::Logger logger) -> bool
sig/datadog/profiling/component.rbs:41
└── def self.no_signals_workaround_enabled?: (untyped settings, Datadog::Core::Logger logger) -> bool
sig/datadog/profiling/component.rbs:42
└── def self.incompatible_libmysqlclient_version?: (untyped settings, Datadog::Core::Logger logger) -> bool
sig/datadog/profiling/component.rbs:44
└── def self.flush_interval: (untyped settings) -> ::Numeric
sig/datadog/profiling/component.rbs:48
└── def self.dir_interruption_workaround_enabled?: (untyped settings, bool no_signals_workaround_enabled) -> bool
sig/datadog/profiling/component.rbs:49
└── def self.can_apply_exec_monkey_patch?: (untyped settings) -> bool
sig/datadog/profiling/component.rbs:50
└── def self.enable_gvl_profiling?: (untyped settings, Datadog::Core::Logger logger) -> bool
sig/datadog/profiling/stack_recorder.rbs:25
└── def self.for_testing: (
        ?alloc_samples_enabled: bool,
        ?heap_samples_enabled: bool,
        ?heap_size_enabled: bool,
        ?heap_sample_every: Integer,
        ?timeline_enabled: bool,
        ?heap_clean_after_gc_enabled: bool,
        **untyped
      ) -> Datadog::Profiling::StackRecorder
sig/datadog/profiling/stack_recorder.rbs:54
└── def stats: () -> ::Hash[::Symbol, untyped]
sig/datadog/profiling/stack_recorder.rbs:55
└── def self._native_stats: (Datadog::Profiling::StackRecorder recorder_instance) -> ::Hash[::Symbol, untyped]

Untyped other declarations

This PR introduces 1 partially typed other declaration, and clears 1 partially typed other declaration.

Partially typed other declarations (+1-1)Introduced:
sig/datadog/profiling/stack_recorder.rbs:32
└── type serialized_profile_data = [
        ::Time, # Start
        ::Time, # Finish
        Datadog::Profiling::EncodedProfile, # Serialized PProf
        ::Hash[::Symbol, untyped], # Hash
      ]
Cleared:
sig/datadog/profiling/stack_recorder.rbs:35
└── type serialized_profile_data = [
        ::Time, # Start
        ::Time, # Finish
        Datadog::Profiling::EncodedProfile, # Serialized PProf
        ::Hash[::Symbol, untyped], # Hash
      ]

If you believe a method or an attribute is rightfully untyped or partially typed, you can add # untyped:accept on the line before the definition to remove it from the stats.

@dd-octo-sts

dd-octo-sts Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

Thank you for updating Change log entry section 👏

Visited at: 2026-05-21 10:06:54 UTC

@eregon
eregon force-pushed the no-disable-gvl-profiling-if-no-timeline branch from 2da61c0 to 19c21c5 Compare May 21, 2026 09:52
@eregon eregon changed the title Enable GVL profiling even if timeline is disabled since it is now also used as a metric Deprecate the timeline_enabled option which is redundant with gvl_enabled May 21, 2026
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 1 Pipeline job failed

Check Pull Request CI Status | all-jobs-are-green   View in Datadog   GitHub Actions

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 97.04% (-0.06%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 2b1ec6f | Docs | Datadog PR Page | Give us feedback!

@eregon
eregon force-pushed the no-disable-gvl-profiling-if-no-timeline branch from 19c21c5 to cb58654 Compare May 26, 2026 10:21

@ivoanjo ivoanjo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍 LGTM

Comment thread ext/datadog_profiling_native_extension/stack_recorder.c Outdated
Comment thread lib/datadog/profiling/component.rb
Comment thread spec/datadog/core/configuration/settings_spec.rb Outdated
Comment thread spec/datadog/profiling/collectors/thread_context_spec.rb
@eregon
eregon force-pushed the no-disable-gvl-profiling-if-no-timeline branch 2 times, most recently from df2a6a5 to 13c29ce Compare May 26, 2026 15:00
@eregon
eregon enabled auto-merge May 26, 2026 15:00
@eregon
eregon force-pushed the no-disable-gvl-profiling-if-no-timeline branch 2 times, most recently from 2656a63 to 53de3a4 Compare May 27, 2026 10:10
@eregon
eregon force-pushed the no-disable-gvl-profiling-if-no-timeline branch from 53de3a4 to ed0c76c Compare May 27, 2026 10:16
@eregon
eregon merged commit 974464f into master May 28, 2026
865 of 867 checks passed
@eregon
eregon deleted the no-disable-gvl-profiling-if-no-timeline branch May 28, 2026 10:40
@dd-octo-sts dd-octo-sts Bot added this to the 2.35.0 milestone May 28, 2026
@Strech Strech mentioned this pull request Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Involves Datadog core libraries profiling Involves Datadog profiling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants