1. Refactor the sidecar so it can handle more than one configuration per backend.
The sidecar has three different global "stores" where it keeps the current state:
backends (aka collectors)
assignments
daemon / runner
All of these stores are currently tied together with the collector id.
If we want to support multiple instances of one collector, we need to use a unique ID for this.
The obvious choice is to build an ID out of the collector and the configuration ID. (collector_id-configuration_id)
Will create 3 backends:
1234-aaa, 1234-bbb, 5678-eee
2. Report the collector_configuration_directory back to Graylog
This allows Graylog to create a sidecar config variable
${sidecar.spoolDir} would expand to sth like /var/lib/graylog-sidecar/generated/62864e0056caeb4862bf016b/
To make this backwards compatible with older Graylog servers that won't accept additional
NodeDetail fields in the API. (:roll_eyes:) we need to add a version check, and only send this to servers that support it.
3. Backwards compatible collector status.
The status of each collector was reported back to Graylog by using the collector_id.
Additionally, we will now report this with the assigned configuration_id.
But only to Graylog > 4.3
This PR contains 3 changes.
1. Refactor the sidecar so it can handle more than one configuration per backend.
The sidecar has three different global "stores" where it keeps the current state:
All of these stores are currently tied together with the collector id. If we want to support multiple instances of one collector, we need to use a unique ID for this. The obvious choice is to build an ID out of the collector and the configuration ID. (
collector_id
-configuration_id
)An assignment like:
Will create 3 backends:
1234-aaa
,1234-bbb
,5678-eee
2. Report the
collector_configuration_directory
back to GraylogThis allows Graylog to create a sidecar config variable
${sidecar.spoolDir}
would expand to sth like/var/lib/graylog-sidecar/generated/62864e0056caeb4862bf016b/
To make this backwards compatible with older Graylog servers that won't accept additional
NodeDetail
fields in the API. (:roll_eyes:) we need to add a version check, and only send this to servers that support it.3. Backwards compatible collector status.
The status of each collector was reported back to Graylog by using the collector_id. Additionally, we will now report this with the assigned
configuration_id
. But only to Graylog > 4.3Refs https://github.com/Graylog2/graylog-plugin-enterprise/issues/3956