From 5b21dc49413d039b2b33b61160691bbe49580549 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 20 Mar 2024 16:12:58 -0400 Subject: [PATCH] [8.13] Make in-product APM alerting links smart (stateful vs serverless) (#176252) (#179093) # Backport This will backport the following commits from `main` to `8.13`: - [Make in-product APM alerting links smart (stateful vs serverless) (#176252)](https://github.com/elastic/kibana/pull/176252) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Brandon Morelli --- packages/kbn-doc-links/src/get_doc_links.ts | 13 ++++++++++++- packages/kbn-doc-links/src/types.ts | 5 ++++- .../cypress/e2e/dependencies/dependencies.cy.ts | 5 +---- .../alerting/rule_types/register_apm_rule_types.ts | 8 ++++---- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/packages/kbn-doc-links/src/get_doc_links.ts b/packages/kbn-doc-links/src/get_doc_links.ts index bfa2953310e0c..d0a78b272128c 100644 --- a/packages/kbn-doc-links/src/get_doc_links.ts +++ b/packages/kbn-doc-links/src/get_doc_links.ts @@ -599,7 +599,18 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D actionTypes: isServerless ? `${SERVERLESS_DOCS}action-connectors` : `${KIBANA_DOCS}action-types.html`, - apmRules: `${KIBANA_DOCS}apm-alerts.html`, + apmRulesErrorCount: isServerless + ? `${SERVERLESS_OBSERVABILITY_DOCS}create-error-count-threshold-alert-rule` + : `${KIBANA_DOCS}apm-alerts.html`, + apmRulesTransactionDuration: isServerless + ? `${SERVERLESS_OBSERVABILITY_DOCS}create-latency-threshold-alert-rule` + : `${KIBANA_DOCS}apm-alerts.html`, + apmRulesTransactionError: isServerless + ? `${SERVERLESS_OBSERVABILITY_DOCS}create-failed-transaction-rate-threshold-alert-rule` + : `${KIBANA_DOCS}apm-alerts.html`, + apmRulesAnomaly: isServerless + ? `${SERVERLESS_OBSERVABILITY_DOCS}create-anomaly-alert-rule` + : `${KIBANA_DOCS}apm-alerts.html`, emailAction: `${KIBANA_DOCS}email-action-type.html`, emailActionConfig: `${KIBANA_DOCS}email-action-type.html`, emailExchangeClientSecretConfig: `${KIBANA_DOCS}email-action-type.html#exchange-client-secret`, diff --git a/packages/kbn-doc-links/src/types.ts b/packages/kbn-doc-links/src/types.ts index 6120d6f30f425..df39d8e33e77c 100644 --- a/packages/kbn-doc-links/src/types.ts +++ b/packages/kbn-doc-links/src/types.ts @@ -436,7 +436,10 @@ export interface DocLinks { readonly alerting: Readonly<{ guide: string; actionTypes: string; - apmRules: string; + apmRulesErrorCount: string; + apmRulesTransactionDuration: string; + apmRulesTransactionError: string; + apmRulesAnomaly: string; emailAction: string; emailActionConfig: string; emailExchangeClientSecretConfig: string; diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/dependencies/dependencies.cy.ts b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/dependencies/dependencies.cy.ts index 11741c3d3066b..9870a09d079b5 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/dependencies/dependencies.cy.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/dependencies/dependencies.cy.ts @@ -142,10 +142,7 @@ describe('Dependencies with high volume of data', () => { it('shows dependencies inventory page', () => { cy.visitKibana( - `/app/apm/dependencies/inventory?${new URLSearchParams({ - ...timeRange, - kuery: 'elasticsearch*', - })}` + `/app/apm/dependencies/inventory?${new URLSearchParams(timeRange)}` ); cy.getByTestSubj('dependenciesTable'); diff --git a/x-pack/plugins/apm/public/components/alerting/rule_types/register_apm_rule_types.ts b/x-pack/plugins/apm/public/components/alerting/rule_types/register_apm_rule_types.ts index 86465817689fd..f95b5503fd5ec 100644 --- a/x-pack/plugins/apm/public/components/alerting/rule_types/register_apm_rule_types.ts +++ b/x-pack/plugins/apm/public/components/alerting/rule_types/register_apm_rule_types.ts @@ -47,7 +47,7 @@ export function registerApmRuleTypes( }, iconClass: 'bell', documentationUrl(docLinks) { - return `${docLinks.links.alerting.apmRules}`; + return `${docLinks.links.alerting.apmRulesErrorCount}`; }, ruleParamsExpression: lazy(() => import('./error_count_rule_type')), validate: () => ({ @@ -80,7 +80,7 @@ export function registerApmRuleTypes( }, iconClass: 'bell', documentationUrl(docLinks) { - return `${docLinks.links.alerting.apmRules}`; + return `${docLinks.links.alerting.apmRulesTransactionDuration}`; }, ruleParamsExpression: lazy( () => import('./transaction_duration_rule_type') @@ -116,7 +116,7 @@ export function registerApmRuleTypes( }), iconClass: 'bell', documentationUrl(docLinks) { - return `${docLinks.links.alerting.apmRules}`; + return `${docLinks.links.alerting.apmRulesTransactionError}`; }, ruleParamsExpression: lazy( () => import('./transaction_error_rate_rule_type') @@ -146,7 +146,7 @@ export function registerApmRuleTypes( }), iconClass: 'bell', documentationUrl(docLinks) { - return `${docLinks.links.alerting.apmRules}`; + return `${docLinks.links.alerting.apmRulesAnomaly}`; }, ruleParamsExpression: lazy(() => import('./anomaly_rule_type')), validate: validateAnomalyRule,