Replace hard-coded links in infra alerting (#111072)

This commit is contained in:
Lisa Cawley 2021-09-09 11:27:29 -07:00 committed by GitHub
parent de2cfd2e65
commit 4d933c7d98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 4 deletions

View file

@ -190,6 +190,9 @@ readonly links: {
}>;
readonly observability: Readonly<{
guide: string;
infrastructureThreshold: string;
logsThreshold: string;
metricsThreshold: string;
monitorStatus: string;
monitorUptime: string;
tlsCertificate: string;

File diff suppressed because one or more lines are too long

View file

@ -282,6 +282,9 @@ export class DocLinksService {
},
observability: {
guide: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/index.html`,
infrastructureThreshold: `{ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/infrastructure-threshold-alert.html`,
logsThreshold: `{ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/logs-threshold-alert.html`,
metricsThreshold: `{ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/metrics-threshold-alert.html`,
monitorStatus: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/monitor-status-alert.html`,
monitorUptime: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/monitor-uptime.html`,
tlsCertificate: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/tls-certificate-alert.html`,
@ -645,6 +648,9 @@ export interface DocLinksStart {
}>;
readonly observability: Readonly<{
guide: string;
infrastructureThreshold: string;
logsThreshold: string;
metricsThreshold: string;
monitorStatus: string;
monitorUptime: string;
tlsCertificate: string;

View file

@ -655,6 +655,9 @@ export interface DocLinksStart {
}>;
readonly observability: Readonly<{
guide: string;
infrastructureThreshold: string;
logsThreshold: string;
metricsThreshold: string;
monitorStatus: string;
monitorUptime: string;
tlsCertificate: string;

View file

@ -31,7 +31,7 @@ export function createInventoryMetricAlertType(): ObservabilityRuleTypeModel<Inv
}),
iconClass: 'bell',
documentationUrl(docLinks) {
return `${docLinks.ELASTIC_WEBSITE_URL}guide/en/observability/${docLinks.DOC_LINK_VERSION}/infrastructure-threshold-alert.html`;
return `${docLinks.links.observability.infrastructureThreshold}`;
},
alertParamsExpression: React.lazy(() => import('./components/expression')),
validate: validateMetricThreshold,

View file

@ -23,7 +23,7 @@ export function createLogThresholdAlertType(): ObservabilityRuleTypeModel<Partia
}),
iconClass: 'bell',
documentationUrl(docLinks) {
return `${docLinks.ELASTIC_WEBSITE_URL}guide/en/observability/${docLinks.DOC_LINK_VERSION}/logs-threshold-alert.html`;
return `${docLinks.links.observability.logsThreshold}`;
},
alertParamsExpression: React.lazy(() => import('./components/expression_editor/editor')),
validate: validateExpression,

View file

@ -29,7 +29,7 @@ export function createMetricThresholdAlertType(): ObservabilityRuleTypeModel<Met
}),
iconClass: 'bell',
documentationUrl(docLinks) {
return `${docLinks.ELASTIC_WEBSITE_URL}guide/en/observability/${docLinks.DOC_LINK_VERSION}/metrics-threshold-alert.html`;
return `${docLinks.links.observability.metricsThreshold}`;
},
alertParamsExpression: React.lazy(() => import('./components/expression')),
validate: validateMetricThreshold,