Skip to content

x-pack/filebeat/input/entityanalytics: add entcollect adapter layer#49871

Merged
efd6 merged 5 commits into
elastic:mainfrom
efd6:49160-entcollect
Apr 27, 2026
Merged

x-pack/filebeat/input/entityanalytics: add entcollect adapter layer#49871
efd6 merged 5 commits into
elastic:mainfrom
efd6:49160-entcollect

Conversation

@efd6

@efd6 efd6 commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Proposed commit message

x-pack/filebeat/input/entityanalytics,x-pack/otel/extension/elasticsearchstorage: add entcollect adapters

Wire the entcollect shared library into the entity-analytics input
behind a new use_minimal_state config flag. When the flag is false
(the default), the existing kvstore-based provider path is unchanged.

The Beats adapter layer consists of:

 - Plugin signature extended with statestore.States, matching the
   CEL/httpjson pattern and positioning for ES-backed state later.
 - EntcollectStore wrapping kvstore.Transaction as entcollect.Store
   with error translation and a per-provider bucket namespace.
 - Publisher closure converting entcollect.Document to beat.Event
   with TxTracker.Add before each Publish for ACK-before-commit.
 - MinimalStateProviderFactory registry for entcollect providers
   (empty for now; later sessions populate it).
 - minimalStateInput implementing the generic sync loop: timer,
   buffer, ACK-then-commit, and buffer discard on error.
 - slog bridge from logp.Logger via zapslog.

The OTel adapter adds an entcollect.Registry implementation to the
elasticsearchstorage extension. The receiver (in opentelemetry-
collector-components) will resolve the extension via
host.GetExtensions() and type-assert to entcollect.Registry. Both
sides depend only on the stdlib-only entcollect module; neither
imports the other. The adapter translates between backend.Store and
entcollect.Store (error sentinels, method names, Each callback
shape).

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works. Where relevant, I have used the stresstest.sh script to run them under stress conditions and race detector to verify their stability.
  • I have added an entry in ./changelog/fragments using the changelog tool.

Disruptive User Impact

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

@efd6 efd6 self-assigned this Apr 2, 2026
@efd6 efd6 added enhancement Filebeat Filebeat backport-skip Skip notification from the automated backport with mergify Team:Security-Service Integrations Security Service Integrations Team labels Apr 2, 2026
@botelastic botelastic Bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Apr 2, 2026
@github-actions

github-actions Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@efd6 efd6 force-pushed the 49160-entcollect branch from af58763 to 22ee85f Compare April 2, 2026 06:55
@efd6 efd6 marked this pull request as ready for review April 2, 2026 20:16
@efd6 efd6 requested review from a team as code owners April 2, 2026 20:16
@efd6 efd6 requested review from mauri870 and orestisfl April 2, 2026 20:16
@elasticmachine

Copy link
Copy Markdown
Contributor

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

@coderabbitai

