New - add support for profiling flag#481
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for a remote
PROFILINGflag 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_ENABLEDflag (bit0x40) was unused. This change repurposes that bit position as the newPROFILINGflag, which the backend can set to remotely enable or disable profiling.The
isProfilingEnabled()check inSolarwindsProfilingSpanProcessoris extended: after confirming local profiling config is enabled, it callsTraceDecisionUtil.isProfilingEnabledByFlags()to consult remote settings. The logic respects theOVERRIDEflag semantics — when override is set, the remotePROFILINGflag is authoritative; when override is not set (or remote settings are unavailable), profiling defaults to enabled (assuming local config allows it).Key changes:
OBOE_SETTINGS_FLAG_SAMPLE_BUCKET_ENABLEDtoOBOE_SETTINGS_FLAG_PROFILINGin theSettingsconstantsRpcSettingsandJsonSettingWrapperto recognize the"PROFILING"tokenTraceConfig.hasProfilingFlag()for querying the flag with null-safety on the flags fieldTraceDecisionUtil.isProfilingEnabledByFlags()which encapsulates the override-aware logicTraceConfig.hasSampleTriggerTraceFlag()(defensive fix while modifying the class)solarwinds-apm-settings.json) to usePROFILINGinstead ofSAMPLE_BUCKET_ENABLEDSettingsStubbuilder with aisProfilingparameter for test flexibilityTest services data