-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[serverless] Create Observability Serverless plugin (#156118)
> Derived from #153274 > Builds upon #155582 ## Summary This PR creates the Serverless Observability plugin, based on the work from #153274: - creates the plugin, - adds API to hide the solution navigation from Enterprise Search, - calls that API if the chrome style is `project`. <img width="1610" alt="Screenshot 2023-04-27 at 5 03 44 PM" src="https://user-images.githubusercontent.com/297604/234990765-d6770650-41b3-4e94-ad7f-c6a22778d39a.png"> --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
29dfcd5
commit 4e88645
Showing
24 changed files
with
299 additions
and
12 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
uiSettings.overrides.defaultRoute: /app/observability/overview | ||
# Observability Project config | ||
|
||
## Disable plugins | ||
enterpriseSearch.enabled: false | ||
xpack.cloudSecurityPosture.enabled: false | ||
xpack.securitySolution.enabled: false | ||
|
||
## Enable the Serverless Obsersability plugin | ||
xpack.serverless.observability.enabled: true | ||
|
||
## Configure plugins | ||
xpack.infra.logs.app_target: discover | ||
|
||
## Set the home route | ||
uiSettings.overrides.defaultRoute: /app/observability/overview | ||
|
||
## Set the dev project switch current type | ||
xpack.serverless.plugin.developer.projectSwitcher.currentType: 'observability' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/build | ||
/target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Serverless Observability project plugin | ||
|
||
This plugin contains configuration and code used to create a Serverless Observability project. It leverages universal configuration and other APIs in the [`serverless`](../serverless/README.mdx) plugin to configure Kibana. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export const PLUGIN_ID = 'serverlessObservability'; | ||
export const PLUGIN_NAME = 'serverlessObservability'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"type": "plugin", | ||
"id": "@kbn/serverless-observability", | ||
"owner": "@elastic/appex-sharedux", | ||
"description": "Serverless customizations for observability.", | ||
"plugin": { | ||
"id": "serverlessObservability", | ||
"server": true, | ||
"browser": true, | ||
"configPath": [ | ||
"xpack", | ||
"serverless", | ||
"observability" | ||
], | ||
"requiredPlugins": [ | ||
"serverless", | ||
"observabilityShared" | ||
], | ||
"optionalPlugins": [], | ||
"requiredBundles": [] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "@kbn/serverless-observability", | ||
"version": "1.0.0", | ||
"license": "Elastic License 2.0", | ||
"private": true, | ||
"scripts": { | ||
"build": "yarn plugin-helpers build", | ||
"plugin-helpers": "node ../../../scripts/plugin_helpers", | ||
"kbn": "node ../../../scripts/kbn" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { ServerlessObservabilityPlugin } from './plugin'; | ||
|
||
// This exports static code and TypeScript types, | ||
// as well as, Kibana Platform `plugin()` initializer. | ||
export function plugin() { | ||
return new ServerlessObservabilityPlugin(); | ||
} | ||
|
||
export type { | ||
ServerlessObservabilityPluginSetup, | ||
ServerlessObservabilityPluginStart, | ||
} from './types'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; | ||
import { | ||
ServerlessObservabilityPluginSetup, | ||
ServerlessObservabilityPluginStart, | ||
ServerlessObservabilityPluginSetupDependencies, | ||
ServerlessObservabilityPluginStartDependencies, | ||
} from './types'; | ||
|
||
export class ServerlessObservabilityPlugin | ||
implements Plugin<ServerlessObservabilityPluginSetup, ServerlessObservabilityPluginStart> | ||
{ | ||
public setup( | ||
_core: CoreSetup, | ||
_setupDeps: ServerlessObservabilityPluginSetupDependencies | ||
): ServerlessObservabilityPluginSetup { | ||
return {}; | ||
} | ||
|
||
public start( | ||
_core: CoreStart, | ||
{ observabilityShared }: ServerlessObservabilityPluginStartDependencies | ||
): ServerlessObservabilityPluginStart { | ||
observabilityShared.setIsSidebarEnabled(false); | ||
return {}; | ||
} | ||
|
||
public stop() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { ServerlessPluginSetup, ServerlessPluginStart } from '@kbn/serverless/public'; | ||
import { | ||
ObservabilitySharedPluginSetup, | ||
ObservabilitySharedPluginStart, | ||
} from '@kbn/observability-shared-plugin/public'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
export interface ServerlessObservabilityPluginSetup {} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
export interface ServerlessObservabilityPluginStart {} | ||
|
||
export interface ServerlessObservabilityPluginSetupDependencies { | ||
observabilityShared: ObservabilitySharedPluginSetup; | ||
serverless: ServerlessPluginSetup; | ||
} | ||
|
||
export interface ServerlessObservabilityPluginStartDependencies { | ||
observabilityShared: ObservabilitySharedPluginStart; | ||
serverless: ServerlessPluginStart; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { schema, TypeOf } from '@kbn/config-schema'; | ||
import { PluginConfigDescriptor } from '@kbn/core/server'; | ||
|
||
export * from './types'; | ||
|
||
const configSchema = schema.object({ | ||
enabled: schema.boolean({ defaultValue: false }), | ||
}); | ||
|
||
type ConfigType = TypeOf<typeof configSchema>; | ||
|
||
export const config: PluginConfigDescriptor<ConfigType> = { | ||
schema: configSchema, | ||
}; | ||
|
||
export type ServerlessObservabilityConfig = TypeOf<typeof configSchema>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { PluginInitializerContext } from '@kbn/core/server'; | ||
|
||
import { ServerlessObservabilityPlugin } from './plugin'; | ||
export { config } from './config'; | ||
|
||
// This exports static code and TypeScript types, | ||
// as well as, Kibana Platform `plugin()` initializer. | ||
|
||
export function plugin(initializerContext: PluginInitializerContext) { | ||
return new ServerlessObservabilityPlugin(initializerContext); | ||
} | ||
|
||
export type { | ||
ServerlessObservabilityPluginSetup, | ||
ServerlessObservabilityPluginStart, | ||
} from './types'; |
Oops, something went wrong.