Skip to content

Commit

Permalink
Configure observability rule URL for observability rule types
Browse files Browse the repository at this point in the history
  • Loading branch information
maryam-saeidi committed Aug 7, 2023
1 parent d805802 commit 54f353b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
* 2.0.
*/

import { GetViewInAppRelativeUrlFnOpts } from '@kbn/alerting-plugin/server';
import { schema } from '@kbn/config-schema';
import { i18n } from '@kbn/i18n';
import { LicenseType } from '@kbn/licensing-plugin/server';
import { createLifecycleExecutor } from '@kbn/rule-registry-plugin/server';
import { legacyExperimentalFieldMap } from '@kbn/alerts-as-data-utils';
import { IBasePath } from '@kbn/core/server';
import { LocatorPublic } from '@kbn/share-plugin/common';
import { AlertsLocatorParams, sloFeatureId } from '../../../../common';
import { AlertsLocatorParams, observabilityPaths, sloFeatureId } from '../../../../common';
import { SLO_RULE_REGISTRATION_CONTEXT } from '../../../common/constants';

import {
Expand Down Expand Up @@ -84,6 +85,8 @@ export function sloBurnRateRuleType(
useEcs: false,
useLegacyAlerts: true,
},
getViewInAppRelativeUrl: ({ rule }: GetViewInAppRelativeUrlFnOpts<{}>) =>
observabilityPaths.ruleDetails(rule.id),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ import { createLifecycleExecutor, IRuleDataClient } from '@kbn/rule-registry-plu
import { LicenseType } from '@kbn/licensing-plugin/server';
import { LocatorPublic } from '@kbn/share-plugin/common';
import { EsQueryRuleParamsExtractedParams } from '@kbn/stack-alerts-plugin/server/rule_types/es_query/rule_type_params';
import { paths } from '../../../../common/locators/paths';
import { AlertsLocatorParams, observabilityFeatureId } from '../../../../common';
import {
AlertsLocatorParams,
observabilityFeatureId,
observabilityPaths,
} from '../../../../common';
import { Comparator } from '../../../../common/threshold_rule/types';
import { OBSERVABILITY_THRESHOLD_RULE_TYPE_ID } from '../../../../common/constants';
import { THRESHOLD_RULE_REGISTRATION_CONTEXT } from '../../../common/constants';
Expand Down Expand Up @@ -182,6 +185,6 @@ export function thresholdRuleType(
producer: observabilityFeatureId,
alerts: MetricsRulesTypeAlertDefinition,
getViewInAppRelativeUrl: ({ rule }: GetViewInAppRelativeUrlFnOpts<{}>) =>
paths.observability.ruleDetails(rule.id),
observabilityPaths.ruleDetails(rule.id),
};
}

0 comments on commit 54f353b

Please sign in to comment.