[fbreceiver] partial fix for global paths#46779
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
c273bd9 to
84f3e79
Compare
84f3e79 to
559b70c
Compare
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
|
Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services) |
cmacknz
left a comment
There was a problem hiding this comment.
It looks like several of the existing tests had to be modified to account for these changes, so there is test coverage through that.
Do we have any larger test we can rely on to prove we fixed this, so we aren't reliant on manual testing of beats receivers to ensure it doesn't regress.
One wrong use of the global paths import from the wrong source will bring back the problem but there's a lot of surface area to cover. Maybe we can use the linter to forbid the import that would cause this to come back?
The Could be improved by getting diagnostics from each receiver and making sure the registry in each diagnostic is unique. We could do that in a follow on PR.
We can deprecate the functions in That would let the linter catch any new instances. But we still have to do the work to abolish the global variable. |
belimawr
left a comment
There was a problem hiding this comment.
LGTM, but having a test to ensure the stores are using different paths would put my mind at easy.
faec
left a comment
There was a problem hiding this comment.
Looks good as far as this PR, one small related followup for the non-filebeat case
partial fix of global paths for filebeat receiver (cherry picked from commit e55e0be) # Conflicts: # filebeat/beater/diagnostics.go # filebeat/beater/filebeat.go # libbeat/cfgfile/reload_integration_test.go # libbeat/cmd/instance/beat.go
partial fix of global paths for filebeat receiver (cherry picked from commit e55e0be) # Conflicts: # filebeat/beater/crawler.go # libbeat/cfgfile/reload_test.go # libbeat/cmd/instance/beat.go # libbeat/otelbeat/oteltest/oteltest.go # x-pack/filebeat/fbreceiver/receiver_test.go
…7829) * [fbreceiver] partial fix for global paths (#46779) partial fix of global paths for filebeat receiver (cherry picked from commit e55e0be) # Conflicts: # filebeat/beater/crawler.go # libbeat/cfgfile/reload_test.go # libbeat/cmd/instance/beat.go # libbeat/otelbeat/oteltest/oteltest.go # x-pack/filebeat/fbreceiver/receiver_test.go * fix conflicts --------- Co-authored-by: Lee E Hinman <57081003+leehinman@users.noreply.github.com> Co-authored-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Proposed commit message
** For filebeatreceiver only **
Add a unique per filebeat receiver path variable. All other beats will use the global
paths.Pathsprovided byelastic-agent-libs/pathsThis is necessary for each filebeat receiver to have it's own registry in a separate directory.
This is not a complete fix for #44903 . The following paths still need to migrated to use the unique per beat path variable.
auditbeat/datastore/datastore.gofilebeat/autodiscover/builder/hints/logs.gofilebeat/cmd/generate.golibbeat/processors/cache/cache.golibbeat/processors/cache/file_store.golibbeat/processors/script/javascript/javascript.golibbeat/publisher/queue/diskqueue/config.gometricbeat/beater/metricbeat.gowinlogbeat/beater/winlogbeat.gox-pack/libbeat/persistentcache/persistentcache.gox-pack/metricbeat/module/openai/usage/usage.goChecklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.Disruptive User Impact
Author's Checklist
How to test this PR locally
Unit Test
By hand
path.homeRelated issues
Use cases
Screenshots
Logs