Skip to content

Commit

Permalink
[Actionable Observability] - add alertDetailAppSection to the APM Rul…
Browse files Browse the repository at this point in the history
…e Details page (#143298)

## Summary

It fixes #145572 and #143183 by
- Adding an abstraction layer for the Timeseries chart and using it
without APM's context and hooks
- Create and link `AlertDetailAppSection` new component to all APM rule
types
- Provide the new Alert Details page under Observability using APM
charts

<img width="1205" alt="Screenshot 2022-11-08 at 17 22 17"
src="https://user-images.githubusercontent.com/6838659/200619684-0f9eaf5b-4618-4dd3-8539-f4bc13107c2e.png">

### Checklist

Delete any items that are not applicable to this PR.

- [x] 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)


## For the reviewers
- Enable the feature flag
`xpack.observability.unsafe.alertDetails.apm.enabled: true` in
`kibana.yml`.
- Create an APM rule that fires alerts
- Click on `View alert details` from the Alert table
  • Loading branch information
fkanout authored Dec 1, 2022
1 parent 1145112 commit 137d178
Show file tree
Hide file tree
Showing 23 changed files with 763 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export function registerApmRuleTypes(
return {
reason: fields[ALERT_REASON]!,
link: getAlertUrlErrorCount(
String(fields[SERVICE_NAME][0]!),
// TODO:fix SERVICE_NAME when we move it to initializeIndex
String(fields[SERVICE_NAME]![0]),
fields[SERVICE_ENVIRONMENT] && String(fields[SERVICE_ENVIRONMENT][0])
),
};
Expand All @@ -46,6 +47,12 @@ export function registerApmRuleTypes(
validate: () => ({
errors: [],
}),
alertDetailsAppSection: lazy(
() =>
import(
'../ui_components/alert_details_app_section/alert_details_app_section'
)
),
requiresAppContext: false,
defaultActionMessage: i18n.translate(
'xpack.apm.alertTypes.errorCount.defaultActionMessage',
Expand Down Expand Up @@ -73,9 +80,10 @@ export function registerApmRuleTypes(
return {
reason: fields[ALERT_REASON]!,
link: getAlertUrlTransaction(
String(fields[SERVICE_NAME][0]!),
// TODO:fix SERVICE_NAME when we move it to initializeIndex
String(fields[SERVICE_NAME]![0]),
fields[SERVICE_ENVIRONMENT] && String(fields[SERVICE_ENVIRONMENT][0]),
String(fields[TRANSACTION_TYPE][0]!)
String(fields[TRANSACTION_TYPE]![0])
),
};
},
Expand All @@ -89,6 +97,12 @@ export function registerApmRuleTypes(
validate: () => ({
errors: [],
}),
alertDetailsAppSection: lazy(
() =>
import(
'../ui_components/alert_details_app_section/alert_details_app_section'
)
),
requiresAppContext: false,
defaultActionMessage: i18n.translate(
'xpack.apm.alertTypes.transactionDuration.defaultActionMessage',
Expand Down Expand Up @@ -116,9 +130,10 @@ export function registerApmRuleTypes(
format: ({ fields, formatters: { asPercent } }) => ({
reason: fields[ALERT_REASON]!,
link: getAlertUrlTransaction(
String(fields[SERVICE_NAME][0]!),
// TODO:fix SERVICE_NAME when we move it to initializeIndex
String(fields[SERVICE_NAME]![0]),
fields[SERVICE_ENVIRONMENT] && String(fields[SERVICE_ENVIRONMENT][0]),
String(fields[TRANSACTION_TYPE][0]!)
String(fields[TRANSACTION_TYPE]![0])
),
}),
iconClass: 'bell',
Expand All @@ -131,6 +146,12 @@ export function registerApmRuleTypes(
validate: () => ({
errors: [],
}),
alertDetailsAppSection: lazy(
() =>
import(
'../ui_components/alert_details_app_section/alert_details_app_section'
)
),
requiresAppContext: false,
defaultActionMessage: i18n.translate(
'xpack.apm.alertTypes.transactionErrorRate.defaultActionMessage',
Expand All @@ -155,9 +176,10 @@ export function registerApmRuleTypes(
format: ({ fields }) => ({
reason: fields[ALERT_REASON]!,
link: getAlertUrlTransaction(
String(fields[SERVICE_NAME][0]!),
// TODO:fix SERVICE_NAME when we move it to initializeIndex
String(fields[SERVICE_NAME]![0]),
fields[SERVICE_ENVIRONMENT] && String(fields[SERVICE_ENVIRONMENT][0]),
String(fields[TRANSACTION_TYPE][0]!)
String(fields[TRANSACTION_TYPE]![0])
),
}),
iconClass: 'bell',
Expand All @@ -170,6 +192,12 @@ export function registerApmRuleTypes(
validate: () => ({
errors: [],
}),
alertDetailsAppSection: lazy(
() =>
import(
'../ui_components/alert_details_app_section/alert_details_app_section'
)
),
requiresAppContext: false,
defaultActionMessage: i18n.translate(
'xpack.apm.alertTypes.transactionDurationAnomaly.defaultActionMessage',
Expand Down
Loading

0 comments on commit 137d178

Please sign in to comment.