mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
feat(composite-slo): add feature flag (#159427)
This commit is contained in:
parent
fb41ca56f9
commit
65b776280f
16 changed files with 28 additions and 42 deletions
|
@ -2137,36 +2137,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"composite-slo": {
|
||||
"dynamic": false,
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"name": {
|
||||
"type": "text"
|
||||
},
|
||||
"budgetingMethod": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"compositeMethod": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"sources": {
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"revision": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": {
|
||||
"type": "keyword"
|
||||
}
|
||||
}
|
||||
},
|
||||
"threshold-explorer-view": {
|
||||
"dynamic": false,
|
||||
"properties": {}
|
||||
|
|
|
@ -75,7 +75,6 @@ describe('checking migration metadata changes on all registered SO types', () =>
|
|||
"cases-connector-mappings": "f9d1ac57e484e69506c36a8051e4d61f4a8cfd25",
|
||||
"cases-telemetry": "f219eb7e26772884342487fc9602cfea07b3cedc",
|
||||
"cases-user-actions": "483f10db9b3bd1617948d7032a98b7791bf87414",
|
||||
"composite-slo": "d771c24af50d7ca5667a046b63ed024a4bfd819d",
|
||||
"config": "179b3e2bc672626aafce3cf92093a113f456af38",
|
||||
"config-global": "8e8a134a2952df700d7d4ec51abb794bbd4cf6da",
|
||||
"connector_token": "5a9ac29fe9c740eb114e9c40517245c71706b005",
|
||||
|
|
|
@ -196,7 +196,6 @@ describe('split .kibana index into multiple system indices', () => {
|
|||
"cases-connector-mappings",
|
||||
"cases-telemetry",
|
||||
"cases-user-actions",
|
||||
"composite-slo",
|
||||
"config",
|
||||
"config-global",
|
||||
"connector_token",
|
||||
|
|
|
@ -38,7 +38,6 @@ const previouslyRegisteredTypes = [
|
|||
'config',
|
||||
'config-global',
|
||||
'connector_token',
|
||||
'composite-slo',
|
||||
'core-usage-stats',
|
||||
'csp-rule-template',
|
||||
'csp_rule',
|
||||
|
|
|
@ -308,6 +308,7 @@ kibana_vars=(
|
|||
xpack.observability.unsafe.alertDetails.logs.enabled
|
||||
xpack.observability.unsafe.alertDetails.uptime.enabled
|
||||
xpack.observability.unsafe.thresholdRule.enabled
|
||||
xpack.observability.compositeSlo.enabled
|
||||
xpack.reporting.capture.browser.autoDownload
|
||||
xpack.reporting.capture.browser.chromium.disableSandbox
|
||||
xpack.reporting.capture.browser.chromium.inspect
|
||||
|
|
|
@ -87,6 +87,7 @@ const withCore = makeDecorator({
|
|||
},
|
||||
thresholdRule: { enabled: false },
|
||||
},
|
||||
compositeSlo: { enabled: false },
|
||||
coPilot: {
|
||||
enabled: false,
|
||||
},
|
||||
|
|
|
@ -43,6 +43,9 @@ jest.spyOn(pluginContext, 'usePluginContext').mockImplementation(() => ({
|
|||
},
|
||||
thresholdRule: { enabled: false },
|
||||
},
|
||||
compositeSlo: {
|
||||
enabled: false,
|
||||
},
|
||||
coPilot: {
|
||||
enabled: false,
|
||||
},
|
||||
|
|
|
@ -80,6 +80,7 @@ export interface ConfigSchema {
|
|||
enabled: boolean;
|
||||
};
|
||||
};
|
||||
compositeSlo: { enabled: boolean };
|
||||
coPilot?: {
|
||||
enabled?: boolean;
|
||||
};
|
||||
|
|
|
@ -34,6 +34,7 @@ export function KibanaReactStorybookDecorator(Story: ComponentType) {
|
|||
},
|
||||
thresholdRule: { enabled: false },
|
||||
},
|
||||
compositeSlo: { enabled: false },
|
||||
coPilot: {
|
||||
enabled: false,
|
||||
},
|
||||
|
|
|
@ -38,6 +38,7 @@ const defaultConfig: ConfigSchema = {
|
|||
},
|
||||
thresholdRule: { enabled: false },
|
||||
},
|
||||
compositeSlo: { enabled: false },
|
||||
coPilot: {
|
||||
enabled: false,
|
||||
},
|
||||
|
|
|
@ -50,6 +50,9 @@ const configSchema = schema.object({
|
|||
}),
|
||||
enabled: schema.boolean({ defaultValue: true }),
|
||||
coPilot: schema.maybe(observabilityCoPilotConfig),
|
||||
compositeSlo: schema.object({
|
||||
enabled: schema.boolean({ defaultValue: false }),
|
||||
}),
|
||||
});
|
||||
|
||||
export const config: PluginConfigDescriptor = {
|
||||
|
|
|
@ -173,6 +173,9 @@ export class ObservabilityPlugin implements Plugin<ObservabilityPluginSetup> {
|
|||
|
||||
const { ruleDataService } = plugins.ruleRegistry;
|
||||
|
||||
const savedObjectTypes = config.compositeSlo.enabled
|
||||
? [SO_SLO_TYPE, SO_COMPOSITE_SLO_TYPE]
|
||||
: [SO_SLO_TYPE];
|
||||
plugins.features.registerKibanaFeature({
|
||||
id: sloFeatureId,
|
||||
name: i18n.translate('xpack.observability.featureRegistry.linkSloTitle', {
|
||||
|
@ -189,7 +192,7 @@ export class ObservabilityPlugin implements Plugin<ObservabilityPluginSetup> {
|
|||
catalogue: [sloFeatureId, 'observability'],
|
||||
api: ['slo_write', 'slo_read', 'rac'],
|
||||
savedObject: {
|
||||
all: [SO_SLO_TYPE, SO_COMPOSITE_SLO_TYPE],
|
||||
all: savedObjectTypes,
|
||||
read: [],
|
||||
},
|
||||
alerting: {
|
||||
|
@ -208,7 +211,7 @@ export class ObservabilityPlugin implements Plugin<ObservabilityPluginSetup> {
|
|||
api: ['slo_read', 'rac'],
|
||||
savedObject: {
|
||||
all: [],
|
||||
read: [SO_SLO_TYPE, SO_COMPOSITE_SLO_TYPE],
|
||||
read: savedObjectTypes,
|
||||
},
|
||||
alerting: {
|
||||
rule: {
|
||||
|
@ -224,7 +227,9 @@ export class ObservabilityPlugin implements Plugin<ObservabilityPluginSetup> {
|
|||
});
|
||||
|
||||
core.savedObjects.registerType(slo);
|
||||
core.savedObjects.registerType(compositeSlo);
|
||||
if (config.compositeSlo.enabled) {
|
||||
core.savedObjects.registerType(compositeSlo);
|
||||
}
|
||||
core.savedObjects.registerType(threshold);
|
||||
|
||||
registerRuleTypes(
|
||||
|
@ -248,7 +253,7 @@ export class ObservabilityPlugin implements Plugin<ObservabilityPluginSetup> {
|
|||
getOpenAIClient: () => openAIService?.client,
|
||||
},
|
||||
logger: this.logger,
|
||||
repository: getObservabilityServerRouteRepository(),
|
||||
repository: getObservabilityServerRouteRepository(config),
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -5,16 +5,19 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { ObservabilityConfig } from '..';
|
||||
import { compositeSloRouteRepository } from './composite_slo/route';
|
||||
import { observabilityCoPilotRouteRepository } from './copilot/route';
|
||||
import { rulesRouteRepository } from './rules/route';
|
||||
import { sloRouteRepository } from './slo/route';
|
||||
|
||||
export function getObservabilityServerRouteRepository() {
|
||||
export function getObservabilityServerRouteRepository(config: ObservabilityConfig) {
|
||||
const isCompositeSloFeatureEnabled = config.compositeSlo.enabled;
|
||||
|
||||
const repository = {
|
||||
...rulesRouteRepository,
|
||||
...sloRouteRepository,
|
||||
...compositeSloRouteRepository,
|
||||
...(isCompositeSloFeatureEnabled ? compositeSloRouteRepository : {}),
|
||||
...observabilityCoPilotRouteRepository,
|
||||
};
|
||||
return repository;
|
||||
|
|
|
@ -13,7 +13,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
const supertest = getService('supertest');
|
||||
const kibanaServer = getService('kibanaServer');
|
||||
|
||||
describe('create >', () => {
|
||||
describe.skip('create >', () => {
|
||||
const security = getService('security');
|
||||
|
||||
before(async () => {
|
||||
|
|
|
@ -12,7 +12,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
const supertest = getService('supertest');
|
||||
const kibanaServer = getService('kibanaServer');
|
||||
|
||||
describe('delete >', () => {
|
||||
describe.skip('delete >', () => {
|
||||
const security = getService('security');
|
||||
|
||||
before(async () => {
|
||||
|
|
|
@ -13,7 +13,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
const supertest = getService('supertest');
|
||||
const kibanaServer = getService('kibanaServer');
|
||||
|
||||
describe('update >', () => {
|
||||
describe.skip('update >', () => {
|
||||
const security = getService('security');
|
||||
|
||||
before(async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue