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] Add and edit alerts outside of APM UI #106786

Closed
smith opened this issue Jul 26, 2021 · 4 comments · Fixed by #111883
Closed

[APM] Add and edit alerts outside of APM UI #106786

smith opened this issue Jul 26, 2021 · 4 comments · Fixed by #111883
Assignees
Labels
apm:alerting bug Fixes for quality problems that affect the customer experience Team:APM - DEPRECATED Use Team:obs-ux-infra_services.

Comments

@smith
Copy link
Contributor

smith commented Jul 26, 2021

In #106598 we added the ability to edit rules, but not their service name, transaction type, or environment.

Problem
This means that it is not possible to edit these values for existing alerts, and it not possible to create new APM alerts outside APM UI.

Solution
We may want to allow free-form values with suggestions (EuiCombobox) for these when creating and editing, similar to what we want to add in agent configuration with #58316.

@smith smith added the Team:APM - DEPRECATED Use Team:obs-ux-infra_services. label Jul 26, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:apm)

smith added a commit that referenced this issue Jul 27, 2021
By pulling out most of the things that depend on the URL into where we open the flyout and passing them in as metadata props, we can make it so editing rules while in Stack Management.

You cannot edit a rule's service name, transaction type, or environment once it has been created (#106786 has been created to allow editing of these other values), but all other values can be edited.

In order for useFetcher to work outside of the APM plugin, it has been changed to use useKibana instead of useApmContext for toast notifications. The notifications API from useKibana is slightly different and allows passing a react element instead of a mount point as the body.

Fixes #76316.
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Jul 27, 2021
By pulling out most of the things that depend on the URL into where we open the flyout and passing them in as metadata props, we can make it so editing rules while in Stack Management.

You cannot edit a rule's service name, transaction type, or environment once it has been created (elastic#106786 has been created to allow editing of these other values), but all other values can be edited.

In order for useFetcher to work outside of the APM plugin, it has been changed to use useKibana instead of useApmContext for toast notifications. The notifications API from useKibana is slightly different and allows passing a react element instead of a mount point as the body.

Fixes elastic#76316.
kibanamachine added a commit that referenced this issue Jul 27, 2021
By pulling out most of the things that depend on the URL into where we open the flyout and passing them in as metadata props, we can make it so editing rules while in Stack Management.

You cannot edit a rule's service name, transaction type, or environment once it has been created (#106786 has been created to allow editing of these other values), but all other values can be edited.

In order for useFetcher to work outside of the APM plugin, it has been changed to use useKibana instead of useApmContext for toast notifications. The notifications API from useKibana is slightly different and allows passing a react element instead of a mount point as the body.

Fixes #76316.

Co-authored-by: Nathan L Smith <nathan.smith@elastic.co>
@formgeist
Copy link
Contributor

Free-form inputs are fine (and great for yet-to-be-collected services and/or environments) - as long as they're assisted by suggestions (as proposed in the linked issue)

@smith
Copy link
Contributor Author

smith commented Jul 27, 2021

Free-form inputs are fine (and great for yet-to-be-collected services and/or environments) - as long as they're assisted by suggestions (as proposed in the linked issue)

Yes to clarify I meant something like EuiComboBox single selection with custom options.

streamich pushed a commit to vadimkibana/kibana that referenced this issue Aug 8, 2021
By pulling out most of the things that depend on the URL into where we open the flyout and passing them in as metadata props, we can make it so editing rules while in Stack Management.

You cannot edit a rule's service name, transaction type, or environment once it has been created (elastic#106786 has been created to allow editing of these other values), but all other values can be edited.

In order for useFetcher to work outside of the APM plugin, it has been changed to use useKibana instead of useApmContext for toast notifications. The notifications API from useKibana is slightly different and allows passing a react element instead of a mount point as the body.

Fixes elastic#76316.
@sorenlouv sorenlouv added the bug Fixes for quality problems that affect the customer experience label Aug 19, 2021
@sorenlouv sorenlouv changed the title [APM] Allow editing of APM rule service name, transaction type, and environment [APM] Add and edit alerts outside of APM UI Aug 19, 2021
@smith
Copy link
Contributor Author

smith commented Sep 10, 2021

We have a temporary solution for alert creation with #111781 which will allow editing but not creating rules in Stack Management for 7.15.

Much of alert creation is broken in master, so we're going to fix that next.

smith added a commit that referenced this issue Sep 29, 2021
Allow selecting any service name, transaction type (where appropriate), and environment when creating and editing rules, both in APM and Stack Management.

- Create /internal/apm/suggestions endpoint that uses `terms_enum`
- Use combo box for environment, service name, and transaction type with suggestions endpoint on all alerts
- Remove "Go to APM" callouts on new alert creation
- Wrap calls to `createCallApmApi` in alert triggers with `useEffect`
- Use `getEnvironmentLabel` for value in environment field expression
- Make all `AlertParams` fields optional (except in latency threshold alert)
- Add e2e tests for creating an alert
- Remove `NewAlertEmptyPrompt` component and `isNewApmRuleFromStackManagement` helper
- Replace `maxServiceEnvironments` and `maxServiceSelections` config options with `maxSuggestions` advanced setting.


![CleanShot 2021-09-28 at 10 35 58](https://user-images.githubusercontent.com/9912/135119948-e247615a-d235-4feb-b197-b803f165ad1e.gif)

Fixes #106786
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Sep 29, 2021
Allow selecting any service name, transaction type (where appropriate), and environment when creating and editing rules, both in APM and Stack Management.

- Create /internal/apm/suggestions endpoint that uses `terms_enum`
- Use combo box for environment, service name, and transaction type with suggestions endpoint on all alerts
- Remove "Go to APM" callouts on new alert creation
- Wrap calls to `createCallApmApi` in alert triggers with `useEffect`
- Use `getEnvironmentLabel` for value in environment field expression
- Make all `AlertParams` fields optional (except in latency threshold alert)
- Add e2e tests for creating an alert
- Remove `NewAlertEmptyPrompt` component and `isNewApmRuleFromStackManagement` helper
- Replace `maxServiceEnvironments` and `maxServiceSelections` config options with `maxSuggestions` advanced setting.


![CleanShot 2021-09-28 at 10 35 58](https://user-images.githubusercontent.com/9912/135119948-e247615a-d235-4feb-b197-b803f165ad1e.gif)

Fixes elastic#106786
kibanamachine added a commit that referenced this issue Sep 29, 2021
Allow selecting any service name, transaction type (where appropriate), and environment when creating and editing rules, both in APM and Stack Management.

- Create /internal/apm/suggestions endpoint that uses `terms_enum`
- Use combo box for environment, service name, and transaction type with suggestions endpoint on all alerts
- Remove "Go to APM" callouts on new alert creation
- Wrap calls to `createCallApmApi` in alert triggers with `useEffect`
- Use `getEnvironmentLabel` for value in environment field expression
- Make all `AlertParams` fields optional (except in latency threshold alert)
- Add e2e tests for creating an alert
- Remove `NewAlertEmptyPrompt` component and `isNewApmRuleFromStackManagement` helper
- Replace `maxServiceEnvironments` and `maxServiceSelections` config options with `maxSuggestions` advanced setting.


![CleanShot 2021-09-28 at 10 35 58](https://user-images.githubusercontent.com/9912/135119948-e247615a-d235-4feb-b197-b803f165ad1e.gif)

Fixes #106786

Co-authored-by: Nathan L Smith <nathan.smith@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:alerting bug Fixes for quality problems that affect the customer experience Team:APM - DEPRECATED Use Team:obs-ux-infra_services.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants