Skip to content
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

[Fleet] agent monitoring http UI settings #180597

Merged
merged 7 commits into from
Apr 12, 2024

Conversation

juliaElastic
Copy link
Contributor

@juliaElastic juliaElastic commented Apr 11, 2024

Summary

Related to https://github.com/elastic/ingest-dev/issues/2471

Generate UI settings from an object type with nested fields.

Configured Agent monitoring http settings to show up on the UI to demo, it should be removed before merge as it's not yet supported by Agent.

The object field values are rendered as labels on the UI (e.g. enabled).
We could add description on the fields to render as tooltip/description.

The logic supports one level of object with base field types (number, string, boolean) for now. We could extend it with more levels if needed.

agent.monitoring:
  http:
    enabled: true 
    host: localhost 
    port: 6791
    buffer.enabled: false

To verify:

  • enable the settings config: [Fleet] agent monitoring http UI settings #180597 (comment)
  • create/edit an agent policy and scroll down/open advanced settings
  • check that Agent monitoring HTTP settings are showing up on UI
  • verify that settings can be changed and updated
  • validation is added for the port to be in the valid range
  • click Preview API request to verify the request being sent to update the policy
  • click View policy to check how the new settings show up in full agent policy after saving
image image image image

Added an (optional) description to fields to make it more human readable:
image

Checklist

@juliaElastic juliaElastic self-assigned this Apr 11, 2024
@juliaElastic
Copy link
Contributor Author

/ci

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

enabled: z.boolean().default(false),
host: z.string().default('localhost'),
port: z.number().min(0).max(65353).default(6791),
'buffer.enabled': z.boolean().default(false),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

kept buffer.enabled as one field, it appears the same in agent config: https://github.com/elastic/elastic-agent/blob/main/elastic-agent.reference.yml#L163
the code doesn't support including more than one levels of nesting as of now.

@juliaElastic juliaElastic added the release_note:skip Skip the PR/issue when compiling release notes label Apr 11, 2024
},
{
name: 'agent.monitoring.http',
hidden: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a hidden flag to be able to hide a config without deleting from this file. This acts like a feature flag, so when a setting is ready to be rendered, just update hidden: false.

@juliaElastic juliaElastic marked this pull request as ready for review April 12, 2024 11:56
@juliaElastic juliaElastic requested a review from a team as a code owner April 12, 2024 11:56
@juliaElastic
Copy link
Contributor Author

/ci

Copy link
Member

@kpollich kpollich left a comment

Choose a reason for hiding this comment

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

Code LGTM. Do you think it's worth feature flagging the monitoring settings UI or easier to just delete and recreate once the agent support is implemented? It's not much code since it's just the configuration, so I could go either way 🤷‍♀️

@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Apr 12, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
fleet 992 994 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fleet 1.3MB 1.3MB +4.3KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @juliaElastic

@juliaElastic
Copy link
Contributor Author

Do you think it's worth feature flagging the monitoring settings UI or easier to just delete and recreate once the agent support is implemented? It's not much code since it's just the configuration, so I could go either way 🤷‍♀️

I added a hidden flag per config so it's easier to toggle the visibility of each config without deleting. It's easier than having to pull up the config from an old pull request.

@juliaElastic juliaElastic merged commit 958fb08 into elastic:main Apr 12, 2024
21 checks passed
@kibanamachine kibanamachine added v8.14.0 backport:skip This commit does not require backporting labels Apr 12, 2024
criamico added a commit that referenced this pull request Apr 15, 2024
Closes #158861

## Summary
Expose agent logging level in agent policy settings. 
The new setting is added via the new settings framework and will show up
under "advanced settings". It's currently hidden until the agent
supports it.

### Testing
Enable the settings config:
#180597 (comment)
- Go to the agent policy settings form
- Under advanced settings there is a new dropdown "Agent logging level".
Choose a value and save the policy
- The new value should be retained after saving
- Go to the agent policies tab and select action "View policy"
- The new field should be visible under `agent.logging.level`

<details>
  <summary> Screenshots</summary>
  
![Screenshot 2024-04-12 at 16 21
46](https://github.com/elastic/kibana/assets/16084106/b3083bb5-703a-44c6-a00d-da9d64a2b083)
![Screenshot 2024-04-12 at 16 21
52](https://github.com/elastic/kibana/assets/16084106/bd934262-86f0-4b11-b7b4-d4be72f00715)
![Screenshot 2024-04-12 at 16 22
28](https://github.com/elastic/kibana/assets/16084106/4a352c82-f274-4779-9718-85135f84b0c8)
![Screenshot 2024-04-12 at 16 27
48](https://github.com/elastic/kibana/assets/16084106/11e20051-f91b-44c1-b795-76ef6804cf78)

</details>

### Checklist
- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants