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

This commit is contained in:
Lisa Cawley 2021-09-09 13:37:56 -07:00 committed by GitHub
parent a9d1b5ce3e
commit 5b88ab7661
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

@ -284,6 +284,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`,
@ -647,6 +650,9 @@ export interface DocLinksStart {
}>;
readonly observability: Readonly<{
guide: string;
infrastructureThreshold: string;
logsThreshold: string;
metricsThreshold: string;
monitorStatus: string;
monitorUptime: string;
tlsCertificate: string;

View file

@ -656,6 +656,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,