Make Sidecar default collector paths and host variable configurable#26199
Make Sidecar default collector paths and host variable configurable#26199xd4rker wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds new server-side configuration options to make the default Sidecar collector executable paths, spool locations, auditbeat server-config path, and the ${user.<host>} variable name configurable via graylog.conf, while keeping the existing defaults for backward compatibility.
Changes:
- Introduce new
sidecar_*settings inSidecarPluginConfigurationand wire them into the default Sidecar collectors seeding migration. - Update the default-collectors migration to substitute configurable paths and the configurable host variable name while preserving checksum-based upgrade behavior.
- Add unit tests covering configuration defaults/validation and migration behavior with custom settings.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| graylog2-server/src/test/java/org/graylog/plugins/sidecar/migrations/V20180212165000_AddDefaultCollectorsTest.java | Adds migration-level tests to verify default seeding and custom path/host-variable substitution. |
| graylog2-server/src/test/java/org/graylog/plugins/sidecar/common/SidecarPluginConfigurationTest.java | Adds tests for new config defaults and host-variable name validation. |
| graylog2-server/src/main/java/org/graylog2/commands/Server.java | Registers SidecarPluginConfiguration as a node configuration bean so the new graylog.conf options are parsed/bound. |
| graylog2-server/src/main/java/org/graylog/plugins/sidecar/rest/models/ConfigurationVariable.java | Extracts template-reference formatting into a reusable helper. |
| graylog2-server/src/main/java/org/graylog/plugins/sidecar/migrations/V20180212165000_AddDefaultCollectors.java | Uses configurable paths and host-variable name when generating default collector templates/configs. |
| graylog2-server/src/main/java/org/graylog/plugins/sidecar/common/SidecarPluginConfiguration.java | Adds new sidecar_* parameters (paths + host variable) and validation for host-variable naming. |
| changelog/unreleased/pr-26199.toml | Adds changelog entry for the new configurability feature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This PR includes the change from #26200. What's the purpose of breaking that out into a separate PR? |
patrickmann
left a comment
There was a problem hiding this comment.
- We should document that these options set the seed-time defaults and only fully apply to freshly-seeded collectors; to change an existing deployment, drop the collections or edit collectors in the UI.
- Warn on drift: If the configured values differ from what an existing collector carries (especially executablePath-bound ones), LOG.warn(...) that exec paths won't be auto-updated.
I kept it separate so each PR stays focused. That way, if we ever need to revert the feature, we won't have to revert the fix too, and the fix keeps its own changelog. Happy to combine them if you think that's cleaner 👍 |
…aylog2/graylog2-server into feature/configurable-sidecar-defaults
Maybe rebase 26199 on 26200 then. |
Description
Make the hardcoded paths and host-variable name in the default Sidecar collectors (seeded by the
V20180212165000_AddDefaultCollectorsmigration) configurable viagraylog.conf, for deployments with a custom Sidecar/server layout.New server options, all defaulting to the current values:
sidecar_collector_binary_dir(default:/usr/lib/graylog-sidecar)sidecar_spool_dir(default:/var/lib/graylog-sidecar)sidecar_windows_install_dir(default:C:\Program Files\Graylog\sidecar)sidecar_server_config_dir(default:/etc/graylog/server)sidecar_host_variable(default:graylog_host)How Has This Been Tested?
graylog.conf:filebeat-linux-default) shows/var/lib/custom-sidecar/...and${user.custom_host}.auditbeat-linux-defaultshows/etc/custom/server/usr/lib/custom-sidecar/...custom_hostTypes of changes
Checklist: