Skip to content

New - add support for profiling flag#481

Merged
cleverchuk merged 2 commits into
mainfrom
cc/NH-133021
May 7, 2026
Merged

New - add support for profiling flag#481
cleverchuk merged 2 commits into
mainfrom
cc/NH-133021

Conversation

@cleverchuk
Copy link
Copy Markdown
Contributor

Summary

Adds support for a remote PROFILING flag in the settings response, allowing the backend to control whether profiling is active. The profiling span processor now checks this flag in addition to local config before profiling.

Details

The existing SAMPLE_BUCKET_ENABLED flag (bit 0x40) was unused. This change repurposes that bit position as the new PROFILING flag, which the backend can set to remotely enable or disable profiling.

The isProfilingEnabled() check in SolarwindsProfilingSpanProcessor is extended: after confirming local profiling config is enabled, it calls TraceDecisionUtil.isProfilingEnabledByFlags() to consult remote settings. The logic respects the OVERRIDE flag semantics — when override is set, the remote PROFILING flag is authoritative; when override is not set (or remote settings are unavailable), profiling defaults to enabled (assuming local config allows it).

Key changes:

  • Renamed OBOE_SETTINGS_FLAG_SAMPLE_BUCKET_ENABLED to OBOE_SETTINGS_FLAG_PROFILING in the Settings constants
  • Updated flag parsing in RpcSettings and JsonSettingWrapper to recognize the "PROFILING" token
  • Added TraceConfig.hasProfilingFlag() for querying the flag with null-safety on the flags field
  • Added TraceDecisionUtil.isProfilingEnabledByFlags() which encapsulates the override-aware logic
  • Added null-safety to TraceConfig.hasSampleTriggerTraceFlag() (defensive fix while modifying the class)
  • Updated test fixtures (solarwinds-apm-settings.json) to use PROFILING instead of SAMPLE_BUCKET_ENABLED
  • Extended SettingsStub builder with a isProfiling parameter for test flexibility

Test services data

  1. e-1712644058766987264
  2. e-1712643928659124224
  3. e-1742334541200846848
  4. e-1777406072376840192

Copilot AI review requested due to automatic review settings May 6, 2026 19:09
@cleverchuk cleverchuk requested review from a team as code owners May 6, 2026 19:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Comment thread libs/sampling/src/main/java/com/solarwinds/joboe/sampling/TraceDecisionUtil.java Outdated
jerrytfleung
jerrytfleung previously approved these changes May 6, 2026
Copy link
Copy Markdown

@jerrytfleung jerrytfleung left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.

Copy link
Copy Markdown

@jerrytfleung jerrytfleung left a comment

Choose a reason for hiding this comment

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

LGTM

@cleverchuk cleverchuk merged commit 43cb04b into main May 7, 2026
16 checks passed
@cleverchuk cleverchuk deleted the cc/NH-133021 branch May 7, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants