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

Make in-product APM alerting links smart (stateful vs serverless) #176252

Merged
merged 10 commits into from
Mar 20, 2024
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