coderabbitai Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR adds a minimal-state mode to the entityanalytics input and updates its Plugin signature to accept a shared statestore.States. Configuration gains use_minimal_state and conditional validation for minimal providers. A new minimalStateInput implements timer-driven full/incremental syncs with ACK-based publishing, per-run on-disk kvstores, and panic recovery. Introduces entcollect integrations: an EntcollectStore adapter, a publisher factory, tx-tracker and publisher tests, and a minimal-state provider registry. Also adds an ES-backed entcollect store, provider/fake tests, changelog fragments, go.mod dependency updates, NOTICE/license entries, and a notice override.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@x-pack/filebeat/input/entityanalytics/minimal_test.go`:
- Line 96: The test creates a logger with logp.NewLogger (log variable) which
the linter forbids; change those usages to use the global logger logp.L() or
refactor the test functions to accept a *logp.Logger parameter and pass it in
from the caller. Update each occurrence referenced (the local variable named log
in minimal_test.go at the spots matching the original new-logger calls) to
either assign log := logp.L() or alter the test signatures to take a
*logp.Logger and use that parameter instead, and apply the same change at the
other occurrences reported (lines around 178, 251, 264).
🪄 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: Pro

Run ID: 9b4b42cd-8028-4385-829e-d6fb50135901

📥 Commits

Reviewing files that changed from the base of the PR and between 91d75e4 and 22ee85f.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (19)
  • NOTICE.txt
  • changelog/fragments/1775095457-entity-analytics-entcollect-adapter.yaml
  • dev-tools/notice/overrides.json
  • go.mod
  • x-pack/filebeat/input/default-inputs/inputs_aix.go
  • x-pack/filebeat/input/default-inputs/inputs_darwin.go
  • x-pack/filebeat/input/default-inputs/inputs_other.go
  • x-pack/filebeat/input/default-inputs/inputs_windows.go
  • x-pack/filebeat/input/entityanalytics/conf.go
  • x-pack/filebeat/input/entityanalytics/conf_test.go
  • x-pack/filebeat/input/entityanalytics/input.go
  • x-pack/filebeat/input/entityanalytics/input_test.go
  • x-pack/filebeat/input/entityanalytics/internal/kvstore/entcollect.go
  • x-pack/filebeat/input/entityanalytics/internal/kvstore/entcollect_test.go
  • x-pack/filebeat/input/entityanalytics/internal/kvstore/publish.go
  • x-pack/filebeat/input/entityanalytics/internal/kvstore/publish_test.go
  • x-pack/filebeat/input/entityanalytics/minimal.go
  • x-pack/filebeat/input/entityanalytics/minimal_test.go
  • x-pack/filebeat/input/entityanalytics/provider/minimal.go

Comment thread x-pack/filebeat/input/entityanalytics/minimal_test.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@x-pack/filebeat/input/entityanalytics/conf.go`:
- Around line 24-29: The validation branch that checks c.UseMinimalState calls
provider.HasMinimalStateProvider and immediately returns ErrProviderUnknown
because the minimal-state provider registry is empty; fix by either registering
at least one minimal-state provider in the provider registry (so
HasMinimalStateProvider returns true for supported c.Provider) or remove/guard
the UseMinimalState path until providers are added — update the registry
initialization where providers are registered and/or adjust the validation in
the function containing UseMinimalState to skip the HasMinimalStateProvider
check when no minimal providers exist, ensuring ErrProviderUnknown is not
returned for valid configs.
🪄 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: Pro

Run ID: d348c477-63d0-4b79-99c5-d837d2e1c1a0

📥 Commits

Reviewing files that changed from the base of the PR and between 22ee85f and 41d9b5f.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (19)
  • NOTICE.txt
  • changelog/fragments/1775095457-entity-analytics-entcollect-adapter.yaml
  • dev-tools/notice/overrides.json
  • go.mod
  • x-pack/filebeat/input/default-inputs/inputs_aix.go
  • x-pack/filebeat/input/default-inputs/inputs_darwin.go
  • x-pack/filebeat/input/default-inputs/inputs_other.go
  • x-pack/filebeat/input/default-inputs/inputs_windows.go
  • x-pack/filebeat/input/entityanalytics/conf.go
  • x-pack/filebeat/input/entityanalytics/conf_test.go
  • x-pack/filebeat/input/entityanalytics/input.go
  • x-pack/filebeat/input/entityanalytics/input_test.go
  • x-pack/filebeat/input/entityanalytics/internal/kvstore/entcollect.go
  • x-pack/filebeat/input/entityanalytics/internal/kvstore/entcollect_test.go
  • x-pack/filebeat/input/entityanalytics/internal/kvstore/publish.go
  • x-pack/filebeat/input/entityanalytics/internal/kvstore/publish_test.go
  • x-pack/filebeat/input/entityanalytics/minimal.go
  • x-pack/filebeat/input/entityanalytics/minimal_test.go
  • x-pack/filebeat/input/entityanalytics/provider/minimal.go
✅ Files skipped from review due to trivial changes (9)
  • x-pack/filebeat/input/default-inputs/inputs_windows.go
  • changelog/fragments/1775095457-entity-analytics-entcollect-adapter.yaml
  • x-pack/filebeat/input/entityanalytics/conf_test.go
  • go.mod
  • x-pack/filebeat/input/entityanalytics/provider/minimal.go
  • x-pack/filebeat/input/entityanalytics/minimal.go
  • x-pack/filebeat/input/entityanalytics/internal/kvstore/entcollect_test.go
  • x-pack/filebeat/input/entityanalytics/minimal_test.go
  • x-pack/filebeat/input/entityanalytics/input_test.go
