Skip to content

Commit

Permalink
Make in-product APM alerting links smart (stateful vs serverless) (el…
Browse files Browse the repository at this point in the history
…astic#176252)

## Summary

This is a part of
elastic/observability-docs#3622.

Before this PR, all four in-product APM alerting documentation links
pointed to
https://www.elastic.co/guide/en/kibana/master/apm-alerts.html. This PR
updates our in-product links to point to either our Serverless or
Stateful documentation, depending on the product type.

Closes elastic/observability-docs#3586.

---------

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Caue Marcondes <[email protected]>
(cherry picked from commit 62aa327)
  • Loading branch information
bmorelli25 committed Mar 20, 2024
1 parent 5a40836 commit e310fea
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
13 changes: 12 additions & 1 deletion packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down
5 changes: 4 additions & 1 deletion packages/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: () => ({
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit e310fea

Please sign in to comment.