-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Fleet] Allow to configure monitoring runtime in agent policy #233345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This should be backported to 9.1 and 8.19 as well as we intend to eventually use beat receivers there as well. |
Pinging @elastic/fleet (Team:Fleet) |
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/streams --include-path /api/fleet --include-path /api/saved_objects/_import --include-path /api/saved_objects/_export --include-path /api/maintenance_window --update'
…lastic/kibana into feature-fleet-agent-runtime-monitoring
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/streams --include-path /api/fleet --include-path /api/saved_objects/_import --include-path /api/saved_objects/_export --include-path /api/maintenance_window --update'
…lastic/kibana into feature-fleet-agent-runtime-monitoring
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/streams --include-path /api/fleet --include-path /api/saved_objects/_import --include-path /api/saved_objects/_export --include-path /api/maintenance_window --update'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you do some manual testing of clearing/un-setting this setting? Do brand new agent policies get ''
as a value right away?
I remember encountering unexpected behavior before with these generated settings before, where the agent policies are always created with a non-undefined value for introduced settings (we don't want this since we prefer to use agent default unless user explicitly chooses otherwise). Just want to make sure we double check here :)
{ | ||
name: 'agent.monitoring._runtime_experimental', | ||
title: i18n.translate('xpack.fleet.settings.agentPolicyAdvanced.monitoringRuntimeTitle', { | ||
defaultMessage: 'Monitoring Runtime (experimental)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaultMessage: 'Monitoring Runtime (experimental)', | |
defaultMessage: 'Runtime monitoring (experimental)', |
sentence casing + I think "runtime monitoring" makes more sense than "monitoring runtime"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also agree with Jen here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a native speaker here, but does Runtime monitoring
has a special meaning, here what it's configuring it's that agent flag agent.monitoring._runtime_experimental
that configure the internal runtime of the agent monitoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to say that just happens to be the order from how the setting is nested, but after reviewing the original issue I think I misunderstood the intent. it's the runtime used for the self-monitoring process, not monitoring the runtime :)
so we should just fix the sentence casing here
defaultMessage: 'Monitoring Runtime (experimental)', | |
defaultMessage: 'Monitoring runtime (experimental)', |
}, | ||
{ | ||
value: 'otel', | ||
text: i18n.translate('xpack.fleet.settings.agentPolicyAdvanced.monitoringRuntimeLabel', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
text: i18n.translate('xpack.fleet.settings.agentPolicyAdvanced.monitoringRuntimeLabel', { | |
text: i18n.translate('xpack.fleet.settings.agentPolicyAdvanced.monitoringRuntimeOtelLabel', { |
extremely small nit with naming of this i18n key 😅
timeout: schema.maybe(schema.string()), | ||
target_directory: schema.maybe(schema.string()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious where these additions came from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That a good point, I should have pointed this in the PR description, I added a test that verify that all advenced settings generate a valid full policy response here and found a few settings that were missing from the schema, as we plan to backport this up to 8.17 I think it's okay to not have a dedicated PR for that wdyt?
metrics: schema.maybe( | ||
schema.object({ | ||
period: schema.maybe(schema.string()), | ||
}) | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one too
x-pack/platform/plugins/shared/fleet/common/settings/agent_policy_settings.tsx
Show resolved
Hide resolved
Yes I tested those, and I added a special case to handle |
Looping in @lcawl as I don’t know enough about the API docs (yet) and whether it’s possible to use the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM
You're right it looks like support for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for experience docs.
@lcawl @vishaangelova Assuming that this PR gets merged before we allow x-state at the parameter or props level, will we create a separate task to update it later?
@florent-leborgne good point! I’ve created an issue to track PRs related to Fleet APIs so that we can add the availability information when we have support for |
@elasticmachine merge upstream |
Starting backport for target branches: 8.19, 9.1 |
💚 Build Succeeded
Metrics [docs]Async chunks
History
cc @nchaulet |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…233345) (#233708) # Backport This will backport the following commits from `main` to `9.1`: - [[Fleet] Allow to configure monitoring runtime in agent policy (#233345)](#233345) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Nicolas Chaulet","email":"nicolas.chaulet@elastic.co"},"sourceCommit":{"committedDate":"2025-09-02T10:02:19Z","message":"[Fleet] Allow to configure monitoring runtime in agent policy (#233345)","sha":"52c02e9d73625926f1f3592275db62ed1cbd71ec","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","backport:version","v9.2.0","v9.1.3","v8.19.3"],"title":"[Fleet] Allow to configure monitoring runtime in agent policy","number":233345,"url":"https://github.com/elastic/kibana/pull/233345","mergeCommit":{"message":"[Fleet] Allow to configure monitoring runtime in agent policy (#233345)","sha":"52c02e9d73625926f1f3592275db62ed1cbd71ec"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/233345","number":233345,"mergeCommit":{"message":"[Fleet] Allow to configure monitoring runtime in agent policy (#233345)","sha":"52c02e9d73625926f1f3592275db62ed1cbd71ec"}},{"branch":"9.1","label":"v9.1.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
…233345) (#233710) # Backport This will backport the following commits from `main` to `8.19`: - [[Fleet] Allow to configure monitoring runtime in agent policy (#233345)](#233345) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Nicolas Chaulet","email":"nicolas.chaulet@elastic.co"},"sourceCommit":{"committedDate":"2025-09-02T10:02:19Z","message":"[Fleet] Allow to configure monitoring runtime in agent policy (#233345)","sha":"52c02e9d73625926f1f3592275db62ed1cbd71ec","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","backport:version","v9.2.0","v9.1.3","v8.19.3"],"title":"[Fleet] Allow to configure monitoring runtime in agent policy","number":233345,"url":"https://github.com/elastic/kibana/pull/233345","mergeCommit":{"message":"[Fleet] Allow to configure monitoring runtime in agent policy (#233345)","sha":"52c02e9d73625926f1f3592275db62ed1cbd71ec"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/233345","number":233345,"mergeCommit":{"message":"[Fleet] Allow to configure monitoring runtime in agent policy (#233345)","sha":"52c02e9d73625926f1f3592275db62ed1cbd71ec"}},{"branch":"9.1","label":"v9.1.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Summary
Resolve #233186
Allow to configure monitoring runtime in agent policy.
Implementation details:
UI Changes
Agent policy editor

How to test
I tested this locally and it seems to generate correct policy that are handled by Elastic Agent
And we switch to otel when configuring to otel