Cherry-pick #23848 to 7.x: Agent supports capabilities definition #24037
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cherry-pick of PR #23848 to 7.x branch. Original message:
What does this PR do?
This PR introduces capabilities as described in #21000
Consists of first step of implementation - bare input/output/upgrade filter without any additional filtering options such as only subset of metricsets etc.
How this works is that there is a Capability injected down to components which checks objects passed to Apply fn.
This capability has set of input/output/upgrade capabilities based on description in
capabilities.yml
file. This file sits next to agent config and contains a list of definitions.Each of these capabilities decides whether input object is interesting and capability can operate on it or not.
If so it checks for whatever it is configured for and returns updated object.
It always returns object of the same type as it was passed in.
E.g input capability is able to operate on maps and on AST. if ast is passed in it can never happen map is returned.
When agent rules out inuput/output log is written with ERROR log level and health of agent is degraded as discussed in elastic/kibana#76841
Feature works for standalone and fleet managed mode.
sample
constaints.yml
allowing system metrics and nothing elseTesting
The ideal way how to play with this is to package an agent and then modify
elastic-agent.yml
,capabilities.yml
and invoking./elastic-agent inspect
to see how the resulting config looks likeWhy is it important?
#21000
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.