x-pack/osquerybeat: rename query profiling config and enable profiling by default - #51691
Conversation
…g by default Consolidate the osquerybeat query profiling settings under a single `elastic_options.profiling` block (`ProfilingConfig`): `profiling_all` is the fleet-wide default and `storage` keeps local retention of live profiles for diagnostics. Profiling is now enabled by default: `profiling_all` defaults to true when unset, and individual queries/actions may override it via their own `profiling` flag. Per-query and per-action overrides are tri-state (`*bool`) so an unset value inherits the global default while an explicit `false` opts out.
|
Pinging @elastic/sec-windows-platform (Team:Security-Windows Platform) |
🤖 GitHub commentsJust comment with:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughChangesThis PR renames osquerybeat profiling settings from Sequence Diagram(s)Included in the hidden review stack artifact above. Compact metadata 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@x-pack/osquerybeat/beater/config_plugin.go`:
- Around line 84-88: The live profiling default in ConfigPlugin is incorrectly
left at Go’s zero value, so ad-hoc queries can start with profiling disabled
until the first successful Set() call. Initialize the default in NewConfigPlugin
by setting globalProfileEnabled to true (matching ProfilingAllOrDefault() and
the documented fleet-wide default), and keep set()/Set() as the mechanism for
applying later overrides in config_plugin.go and the related default handling in
action_handler.go.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: 41440362-a40f-4f16-89f1-7d3ab24bed2e
📒 Files selected for processing (11)
changelog/fragments/1783001090-osquerybeat-profiling-config.yamlx-pack/osquerybeat/_meta/config/beat.reference.yml.tmplx-pack/osquerybeat/beater/action_handler.gox-pack/osquerybeat/beater/config_plugin.gox-pack/osquerybeat/beater/config_plugin_test.gox-pack/osquerybeat/beater/osquerybeat.gox-pack/osquerybeat/internal/action/action.gox-pack/osquerybeat/internal/action/action_test.gox-pack/osquerybeat/internal/config/config.gox-pack/osquerybeat/internal/config/osquery.gox-pack/osquerybeat/osquerybeat.reference.yml
Initialize ConfigPlugin.globalProfileEnabled to true in NewConfigPlugin so live/ad-hoc queries resolve profiling as enabled (matching the documented ProfilingAllOrDefault default) during the window before the first successful Set() applies policy.
|
Tick the box to add this pull request to the merge queue (same as
|
Proposed commit message
Consolidate the osquerybeat query profiling settings under a single
elastic_options.profilingblock (ProfilingConfig):profiling_allis the fleet-wide default andstoragekeeps local retention of live profiles for diagnostics.profiling_alldefaults totruewhen unset, and individual queries/actions may override it via their ownprofilingflag.*bool) so an unset value inherits the global default while an explicitfalseopts out.WHY: the previous naming (
profile/query_profile_storage, booleanenabled) conflated the profiling activity with the produced profile artifacts and defaulted profiling off. Renaming toprofilingand defaulting on makes the configuration clearer and profiling available out of the box, while still allowing per-query opt-out.Checklist
./changelog/fragmentsusing the changelog tool.Disruptive User Impact
The profiling configuration keys are renamed (
elastic_options.profiling,profiling_all, per-queryprofiling) and profiling now defaults to on. This profiling feature has not yet shipped in a released version, so there is no migration required for existing deployments.How to test this PR locally
cd x-pack/osquerybeat && go test ./beater/ ./internal/config/ ./internal/action/mage updateand confirmosquerybeat.reference.ymlshows theprofilingblock withprofiling_all: true.Related issues