Skip to content

Commit

Permalink
Add feature flag for new Threshold Alert details page (#162394)
Browse files Browse the repository at this point in the history
Resolves #162393

Adds a new feature flag
`xpack.observability.unsafe.alertDetails.observability.enabled` to
show/hide threshold alert details page until it is ready for GA.
  • Loading branch information
benakansara authored Jul 27, 2023
1 parent fa90a2f commit 5a2b80f
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ kibana_vars=(
xpack.observability.unsafe.alertDetails.metrics.enabled
xpack.observability.unsafe.alertDetails.logs.enabled
xpack.observability.unsafe.alertDetails.uptime.enabled
xpack.observability.unsafe.alertDetails.observability.enabled
xpack.observability.unsafe.thresholdRule.enabled
xpack.observability.compositeSlo.enabled
xpack.reporting.capture.browser.autoDownload
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) {
'xpack.observability.unsafe.alertDetails.metrics.enabled (boolean)',
'xpack.observability.unsafe.alertDetails.logs.enabled (boolean)',
'xpack.observability.unsafe.alertDetails.uptime.enabled (boolean)',
'xpack.observability.unsafe.alertDetails.observability.enabled (boolean)',
'xpack.observability.unsafe.thresholdRule.enabled (boolean)',
'xpack.observability_onboarding.ui.enabled (boolean)',
/**
Expand Down
6 changes: 6 additions & 0 deletions x-pack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ xpack.observability.unsafe.alertDetails.uptime.enabled: true

**[For Uptime rule type]** In Kibana configuration, will allow the user to navigate to the new Alert Details page, instead of the Alert Flyout when clicking on `View alert details` in the Alert table

```yaml
xpack.observability.unsafe.alertDetails.observability.enabled: true
```

**[For Observability Threshold rule type]** In Kibana configuration, will allow the user to navigate to the new Alert Details page, instead of the Alert Flyout when clicking on `View alert details` in the Alert table

# Development

By default, Kibana will run with X-Pack installed as mentioned in the [contributing guide](../CONTRIBUTING.md).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const withCore = makeDecorator({
logs: { enabled: false },
metrics: { enabled: false },
uptime: { enabled: false },
observability: { enabled: false },
},
thresholdRule: { enabled: false },
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jest.spyOn(pluginContext, 'usePluginContext').mockImplementation(() => ({
logs: { enabled: false },
metrics: { enabled: false },
uptime: { enabled: false },
observability: { enabled: false },
},
thresholdRule: { enabled: false },
},
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/observability/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ export interface ConfigSchema {
uptime: {
enabled: boolean;
};
observability: {
enabled: boolean;
};
};
thresholdRule: {
enabled: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const ALLOWED_RULE_TYPES = ['apm.transaction_duration'];
const isUnsafeAlertDetailsFlag = (
subject: string
): subject is keyof ConfigSchema['unsafe']['alertDetails'] =>
['uptime', 'logs', 'metrics'].includes(subject);
['uptime', 'logs', 'metrics', 'observability'].includes(subject);

// We are mapping the ruleTypeId from the feature flag with the ruleTypeId from the alert
// to know whether the feature flag is enabled or not.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function KibanaReactStorybookDecorator(Story: ComponentType) {
logs: { enabled: false },
metrics: { enabled: false },
uptime: { enabled: false },
observability: { enabled: false },
},
thresholdRule: { enabled: false },
},
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/observability/public/utils/test_helper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const defaultConfig: ConfigSchema = {
logs: { enabled: false },
metrics: { enabled: false },
uptime: { enabled: false },
observability: { enabled: false },
},
thresholdRule: { enabled: false },
},
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/observability/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ const configSchema = schema.object({
uptime: schema.object({
enabled: schema.boolean({ defaultValue: false }),
}),
observability: schema.object({
enabled: schema.boolean({ defaultValue: false }),
}),
}),
thresholdRule: schema.object({
enabled: schema.boolean({ defaultValue: false }),
Expand Down

0 comments on commit 5a2b80f

Please sign in to comment.