🚧 Files skipped from review as they are similar to previous changes (6)
  • x-pack/filebeat/input/default-inputs/inputs_aix.go
  • x-pack/filebeat/input/default-inputs/inputs_other.go
  • x-pack/filebeat/input/default-inputs/inputs_darwin.go
  • NOTICE.txt
  • x-pack/filebeat/input/entityanalytics/internal/kvstore/publish_test.go
  • x-pack/filebeat/input/entityanalytics/input.go

Comment thread x-pack/filebeat/input/entityanalytics/conf.go
tmpDir := t.TempDir()
dbFile := filepath.Join(tmpDir, "test.db")

log := logp.L()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linter is correct, we want to avoid introducing any new global loggers including tests. Please use logptest.NewTestingLogger.

@efd6 efd6 requested a review from orestisfl April 8, 2026 20:56

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@x-pack/otel/extension/elasticsearchstorage/entcollect.go`:
- Around line 48-57: The current entcollectStore.Delete implementation is
TOCTOU-prone because it calls s.base.Has(key) then s.base.Remove(key); remove
the pre-check and call s.base.Remove(key) directly, and map the specific
sentinel es.ErrKeyUnknown returned by s.base.Remove to a nil (treat “not found”
as success) while returning any other error unchanged; reference
entcollectStore.Delete, s.base.Remove, and es.ErrKeyUnknown when making this
change.
🪄 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: Pro

Run ID: bbdbe5e5-41c1-4867-b3d1-aac8c1c9050c

📥 Commits

Reviewing files that changed from the base of the PR and between 587cf59 and e2d24b1.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (4)
  • NOTICE.txt
  • changelog/fragments/1775685154-add-entcollect-store-adapter.yaml
  • go.mod
  • x-pack/otel/extension/elasticsearchstorage/entcollect.go
✅ Files skipped from review due to trivial changes (2)
  • changelog/fragments/1775685154-add-entcollect-store-adapter.yaml
  • NOTICE.txt

Comment thread x-pack/otel/extension/elasticsearchstorage/entcollect.go
Comment thread x-pack/filebeat/input/entityanalytics/internal/kvstore/publish.go
Comment thread x-pack/filebeat/input/entityanalytics/minimal.go
@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Apr 15, 2026
@elasticmachine

Copy link
Copy Markdown
Contributor

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@efd6 efd6 force-pushed the 49160-entcollect branch from 765cf76 to 2b5a9c9 Compare April 23, 2026 05:13
@github-actions

This comment has been minimized.

@efd6 efd6 force-pushed the 49160-entcollect branch from 2b5a9c9 to 3a07427 Compare April 24, 2026 03:40
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

TL;DR

The failing Buildkite job is a test failure in x-pack/auditbeat/abreceiver TestLeak on Windows: cleanup cannot remove beat.db because a handle is still open at test teardown. Immediate action is to make teardown wait for the state DB handle to be released before t.TempDir() cleanup.

Remediation

  • In x-pack/auditbeat/abreceiver/receiver_leak_test.go:27-70, avoid sharing a single Config and Factory across both subtests; create fresh path.home/factory settings per subtest so each run gets isolated state paths.
  • Add an explicit teardown wait in the leak test (or in receiver shutdown path) to confirm the state store handle is closed before returning, then rerun the Windows unit test job (mage build unitTest in x-pack/auditbeat).
Investigation details

Root Cause

The failure is not a compile/build break; it is runtime test teardown on Windows:

  • x-pack/auditbeat/abreceiver/receiver_leak_test.go:27-70 runs two subtests ("healthy consumer", "unhealthy consumer") against shared test-level config/factory created once.
  • The failing log shows TempDir RemoveAll cleanup cannot unlink ...\data\beat.db, indicating a lingering open file handle during test cleanup.

Relevant code paths:

  • x-pack/auditbeat/abreceiver/receiver_leak_test.go:27-70 (TestLeak shared setup)
  • x-pack/auditbeat/abreceiver/receiver.go:35-41 (Shutdown calls BeatReceiver.Shutdown() then waits)
  • x-pack/libbeat/cmd/instance/receiver.go:187-233 (BeatReceiver.Shutdown() performs stop/close sequence)

Evidence

=== FAIL: x-pack/auditbeat/abreceiver TestLeak (3.93s)
    testing.go:1369: TempDir RemoveAll cleanup: unlinkat C:\Users\BUILDK~1\AppData\Local\Temp\TestLeak1962573350\002\data\beat.db: The process cannot access the file because it is being used by another process.

Verification

  • I attempted to run go test -run TestLeak -count=1 ./abreceiver from x-pack/auditbeat locally, but this Linux environment cannot build required RPM headers for another package in the module:
module/system/package/rpm_linux.go:27:10: fatal error: rpm/rpmlib.h: No such file or directory

So this needs verification in the Windows CI environment where the failure occurs.

Follow-up

If this still flakes after isolating per-subtest paths, add an assertion/poll in test teardown for state DB unlock (Windows-specific timing), then rerun the same Buildkite pipeline.

Note

🔒 Integrity filter blocked 2 items

The following items were blocked because they don't meet the GitHub integrity level.

To allow these resources, lower min-integrity in your GitHub frontmatter:

tools:
  github:
    min-integrity: approved  # merged | approved | unapproved | none

What is this? | From workflow: PR Buildkite Detective

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

func TestEntcollectStore_SetGet(t *testing.T) {
t.Parallel()

store := testSetupStore(t, "TestEntcollectStore_SetGet.db")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
store := testSetupStore(t, "TestEntcollectStore_SetGet.db")
store := testSetupStore(t, t.Name()+".db")

func TestEntcollectStore_GetMissing(t *testing.T) {
t.Parallel()

store := testSetupStore(t, "TestEntcollectStore_GetMissing.db")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
store := testSetupStore(t, "TestEntcollectStore_GetMissing.db")
store := testSetupStore(t, t.Name()+".db")

func TestEntcollectStore_Delete(t *testing.T) {
t.Parallel()

store := testSetupStore(t, "TestEntcollectStore_Delete.db")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
store := testSetupStore(t, "TestEntcollectStore_Delete.db")
store := testSetupStore(t, t.Name()+".db")

},
}

if err := pub(context.Background(), doc); err != nil {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if err := pub(context.Background(), doc); err != nil {
if err := pub(t.Context(), doc); err != nil {

@mauri870 mauri870 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Left some nit comments regarding test names and context.

efd6 added 5 commits April 27, 2026 10:29
Wire the entcollect shared library into the entity-analytics input
behind a new use_minimal_state config flag. When the flag is false
(the default), the existing kvstore-based provider path is unchanged.

The adapter layer consists of:

 - Plugin signature extended with statestore.States, matching the
   CEL/httpjson pattern and positioning for ES-backed state later.
 - EntcollectStore wrapping kvstore.Transaction as entcollect.Store
   with error translation and a per-provider bucket namespace.
 - Publisher closure converting entcollect.Document to beat.Event
   with TxTracker.Add before each Publish for ACK-before-commit.
 - MinimalStateProviderFactory registry for entcollect providers
   (empty for now; sessions 2-5 populate it).
 - minimalStateInput implementing the generic sync loop: timer,
   buffer, ACK-then-commit, and buffer discard on error.
 - slog bridge from logp.Logger via zapslog.
The OTel entity-analytics receiver (in opentelemetry-collector-
components) needs to obtain an entcollect.Store from the
elasticsearchstorage extension without importing beats types. Add a
Store method on elasticStorage that satisfies entcollect.Registry,
returning an adapter that translates between backend.Store and
entcollect.Store (error sentinels, method names, Each callback shape).

The receiver will resolve the extension via host.GetExtensions() and
type-assert to entcollect.Registry. Both sides depend only on the
stdlib-only entcollect module; neither imports the other.

The entcollect dependency uses a local replace directive until the
module gets a tagged release.

Updates elastic#49160
@efd6 efd6 force-pushed the 49160-entcollect branch from 3a07427 to e5e8c1b Compare April 27, 2026 00:59
@efd6 efd6 merged commit 7cf027b into elastic:main Apr 27, 2026
203 of 204 checks passed
efd6 added a commit to efd6/beats that referenced this pull request May 1, 2026
…inimal-state registry

Register the entcollect Jamf provider under the "jamf" name so that the
entity-analytics input can use it in minimal-state mode (use_minimal_state:
true). The registration mirrors the pattern established by the beats
shim merged in elastic#49871.

A local UCF-tagged struct (localConf) is defined inside minimalProvider
to bridge the ucfg config dialect (config:"" tags) to ecjamf.Config,
which uses json:"" tags for cross-runtime portability. Fields are mapped
explicitly so that a mismatch is a compile error rather than a silent
zero. TestMinimalConfigRoundTrip guards against future drift: if
ecjamf.Config gains a new field the field-count assertion fails, forcing
localConf and the test to be updated together.

Assisted-By: Cursor (claude-opus-4-6)
efd6 added a commit that referenced this pull request May 3, 2026
…inimal-state registry (#50445)

Register the entcollect Jamf provider under the "jamf" name so that the
entity-analytics input can use it in minimal-state mode (use_minimal_state:
true). The registration mirrors the pattern established by the beats
shim merged in #49871.

A local UCF-tagged struct (localConf) is defined inside minimalProvider
to bridge the ucfg config dialect (config:"" tags) to ecjamf.Config,
which uses json:"" tags for cross-runtime portability. Fields are mapped
explicitly so that a mismatch is a compile error rather than a silent
zero. TestMinimalConfigRoundTrip guards against future drift: if
ecjamf.Config gains a new field the field-count assertion fails, forcing
localConf and the test to be updated together.

Assisted-By: Cursor (claude-opus-4-6)
brian-mckinney pushed a commit to brian-mckinney/beats that referenced this pull request May 5, 2026
…lastic#49871)

Wire the entcollect shared library into the entity-analytics input
behind a new use_minimal_state config flag. When the flag is false
(the default), the existing kvstore-based provider path is unchanged.

The Beats adapter layer consists of:

 - Plugin signature extended with statestore.States, matching the
   CEL/httpjson pattern and positioning for ES-backed state later.
 - EntcollectStore wrapping kvstore.Transaction as entcollect.Store
   with error translation and a per-provider bucket namespace.
 - Publisher closure converting entcollect.Document to beat.Event
   with TxTracker.Add before each Publish for ACK-before-commit.
 - MinimalStateProviderFactory registry for entcollect providers
   (empty for now; later sessions populate it).
 - minimalStateInput implementing the generic sync loop: timer,
   buffer, ACK-then-commit, and buffer discard on error.
 - slog bridge from logp.Logger via zapslog.

The OTel adapter adds an entcollect.Registry implementation to the
elasticsearchstorage extension. The receiver (in opentelemetry-
collector-components) will resolve the extension via
host.GetExtensions() and type-assert to entcollect.Registry. Both
sides depend only on the stdlib-only entcollect module; neither
imports the other. The adapter translates between backend.Store and
entcollect.Store (error sentinels, method names, Each callback
shape).
brian-mckinney pushed a commit to brian-mckinney/beats that referenced this pull request May 5, 2026
…inimal-state registry (elastic#50445)

Register the entcollect Jamf provider under the "jamf" name so that the
entity-analytics input can use it in minimal-state mode (use_minimal_state:
true). The registration mirrors the pattern established by the beats
shim merged in elastic#49871.

A local UCF-tagged struct (localConf) is defined inside minimalProvider
to bridge the ucfg config dialect (config:"" tags) to ecjamf.Config,
which uses json:"" tags for cross-runtime portability. Fields are mapped
explicitly so that a mismatch is a compile error rather than a silent
zero. TestMinimalConfigRoundTrip guards against future drift: if
ecjamf.Config gains a new field the field-count assertion fails, forcing
localConf and the test to be updated together.

Assisted-By: Cursor (claude-opus-4-6)
brian-mckinney pushed a commit to brian-mckinney/beats that referenced this pull request May 6, 2026
…lastic#49871)

Wire the entcollect shared library into the entity-analytics input
behind a new use_minimal_state config flag. When the flag is false
(the default), the existing kvstore-based provider path is unchanged.

The Beats adapter layer consists of:

 - Plugin signature extended with statestore.States, matching the
   CEL/httpjson pattern and positioning for ES-backed state later.
 - EntcollectStore wrapping kvstore.Transaction as entcollect.Store
   with error translation and a per-provider bucket namespace.
 - Publisher closure converting entcollect.Document to beat.Event
   with TxTracker.Add before each Publish for ACK-before-commit.
 - MinimalStateProviderFactory registry for entcollect providers
   (empty for now; later sessions populate it).
 - minimalStateInput implementing the generic sync loop: timer,
   buffer, ACK-then-commit, and buffer discard on error.
 - slog bridge from logp.Logger via zapslog.

The OTel adapter adds an entcollect.Registry implementation to the
elasticsearchstorage extension. The receiver (in opentelemetry-
collector-components) will resolve the extension via
host.GetExtensions() and type-assert to entcollect.Registry. Both
sides depend only on the stdlib-only entcollect module; neither
imports the other. The adapter translates between backend.Store and
entcollect.Store (error sentinels, method names, Each callback
shape).
brian-mckinney pushed a commit to brian-mckinney/beats that referenced this pull request May 6, 2026
…inimal-state registry (elastic#50445)

Register the entcollect Jamf provider under the "jamf" name so that the
entity-analytics input can use it in minimal-state mode (use_minimal_state:
true). The registration mirrors the pattern established by the beats
shim merged in elastic#49871.

A local UCF-tagged struct (localConf) is defined inside minimalProvider
to bridge the ucfg config dialect (config:"" tags) to ecjamf.Config,
which uses json:"" tags for cross-runtime portability. Fields are mapped
explicitly so that a mismatch is a compile error rather than a silent
zero. TestMinimalConfigRoundTrip guards against future drift: if
ecjamf.Config gains a new field the field-count assertion fails, forcing
localConf and the test to be updated together.

Assisted-By: Cursor (claude-opus-4-6)
brian-mckinney pushed a commit to brian-mckinney/beats that referenced this pull request May 6, 2026
…lastic#49871)

Wire the entcollect shared library into the entity-analytics input
behind a new use_minimal_state config flag. When the flag is false
(the default), the existing kvstore-based provider path is unchanged.

The Beats adapter layer consists of:

 - Plugin signature extended with statestore.States, matching the
   CEL/httpjson pattern and positioning for ES-backed state later.
 - EntcollectStore wrapping kvstore.Transaction as entcollect.Store
   with error translation and a per-provider bucket namespace.
 - Publisher closure converting entcollect.Document to beat.Event
   with TxTracker.Add before each Publish for ACK-before-commit.
 - MinimalStateProviderFactory registry for entcollect providers
   (empty for now; later sessions populate it).
 - minimalStateInput implementing the generic sync loop: timer,
   buffer, ACK-then-commit, and buffer discard on error.
 - slog bridge from logp.Logger via zapslog.

The OTel adapter adds an entcollect.Registry implementation to the
elasticsearchstorage extension. The receiver (in opentelemetry-
collector-components) will resolve the extension via
host.GetExtensions() and type-assert to entcollect.Registry. Both
sides depend only on the stdlib-only entcollect module; neither
imports the other. The adapter translates between backend.Store and
entcollect.Store (error sentinels, method names, Each callback
shape).
brian-mckinney pushed a commit to brian-mckinney/beats that referenced this pull request May 6, 2026
…inimal-state registry (elastic#50445)

Register the entcollect Jamf provider under the "jamf" name so that the
entity-analytics input can use it in minimal-state mode (use_minimal_state:
true). The registration mirrors the pattern established by the beats
shim merged in elastic#49871.

A local UCF-tagged struct (localConf) is defined inside minimalProvider
to bridge the ucfg config dialect (config:"" tags) to ecjamf.Config,
which uses json:"" tags for cross-runtime portability. Fields are mapped
explicitly so that a mismatch is a compile error rather than a silent
zero. TestMinimalConfigRoundTrip guards against future drift: if
ecjamf.Config gains a new field the field-count assertion fails, forcing
localConf and the test to be updated together.

Assisted-By: Cursor (claude-opus-4-6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-skip Skip notification from the automated backport with mergify enhancement Filebeat Filebeat Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team Team:Security-Service Integrations Security Service Integrations Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants