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

[APM] Agent remote configuration #39555

Merged
merged 17 commits into from
Jul 2, 2019

Conversation

ogupte
Copy link
Contributor

@ogupte ogupte commented Jun 25, 2019

Summary

Closes #34990. Adds support for remote configuration of agents within the APM UI.

This is based off the work of this PR: #36031.

agent-remote-config-ui-3

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@simitt
Copy link
Contributor

simitt commented Jun 25, 2019

@ogupte I tested APM Server playing together with this branch. I did find some unexpected behavior related to service.environment. Entries in ES that only contain a service.name but no service.environment should not be returned if the query only contains service.name. Same thing the other way around, if the query contains service.name and service.environment no results that are not matching the service.environment part should be returned. During my tests entries that should not match based on the environment were returned in the result. Do you have any tests for that?

@ogupte
Copy link
Contributor Author

ogupte commented Jun 25, 2019

@ogupte I tested APM Server playing together with this branch. I did find some unexpected behavior related to service.environment. Entries in ES that only contain a service.name but no service.environment should not be returned if the query only contains service.name. Same thing the other way around, if the query contains service.name and service.environment no results that are not matching the service.environment part should be returned. During my tests entries that should not match based on the environment were returned in the result. Do you have any tests for that?

I'll make sure to address this and add tests to make sure only entries with both service.name and service.environment are returned. Thank you for checking this.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@formgeist formgeist left a comment

Choose a reason for hiding this comment

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

@ogupte Starting to take shape and it's looking really good. I have a few nits and changes to request.

@@ -143,7 +169,7 @@ export function AddSettingFlyoutBody({ onSubmit }: { onSubmit: () => void }) {
<EuiFieldNumber
min={0}
max={1}
step={0.1}
step={0.001}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this might need to change to 0.01 as I don't think we need to support 0.5%. @graphaelli thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Notes from Slack conversation: we agreed to keep the 0.001 validation because it should be possible for users to do 0.1% sample rate configuration.

@formgeist
Copy link
Contributor

formgeist commented Jun 27, 2019

I forgot to add this in as a note yesterday after the APM weekly, but there's a couple of larger things to address;

"All environments" option

Perhaps because the Opbeans apps don't have multiple environments, I haven't been able to test out the functionality in which a user is able to select "all environments" option which will bulk create configurations for each environment for the selected service with the set sample rate. Remind me, is this possible in this current implementation?

Minor design feedbacks

  • The services list is currently not sorted alphabetically.

Screenshot 2019-06-27 at 08 48 31

  • The Flyout should not pre-fill the name and environment selects upon loading. In some cases, the user will have created a configuration for the preselected values and that's where they see an error.
    Kapture 2019-06-27 at 8 51 14

  • The sample rate input field could use some stricter input validation. I understand that 00000000 results in 0, but perhaps having it restricted to max. 4 chars (because x.xx is the max amount of decimals we allow).

@ogupte
Copy link
Contributor Author

ogupte commented Jun 27, 2019

@formgeist

"All environments" option

Perhaps because the Opbeans apps don't have multiple environments, I haven't been able to test out the functionality in which a user is able to select "all environments" option which will bulk create configurations for each environment for the selected service with the set sample rate. Remind me, is this possible in this current implementation?

We could do something like this, but it would be a shortcut to adding one configuration per each existing environment. This means if a new environment comes online after this configuration is set, it would not apply to the new environment. I'm not sure if users will understand this subtly. Also, would selecting 'all environments' like this apply to those services with no value in service.environemnt?

@formgeist
Copy link
Contributor

@ogupte I can see how it might be confusing to users that 1. is it going to work for my future environments and 2. how does it apply to services where environment is not set. I reckon we leave it for now. It's more of a shortcut or making that bulk action easier for the user. Let's focus on getting this and other planned features in good shape for next week 👍

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@formgeist
Copy link
Contributor

@bmorelli25 I'm not sure if you already did a pass on the copy, but I would like some help on possible improvements. Thanks!

@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Member

@bmorelli25 bmorelli25 left a comment

Choose a reason for hiding this comment

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

@formgeist - looks like you updated the copy since yesterday. I'm liking the changes! Just a few recommendations.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@ogupte ogupte marked this pull request as ready for review June 29, 2019 00:53
@ogupte ogupte requested a review from a team as a code owner June 29, 2019 00:53
@elasticmachine
Copy link
Contributor

💔 Build Failed

@ogupte ogupte force-pushed the central-config-management branch from 0534851 to c35a8ee Compare June 29, 2019 04:42
@elasticmachine
Copy link
Contributor

💔 Build Failed

sorenlouv and others added 17 commits July 2, 2019 08:21
  - Creates apmCm index mapping on plugin initialization.
  - Links from home page to settings page
  - Polishes settings page to match design
- Adds ability to update/edit existing setting value
- Adds delete functionality to edit settings flyout
…ttings/AddSettingFlyout.tsx


sentence updated to remove "central"

Co-Authored-By: Brandon Morelli <bmorelli25@gmail.com>
…ettings.tsx


fix wording

Co-Authored-By: Brandon Morelli <bmorelli25@gmail.com>
…ttings/AddSettingFlyoutBody.tsx


fix typo

Co-Authored-By: Brandon Morelli <bmorelli25@gmail.com>
…ttings/AddSettingFlyoutBody.tsx


fix wording

Co-Authored-By: Brandon Morelli <bmorelli25@gmail.com>
Co-Authored-By: Brandon Morelli <bmorelli25@gmail.com>
- adds last updated to config table
- fixes validation for all form fields
- adds text for toast notifications (create,edit,delete)
- makes service name clickable to open edit flyout
- adds i18n for all text
- memoized returned object from useFetcher when data doesn't change
- changed delete query refresh from true to 'wait_for'
- added ignore_above: 1024 to all keyword typed fields in .apm-cm index
- fixed some wording around sample_rate granularity
- various code cleanup
@ogupte ogupte force-pushed the central-config-management branch from a7f71ad to f734012 Compare July 2, 2019 18:12
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@ogupte ogupte merged commit 0e8b722 into elastic:master Jul 2, 2019
ogupte added a commit to ogupte/kibana that referenced this pull request Jul 2, 2019
* [APM] Agent remote configuration UI
  - Creates apmCm index mapping on plugin initialization.
  - Links from home page to settings page
ogupte added a commit to ogupte/kibana that referenced this pull request Jul 2, 2019
* [APM] Agent remote configuration UI
  - Creates apmCm index mapping on plugin initialization.
  - Links from home page to settings page
ogupte added a commit that referenced this pull request Jul 3, 2019
* [APM] Agent remote configuration (#39555)

* [APM] Agent remote configuration UI
  - Creates apmCm index mapping on plugin initialization.
  - Links from home page to settings page

* [APM] removes apm agent config index from list of indices that match the
apm index patter. Fixes smoke tests.
selectedConfig ? parseFloat(selectedConfig.settings.sample_rate) : NaN
);
const { data: serviceNames = [], status: serviceNamesStatus } = useFetcher<
string[]
Copy link
Member

Choose a reason for hiding this comment

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

You don't need to supply a type to useFetcher. It is inferred from the promise return type.

string[]
>(async () => (await loadCMServices()).sort(), [], {
preservePreviousResponse: false
});
Copy link
Member

Choose a reason for hiding this comment

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

I think you should move the sort to the rest method (loadCMServices) and jsut do:

useFetcher(loadCMServices, [], { preservePreviousResponse: false });

});
const { data: environments = [], status: environmentStatus } = useFetcher<
Array<{ name: string; available: boolean }>
>(
Copy link
Member

Choose a reason for hiding this comment

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

Same as above: no type needs to be supplied to useFetcher

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[APM] Central Configuration Management for agents in APM UI
7 participants