Merge branch 'master' into sec-team-543/allow-wildcard-for-paths

This commit is contained in:
Kibana Machine 2021-04-29 04:35:29 -04:00 committed by GitHub
commit e8e9ce5256
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
718 changed files with 16402 additions and 6108 deletions

View file

@ -1377,6 +1377,10 @@ module.exports = {
['parent', 'sibling', 'index'],
],
pathGroups: [
{
pattern: '{**,.}/*.test.mocks',
group: 'unknown',
},
{
pattern: '{@kbn/**,src/**,kibana{,/**}}',
group: 'internal',
@ -1402,6 +1406,24 @@ module.exports = {
},
},
/**
* Do not allow `any`
*/
{
files: [
'packages/kbn-analytics/**',
// 'packages/kbn-telemetry-tools/**',
'src/plugins/kibana_usage_collection/**',
'src/plugins/usage_collection/**',
'src/plugins/telemetry/**',
'src/plugins/telemetry_collection_manager/**',
'src/plugins/telemetry_management_section/**',
'x-pack/plugins/telemetry_collection_xpack/**',
],
rules: {
'@typescript-eslint/no-explicit-any': 'error',
},
},
{
files: [
// core-team owned code

View file

@ -1,9 +1,611 @@
{
"id": "telemetry",
"client": {
"classes": [],
"classes": [
{
"id": "def-public.TelemetryNotifications",
"type": "Class",
"tags": [],
"label": "TelemetryNotifications",
"description": [],
"children": [
{
"id": "def-public.TelemetryNotifications.Unnamed",
"type": "Function",
"label": "Constructor",
"signature": [
"any"
],
"description": [],
"children": [
{
"id": "def-public.TelemetryNotifications.Unnamed.$1",
"type": "Object",
"label": "{ http, overlays, telemetryService }",
"isRequired": true,
"signature": [
"TelemetryNotificationsConstructor"
],
"description": [],
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_notifications/telemetry_notifications.ts",
"lineNumber": 27
}
}
],
"tags": [],
"returnComment": [],
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_notifications/telemetry_notifications.ts",
"lineNumber": 27
}
},
{
"id": "def-public.TelemetryNotifications.shouldShowOptedInNoticeBanner",
"type": "Function",
"children": [],
"signature": [
"() => boolean"
],
"description": [],
"label": "shouldShowOptedInNoticeBanner",
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_notifications/telemetry_notifications.ts",
"lineNumber": 33
},
"tags": [],
"returnComment": []
},
{
"id": "def-public.TelemetryNotifications.renderOptedInNoticeBanner",
"type": "Function",
"children": [],
"signature": [
"() => void"
],
"description": [],
"label": "renderOptedInNoticeBanner",
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_notifications/telemetry_notifications.ts",
"lineNumber": 39
},
"tags": [],
"returnComment": []
},
{
"id": "def-public.TelemetryNotifications.shouldShowOptInBanner",
"type": "Function",
"children": [],
"signature": [
"() => boolean"
],
"description": [],
"label": "shouldShowOptInBanner",
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_notifications/telemetry_notifications.ts",
"lineNumber": 49
},
"tags": [],
"returnComment": []
},
{
"id": "def-public.TelemetryNotifications.renderOptInBanner",
"type": "Function",
"children": [],
"signature": [
"() => void"
],
"description": [],
"label": "renderOptInBanner",
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_notifications/telemetry_notifications.ts",
"lineNumber": 55
},
"tags": [],
"returnComment": []
},
{
"id": "def-public.TelemetryNotifications.setOptedInNoticeSeen",
"type": "Function",
"children": [],
"signature": [
"() => Promise<void>"
],
"description": [],
"label": "setOptedInNoticeSeen",
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_notifications/telemetry_notifications.ts",
"lineNumber": 73
},
"tags": [],
"returnComment": []
}
],
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_notifications/telemetry_notifications.ts",
"lineNumber": 20
},
"initialIsOpen": false
},
{
"id": "def-public.TelemetryService",
"type": "Class",
"tags": [],
"label": "TelemetryService",
"description": [],
"children": [
{
"tags": [],
"id": "def-public.TelemetryService.currentKibanaVersion",
"type": "string",
"label": "currentKibanaVersion",
"description": [],
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 28
}
},
{
"id": "def-public.TelemetryService.Unnamed",
"type": "Function",
"label": "Constructor",
"signature": [
"any"
],
"description": [],
"children": [
{
"id": "def-public.TelemetryService.Unnamed.$1",
"type": "Object",
"label": "{\n config,\n http,\n notifications,\n currentKibanaVersion,\n reportOptInStatusChange = true,\n }",
"isRequired": true,
"signature": [
"TelemetryServiceConstructor"
],
"description": [],
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 30
}
}
],
"tags": [],
"returnComment": [],
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 30
}
},
{
"id": "def-public.TelemetryService.config",
"type": "Object",
"label": "config",
"tags": [],
"description": [],
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 44
},
"signature": [
{
"pluginId": "telemetry",
"scope": "public",
"docId": "kibTelemetryPluginApi",
"section": "def-public.TelemetryPluginConfig",
"text": "TelemetryPluginConfig"
}
]
},
{
"id": "def-public.TelemetryService.config",
"type": "Object",
"label": "config",
"tags": [],
"description": [],
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 48
},
"signature": [
{
"pluginId": "telemetry",
"scope": "public",
"docId": "kibTelemetryPluginApi",
"section": "def-public.TelemetryPluginConfig",
"text": "TelemetryPluginConfig"
}
]
},
{
"id": "def-public.TelemetryService.isOptedIn",
"type": "CompoundType",
"label": "isOptedIn",
"tags": [],
"description": [],
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 52
},
"signature": [
"boolean | null"
]
},
{
"id": "def-public.TelemetryService.isOptedIn",
"type": "CompoundType",
"label": "isOptedIn",
"tags": [],
"description": [],
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 56
},
"signature": [
"boolean | null"
]
},
{
"id": "def-public.TelemetryService.userHasSeenOptedInNotice",
"type": "CompoundType",
"label": "userHasSeenOptedInNotice",
"tags": [],
"description": [],
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 60
},
"signature": [
"boolean | undefined"
]
},
{
"id": "def-public.TelemetryService.userHasSeenOptedInNotice",
"type": "CompoundType",
"label": "userHasSeenOptedInNotice",
"tags": [],
"description": [],
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 64
},
"signature": [
"boolean | undefined"
]
},
{
"id": "def-public.TelemetryService.getCanChangeOptInStatus",
"type": "Function",
"children": [],
"signature": [
"() => boolean"
],
"description": [],
"label": "getCanChangeOptInStatus",
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 68
},
"tags": [],
"returnComment": []
},
{
"id": "def-public.TelemetryService.getOptInStatusUrl",
"type": "Function",
"children": [],
"signature": [
"() => string"
],
"description": [],
"label": "getOptInStatusUrl",
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 73
},
"tags": [],
"returnComment": []
},
{
"id": "def-public.TelemetryService.getTelemetryUrl",
"type": "Function",
"children": [],
"signature": [
"() => string"
],
"description": [],
"label": "getTelemetryUrl",
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 78
},
"tags": [],
"returnComment": []
},
{
"id": "def-public.TelemetryService.getUserShouldSeeOptInNotice",
"type": "Function",
"label": "getUserShouldSeeOptInNotice",
"signature": [
"() => boolean"
],
"description": [
"\nReturns if an user should be shown the notice about Opt-In/Out telemetry.\nThe decision is made based on whether any user has already dismissed the message or\nthe user can't actually change the settings (in which case, there's no point on bothering them)"
],
"children": [],
"tags": [],
"returnComment": [],
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 88
}
},
{
"id": "def-public.TelemetryService.userCanChangeSettings",
"type": "boolean",
"label": "userCanChangeSettings",
"tags": [],
"description": [],
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 95
}
},
{
"id": "def-public.TelemetryService.userCanChangeSettings",
"type": "boolean",
"label": "userCanChangeSettings",
"tags": [],
"description": [],
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 99
}
},
{
"id": "def-public.TelemetryService.getIsOptedIn",
"type": "Function",
"children": [],
"signature": [
"() => boolean | null"
],
"description": [],
"label": "getIsOptedIn",
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 103
},
"tags": [],
"returnComment": []
},
{
"id": "def-public.TelemetryService.fetchExample",
"type": "Function",
"children": [],
"signature": [
"() => Promise<any>"
],
"description": [],
"label": "fetchExample",
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 107
},
"tags": [],
"returnComment": []
},
{
"id": "def-public.TelemetryService.fetchTelemetry",
"type": "Function",
"children": [
{
"id": "def-public.TelemetryService.fetchTelemetry.$1",
"type": "Object",
"label": "{ unencrypted = false }",
"isRequired": true,
"signature": [
"{ unencrypted?: boolean | undefined; }"
],
"description": [],
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 111
}
}
],
"signature": [
"({ unencrypted }?: { unencrypted?: boolean | undefined; }) => Promise<any>"
],
"description": [],
"label": "fetchTelemetry",
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 111
},
"tags": [],
"returnComment": []
},
{
"id": "def-public.TelemetryService.setOptIn",
"type": "Function",
"children": [
{
"id": "def-public.TelemetryService.setOptIn.$1",
"type": "boolean",
"label": "optedIn",
"isRequired": true,
"signature": [
"boolean"
],
"description": [],
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 119
}
}
],
"signature": [
"(optedIn: boolean) => Promise<boolean>"
],
"description": [],
"label": "setOptIn",
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 119
},
"tags": [],
"returnComment": []
},
{
"id": "def-public.TelemetryService.setUserHasSeenNotice",
"type": "Function",
"children": [],
"signature": [
"() => Promise<void>"
],
"description": [],
"label": "setUserHasSeenNotice",
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 153
},
"tags": [],
"returnComment": []
}
],
"source": {
"path": "src/plugins/telemetry/public/services/telemetry_service.ts",
"lineNumber": 21
},
"initialIsOpen": false
}
],
"functions": [],
"interfaces": [],
"interfaces": [
{
"id": "def-public.TelemetryPluginConfig",
"type": "Interface",
"label": "TelemetryPluginConfig",
"description": [],
"tags": [],
"children": [
{
"tags": [],
"id": "def-public.TelemetryPluginConfig.enabled",
"type": "boolean",
"label": "enabled",
"description": [],
"source": {
"path": "src/plugins/telemetry/public/plugin.ts",
"lineNumber": 46
}
},
{
"tags": [],
"id": "def-public.TelemetryPluginConfig.url",
"type": "string",
"label": "url",
"description": [],
"source": {
"path": "src/plugins/telemetry/public/plugin.ts",
"lineNumber": 47
}
},
{
"tags": [],
"id": "def-public.TelemetryPluginConfig.banner",
"type": "boolean",
"label": "banner",
"description": [],
"source": {
"path": "src/plugins/telemetry/public/plugin.ts",
"lineNumber": 48
}
},
{
"tags": [],
"id": "def-public.TelemetryPluginConfig.allowChangingOptInStatus",
"type": "boolean",
"label": "allowChangingOptInStatus",
"description": [],
"source": {
"path": "src/plugins/telemetry/public/plugin.ts",
"lineNumber": 49
}
},
{
"tags": [],
"id": "def-public.TelemetryPluginConfig.optIn",
"type": "CompoundType",
"label": "optIn",
"description": [],
"source": {
"path": "src/plugins/telemetry/public/plugin.ts",
"lineNumber": 50
},
"signature": [
"boolean | null"
]
},
{
"tags": [],
"id": "def-public.TelemetryPluginConfig.optInStatusUrl",
"type": "string",
"label": "optInStatusUrl",
"description": [],
"source": {
"path": "src/plugins/telemetry/public/plugin.ts",
"lineNumber": 51
}
},
{
"tags": [],
"id": "def-public.TelemetryPluginConfig.sendUsageFrom",
"type": "CompoundType",
"label": "sendUsageFrom",
"description": [],
"source": {
"path": "src/plugins/telemetry/public/plugin.ts",
"lineNumber": 52
},
"signature": [
"\"browser\" | \"server\""
]
},
{
"tags": [],
"id": "def-public.TelemetryPluginConfig.telemetryNotifyUserAboutOptInDefault",
"type": "CompoundType",
"label": "telemetryNotifyUserAboutOptInDefault",
"description": [],
"source": {
"path": "src/plugins/telemetry/public/plugin.ts",
"lineNumber": 53
},
"signature": [
"boolean | undefined"
]
},
{
"tags": [],
"id": "def-public.TelemetryPluginConfig.userCanChangeSettings",
"type": "CompoundType",
"label": "userCanChangeSettings",
"description": [],
"source": {
"path": "src/plugins/telemetry/public/plugin.ts",
"lineNumber": 54
},
"signature": [
"boolean | undefined"
]
}
],
"source": {
"path": "src/plugins/telemetry/public/plugin.ts",
"lineNumber": 45
},
"initialIsOpen": false
}
],
"enums": [],
"misc": [],
"objects": [],
@ -25,7 +627,13 @@
"lineNumber": 38
},
"signature": [
"TelemetryService"
{
"pluginId": "telemetry",
"scope": "public",
"docId": "kibTelemetryPluginApi",
"section": "def-public.TelemetryService",
"text": "TelemetryService"
}
]
},
{
@ -39,7 +647,13 @@
"lineNumber": 39
},
"signature": [
"TelemetryNotifications"
{
"pluginId": "telemetry",
"scope": "public",
"docId": "kibTelemetryPluginApi",
"section": "def-public.TelemetryNotifications",
"text": "TelemetryNotifications"
}
]
},
{
@ -82,7 +696,13 @@
"lineNumber": 34
},
"signature": [
"TelemetryService"
{
"pluginId": "telemetry",
"scope": "public",
"docId": "kibTelemetryPluginApi",
"section": "def-public.TelemetryService",
"text": "TelemetryService"
}
]
}
],
@ -95,137 +715,7 @@
}
},
"server": {
"classes": [
{
"id": "def-server.FetcherTask",
"type": "Class",
"tags": [],
"label": "FetcherTask",
"description": [],
"children": [
{
"id": "def-server.FetcherTask.Unnamed",
"type": "Function",
"label": "Constructor",
"signature": [
"any"
],
"description": [],
"children": [
{
"id": "def-server.FetcherTask.Unnamed.$1",
"type": "Object",
"label": "initializerContext",
"isRequired": true,
"signature": [
{
"pluginId": "core",
"scope": "server",
"docId": "kibCorePluginApi",
"section": "def-server.PluginInitializerContext",
"text": "PluginInitializerContext"
},
"<Readonly<{ optIn?: boolean | undefined; } & { enabled: boolean; url: string; allowChangingOptInStatus: boolean; config: string; banner: boolean; optInStatusUrl: string; sendUsageFrom: \"browser\" | \"server\"; }>>"
],
"description": [],
"source": {
"path": "src/plugins/telemetry/server/fetcher.ts",
"lineNumber": 58
}
}
],
"tags": [],
"returnComment": [],
"source": {
"path": "src/plugins/telemetry/server/fetcher.ts",
"lineNumber": 58
}
},
{
"id": "def-server.FetcherTask.start",
"type": "Function",
"label": "start",
"signature": [
"({ savedObjects, elasticsearch }: ",
{
"pluginId": "core",
"scope": "server",
"docId": "kibCorePluginApi",
"section": "def-server.CoreStart",
"text": "CoreStart"
},
", { telemetryCollectionManager }: ",
"FetcherTaskDepsStart",
") => void"
],
"description": [],
"children": [
{
"id": "def-server.FetcherTask.start.$1",
"type": "Object",
"label": "{ savedObjects, elasticsearch }",
"isRequired": true,
"signature": [
{
"pluginId": "core",
"scope": "server",
"docId": "kibCorePluginApi",
"section": "def-server.CoreStart",
"text": "CoreStart"
}
],
"description": [],
"source": {
"path": "src/plugins/telemetry/server/fetcher.ts",
"lineNumber": 65
}
},
{
"id": "def-server.FetcherTask.start.$2",
"type": "Object",
"label": "{ telemetryCollectionManager }",
"isRequired": true,
"signature": [
"FetcherTaskDepsStart"
],
"description": [],
"source": {
"path": "src/plugins/telemetry/server/fetcher.ts",
"lineNumber": 66
}
}
],
"tags": [],
"returnComment": [],
"source": {
"path": "src/plugins/telemetry/server/fetcher.ts",
"lineNumber": 64
}
},
{
"id": "def-server.FetcherTask.stop",
"type": "Function",
"label": "stop",
"signature": [
"() => void"
],
"description": [],
"children": [],
"tags": [],
"returnComment": [],
"source": {
"path": "src/plugins/telemetry/server/fetcher.ts",
"lineNumber": 77
}
}
],
"source": {
"path": "src/plugins/telemetry/server/fetcher.ts",
"lineNumber": 45
},
"initialIsOpen": false
}
],
"classes": [],
"functions": [
{
"id": "def-server.buildDataTelemetryPayload",
@ -420,15 +910,16 @@
"section": "def-server.StatsCollectionContext",
"text": "StatsCollectionContext"
},
") => Promise<{ timestamp: string; cluster_uuid: string; cluster_name: string; version: string; cluster_stats: any; collection: string; stack_stats: { data: ",
") => Promise<{ timestamp: string; cluster_uuid: string; cluster_name: string; version: string; cluster_stats: Pick<{ nodes: { usage: { nodes: ",
{
"pluginId": "telemetry",
"scope": "server",
"docId": "kibTelemetryPluginApi",
"section": "def-server.DataTelemetryPayload",
"text": "DataTelemetryPayload"
"section": "def-server.NodeUsage",
"text": "NodeUsage"
},
" | undefined; kibana: { count: number; indices: number; os: {}; versions: { version: string; count: number; }[]; plugins: { [plugin: string]: any; }; } | undefined; }; }[]>"
"[] | {}[]; }; count: ",
"ClusterNodeCount"
],
"description": [
"\nGet statistics for all products joined by Elasticsearch cluster."
@ -656,6 +1147,123 @@
"lineNumber": 38
},
"initialIsOpen": false
},
{
"id": "def-server.NodeUsage",
"type": "Interface",
"label": "NodeUsage",
"description": [],
"tags": [],
"children": [
{
"tags": [],
"id": "def-server.NodeUsage.node_id",
"type": "string",
"label": "node_id",
"description": [],
"source": {
"path": "src/plugins/telemetry/server/telemetry_collection/get_nodes_usage.ts",
"lineNumber": 18
},
"signature": [
"string | undefined"
]
},
{
"tags": [],
"id": "def-server.NodeUsage.timestamp",
"type": "CompoundType",
"label": "timestamp",
"description": [],
"source": {
"path": "src/plugins/telemetry/server/telemetry_collection/get_nodes_usage.ts",
"lineNumber": 19
},
"signature": [
"React.ReactText"
]
},
{
"tags": [],
"id": "def-server.NodeUsage.since",
"type": "number",
"label": "since",
"description": [],
"source": {
"path": "src/plugins/telemetry/server/telemetry_collection/get_nodes_usage.ts",
"lineNumber": 20
}
},
{
"tags": [],
"id": "def-server.NodeUsage.rest_actions",
"type": "Object",
"label": "rest_actions",
"description": [],
"source": {
"path": "src/plugins/telemetry/server/telemetry_collection/get_nodes_usage.ts",
"lineNumber": 21
},
"signature": [
"{ [key: string]: number; }"
]
},
{
"tags": [],
"id": "def-server.NodeUsage.aggregations",
"type": "Object",
"label": "aggregations",
"description": [],
"source": {
"path": "src/plugins/telemetry/server/telemetry_collection/get_nodes_usage.ts",
"lineNumber": 24
},
"signature": [
"{ [key: string]: ",
{
"pluginId": "telemetry",
"scope": "server",
"docId": "kibTelemetryPluginApi",
"section": "def-server.NodeUsageAggregation",
"text": "NodeUsageAggregation"
},
"; } | undefined"
]
}
],
"source": {
"path": "src/plugins/telemetry/server/telemetry_collection/get_nodes_usage.ts",
"lineNumber": 17
},
"initialIsOpen": false
},
{
"id": "def-server.NodeUsageAggregation",
"type": "Interface",
"label": "NodeUsageAggregation",
"description": [],
"tags": [],
"children": [
{
"id": "def-server.NodeUsageAggregation.Unnamed",
"type": "Any",
"label": "Unnamed",
"tags": [],
"description": [],
"source": {
"path": "src/plugins/telemetry/server/telemetry_collection/get_nodes_usage.ts",
"lineNumber": 13
},
"signature": [
"any"
]
}
],
"source": {
"path": "src/plugins/telemetry/server/telemetry_collection/get_nodes_usage.ts",
"lineNumber": 12
},
"initialIsOpen": false
}
],
"enums": [],
@ -701,7 +1309,7 @@
"lineNumber": 51
},
"signature": [
"{ timestamp: string; cluster_uuid: string; cluster_name: string; version: string; cluster_stats: any; collection: string; stack_stats: { data: DataTelemetryPayload | undefined; kibana: { count: number; indices: number; os: {}; versions: { version: string; count: number; }[]; plugins: { [plugin: string]: any; }; } | undefined; }; }"
"{ timestamp: string; cluster_uuid: string; cluster_name: string; version: string; cluster_stats: Pick<estypes.ClusterStatsResponse, \"status\" | \"indices\" | \"nodes\" | \"cluster_uuid\" | \"timestamp\">; collection: string; stack_stats: { data: DataTelemetryPayload | undefined; kibana: { count: number; indices: number; os: {}; versions: { version: string; count: number; }[]; plugins: { [plugin: string]: Record<string, unknown>; }; } | undefined; }; }"
],
"initialIsOpen": false
}

View file

@ -19,6 +19,12 @@ import telemetryObj from './telemetry.json';
### Start
<DocDefinitionList data={[telemetryObj.client.start]}/>
### Classes
<DocDefinitionList data={telemetryObj.client.classes}/>
### Interfaces
<DocDefinitionList data={telemetryObj.client.interfaces}/>
## Server
### Setup
@ -30,9 +36,6 @@ import telemetryObj from './telemetry.json';
### Functions
<DocDefinitionList data={telemetryObj.server.functions}/>
### Classes
<DocDefinitionList data={telemetryObj.server.classes}/>
### Interfaces
<DocDefinitionList data={telemetryObj.server.interfaces}/>

View file

@ -65,6 +65,7 @@ Every publicly exposed function, class, interface, type, parameter and property
- Use `@returns` tags for return types.
- Use `@throws` when appropriate.
- Use `@beta` or `@deprecated` when appropriate.
- Use `@removeBy {version}` on `@deprecated` APIs. The version should be the last version the API will work in. For example, `@removeBy 7.15` means the API will be removed in 7.16. This lets us avoid mid-release cycle coordination. The API can be removed as soon as the 7.15 branch is cut.
- Use `@internal` to indicate this API item is intended for internal use only, which will also remove it from the docs.
#### Interfaces vs inlined types

View file

@ -355,7 +355,7 @@ export class SearchEmbeddable
this.updateOutput({ loading: true, error: undefined });
// Make the request, wait for the final result
const resp = await searchSource.fetch$({
const {rawResponse: resp} = await searchSource.fetch$({
sessionId: searchSessionId,
}).toPromise();

View file

@ -73,6 +73,7 @@ The API returns the following:
"refresh": false,
"executionTimeField": null
},
"is_preconfigured": false
"is_preconfigured": false,
"is_missing_secrets": false
}
--------------------------------------------------

View file

@ -50,6 +50,7 @@ The API returns the following:
"refresh": false,
"executionTimeField": null
},
"is_preconfigured": false
"is_preconfigured": false,
"is_missing_secrets": false
}
--------------------------------------------------

View file

@ -56,6 +56,7 @@ The API returns the following:
"executionTimeField": null
},
"is_preconfigured": false,
"is_missing_secrets": false,
"referenced_by_count": 3
}
]

View file

@ -75,6 +75,7 @@ The API returns the following:
"refresh": false,
"executionTimeField": null
},
"isPreconfigured": false
"isPreconfigured": false,
"isMissingSecrets": false
}
--------------------------------------------------

View file

@ -52,6 +52,7 @@ The API returns the following:
"refresh": false,
"executionTimeField": null
},
"isPreconfigured": false
"isPreconfigured": false,
"isMissingSecrets": false
}
--------------------------------------------------

View file

@ -56,7 +56,8 @@ The API returns the following:
"refresh": false,
"executionTimeField": null
},
"isPreconfigured": false
"isPreconfigured": false,
"isMissingSecrets": false
}
]
--------------------------------------------------

View file

@ -70,6 +70,7 @@ The API returns the following:
"refresh": false,
"executionTimeField": null
},
"isPreconfigured": false
"isPreconfigured": false,
"isMissingSecrets": false
}
--------------------------------------------------

View file

@ -68,6 +68,7 @@ The API returns the following:
"refresh": false,
"executionTimeField": null
},
"is_preconfigured": false
"is_preconfigured": false,
"is_missing_secrets": false
}
--------------------------------------------------

View file

@ -6,6 +6,8 @@
Create {kib} rules.
WARNING: This API supports <<token-api-authentication>> only.
[[create-rule-api-request]]
==== Request

View file

@ -6,6 +6,8 @@
Enable a rule.
WARNING: This API supports <<token-api-authentication>> only.
[[enable-rule-api-request]]
==== Request

View file

@ -6,6 +6,8 @@
Update the attributes for an existing rule.
WARNING: This API supports <<token-api-authentication>> only.
[[update-rule-api-request]]
==== Request

View file

@ -10,7 +10,7 @@
<titleabbrev>Users and privileges</titleabbrev>
++++
You can use role-based access control to grant users access to secured
Use role-based access control to grant users access to secured
resources. The roles that you set up depend on your organization's security
requirements and the minimum privileges required to use specific features.
@ -24,6 +24,13 @@ In general, there are three types of privileges you'll work with:
* **Elasticsearch index privileges**: Control access to the data in specific indices your cluster.
* **Kibana space privileges**: Grant users write or read access to features and apps within Kibana.
Select your use-case to get started:
* <<apm-app-reader>>
* <<apm-app-annotation-user-create>>
* <<apm-app-central-config-user>>
* <<apm-app-api-user>>
////
*********************************** ***********************************
////
@ -36,13 +43,25 @@ In general, there are three types of privileges you'll work with:
<titleabbrev>Create an APM reader user</titleabbrev>
++++
[[apm-app-reader-full]]
==== Full APM reader
APM reader users typically need to view the APM app, dashboards, and visualizations that contain APM data.
APM reader users typically need to view the APM app and dashboards and visualizations that use APM data.
These users might also need to create and edit dashboards, visualizations, and machine learning jobs.
. Assign the following built-in roles:
[[apm-app-reader-full]]
==== APM reader
To create an APM reader user:
. Create a new role, named something like `read-apm`, and assign the following privileges:
+
--
include::./tab-widgets/apm-app-reader/widget.asciidoc[]
--
+
TIP: Using the {apm-server-ref-v}/apm-integration.html[APM integration for Elastic Agent]?
Add the privileges under the **Data streams** tab.
. Assign the `read-apm` role created in the previous step, and the following built-in roles to
any APM reader users:
+
[options="header"]
|====
@ -51,9 +70,6 @@ These users might also need to create and edit dashboards, visualizations, and m
|`kibana_admin`
|Grants access to all features in Kibana.
|`apm_user`
|Grants the privileges required for APM users on +{beat_default_index_prefix}*+ indices
|`machine_learning_admin`
|Grants the privileges required to create, update, and view machine learning jobs
|====
@ -63,14 +79,14 @@ These users might also need to create and edit dashboards, visualizations, and m
In some instances, you may wish to restrict certain Kibana apps that a user has access to.
. Assign the following built in roles:
. Create a new role, named something like `read-apm-partial`, and assign the following privileges:
+
[options="header"]
|====
|Role | Purpose
|`apm_user`
|Grants the privileges required for APM users on +{beat_default_index_prefix}*+ indices
|====
--
include::./tab-widgets/apm-app-reader/widget.asciidoc[]
--
+
TIP: Using the {apm-server-ref-v}/apm-integration.html[APM integration for Elastic Agent]?
Add the privileges under the **Data streams** tab.
. Assign space privileges to any Kibana space that the user needs access to.
Here are two examples:
@ -98,6 +114,8 @@ Here are two examples:
|Grants the privileges required to create, update, and view machine learning jobs
|====
include::./tab-widgets/code.asciidoc[]
////
*********************************** ***********************************
////
@ -138,7 +156,7 @@ and assign the following privileges:
^1^ +\{ANNOTATION_INDEX\}+ should be the index name you've defined in
<<apm-settings-kb,`xpack.observability.annotations.index`>>.
. Assign the `annotation_user` created previously, and the built-in roles necessary to create
. Assign the `annotation_user` created previously, and the roles and privileges necessary to create
a <<apm-app-reader-full,full>> or <<apm-app-reader-partial,partial>> APM reader to any users that need to view annotations in the APM app
[[apm-app-annotation-api]]
@ -163,17 +181,17 @@ See <<apm-app-api-user>>.
Central configuration users need to be able to view, create, update, and delete Agent configurations.
. Assign the following built-in roles:
. Create a new role, named something like `central-config-manager`, and assign the following privileges:
+
[options="header"]
|====
|Role | Purpose
--
include::./tab-widgets/central-config-users/widget.asciidoc[]
--
+
TIP: Using the {apm-server-ref-v}/apm-integration.html[APM integration for Elastic Agent]?
Add the privileges under the **Data streams** tab.
|`apm_user`
|Grants the privileges required for APM users on +{beat_default_index_prefix}*+ indices
|====
. Assign the following Kibana space privileges:
. Assign the `central-config-manager` role created in the previous step, and the following Kibana space privileges to
anyone who needs to manage central configurations:
+
[options="header"]
|====
@ -190,16 +208,17 @@ Central configuration users need to be able to view, create, update, and delete
In some instances, you may wish to create a user that can only read central configurations,
but not create, update, or delete them.
. Assign the following built-in roles:
. Create a new role, named something like `central-config-reader`, and assign the following privileges:
+
[options="header"]
|====
|Role | Purpose
|`apm_user`
|Grants the privileges required for APM users on +{beat_default_index_prefix}*+ indices
|====
--
include::./tab-widgets/central-config-users/widget.asciidoc[]
--
+
TIP: Using the {apm-server-ref-v}/apm-integration.html[APM integration for Elastic Agent]?
Add the privileges under the **Data streams** tab.
. Assign the following Kibana space privileges:
. Assign the `central-config-reader` role created in the previous step, and the following Kibana space privileges to
anyone who needs to read central configurations:
+
[options="header"]
|====
@ -215,6 +234,8 @@ but not create, update, or delete them.
See <<apm-app-api-user>>.
include::./tab-widgets/code.asciidoc[]
////
*********************************** ***********************************
////

View file

@ -0,0 +1,45 @@
// tag::classic-indices[]
[options="header"]
|====
|Type |Privilege |Purpose
|Index
|`read` on `apm-*`
|Read-only access to `apm-*` data
|Index
|`view_index_metadata` on `apm-*`
|Read-only access to `apm-*` index metadata
|====
// end::classic-indices[]
// tag::data-streams[]
[options="header"]
|====
|Type |Privilege |Purpose
|Index
|`read` on `logs-apm*`
|Read-only access to `logs-apm*` data
|Index
|`view_index_metadata` on `logs-apm*`
|Read-only access to `logs-apm*` index metadata
|Index
|`read` on `metrics-apm*`
|Read-only access to `metrics-apm*` data
|Index
|`view_index_metadata` on `metrics-apm*`
|Read-only access to `metrics-apm*` index metadata
|Index
|`read` on `traces-apm*`
|Read-only access to `traces-apm*` data
|Index
|`view_index_metadata` on `traces-apm*`
|Read-only access to `traces-apm*` index metadata
|====
// end::data-streams[]

View file

@ -0,0 +1,40 @@
++++
<div class="tabs" data-tab-group="apm-app-reader">
<div role="tablist" aria-label="APM app reader">
<button role="tab"
aria-selected="true"
aria-controls="classic-indices-tab"
id="classic-indices">
Classic APM indices
</button>
<button role="tab"
aria-selected="false"
aria-controls="data-streams-tab"
id="data-streams"
tabindex="-1">
Data streams
</button>
</div>
<div tabindex="0"
role="tabpanel"
id="classic-indices-tab"
aria-labelledby="classic-indices">
++++
include::content.asciidoc[tag=classic-indices]
++++
</div>
<div tabindex="0"
role="tabpanel"
id="data-streams-tab"
aria-labelledby="data-streams"
hidden="">
++++
include::content.asciidoc[tag=data-streams]
++++
</div>
</div>
++++

View file

@ -0,0 +1,53 @@
// tag::classic-indices[]
[options="header"]
|====
|Type |Privilege |Purpose
|Index
|`read` on `apm-*`
|Read-only access to `apm-*` data
|Index
|`view_index_metadata` on `apm-*`
|Read-only access to `apm-*` index metadata
|====
// end::classic-indices[]
// tag::data-streams[]
[options="header"]
|====
|Type |Privilege |Purpose
|Index
|`read` on `apm-agent-configuration`
|Read-only access to `apm-agent-configuration` data
|Index
|`view_index_metadata` on `apm-agent-configuration`
|Read-only access to `apm-agent-configuration` index metadata
|Index
|`read` on `logs-apm*`
|Read-only access to `logs-apm*` data
|Index
|`view_index_metadata` on `logs-apm*`
|Read-only access to `logs-apm*` index metadata
|Index
|`read` on `metrics-apm*`
|Read-only access to `metrics-apm*` data
|Index
|`view_index_metadata` on `metrics-apm*`
|Read-only access to `metrics-apm*` index metadata
|Index
|`read` on `traces-apm*`
|Read-only access to `traces-apm*` data
|Index
|`view_index_metadata` on `traces-apm*`
|Read-only access to `traces-apm*` index metadata
|====
// end::data-streams[]

View file

@ -0,0 +1,40 @@
++++
<div class="tabs" data-tab-group="central-config-manager">
<div role="tablist" aria-label="Central config manager">
<button role="tab"
aria-selected="true"
aria-controls="classic-indices-tab"
id="classic-indices">
Classic APM indices
</button>
<button role="tab"
aria-selected="false"
aria-controls="data-streams-tab"
id="data-streams"
tabindex="-1">
Data streams
</button>
</div>
<div tabindex="0"
role="tabpanel"
id="classic-indices-tab"
aria-labelledby="classic-indices">
++++
include::content.asciidoc[tag=classic-indices]
++++
</div>
<div tabindex="0"
role="tabpanel"
id="data-streams-tab"
aria-labelledby="data-streams"
hidden="">
++++
include::content.asciidoc[tag=data-streams]
++++
</div>
</div>
++++

View file

@ -0,0 +1,166 @@
// Defining styles and script here for simplicity.
++++
<style>
.tabs {
width: 100%;
}
[role="tablist"] {
margin: 0 0 -0.1em;
overflow: visible;
}
[role="tab"] {
position: relative;
padding: 0.3em 0.5em 0.4em;
border: 1px solid hsl(219, 1%, 72%);
border-radius: 0.2em 0.2em 0 0;
overflow: visible;
font-family: inherit;
font-size: inherit;
background: hsl(220, 20%, 94%);
}
[role="tab"]:hover::before,
[role="tab"]:focus::before,
[role="tab"][aria-selected="true"]::before {
position: absolute;
bottom: 100%;
right: -1px;
left: -1px;
border-radius: 0.2em 0.2em 0 0;
border-top: 3px solid hsl(219, 1%, 72%);
content: '';
}
[role="tab"][aria-selected="true"] {
border-radius: 0;
background: hsl(220, 43%, 99%);
outline: 0;
}
[role="tab"][aria-selected="true"]:not(:focus):not(:hover)::before {
border-top: 5px solid hsl(218, 96%, 48%);
}
[role="tab"][aria-selected="true"]::after {
position: absolute;
z-index: 3;
bottom: -1px;
right: 0;
left: 0;
height: 0.3em;
background: hsl(220, 43%, 99%);
box-shadow: none;
content: '';
}
[role="tab"]:hover,
[role="tab"]:focus,
[role="tab"]:active {
outline: 0;
border-radius: 0;
color: inherit;
}
[role="tab"]:hover::before,
[role="tab"]:focus::before {
border-color: hsl(218, 96%, 48%);
}
[role="tabpanel"] {
position: relative;
z-index: 2;
padding: 1em;
border: 1px solid hsl(219, 1%, 72%);
border-radius: 0 0.2em 0.2em 0.2em;
box-shadow: 0 0 0.2em hsl(219, 1%, 72%);
background: hsl(220, 43%, 99%);
margin-bottom: 1em;
}
[role="tabpanel"] p {
margin: 0;
}
[role="tabpanel"] * + p {
margin-top: 1em;
}
</style>
<script>
window.addEventListener("DOMContentLoaded", () => {
const tabs = document.querySelectorAll('[role="tab"]');
const tabList = document.querySelector('[role="tablist"]');
// Add a click event handler to each tab
tabs.forEach(tab => {
tab.addEventListener("click", changeTabs);
});
// Enable arrow navigation between tabs in the tab list
let tabFocus = 0;
tabList.addEventListener("keydown", e => {
// Move right
if (e.keyCode === 39 || e.keyCode === 37) {
tabs[tabFocus].setAttribute("tabindex", -1);
if (e.keyCode === 39) {
tabFocus++;
// If we're at the end, go to the start
if (tabFocus >= tabs.length) {
tabFocus = 0;
}
// Move left
} else if (e.keyCode === 37) {
tabFocus--;
// If we're at the start, move to the end
if (tabFocus < 0) {
tabFocus = tabs.length - 1;
}
}
tabs[tabFocus].setAttribute("tabindex", 0);
tabs[tabFocus].focus();
}
});
});
function setActiveTab(target) {
const parent = target.parentNode;
const grandparent = parent.parentNode;
// console.log(grandparent);
// Remove all current selected tabs
parent
.querySelectorAll('[aria-selected="true"]')
.forEach(t => t.setAttribute("aria-selected", false));
// Set this tab as selected
target.setAttribute("aria-selected", true);
// Hide all tab panels
grandparent
.querySelectorAll('[role="tabpanel"]')
.forEach(p => p.setAttribute("hidden", true));
// Show the selected panel
grandparent.parentNode
.querySelector(`#${target.getAttribute("aria-controls")}`)
.removeAttribute("hidden");
}
function changeTabs(e) {
// get the containing list of the tab that was just clicked
const tabList = e.target.parentNode;
// get all of the sibling tabs
const buttons = Array.apply(null, tabList.querySelectorAll('button'));
// loop over the siblings to discover which index thje clicked one was
const { index } = buttons.reduce(({ found, index }, button) => {
if (!found && buttons[index] === e.target) {
return { found: true, index };
} else if (!found) {
return { found, index: index + 1 };
} else {
return { found, index };
}
}, { found: false, index: 0 });
// get the tab container
const container = tabList.parentNode;
// read the data-tab-group value from the container, e.g. "os"
const { tabGroup } = container.dataset;
// get a list of all the tab groups that match this value on the page
const groups = document.querySelectorAll('[data-tab-group=' + tabGroup + ']');
// for each of the found tab groups, find the tab button at the previously discovered index and select it for each group
groups.forEach((group) => {
const target = group.querySelectorAll('button')[index];
setActiveTab(target);
});
}
</script>
++++

View file

@ -19,7 +19,7 @@ root)
|Functional
|`test/**/config.js` `x-pack/test/**/config.js`
|`node scripts/functional_tests_server --config [directory]/config.js``node scripts/functional_test_runner_ --config [directory]/config.js --grep=regexp`
|`node scripts/functional_tests_server --config [directory]/config.js` `node scripts/functional_test_runner --config [directory]/config.js --grep=regexp`
|===
Test runner arguments: - Where applicable, the optional arguments

View file

@ -63,11 +63,14 @@ yarn kbn watch-bazel
- @elastic/datemath
- @elastic/safer-lodash-set
- @kbn/apm-config-loader
- @kbn/apm-utils
- @kbn/babel-code-parser
- @kbn/babel-preset
- @kbn/config-schema
- @kbn/dev-utils
- @kbn/expect
- @kbn/logging
- @kbn/std
- @kbn/tinymath
- @kbn/utility-types

View file

@ -6,7 +6,7 @@ NOTE:
node scripts/build_plugin_list_docs
You can update the template within packages/kbn-dev-utils/target/plugin_list/generate_plugin_list.js
You can update the template within node_modules/@kbn/dev-utils/target/plugin_list/generate_plugin_list.js
////

View file

@ -1,17 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [IUiSettingsClient](./kibana-plugin-core-public.iuisettingsclient.md) &gt; [getSaved$](./kibana-plugin-core-public.iuisettingsclient.getsaved_.md)
## IUiSettingsClient.getSaved$ property
Returns an Observable that notifies subscribers of each update to the uiSettings, including the key, newValue, and oldValue of the setting that changed.
<b>Signature:</b>
```typescript
getSaved$: <T = any>() => Observable<{
key: string;
newValue: T;
oldValue: T;
}>;
```

View file

@ -19,14 +19,12 @@ export interface IUiSettingsClient
| [get](./kibana-plugin-core-public.iuisettingsclient.get.md) | <code>&lt;T = any&gt;(key: string, defaultOverride?: T) =&gt; T</code> | Gets the value for a specific uiSetting. If this setting has no user-defined value then the <code>defaultOverride</code> parameter is returned (and parsed if setting is of type "json" or "number). If the parameter is not defined and the key is not registered by any plugin then an error is thrown, otherwise reads the default value defined by a plugin. |
| [get$](./kibana-plugin-core-public.iuisettingsclient.get_.md) | <code>&lt;T = any&gt;(key: string, defaultOverride?: T) =&gt; Observable&lt;T&gt;</code> | Gets an observable of the current value for a config key, and all updates to that config key in the future. Providing a <code>defaultOverride</code> argument behaves the same as it does in \#get() |
| [getAll](./kibana-plugin-core-public.iuisettingsclient.getall.md) | <code>() =&gt; Readonly&lt;Record&lt;string, PublicUiSettingsParams &amp; UserProvidedValues&gt;&gt;</code> | Gets the metadata about all uiSettings, including the type, default value, and user value for each key. |
| [getSaved$](./kibana-plugin-core-public.iuisettingsclient.getsaved_.md) | <code>&lt;T = any&gt;() =&gt; Observable&lt;{</code><br/><code> key: string;</code><br/><code> newValue: T;</code><br/><code> oldValue: T;</code><br/><code> }&gt;</code> | Returns an Observable that notifies subscribers of each update to the uiSettings, including the key, newValue, and oldValue of the setting that changed. |
| [getUpdate$](./kibana-plugin-core-public.iuisettingsclient.getupdate_.md) | <code>&lt;T = any&gt;() =&gt; Observable&lt;{</code><br/><code> key: string;</code><br/><code> newValue: T;</code><br/><code> oldValue: T;</code><br/><code> }&gt;</code> | Returns an Observable that notifies subscribers of each update to the uiSettings, including the key, newValue, and oldValue of the setting that changed. |
| [getUpdateErrors$](./kibana-plugin-core-public.iuisettingsclient.getupdateerrors_.md) | <code>() =&gt; Observable&lt;Error&gt;</code> | Returns an Observable that notifies subscribers of each error while trying to update the settings, containing the actual Error class. |
| [isCustom](./kibana-plugin-core-public.iuisettingsclient.iscustom.md) | <code>(key: string) =&gt; boolean</code> | Returns true if the setting wasn't registered by any plugin, but was either added directly via <code>set()</code>, or is an unknown setting found in the uiSettings saved object |
| [isDeclared](./kibana-plugin-core-public.iuisettingsclient.isdeclared.md) | <code>(key: string) =&gt; boolean</code> | Returns true if the key is a "known" uiSetting, meaning it is either registered by any plugin or was previously added as a custom setting via the <code>set()</code> method. |
| [isDefault](./kibana-plugin-core-public.iuisettingsclient.isdefault.md) | <code>(key: string) =&gt; boolean</code> | Returns true if the setting has no user-defined value or is unknown |
| [isOverridden](./kibana-plugin-core-public.iuisettingsclient.isoverridden.md) | <code>(key: string) =&gt; boolean</code> | Shows whether the uiSettings value set by the user. |
| [overrideLocalDefault](./kibana-plugin-core-public.iuisettingsclient.overridelocaldefault.md) | <code>(key: string, newDefault: any) =&gt; void</code> | Overrides the default value for a setting in this specific browser tab. If the page is reloaded the default override is lost. |
| [remove](./kibana-plugin-core-public.iuisettingsclient.remove.md) | <code>(key: string) =&gt; Promise&lt;boolean&gt;</code> | Removes the user-defined value for a setting, causing it to revert to the default. This method behaves the same as calling <code>set(key, null)</code>, including the synchronization, custom setting, and error behavior of that method. |
| [set](./kibana-plugin-core-public.iuisettingsclient.set.md) | <code>(key: string, value: any) =&gt; Promise&lt;boolean&gt;</code> | Sets the value for a uiSetting. If the setting is not registered by any plugin it will be stored as a custom setting. The new value will be synchronously available via the <code>get()</code> method and sent to the server in the background. If the request to the server fails then a updateErrors$ will be notified and the setting will be reverted to its value before <code>set()</code> was called. |

View file

@ -1,13 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [IUiSettingsClient](./kibana-plugin-core-public.iuisettingsclient.md) &gt; [overrideLocalDefault](./kibana-plugin-core-public.iuisettingsclient.overridelocaldefault.md)
## IUiSettingsClient.overrideLocalDefault property
Overrides the default value for a setting in this specific browser tab. If the page is reloaded the default override is lost.
<b>Signature:</b>
```typescript
overrideLocalDefault: (key: string, newDefault: any) => void;
```

View file

@ -7,7 +7,7 @@
<b>Signature:</b>
```typescript
SearchBar: React.ComponentClass<Pick<Pick<SearchBarProps, "query" | "placeholder" | "isLoading" | "iconType" | "indexPatterns" | "filters" | "dataTestSubj" | "isClearable" | "intl" | "refreshInterval" | "nonKqlMode" | "nonKqlModeHelpText" | "screenTitle" | "onRefresh" | "onRefreshChange" | "showQueryInput" | "showDatePicker" | "showAutoRefreshOnly" | "dateRangeFrom" | "dateRangeTo" | "isRefreshPaused" | "customSubmitButton" | "timeHistory" | "indicateNoData" | "onFiltersUpdated" | "savedQuery" | "showSaveQuery" | "onClearSavedQuery" | "showQueryBar" | "showFilterBar" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated">, "query" | "placeholder" | "isLoading" | "iconType" | "indexPatterns" | "filters" | "dataTestSubj" | "isClearable" | "refreshInterval" | "nonKqlMode" | "nonKqlModeHelpText" | "screenTitle" | "onRefresh" | "onRefreshChange" | "showQueryInput" | "showDatePicker" | "showAutoRefreshOnly" | "dateRangeFrom" | "dateRangeTo" | "isRefreshPaused" | "customSubmitButton" | "timeHistory" | "indicateNoData" | "onFiltersUpdated" | "savedQuery" | "showSaveQuery" | "onClearSavedQuery" | "showQueryBar" | "showFilterBar" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated">, any> & {
WrappedComponent: React.ComponentType<Pick<SearchBarProps, "query" | "placeholder" | "isLoading" | "iconType" | "indexPatterns" | "filters" | "dataTestSubj" | "isClearable" | "intl" | "refreshInterval" | "nonKqlMode" | "nonKqlModeHelpText" | "screenTitle" | "onRefresh" | "onRefreshChange" | "showQueryInput" | "showDatePicker" | "showAutoRefreshOnly" | "dateRangeFrom" | "dateRangeTo" | "isRefreshPaused" | "customSubmitButton" | "timeHistory" | "indicateNoData" | "onFiltersUpdated" | "savedQuery" | "showSaveQuery" | "onClearSavedQuery" | "showQueryBar" | "showFilterBar" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated"> & ReactIntl.InjectedIntlProps>;
SearchBar: React.ComponentClass<Pick<Pick<SearchBarProps, "query" | "placeholder" | "isLoading" | "iconType" | "indexPatterns" | "filters" | "dataTestSubj" | "refreshInterval" | "isClearable" | "intl" | "nonKqlMode" | "nonKqlModeHelpText" | "screenTitle" | "onRefresh" | "onRefreshChange" | "showQueryInput" | "showDatePicker" | "showAutoRefreshOnly" | "dateRangeFrom" | "dateRangeTo" | "isRefreshPaused" | "customSubmitButton" | "timeHistory" | "indicateNoData" | "onFiltersUpdated" | "savedQuery" | "showSaveQuery" | "onClearSavedQuery" | "showQueryBar" | "showFilterBar" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated">, "query" | "placeholder" | "isLoading" | "iconType" | "indexPatterns" | "filters" | "dataTestSubj" | "refreshInterval" | "isClearable" | "nonKqlMode" | "nonKqlModeHelpText" | "screenTitle" | "onRefresh" | "onRefreshChange" | "showQueryInput" | "showDatePicker" | "showAutoRefreshOnly" | "dateRangeFrom" | "dateRangeTo" | "isRefreshPaused" | "customSubmitButton" | "timeHistory" | "indicateNoData" | "onFiltersUpdated" | "savedQuery" | "showSaveQuery" | "onClearSavedQuery" | "showQueryBar" | "showFilterBar" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated">, any> & {
WrappedComponent: React.ComponentType<Pick<SearchBarProps, "query" | "placeholder" | "isLoading" | "iconType" | "indexPatterns" | "filters" | "dataTestSubj" | "refreshInterval" | "isClearable" | "intl" | "nonKqlMode" | "nonKqlModeHelpText" | "screenTitle" | "onRefresh" | "onRefreshChange" | "showQueryInput" | "showDatePicker" | "showAutoRefreshOnly" | "dateRangeFrom" | "dateRangeTo" | "isRefreshPaused" | "customSubmitButton" | "timeHistory" | "indicateNoData" | "onFiltersUpdated" | "savedQuery" | "showSaveQuery" | "onClearSavedQuery" | "showQueryBar" | "showFilterBar" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated"> & ReactIntl.InjectedIntlProps>;
}
```

View file

@ -1,22 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [SearchInterceptor](./kibana-plugin-plugins-data-public.searchinterceptor.md) &gt; [getSerializableOptions](./kibana-plugin-plugins-data-public.searchinterceptor.getserializableoptions.md)
## SearchInterceptor.getSerializableOptions() method
<b>Signature:</b>
```typescript
protected getSerializableOptions(options?: ISearchOptions): Pick<ISearchOptions, "strategy" | "sessionId" | "isStored" | "isRestore" | "legacyHitsTotal">;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| options | <code>ISearchOptions</code> | |
<b>Returns:</b>
`Pick<ISearchOptions, "strategy" | "sessionId" | "isStored" | "isRestore" | "legacyHitsTotal">`

View file

@ -1,15 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [SearchInterceptor](./kibana-plugin-plugins-data-public.searchinterceptor.md) &gt; [getTimeoutMode](./kibana-plugin-plugins-data-public.searchinterceptor.gettimeoutmode.md)
## SearchInterceptor.getTimeoutMode() method
<b>Signature:</b>
```typescript
protected getTimeoutMode(): TimeoutErrorMode;
```
<b>Returns:</b>
`TimeoutErrorMode`

View file

@ -1,24 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [SearchInterceptor](./kibana-plugin-plugins-data-public.searchinterceptor.md) &gt; [handleSearchError](./kibana-plugin-plugins-data-public.searchinterceptor.handlesearcherror.md)
## SearchInterceptor.handleSearchError() method
<b>Signature:</b>
```typescript
protected handleSearchError(e: KibanaServerError | AbortError, options?: ISearchOptions, isTimeout?: boolean): Error;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| e | <code>KibanaServerError &#124; AbortError</code> | |
| options | <code>ISearchOptions</code> | |
| isTimeout | <code>boolean</code> | |
<b>Returns:</b>
`Error`

View file

@ -16,19 +16,11 @@ export declare class SearchInterceptor
| --- | --- | --- |
| [(constructor)(deps)](./kibana-plugin-plugins-data-public.searchinterceptor._constructor_.md) | | Constructs a new instance of the <code>SearchInterceptor</code> class |
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [deps](./kibana-plugin-plugins-data-public.searchinterceptor.deps.md) | | <code>SearchInterceptorDeps</code> | |
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [getSerializableOptions(options)](./kibana-plugin-plugins-data-public.searchinterceptor.getserializableoptions.md) | | |
| [getTimeoutMode()](./kibana-plugin-plugins-data-public.searchinterceptor.gettimeoutmode.md) | | |
| [handleSearchError(e, options, isTimeout)](./kibana-plugin-plugins-data-public.searchinterceptor.handlesearcherror.md) | | |
| [search(request, options)](./kibana-plugin-plugins-data-public.searchinterceptor.search.md) | | Searches using the given <code>search</code> method. Overrides the <code>AbortSignal</code> with one that will abort either when the request times out, or when the original <code>AbortSignal</code> is aborted. Updates <code>pendingCount$</code> when the request is started/finalized. |
| [search({ id, ...request }, options)](./kibana-plugin-plugins-data-public.searchinterceptor.search.md) | | Searches using the given <code>search</code> method. Overrides the <code>AbortSignal</code> with one that will abort either when the request times out, or when the original <code>AbortSignal</code> is aborted. Updates <code>pendingCount$</code> when the request is started/finalized. |
| [showError(e)](./kibana-plugin-plugins-data-public.searchinterceptor.showerror.md) | | |
| [stop()](./kibana-plugin-plugins-data-public.searchinterceptor.stop.md) | | |

View file

@ -9,19 +9,19 @@ Searches using the given `search` method. Overrides the `AbortSignal` with one t
<b>Signature:</b>
```typescript
search(request: IKibanaSearchRequest, options?: ISearchOptions): Observable<IKibanaSearchResponse>;
search({ id, ...request }: IKibanaSearchRequest, options?: IAsyncSearchOptions): import("rxjs").Observable<IKibanaSearchResponse<any>>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| request | <code>IKibanaSearchRequest</code> | |
| options | <code>ISearchOptions</code> | |
| { id, ...request } | <code>IKibanaSearchRequest</code> | |
| options | <code>IAsyncSearchOptions</code> | |
<b>Returns:</b>
`Observable<IKibanaSearchResponse>`
`import("rxjs").Observable<IKibanaSearchResponse<any>>`
`Observable` emitting the search response or an error.

View file

@ -1,11 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [SearchInterceptor](./kibana-plugin-plugins-data-public.searchinterceptor.md) &gt; [deps](./kibana-plugin-plugins-data-public.searchinterceptor.deps.md)
[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [SearchInterceptor](./kibana-plugin-plugins-data-public.searchinterceptor.md) &gt; [stop](./kibana-plugin-plugins-data-public.searchinterceptor.stop.md)
## SearchInterceptor.deps property
## SearchInterceptor.stop() method
<b>Signature:</b>
```typescript
protected readonly deps: SearchInterceptorDeps;
stop(): void;
```
<b>Returns:</b>
`void`

View file

@ -9,7 +9,7 @@ Fetch this source from Elasticsearch, returning an observable over the response(
<b>Signature:</b>
```typescript
fetch$(options?: ISearchOptions): Observable<estypes.SearchResponse<any>>;
fetch$(options?: ISearchOptions): Observable<IKibanaSearchResponse<estypes.SearchResponse<any>>>;
```
## Parameters
@ -20,5 +20,5 @@ fetch$(options?: ISearchOptions): Observable<estypes.SearchResponse<any>>;
<b>Returns:</b>
`Observable<estypes.SearchResponse<any>>`
`Observable<IKibanaSearchResponse<estypes.SearchResponse<any>>>`

View file

@ -14,7 +14,6 @@ export declare enum TimeoutErrorMode
| Member | Value | Description |
| --- | --- | --- |
| CHANGE | <code>2</code> | |
| CONTACT | <code>1</code> | |
| UPGRADE | <code>0</code> | |
| CHANGE | <code>1</code> | |
| CONTACT | <code>0</code> | |

View file

@ -40,11 +40,9 @@ To disable EMS, change your <<settings, kibana.yml>> file.
[id=elastic-maps-server]
=== Host Elastic Maps Service locally
beta::[]
If you cannot connect to Elastic Maps Service from the {kib} server or browser clients, and your cluster has the appropriate license level, you can opt to host the service on your own infrastructure.
{hosted-ems} is a self-managed version of Elastic Maps Service offered as a Docker image that provides both the EMS basemaps and EMS boundaries. You must first download and run the image. After connecting it to your {es} cluster for license validation, you're guided to download and configure the basemaps database, which must be retrieved separately.
{hosted-ems} is a self-managed version of Elastic Maps Service offered as a Docker image that provides both the EMS basemaps and EMS boundaries. The image is bundled with basemaps up to zoom level 8. After connecting it to your {es} cluster for license validation, you have the option to download and configure a more detailed basemaps database.
IMPORTANT: {hosted-ems} does not serve raster tiles, needed by Vega, coordinate, and region map visualizations.
@ -69,7 +67,7 @@ docker run --rm --init --publish 8080:8080 \
{ems-docker-image}
----------------------------------
Once {hosted-ems} is running, follow instructions from the webpage at `localhost:8080` to define a configuration file and download the basemaps database.
Once {hosted-ems} is running, follow instructions from the webpage at `localhost:8080` to define a configuration file and optionally download a more detailed basemaps database.
[role="screenshot"]
image::images/elastic-maps-server-instructions.png[Set-up instructions]
@ -92,6 +90,9 @@ endif::[]
| `port`
| Specifies the port used by the backend server. Default: *`8080`*. <<server-port,Equivalent {kib} setting>>.
| `basePath`
| Specify a path at which to mount the server if you are running behind a proxy. This setting cannot end in a slash (`/`). <<server-basePath,Equivalent {kib} setting>>.
| `ui`
| Controls the display of the status page and the layer preview. *Default: `true`*
@ -190,9 +191,13 @@ services:
[[elastic-maps-server-data]]
==== Data
{hosted-ems} hosts vector layer boundaries and vector tile basemaps for the entire planet. Boundaries include world countries, global administrative regions, and specific country regions. A minimal basemap is provided with {hosted-ems}. This can be used for testing environments but won't be functional for normal operations. The full basemap (around 90GB file) needs to be mounted on the Docker container for {hosted-ems} to run normally.
{hosted-ems} hosts vector layer boundaries and vector tile basemaps for the entire planet. Boundaries include world countries, global administrative regions, and specific country regions. Basemaps up to zoom level 8 are bundled in the Docker image. These basemaps are sufficient for maps and dashboards at the country level. To present maps with higher detail, follow the instructions of the front page to download and configure the appropriate basemaps database. The most detailed basemaps at zoom level 14 are good for street level maps, but require ~90GB of disk space.
TIP: The available basemaps and boundaries can be explored from the `/maps` endpoint in a web page that is your self-managed equivalent to https://maps.elastic.co
[role="screenshot"]
image::images/elastic-maps-server-basemaps.png[Basemaps download options]
TIP: The available basemaps and boundaries can be explored from the `/maps` endpoint in a web page that is your self-managed equivalent to https://maps.elastic.co.
[float]

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Before After
Before After

View file

@ -47,6 +47,88 @@ You can configure the following settings in the `kibana.yml` file.
| A list of hostnames that {kib} is allowed to connect to when built-in actions are triggered. It defaults to `[*]`, allowing any host, but keep in mind the potential for SSRF attacks when hosts are not explicitly added to the allowed hosts. An empty list `[]` can be used to block built-in actions from making any external connections. +
+
Note that hosts associated with built-in actions, such as Slack and PagerDuty, are not automatically added to allowed hosts. If you are not using the default `[*]` setting, you must ensure that the corresponding endpoints are added to the allowed hosts as well.
| `xpack.actions.customHostSettings` {ess-icon}
| A list of custom host settings to override existing global settings.
Defaults to an empty list. +
+
Each entry in the list must have a `url` property, to associate a connection
type (mail or https), hostname and port with the remaining options in the
entry.
+
In the following example, two custom host settings
are defined. The first provides a custom host setting for mail server
`mail.example.com` using port 465 that supplies server certificate authorization
data from both a file and inline, and requires TLS for the
connection. The second provides a custom host setting for https server
`webhook.example.com` which turns off server certificate authorization.
|===
[source,yaml]
--
xpack.actions.customHostSettings:
- url: smtp://mail.example.com:465
tls:
certificateAuthoritiesFiles: [ 'one.crt' ]
certificateAuthoritiesData: |
-----BEGIN CERTIFICATE-----
... multiple lines of certificate data here ...
-----END CERTIFICATE-----
smtp:
requireTLS: true
- url: https://webhook.example.com
tls:
rejectUnauthorized: false
--
[cols="2*<"]
|===
| `xpack.actions.customHostSettings[n]`
`.url` {ess-icon}
| A URL associated with this custom host setting. Should be in the form of
`protocol://hostname:port`, where `protocol` is `https` or `smtp`. If the
port is not provided, 443 is used for `https` and 25 is used for
`smtp`. The `smtp` URLs are used for the Email actions that use this
server, and the `https` URLs are used for actions which use `https` to
connect to services. +
+
Entries with `https` URLs can use the `tls` options, and entries with `smtp`
URLs can use both the `tls` and `smtp` options. +
+
No other URL values should be part of this URL, including paths,
query strings, and authentication information. When an http or smtp request
is made as part of executing an action, only the protocol, hostname, and
port of the URL for that request are used to look up these configuration
values.
| `xpack.actions.customHostSettings[n]`
`.smtp.ignoreTLS` {ess-icon}
| A boolean value indicating that TLS must not be used for this connection.
The options `smtp.ignoreTLS` and `smtp.requireTLS` can not both be set to true.
| `xpack.actions.customHostSettings[n]`
`.smtp.requireTLS` {ess-icon}
| A boolean value indicating that TLS must be used for this connection.
The options `smtp.ignoreTLS` and `smtp.requireTLS` can not both be set to true.
| `xpack.actions.customHostSettings[n]`
`.tls.rejectUnauthorized` {ess-icon}
| A boolean value indicating whether to bypass server certificate validation.
Overrides the general `xpack.actions.rejectUnauthorized` configuration
for requests made for this hostname/port.
| `xpack.actions.customHostSettings[n]`
`.tls.certificateAuthoritiesFiles`
| A file name or list of file names of PEM-encoded certificate files to use
to validate the server.
| `xpack.actions.customHostSettings[n]`
`.tls.certificateAuthoritiesData` {ess-icon}
| The contents of a PEM-encoded certificate file, or multiple files appended
into a single string. This configuration can be used for environments where
the files cannot be made available.
| `xpack.actions.enabledActionTypes` {ess-icon}
| A list of action types that are enabled. It defaults to `[*]`, enabling all types. The names for built-in {kib} action types are prefixed with a `.` and include: `.server-log`, `.slack`, `.email`, `.index`, `.pagerduty`, and `.webhook`. An empty list `[]` will disable all action types. +
@ -79,13 +161,18 @@ a|`xpack.actions.`
| `xpack.actions.rejectUnauthorized` {ess-icon}
| Set to `false` to bypass certificate validation for actions. Defaults to `true`. +
+
As an alternative to setting both `xpack.actions.proxyRejectUnauthorizedCertificates` and `xpack.actions.rejectUnauthorized`, you can point the OS level environment variable `NODE_EXTRA_CA_CERTS` to a file that contains the root CAs needed to trust certificates.
As an alternative to setting `xpack.actions.rejectUnauthorized`, you can use the setting
`xpack.actions.customHostSettings` to set TLS options for specific servers.
| `xpack.actions.maxResponseContentLength` {ess-icon}
| Specifies the max number of bytes of the http response for requests to external resources. Defaults to 1000000 (1MB).
| `xpack.actions.responseTimeout` {ess-icon}
| Specifies the time allowed for requests to external resources. Requests that take longer are aborted. The time is formatted as <count>[ms|s|m|h|d|w|M|Y], for example, '20m', '24h', '7d', '1w'. Defaults to 60s.
| Specifies the time allowed for requests to external resources. Requests that take longer are aborted. The time is formatted as: +
+
`<count>[ms,s,m,h,d,w,M,Y]` +
+
For example, `20m`, `24h`, `7d`, `1w`. Defaults to `60s`.
|===

View file

@ -0,0 +1,31 @@
[[url-drilldown-settings-kb]]
=== URL drilldown settings in {kib}
++++
<titleabbrev>URL drilldown settings</titleabbrev>
++++
Configure the URL drilldown settings in your `kibana.yml` configuration file.
[cols="2*<"]
|===
| [[url-drilldown-enabled]] `url_drilldown.enabled`
| When `true`, enables URL drilldowns on your {kib} instance.
| [[external-URL-policy]] `externalUrl.policy`
| Configures the external URL policies. URL drilldowns respect the global *External URL* service, which you can use to deny or allow external URLs.
By default all external URLs are allowed.
|===
For example, to allow external URLs only to the `example.com` domain with the `https` scheme, except for the `danger.example.com` sub-domain,
which is denied even when `https` scheme is used:
["source","yml"]
-----------
externalUrl.policy:
- allow: false
host: danger.example.com
- allow: true
host: example.com
protocol: https
-----------

View file

@ -756,3 +756,4 @@ include::{kib-repo-dir}/settings/security-settings.asciidoc[]
include::{kib-repo-dir}/settings/spaces-settings.asciidoc[]
include::{kib-repo-dir}/settings/task-manager-settings.asciidoc[]
include::{kib-repo-dir}/settings/telemetry-settings.asciidoc[]
include::{kib-repo-dir}/settings/url-drilldown-settings.asciidoc[]

View file

@ -53,3 +53,19 @@ Alerting and action tasks are identified by their type.
When diagnosing issues related to Alerting, focus on the tasks that begin with `alerting:` and `actions:`.
For more details on monitoring and diagnosing task execution in Task Manager, see <<task-manager-health-monitoring>>.
[float]
[[connector-tls-settings]]
=== Connectors have TLS errors when executing actions
*Problem*:
When executing actions, a connector gets a TLS socket error when connecting to
the server.
*Resolution*:
Configuration options are available to specialize connections to TLS servers,
including ignoring server certificate validation, and providing certificate
authority data to verify servers using custom certificates. For more details,
see <<action-settings,Action settings>>.

View file

@ -2,8 +2,8 @@
[[drilldowns]]
== Create custom dashboard actions
Custom dashboard actions, also known as drilldowns, allow you to create
workflows for analyzing and troubleshooting your data. Drilldowns apply only to the panel that you created the drilldown from, and are not shared across all of the panels. Each panel can have multiple drilldowns.
Custom dashboard actions, or _drilldowns_, allow you to create workflows for analyzing and troubleshooting your data.
Drilldowns apply only to the panel that you created the drilldown from, and are not shared across all panels. Each panel can have multiple drilldowns.
Third-party developers can create drilldowns. To learn how to code drilldowns, refer to {kib-repo}blob/{branch}/x-pack/examples/ui_actions_enhanced_examples[this example plugin].
@ -11,27 +11,23 @@ Third-party developers can create drilldowns. To learn how to code drilldowns, r
[[supported-drilldowns]]
=== Supported drilldowns
{kib} supports two types of drilldowns.
[NOTE]
=====================================
Some drilldowns are paid subscription features, while others are free.
For a comparison of the Elastic subscription levels,
refer https://www.elastic.co/subscriptions[the subscription page].
=====================================
{kib} supports dashboard and URL drilldowns.
[float]
[[dashboard-drilldowns]]
==== Dashboard drilldowns
Dashboard drilldowns enable you to open a dashboard from another dashboard,
taking the time range, filters, and other parameters with you,
taking the time range, filters, and other parameters with you
so the context remains the same. Dashboard drilldowns help you to continue your analysis from a new perspective.
For example, if you have a dashboard that shows the overall status of multiple data center,
you can create a drilldown that navigates from the overall status dashboard to a dashboard
that shows a single data center or server.
[role="screenshot"]
image:images/drilldown_on_piechart.gif[Drilldown on pie chart that navigates to another dashboard]
[float]
[[url-drilldowns]]
==== URL drilldowns
@ -39,45 +35,25 @@ that shows a single data center or server.
URL drilldowns enable you to navigate from a dashboard to internal or external URLs.
Destination URLs can be dynamic, depending on the dashboard context or user interaction with a panel.
For example, if you have a dashboard that shows data from a Github repository, you can create a URL drilldown
that opens Github from the dashboard.
that opens Github from the dashboard panel.
[role="screenshot"]
image:images/url_drilldown_go_to_github.gif[Drilldown on pie chart that navigates to Github]
Some panels support multiple interactions, also known as triggers.
The <<url-template-variables,variables>> you use to create a <<url_templating-language, URL template>> depends on the trigger you choose. URL drilldowns support these types of triggers:
* *Single click* &mdash; A single data point in the visualization.
* *Single click* &mdash; A single data point in the panel.
* *Range selection* &mdash; A range of values in a visualization.
* *Range selection* &mdash; A range of values in a panel.
For example, *Single click* has `{{event.value}}` and *Range selection* has `{{event.from}}` and `{{event.to}}`.
To disable URL drilldowns on your {kib} instance, add the following line to `kibana.yml` config file:
["source","yml"]
-----------
url_drilldown.enabled: false
-----------
URL drilldown also respects the global *External URL* service, which can be used to deny/allow external URLs.
By default all external URLs are allowed. To configure external URL policies you need to use `externalUrl.policy` setting in `kibana.yml`, for example:
["source","yml"]
-----------
externalUrl.policy:
- allow: false
host: danger.example.com
- allow: true
host: example.com
protocol: https
-----------
The above rules allow external URLs only to `example.com` domain with `https` scheme, except for `danger.example.com` sub-domain,
which is denied even when `https` scheme is used.
[float]
[[dashboard-drilldown-supported-panels]]
=== Supported panels
=== Supported panel types
The following panels support dashboard and URL drilldowns.
The following panel types support drilldowns.
[options="header"]
|===
@ -138,7 +114,7 @@ The following panels support dashboard and URL drilldowns.
| TSVB
^| X
^|
^| X
| Tag Cloud
^| X
@ -160,25 +136,23 @@ The following panels support dashboard and URL drilldowns.
[float]
[[drilldowns-example]]
=== Try it: Create a dashboard drilldown
=== Create a dashboard drilldown
To create dashboard drilldowns, you create or locate the dashboards you want to connect, then configure the drilldown that allows you to easily open one dashboard from the other dashboard.
image:images/drilldown_on_piechart.gif[Drilldown on pie chart that navigates to another dashboard]
[float]
==== Create the dashboard
. Add the *Sample web logs* data.
. Create a new dashboard, then add the following panels:
. Create a new dashboard, then add the following panels from the *Visualize Library*:
* *[Logs] Heatmap*
* *[Logs] Host, Visits, and Bytes Table*
* *[Logs] Total Requests and Bytes*
* *[Logs] Visitors by OS*
+
If you dont see data for a panel, try changing the <<set-time-filter,time filter>>.
If you dont see the data on a panel, try changing the <<set-time-filter,time filter>>.
. Save the dashboard. In the *Title* field, enter `Host Overview`.
@ -197,79 +171,82 @@ Filter: `geo.src: CN`
. Open the *[Logs] Visitors by OS* panel menu, then select *Create drilldown*.
. Give the drilldown a name, then select *Go to dashboard*.
. Click *Go to dashboard*.
. From the *Choose a destination dashboard* dropdown, select *Host Overview*.
.. Give the drilldown a name. For example, `My Drilldown`.
. To carry over the filter, query, and date range, make sure that *Use filters and query from origin dashboard* and *Use date range from origin dashboard* are selected.
+
[role="screenshot"]
image::images/drilldown_create.png[Create drilldown with entries for drilldown name and destination]
.. From the *Choose a destination dashboard* dropdown, select *Host Overview*.
. Click *Create drilldown*.
+
The drilldown is stored as dashboard metadata.
.. To use the geo.src filter, KQL query, and time filter, select *Use filters and query from origin dashboard* and *Use date range from origin dashboard*.
.. Click *Create drilldown*.
. Save the dashboard.
+
If you fail to save the dashboard, the drilldown is lost when you navigate away from the dashboard.
. In the *[Logs] Visitors by OS* panel, click *win 8*, then select the drilldown.
. In the *[Logs] Visitors by OS* panel, click *win 8*, then select `My Drilldown`.
+
[role="screenshot"]
image::images/drilldown_on_panel.png[Drilldown on pie chart that navigates to another dashboard]
. On the *Host Overview* dashboard, verify that the search query, filters,
and date range are carried over.
. On the *Host Overview* dashboard, verify that the geo.src filter, KQL query, and time filter are applied.
[float]
[[create-a-url-drilldown]]
=== Try it: Create a URL drilldown
=== Create a URL drilldown
To create URL drilldowns, you add <<variables,variables>> to a URL template, which configures the behavior of the drilldown.
image:images/url_drilldown_go_to_github.gif[Drilldown on pie chart that navigates to Github]
. Add the *Sample web logs* data.
. Open the *[Logs] Web traffic* dashboard. This isnt data from Github, but works for demonstration purposes.
. Open the *[Logs] Web traffic* dashboard.
. In the toolbar, click *Edit*.
. Open the *[Logs] Visitors by OS* panel menu, then select *Create drilldown*.
.. In the *Name* field, enter `Show on Github`.
. Click *Go to URL*.
.. Select *Go to URL*.
.. Give the drilldown a name. For example, `Show on Github`.
.. Enter the URL template:
.. For the *Trigger*, select *Single click*.
.. To navigate to the {kib} repository Github issues, enter the following in the *Enter URL* field:
+
[source, bash]
----
https://github.com/elastic/kibana/issues?q=is:issue+is:open+{{event.value}}
----
+
The example URL navigates to {kib} issues on Github. `{{event.value}}` is substituted with a value associated with a selected pie slice.
+
[role="screenshot"]
image:images/url_drilldown_url_template.png[URL template input]
`{{event.value}}` is substituted with a value associated with a selected pie slice.
.. Click *Create drilldown*.
+
The drilldown is stored as dashboard metadata.
. Save the dashboard.
+
If you fail to save the dashboard, the drilldown is lost when you navigate away from the dashboard.
. On the *[Logs] Visitors by OS* panel, click any chart slice, then select *Show on Github*.
+
[role="screenshot"]
image:images/url_drilldown_popup.png[URL drilldown popup]
. On the page that lists the issues in the {kib} repository, verify the slice value appears in Github.
. In the list of {kib} repository issues, verify that the slice value appears.
+
[role="screenshot"]
image:images/url_drilldown_github.png[Github]
[float]
[[manage-drilldowns]]
=== Manage drilldowns
Make changes to your drilldowns, make a copy of your drilldowns for another panel, and delete drilldowns.
. Open the panel menu that includes the drilldown, then click *Manage drilldowns*.
. On the *Manage* tab, use the following options:
* To change drilldowns, click *Edit* next to the drilldown you want to change, make your changes, then click *Save*.
* To make a copy, click *Copy* next to the drilldown you want to change, enter the drilldown name, then click *Create drilldown*.
* To delete a drilldown, select the drilldown you want to delete, then click *Delete*.
include::url-drilldown.asciidoc[]

View file

@ -233,7 +233,7 @@ export const SearchExamplesApp = ({
}
setRequest(searchSource.getSearchRequestBody());
const res = await searchSource.fetch$().toPromise();
const { rawResponse: res } = await searchSource.fetch$().toPromise();
setResponse(res);
const message = <EuiText>Searched {res.hits.total} documents.</EuiText>;

View file

@ -123,7 +123,7 @@
"@hapi/wreck": "^17.1.0",
"@kbn/ace": "link:packages/kbn-ace",
"@kbn/analytics": "link:packages/kbn-analytics",
"@kbn/apm-config-loader": "link:packages/kbn-apm-config-loader",
"@kbn/apm-config-loader": "link:bazel-bin/packages/kbn-apm-config-loader/npm_module",
"@kbn/apm-utils": "link:bazel-bin/packages/kbn-apm-utils/npm_module",
"@kbn/config": "link:packages/kbn-config",
"@kbn/config-schema": "link:bazel-bin/packages/kbn-config-schema/npm_module",
@ -132,7 +132,7 @@
"@kbn/interpreter": "link:packages/kbn-interpreter",
"@kbn/io-ts-utils": "link:packages/kbn-io-ts-utils",
"@kbn/legacy-logging": "link:packages/kbn-legacy-logging",
"@kbn/logging": "link:packages/kbn-logging",
"@kbn/logging": "link:bazel-bin/packages/kbn-logging/npm_module",
"@kbn/monaco": "link:packages/kbn-monaco",
"@kbn/server-http-tools": "link:packages/kbn-server-http-tools",
"@kbn/server-route-repository": "link:packages/kbn-server-route-repository",
@ -208,7 +208,7 @@
"deep-freeze-strict": "^1.1.1",
"deepmerge": "^4.2.2",
"del": "^5.1.0",
"elastic-apm-node": "^3.10.0",
"elastic-apm-node": "^3.14.0",
"elasticsearch": "^16.7.0",
"execa": "^4.0.2",
"exit-hook": "^2.2.0",
@ -369,7 +369,7 @@
"semver": "^7.3.2",
"set-value": "^3.0.2",
"source-map-support": "^0.5.19",
"squel": "^5.13.0",
"safe-squel": "^5.12.5",
"stats-lite": "^2.2.0",
"strip-ansi": "^6.0.0",
"style-it": "^2.1.3",
@ -380,7 +380,7 @@
"tar": "4.4.13",
"tinycolor2": "1.4.1",
"tinygradient": "0.4.3",
"topojson-client": "3.0.0",
"topojson-client": "3.1.0",
"tree-kill": "^1.2.2",
"ts-easing": "^0.2.0",
"tslib": "^2.0.0",
@ -440,7 +440,7 @@
"@kbn/babel-code-parser": "link:bazel-bin/packages/kbn-babel-code-parser/npm_module",
"@kbn/babel-preset": "link:bazel-bin/packages/kbn-babel-preset/npm_module",
"@kbn/cli-dev-mode": "link:packages/kbn-cli-dev-mode",
"@kbn/dev-utils": "link:packages/kbn-dev-utils",
"@kbn/dev-utils": "link:bazel-bin/packages/kbn-dev-utils/npm_module",
"@kbn/docs-utils": "link:packages/kbn-docs-utils",
"@kbn/es": "link:packages/kbn-es",
"@kbn/es-archiver": "link:packages/kbn-es-archiver",
@ -658,7 +658,7 @@
"callsites": "^3.1.0",
"chai": "3.5.0",
"chance": "1.0.18",
"chromedriver": "^89.0.0",
"chromedriver": "^90.0.0",
"clean-webpack-plugin": "^3.0.0",
"cmd-shim": "^2.1.0",
"compression-webpack-plugin": "^4.0.0",
@ -757,7 +757,7 @@
"mochawesome-merge": "^4.2.0",
"mock-fs": "^4.12.0",
"mock-http-server": "1.3.0",
"ms-chromium-edge-driver": "^0.2.3",
"ms-chromium-edge-driver": "^0.4.2",
"multimatch": "^4.0.0",
"mutation-observer": "^1.0.3",
"ncp": "^2.0.0",

View file

@ -5,11 +5,14 @@ filegroup(
srcs = [
"//packages/elastic-datemath:build",
"//packages/elastic-safer-lodash-set:build",
"//packages/kbn-apm-config-loader:build",
"//packages/kbn-apm-utils:build",
"//packages/kbn-babel-code-parser:build",
"//packages/kbn-babel-preset:build",
"//packages/kbn-config-schema:build",
"//packages/kbn-dev-utils:build",
"//packages/kbn-expect:build",
"//packages/kbn-logging:build",
"//packages/kbn-std:build",
"//packages/kbn-tinymath:build",
"//packages/kbn-utility-types:build",

View file

@ -16,8 +16,5 @@
"bugs": {
"url": "https://github.com/elastic/kibana/tree/master/packages/elastic-eslint-config-kibana"
},
"homepage": "https://github.com/elastic/kibana/tree/master/packages/elastic-eslint-config-kibana",
"dependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils"
}
"homepage": "https://github.com/elastic/kibana/tree/master/packages/elastic-eslint-config-kibana"
}

View file

@ -8,8 +8,5 @@
"scripts": {
"build": "node ./scripts/build.js",
"kbn:bootstrap": "yarn build --dev"
},
"devDependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils"
}
}

View file

@ -12,8 +12,5 @@
"build": "node scripts/build",
"kbn:bootstrap": "node scripts/build --source-maps",
"kbn:watch": "node scripts/build --source-maps --watch"
},
"devDependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils"
}
}

View file

@ -68,7 +68,7 @@ export class Reporter {
}
};
private log(message: any) {
private log(message: unknown) {
if (this.debug) {
// eslint-disable-next-line
console.debug(message);

View file

@ -8,10 +8,10 @@
import { Report } from './report';
export interface Storage<T = any, S = void> {
get: (key: string) => T | null;
export interface Storage<T = Report, S = void> {
get: (key: string) => T | undefined;
set: (key: string, value: T) => S;
remove: (key: string) => T | null;
remove: (key: string) => T | undefined;
clear: () => void;
}

View file

@ -6,7 +6,7 @@
* Side Public License, v 1.
*/
export function wrapArray<T extends any>(subj: T | T[]): T[] {
export function wrapArray<T>(subj: T | T[]): T[] {
return Array.isArray(subj) ? subj : [subj];
}

View file

@ -0,0 +1,87 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
PKG_BASE_NAME = "kbn-apm-config-loader"
PKG_REQUIRE_NAME = "@kbn/apm-config-loader"
SOURCE_FILES = glob(
[
"src/**/*.ts",
],
exclude = [
"**/*.test.*"
],
)
SRCS = SOURCE_FILES
filegroup(
name = "srcs",
srcs = SRCS,
)
NPM_MODULE_EXTRA_FILES = [
"package.json",
"README.md"
]
SRC_DEPS = [
"//packages/elastic-safer-lodash-set",
"//packages/kbn-utils",
"@npm//js-yaml",
"@npm//lodash",
]
TYPES_DEPS = [
"@npm//@types/jest",
"@npm//@types/js-yaml",
"@npm//@types/lodash",
"@npm//@types/node",
]
DEPS = SRC_DEPS + TYPES_DEPS
ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
],
)
ts_project(
name = "tsc",
args = ['--pretty'],
srcs = SRCS,
deps = DEPS,
declaration = True,
declaration_map = True,
incremental = True,
out_dir = "target",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig",
)
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = [":tsc"] + DEPS,
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
pkg_npm(
name = "npm_module",
deps = [
":%s" % PKG_BASE_NAME,
]
)
filegroup(
name = "build",
srcs = [
":npm_module",
],
visibility = ["//visibility:public"],
)

View file

@ -4,10 +4,5 @@
"types": "./target/index.d.ts",
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0",
"private": true,
"scripts": {
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build",
"kbn:watch": "yarn build --watch"
}
"private": true
}

View file

@ -1,11 +1,12 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"incremental": true,
"outDir": "./target",
"stripInternal": false,
"declaration": true,
"declarationMap": true,
"rootDir": "./src",
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-apm-config-loader/src",
"types": [

View file

@ -15,9 +15,7 @@
},
"dependencies": {
"@kbn/config": "link:../kbn-config",
"@kbn/logging": "link:../kbn-logging",
"@kbn/server-http-tools": "link:../kbn-server-http-tools",
"@kbn/optimizer": "link:../kbn-optimizer",
"@kbn/dev-utils": "link:../kbn-dev-utils"
"@kbn/optimizer": "link:../kbn-optimizer"
}
}

View file

@ -42,21 +42,25 @@ it('produces the right watch and ignore list', () => {
/\\\\\\.\\(md\\|sh\\|txt\\)\\$/,
/debug\\\\\\.log\\$/,
<absolute path>/src/plugins/*/test/**,
<absolute path>/src/plugins/*/integration_tests/**,
<absolute path>/src/plugins/*/build/**,
<absolute path>/src/plugins/*/target/**,
<absolute path>/src/plugins/*/scripts/**,
<absolute path>/src/plugins/*/docs/**,
<absolute path>/test/plugin_functional/plugins/*/test/**,
<absolute path>/test/plugin_functional/plugins/*/integration_tests/**,
<absolute path>/test/plugin_functional/plugins/*/build/**,
<absolute path>/test/plugin_functional/plugins/*/target/**,
<absolute path>/test/plugin_functional/plugins/*/scripts/**,
<absolute path>/test/plugin_functional/plugins/*/docs/**,
<absolute path>/x-pack/plugins/*/test/**,
<absolute path>/x-pack/plugins/*/integration_tests/**,
<absolute path>/x-pack/plugins/*/build/**,
<absolute path>/x-pack/plugins/*/target/**,
<absolute path>/x-pack/plugins/*/scripts/**,
<absolute path>/x-pack/plugins/*/docs/**,
<absolute path>/x-pack/test/plugin_functional/plugins/resolver_test/test/**,
<absolute path>/x-pack/test/plugin_functional/plugins/resolver_test/integration_tests/**,
<absolute path>/x-pack/test/plugin_functional/plugins/resolver_test/build/**,
<absolute path>/x-pack/test/plugin_functional/plugins/resolver_test/target/**,
<absolute path>/x-pack/test/plugin_functional/plugins/resolver_test/scripts/**,

View file

@ -28,6 +28,7 @@ export function getServerWatchPaths({ pluginPaths, pluginScanDirs }: Options) {
(acc: string[], path) => [
...acc,
Path.resolve(path, 'test/**'),
Path.resolve(path, 'integration_tests/**'),
Path.resolve(path, 'build/**'),
Path.resolve(path, 'target/**'),
Path.resolve(path, 'scripts/**'),

View file

@ -8,12 +8,5 @@
"scripts": {
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build"
},
"dependencies": {
"@kbn/logging": "link:../kbn-logging"
},
"devDependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils",
"@kbn/utility-types": "link:../kbn-utility-types"
}
}

View file

@ -9,9 +9,5 @@
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build",
"kbn:watch": "yarn build --watch"
},
"dependencies": {},
"devDependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils"
}
}

View file

@ -0,0 +1,128 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
PKG_BASE_NAME = "kbn-dev-utils"
PKG_REQUIRE_NAME = "@kbn/dev-utils"
SOURCE_FILES = glob(
[
"src/**/*.ts",
],
exclude = [
"**/*.test.*"
],
)
SRCS = SOURCE_FILES
filegroup(
name = "srcs",
srcs = SRCS,
)
filegroup(
name = "certs",
srcs = glob(
[
"certs/**/*",
],
exclude = [
"**/README.md"
],
),
)
NPM_MODULE_EXTRA_FILES = [
"package.json",
"README.md",
":certs",
"ci_stats_reporter/package.json",
"stdio/package.json",
"tooling_log/package.json"
]
SRC_DEPS = [
"//packages/kbn-expect",
"//packages/kbn-utils",
"@npm//@babel/core",
"@npm//axios",
"@npm//chalk",
"@npm//chance",
"@npm//cheerio",
"@npm//dedent",
"@npm//execa",
"@npm//exit-hook",
"@npm//getopts",
"@npm//globby",
"@npm//jest-styled-components",
"@npm//load-json-file",
"@npm//markdown-it",
"@npm//moment",
"@npm//normalize-path",
"@npm//rxjs",
"@npm//tree-kill",
"@npm//tslib",
"@npm//typescript",
"@npm//vinyl"
]
TYPES_DEPS = [
"@npm//@types/babel__core",
"@npm//@types/cheerio",
"@npm//@types/dedent",
"@npm//@types/flot",
"@npm//@types/jest",
"@npm//@types/markdown-it",
"@npm//@types/node",
"@npm//@types/normalize-path",
"@npm//@types/react",
"@npm//@types/testing-library__jest-dom",
"@npm//@types/vinyl"
]
DEPS = SRC_DEPS + TYPES_DEPS
ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
],
)
ts_project(
name = "tsc",
args = ['--pretty'],
srcs = SRCS,
deps = DEPS,
declaration = True,
declaration_map = True,
incremental = True,
out_dir = "target",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig",
)
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = [":tsc"] + DEPS,
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
pkg_npm(
name = "npm_module",
deps = [
":%s" % PKG_BASE_NAME,
]
)
filegroup(
name = "build",
srcs = [
":npm_module",
],
visibility = ["//visibility:public"],
)

View file

@ -5,15 +5,7 @@
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js",
"types": "./target/index.d.ts",
"scripts": {
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build",
"kbn:watch": "yarn build --watch"
},
"kibana": {
"devOnly": true
},
"devDependencies": {
"@kbn/expect": "link:../kbn-expect"
}
}

View file

@ -6,7 +6,6 @@
* Side Public License, v 1.
*/
import Fs from 'fs';
import Path from 'path';
import normalizePath from 'normalize-path';
@ -49,7 +48,7 @@ NOTE:
node scripts/build_plugin_list_docs
You can update the template within ${normalizePath(
Path.relative(REPO_ROOT, Fs.realpathSync(Path.resolve(__dirname, __filename)))
Path.relative(REPO_ROOT, Path.resolve(__dirname, __filename))
)}
////

View file

@ -1,12 +1,13 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"incremental": true,
"outDir": "target",
"stripInternal": false,
"target": "ES2019",
"declaration": true,
"declarationMap": true,
"rootDir": "src",
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-dev-utils/src",
"types": [

View file

@ -13,7 +13,6 @@
"kbn:watch": "../../node_modules/.bin/tsc --watch"
},
"dependencies": {
"@kbn/config": "link:../kbn-config",
"@kbn/dev-utils": "link:../kbn-dev-utils"
"@kbn/config": "link:../kbn-config"
}
}

View file

@ -13,7 +13,6 @@
"kbn:watch": "rm -rf target && ../../node_modules/.bin/tsc --watch"
},
"dependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils",
"@kbn/test": "link:../kbn-test"
}
}

View file

@ -11,8 +11,5 @@
"build": "node scripts/build",
"kbn:bootstrap": "node scripts/build",
"kbn:watch": "node scripts/build --watch"
},
"dependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils"
}
}

View file

@ -246,7 +246,10 @@ exports.Cluster = class Cluster {
this._log.info(chalk.bold('Starting'));
this._log.indent(4);
const esArgs = ['action.destructive_requires_name=true'].concat(options.esArgs || []);
const esArgs = [
'action.destructive_requires_name=true',
'ingest.geoip.downloader.enabled=false',
].concat(options.esArgs || []);
// Add to esArgs if ssl is enabled
if (this._ssl) {
@ -272,7 +275,7 @@ exports.Cluster = class Cluster {
// especially because we currently run many instances of ES on the same machine during CI
options.esEnvVars.ES_JAVA_OPTS =
(options.esEnvVars.ES_JAVA_OPTS ? `${options.esEnvVars.ES_JAVA_OPTS} ` : '') +
'-Xms2g -Xmx2g';
'-Xms1g -Xmx1g';
this._process = execa(ES_BIN, args, {
cwd: installPath,

View file

@ -266,6 +266,7 @@ describe('#start(installPath)', () => {
Array [
Array [
"action.destructive_requires_name=true",
"ingest.geoip.downloader.enabled=false",
],
undefined,
Object {
@ -344,6 +345,7 @@ describe('#run()', () => {
Array [
Array [
"action.destructive_requires_name=true",
"ingest.geoip.downloader.enabled=false",
],
undefined,
Object {

View file

@ -10,8 +10,5 @@
"build": "node scripts/build",
"kbn:bootstrap": "node scripts/build --source-maps",
"kbn:watch": "node scripts/build --watch --source-maps"
},
"devDependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils"
}
}

View file

@ -11,8 +11,5 @@
},
"dependencies": {
"@kbn/i18n": "link:../kbn-i18n"
},
"devDependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils"
}
}

View file

@ -0,0 +1,82 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
PKG_BASE_NAME = "kbn-logging"
PKG_REQUIRE_NAME = "@kbn/logging"
SOURCE_FILES = glob(
[
"src/**/*.ts",
],
exclude = [
"**/*.test.*"
],
)
SRCS = SOURCE_FILES
filegroup(
name = "srcs",
srcs = SRCS,
)
NPM_MODULE_EXTRA_FILES = [
"package.json",
"README.md"
]
SRC_DEPS = [
"//packages/kbn-std"
]
TYPES_DEPS = [
"@npm//@types/jest",
"@npm//@types/node",
]
DEPS = SRC_DEPS + TYPES_DEPS
ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
],
)
ts_project(
name = "tsc",
args = ['--pretty'],
srcs = SRCS,
deps = DEPS,
declaration = True,
declaration_map = True,
incremental = True,
out_dir = "target",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig",
)
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = [":tsc"] + DEPS,
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
pkg_npm(
name = "npm_module",
deps = [
":%s" % PKG_BASE_NAME,
]
)
filegroup(
name = "build",
srcs = [
":npm_module",
],
visibility = ["//visibility:public"],
)

View file

@ -4,10 +4,5 @@
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js",
"types": "./target/index.d.ts",
"scripts": {
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build",
"kbn:watch": "yarn build --watch"
}
"types": "./target/index.d.ts"
}

View file

@ -1,11 +1,12 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"incremental": true,
"outDir": "target",
"stripInternal": false,
"declaration": true,
"declarationMap": true,
"rootDir": "src",
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-logging/src",
"types": [

View file

@ -10,9 +10,6 @@
"kbn:bootstrap": "yarn build --dev",
"build:antlr4ts": "../../node_modules/antlr4ts-cli/antlr4ts ./src/painless/antlr/painless_lexer.g4 ./src/painless/antlr/painless_parser.g4 && node ./scripts/fix_generated_antlr.js"
},
"devDependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils"
},
"dependencies": {
"@kbn/i18n": "link:../kbn-i18n"
}

View file

@ -92,7 +92,7 @@ pageLoadAssetSize:
visTypeTable: 94934
visTypeTagcloud: 37575
visTypeTimelion: 68883
visTypeTimeseries: 155203
visTypeTimeseries: 55203
visTypeVega: 153573
visTypeVislib: 242838
visTypeXy: 113478

View file

@ -12,7 +12,6 @@
},
"dependencies": {
"@kbn/config": "link:../kbn-config",
"@kbn/dev-utils": "link:../kbn-dev-utils",
"@kbn/ui-shared-deps": "link:../kbn-ui-shared-deps"
}
}

View file

@ -8,8 +8,5 @@
"scripts": {
"kbn:bootstrap": "node scripts/build",
"kbn:watch": "node scripts/build --watch"
},
"dependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils"
}
}

View file

@ -17,7 +17,6 @@
"kbn:watch": "../../node_modules/.bin/tsc --watch"
},
"dependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils",
"@kbn/optimizer": "link:../kbn-optimizer"
}
}

View file

@ -11,8 +11,5 @@
"build": "../../node_modules/.bin/webpack",
"kbn:watch": "../../node_modules/.bin/webpack --watch",
"prettier": "../../node_modules/.bin/prettier --write './src/**/*.ts'"
},
"devDependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils"
}
}

View file

@ -12,8 +12,5 @@
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build",
"watch": "yarn build --watch"
},
"devDependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils"
}
}

View file

@ -12,9 +12,5 @@
"build": "../../node_modules/.bin/babel src --out-dir target --delete-dir-on-start --extensions .ts --source-maps=inline",
"kbn:bootstrap": "yarn build",
"kbn:watch": "yarn build --watch"
},
"devDependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils",
"@kbn/utility-types": "link:../kbn-utility-types"
}
}

View file

@ -17,9 +17,5 @@
"@kbn/es": "link:../kbn-es",
"@kbn/i18n": "link:../kbn-i18n",
"@kbn/optimizer": "link:../kbn-optimizer"
},
"devDependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils",
"@kbn/expect": "link:../kbn-expect"
}
}

View file

@ -43,7 +43,7 @@ Literal "literal"
// Quoted variables are interpreted as strings
// but unquoted variables are more restrictive
Variable
= _ Quote chars:(ValidChar / Space)* Quote _ {
= _ [\'] chars:(ValidChar / Space / [\"])* [\'] _ {
return {
type: 'variable',
value: chars.join(''),
@ -51,6 +51,14 @@ Variable
text: text()
};
}
/ _ [\"] chars:(ValidChar / Space / [\'])* [\"] _ {
return {
type: 'variable',
value: chars.join(''),
location: simpleLocation(location()),
text: text()
};
}
/ _ rest:ValidChar+ _ {
return {
type: 'variable',
@ -103,10 +111,9 @@ Argument_List "arguments"
}
String
= [\"] value:(ValidChar)+ [\"] { return value.join(''); }
/ [\'] value:(ValidChar)+ [\'] { return value.join(''); }
/ value:(ValidChar)+ { return value.join(''); }
= '"' chars:("\\\"" { return "\""; } / [^"])* '"' { return chars.join(''); }
/ "'" chars:("\\\'" { return "\'"; } / [^'])* "'" { return chars.join(''); }
/ chars:(ValidChar)+ { return chars.join(''); }
Argument
= name:[a-zA-Z_]+ _ '=' _ value:(Number / String) _ {

View file

@ -73,6 +73,7 @@ describe('Parser', () => {
expect(parse('"foo bar"')).toEqual(variableEqual('foo bar'));
expect(parse('"foo bar fizz buzz"')).toEqual(variableEqual('foo bar fizz buzz'));
expect(parse('"foo bar baby"')).toEqual(variableEqual('foo bar baby'));
expect(parse(`"f'oo"`)).toEqual(variableEqual(`f'oo`));
});
it('strings with single quotes', () => {
@ -88,6 +89,7 @@ describe('Parser', () => {
expect(parse("' foo bar'")).toEqual(variableEqual(" foo bar"));
expect(parse("'foo bar '")).toEqual(variableEqual("foo bar "));
expect(parse("'0foo'")).toEqual(variableEqual("0foo"));
expect(parse(`'f"oo'`)).toEqual(variableEqual(`f"oo`));
/* eslint-enable prettier/prettier */
});
@ -138,10 +140,18 @@ describe('Parser', () => {
);
});
it('named argument is empty string', () => {
expect(parse('foo(q="")')).toEqual(functionEqual('foo', [namedArgumentEqual('q', '')]));
expect(parse(`foo(q='')`)).toEqual(functionEqual('foo', [namedArgumentEqual('q', '')]));
});
it('named and positional', () => {
expect(parse('foo(ref, q="bar")')).toEqual(
functionEqual('foo', [variableEqual('ref'), namedArgumentEqual('q', 'bar')])
);
expect(parse(`foo(ref, q='ba"r')`)).toEqual(
functionEqual('foo', [variableEqual('ref'), namedArgumentEqual('q', `ba"r`)])
);
});
it('numerically named', () => {
@ -182,6 +192,21 @@ describe('Parser', () => {
it('invalid named', () => {
expect(() => parse('foo(offset-type="1d")')).toThrow('but "(" found');
});
it('named with complex strings', () => {
expect(parse(`foo(filter='😀 > "\ttab"')`)).toEqual(
functionEqual('foo', [namedArgumentEqual('filter', `😀 > "\ttab"`)])
);
});
it('named with escape characters', () => {
expect(parse(`foo(filter='Women\\'s Clothing')`)).toEqual(
functionEqual('foo', [namedArgumentEqual('filter', `Women's Clothing`)])
);
expect(parse(`foo(filter="\\"Quoted inner string\\"")`)).toEqual(
functionEqual('foo', [namedArgumentEqual('filter', `"Quoted inner string"`)])
);
});
});
it('Missing expression', () => {

View file

@ -12,8 +12,5 @@
"@kbn/analytics": "link:../kbn-analytics",
"@kbn/i18n": "link:../kbn-i18n",
"@kbn/monaco": "link:../kbn-monaco"
},
"devDependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils"
}
}

View file

@ -18,7 +18,8 @@ interface LogEntry {
type: string;
}
describe('cli invalid config support', function () {
// FLAKY: https://github.com/elastic/kibana/issues/32240
describe.skip('cli invalid config support', function () {
it(
'exits with statusCode 64 and logs a single line when config is invalid',
function () {

View file

@ -911,11 +911,6 @@ export interface IUiSettingsClient {
get$: <T = any>(key: string, defaultOverride?: T) => Observable<T>;
get: <T = any>(key: string, defaultOverride?: T) => T;
getAll: () => Readonly<Record<string, PublicUiSettingsParams_2 & UserProvidedValues_2>>;
getSaved$: <T = any>() => Observable<{
key: string;
newValue: T;
oldValue: T;
}>;
getUpdate$: <T = any>() => Observable<{
key: string;
newValue: T;
@ -926,7 +921,6 @@ export interface IUiSettingsClient {
isDeclared: (key: string) => boolean;
isDefault: (key: string) => boolean;
isOverridden: (key: string) => boolean;
overrideLocalDefault: (key: string, newDefault: any) => void;
remove: (key: string) => Promise<boolean>;
set: (key: string, value: any) => Promise<boolean>;
}

View file

@ -44,81 +44,6 @@ Array [
]
`;
exports[`#overrideLocalDefault key has no user value calls subscriber with new and previous value: single subscriber call 1`] = `
Array [
Array [
Object {
"key": "dateFormat",
"newValue": "bar",
"oldValue": "Browser",
},
],
]
`;
exports[`#overrideLocalDefault key has no user value synchronously modifies the default value returned by get(): get after override 1`] = `"bar"`;
exports[`#overrideLocalDefault key has no user value synchronously modifies the default value returned by get(): get before override 1`] = `"Browser"`;
exports[`#overrideLocalDefault key has no user value synchronously modifies the value returned by getAll(): getAll after override 1`] = `
Object {
"dateFormat": Object {
"value": "bar",
},
}
`;
exports[`#overrideLocalDefault key has no user value synchronously modifies the value returned by getAll(): getAll before override 1`] = `
Object {
"dateFormat": Object {
"value": "Browser",
},
}
`;
exports[`#overrideLocalDefault key with user value does not modify the return value of get: get after override 1`] = `"foo"`;
exports[`#overrideLocalDefault key with user value does not modify the return value of get: get before override 1`] = `"foo"`;
exports[`#overrideLocalDefault key with user value is included in the return value of getAll: getAll after override 1`] = `
Object {
"dateFormat": Object {
"userValue": "foo",
"value": "bar",
},
}
`;
exports[`#overrideLocalDefault key with user value is included in the return value of getAll: getAll before override 1`] = `
Object {
"dateFormat": Object {
"userValue": "foo",
"value": "Browser",
},
}
`;
exports[`#overrideLocalDefault key with user value returns default override when setting removed: get after override 1`] = `"bar"`;
exports[`#overrideLocalDefault key with user value returns default override when setting removed: get before override 1`] = `"foo"`;
exports[`#overrideLocalDefault key with user value returns default override when setting removed: getAll after override 1`] = `
Object {
"dateFormat": Object {
"value": "bar",
},
}
`;
exports[`#overrideLocalDefault key with user value returns default override when setting removed: getAll before override 1`] = `
Object {
"dateFormat": Object {
"userValue": "foo",
"value": "bar",
},
}
`;
exports[`#remove throws an error if key is overridden 1`] = `"Unable to update \\"bar\\" because its value is overridden by the Kibana server"`;
exports[`#set throws an error if key is overridden 1`] = `"Unable to update \\"foo\\" because its value is overridden by the Kibana server"`;

View file

@ -53,12 +53,6 @@ export interface IUiSettingsClient {
*/
set: (key: string, value: any) => Promise<boolean>;
/**
* Overrides the default value for a setting in this specific browser tab. If the page
* is reloaded the default override is lost.
*/
overrideLocalDefault: (key: string, newDefault: any) => void;
/**
* Removes the user-defined value for a setting, causing it to revert to the default. This
* method behaves the same as calling `set(key, null)`, including the synchronization, custom
@ -99,16 +93,6 @@ export interface IUiSettingsClient {
oldValue: T;
}>;
/**
* Returns an Observable that notifies subscribers of each update to the uiSettings,
* including the key, newValue, and oldValue of the setting that changed.
*/
getSaved$: <T = any>() => Observable<{
key: string;
newValue: T;
oldValue: T;
}>;
/**
* Returns an Observable that notifies subscribers of each error while trying to update
* the settings, containing the actual Error class.

View file

@ -279,119 +279,3 @@ describe('#getUpdate$', () => {
expect(onComplete).toHaveBeenCalled();
});
});
describe('#overrideLocalDefault', () => {
describe('key has no user value', () => {
it('synchronously modifies the default value returned by get()', () => {
const { client } = setup();
expect(client.get('dateFormat')).toMatchSnapshot('get before override');
client.overrideLocalDefault('dateFormat', 'bar');
expect(client.get('dateFormat')).toMatchSnapshot('get after override');
});
it('synchronously modifies the value returned by getAll()', () => {
const { client } = setup();
expect(client.getAll()).toMatchSnapshot('getAll before override');
client.overrideLocalDefault('dateFormat', 'bar');
expect(client.getAll()).toMatchSnapshot('getAll after override');
});
it('calls subscriber with new and previous value', () => {
const handler = jest.fn();
const { client } = setup();
client.getUpdate$().subscribe(handler);
client.overrideLocalDefault('dateFormat', 'bar');
expect(handler.mock.calls).toMatchSnapshot('single subscriber call');
});
});
describe('key with user value', () => {
it('does not modify the return value of get', () => {
const { client } = setup();
client.set('dateFormat', 'foo');
expect(client.get('dateFormat')).toMatchSnapshot('get before override');
client.overrideLocalDefault('dateFormat', 'bar');
expect(client.get('dateFormat')).toMatchSnapshot('get after override');
});
it('is included in the return value of getAll', () => {
const { client } = setup();
client.set('dateFormat', 'foo');
expect(client.getAll()).toMatchSnapshot('getAll before override');
client.overrideLocalDefault('dateFormat', 'bar');
expect(client.getAll()).toMatchSnapshot('getAll after override');
});
it('does not call subscriber', () => {
const handler = jest.fn();
const { client } = setup();
client.set('dateFormat', 'foo');
client.getUpdate$().subscribe(handler);
client.overrideLocalDefault('dateFormat', 'bar');
expect(handler).not.toHaveBeenCalled();
});
it('returns default override when setting removed', () => {
const { client } = setup();
client.set('dateFormat', 'foo');
client.overrideLocalDefault('dateFormat', 'bar');
expect(client.get('dateFormat')).toMatchSnapshot('get before override');
expect(client.getAll()).toMatchSnapshot('getAll before override');
client.remove('dateFormat');
expect(client.get('dateFormat')).toMatchSnapshot('get after override');
expect(client.getAll()).toMatchSnapshot('getAll after override');
});
});
describe('#isOverridden()', () => {
it('returns false if key is unknown', () => {
const { client } = setup();
expect(client.isOverridden('foo')).toBe(false);
});
it('returns false if key is no overridden', () => {
const { client } = setup({
initialSettings: {
foo: {
userValue: 1,
},
bar: {
isOverridden: true,
userValue: 2,
},
},
});
expect(client.isOverridden('foo')).toBe(false);
});
it('returns true when key is overridden', () => {
const { client } = setup({
initialSettings: {
foo: {
userValue: 1,
},
bar: {
isOverridden: true,
userValue: 2,
},
},
});
expect(client.isOverridden('bar')).toBe(true);
});
it('returns false for object prototype properties', () => {
const { client } = setup();
expect(client.isOverridden('hasOwnProperty')).toBe(false);
});
});
});

View file

@ -24,7 +24,6 @@ interface UiSettingsClientParams {
export class UiSettingsClient implements IUiSettingsClient {
private readonly update$ = new Subject<{ key: string; newValue: any; oldValue: any }>();
private readonly saved$ = new Subject<{ key: string; newValue: any; oldValue: any }>();
private readonly updateErrors$ = new Subject<Error>();
private readonly api: UiSettingsApi;
@ -39,7 +38,6 @@ export class UiSettingsClient implements IUiSettingsClient {
params.done$.subscribe({
complete: () => {
this.update$.complete();
this.saved$.complete();
this.updateErrors$.complete();
},
});
@ -116,37 +114,10 @@ You can use \`IUiSettingsClient.get("${key}", defaultValue)\`, which will just r
return this.isDeclared(key) && Boolean(this.cache[key].isOverridden);
}
overrideLocalDefault(key: string, newDefault: any) {
// capture the previous value
const prevDefault = this.defaults[key] ? this.defaults[key].value : undefined;
// update defaults map
this.defaults[key] = {
...(this.defaults[key] || {}),
value: newDefault,
};
// update cached default value
this.cache[key] = {
...(this.cache[key] || {}),
value: newDefault,
};
// don't broadcast change if userValue was already overriding the default
if (this.cache[key].userValue == null) {
this.update$.next({ key, newValue: newDefault, oldValue: prevDefault });
this.saved$.next({ key, newValue: newDefault, oldValue: prevDefault });
}
}
getUpdate$() {
return this.update$.asObservable();
}
getSaved$() {
return this.saved$.asObservable();
}
getUpdateErrors$() {
return this.updateErrors$.asObservable();
}
@ -178,7 +149,6 @@ You can use \`IUiSettingsClient.get("${key}", defaultValue)\`, which will just r
try {
const { settings } = await this.api.batchSet(key, newVal);
this.cache = defaultsDeep({}, defaults, settings);
this.saved$.next({ key, newValue: newVal, oldValue: initialVal });
return true;
} catch (error) {
this.setLocally(key, initialVal);

View file

@ -22,14 +22,11 @@ const createSetupContractMock = () => {
isDefault: jest.fn(),
isCustom: jest.fn(),
isOverridden: jest.fn(),
overrideLocalDefault: jest.fn(),
getUpdate$: jest.fn(),
getSaved$: jest.fn(),
getUpdateErrors$: jest.fn(),
};
setupContract.get$.mockReturnValue(new Rx.Subject<any>());
setupContract.getUpdate$.mockReturnValue(new Rx.Subject<any>());
setupContract.getSaved$.mockReturnValue(new Rx.Subject<any>());
setupContract.getUpdateErrors$.mockReturnValue(new Rx.Subject<any>());
setupContract.getAll.mockReturnValue({});

View file

@ -34,12 +34,7 @@ describe('#stop', () => {
service.stop();
await expect(
Rx.combineLatest(
client.getUpdate$(),
client.getSaved$(),
client.getUpdateErrors$(),
loadingCount$!
).toPromise()
Rx.combineLatest(client.getUpdate$(), client.getUpdateErrors$(), loadingCount$!).toPromise()
).resolves.toBe(undefined);
});
});

View file

@ -46,22 +46,22 @@ export async function bootstrap({ configs, cliArgs, applyConfigOverrides }: Boot
const root = new Root(rawConfigService, env, onRootShutdown);
process.on('SIGHUP', () => reloadLoggingConfig());
process.on('SIGHUP', () => reloadConfiguration());
// This is only used by the LogRotator service
// in order to be able to reload the log configuration
// under the cluster mode
process.on('message', (msg) => {
if (!msg || msg.reloadLoggingConfig !== true) {
if (!msg || msg.reloadConfiguration !== true) {
return;
}
reloadLoggingConfig();
reloadConfiguration();
});
function reloadLoggingConfig() {
function reloadConfiguration() {
const cliLogger = root.logger.get('cli');
cliLogger.info('Reloading logging configuration due to SIGHUP.', { tags: ['config'] });
cliLogger.info('Reloading Kibana configuration due to SIGHUP.', { tags: ['config'] });
try {
rawConfigService.reloadConfig();
@ -69,7 +69,7 @@ export async function bootstrap({ configs, cliArgs, applyConfigOverrides }: Boot
return shutdown(err);
}
cliLogger.info('Reloaded logging configuration due to SIGHUP.', { tags: ['config'] });
cliLogger.info('Reloaded Kibana configuration due to SIGHUP.', { tags: ['config'] });
}
process.on('SIGINT', () => shutdown());

View file

@ -470,3 +470,59 @@ test('subsequent calls to setContextConfig() for the same context name can disab
},
});
});
test('buffers log records for already created appenders', async () => {
// a default config
await system.upgrade(
config.schema.validate({
appenders: { default: { type: 'console', layout: { type: 'json' } } },
root: { level: 'info' },
})
);
const logger = system.get('test', 'context');
const bufferAppendSpy = jest.spyOn((system as any).bufferAppender, 'append');
const upgradePromise = system.upgrade(
config.schema.validate({
appenders: { default: { type: 'console', layout: { type: 'json' } } },
root: { level: 'all' },
})
);
logger.trace('message to the known context');
expect(bufferAppendSpy).toHaveBeenCalledTimes(1);
expect(mockConsoleLog).toHaveBeenCalledTimes(0);
await upgradePromise;
expect(JSON.parse(mockConsoleLog.mock.calls[0][0]).message).toBe('message to the known context');
});
test('buffers log records for appenders created during config upgrade', async () => {
// a default config
await system.upgrade(
config.schema.validate({
appenders: { default: { type: 'console', layout: { type: 'json' } } },
root: { level: 'info' },
})
);
const bufferAppendSpy = jest.spyOn((system as any).bufferAppender, 'append');
const upgradePromise = system.upgrade(
config.schema.validate({
appenders: { default: { type: 'console', layout: { type: 'json' } } },
root: { level: 'all' },
})
);
const logger = system.get('test', 'context');
logger.trace('message to a new context');
expect(bufferAppendSpy).toHaveBeenCalledTimes(1);
expect(mockConsoleLog).toHaveBeenCalledTimes(0);
await upgradePromise;
expect(JSON.parse(mockConsoleLog.mock.calls[0][0]).message).toBe('message to a new context');
});

View file

@ -167,17 +167,13 @@ export class LoggingSystem implements LoggerFactory {
}
private async applyBaseConfig(newBaseConfig: LoggingConfig) {
this.enforceBufferAppendersUsage();
const computedConfig = [...this.contextConfigs.values()].reduce(
(baseConfig, contextConfig) => baseConfig.extend(contextConfig),
newBaseConfig
);
// reconfigure all the loggers without configuration to have them use the buffer
// appender while we are awaiting for the appenders to be disposed.
for (const [loggerKey, loggerAdapter] of this.loggers) {
loggerAdapter.updateLogger(this.createLogger(loggerKey, undefined));
}
// Appenders must be reset, so we first dispose of the current ones, then
// build up a new set of appenders.
await Promise.all([...this.appenders.values()].map((a) => a.dispose()));
@ -204,18 +200,32 @@ export class LoggingSystem implements LoggerFactory {
}
}
for (const [loggerKey, loggerAdapter] of this.loggers) {
loggerAdapter.updateLogger(this.createLogger(loggerKey, computedConfig));
}
this.enforceConfiguredAppendersUsage(computedConfig);
// We keep a reference to the base config so we can properly extend it
// on each config change.
this.baseConfig = newBaseConfig;
this.computedConfig = computedConfig;
// Re-log all buffered log records with newly configured appenders.
for (const logRecord of this.bufferAppender.flush()) {
this.get(logRecord.context).log(logRecord);
}
}
// reconfigure all the loggers to have them use the buffer appender
// while we are awaiting for the appenders to be disposed.
private enforceBufferAppendersUsage() {
for (const [loggerKey, loggerAdapter] of this.loggers) {
loggerAdapter.updateLogger(this.createLogger(loggerKey, undefined));
}
// new loggers created during applyBaseConfig execution should use the buffer appender as well
this.computedConfig = undefined;
}
private enforceConfiguredAppendersUsage(config: LoggingConfig) {
for (const [loggerKey, loggerAdapter] of this.loggers) {
loggerAdapter.updateLogger(this.createLogger(loggerKey, config));
}
this.computedConfig = config;
}
}

View file

@ -53,8 +53,7 @@ function createRoot() {
);
}
// CI FAILURE: https://github.com/elastic/kibana/issues/98352
describe.skip('migration v2', () => {
describe('migration v2', () => {
let esServer: kbnTestServer.TestElasticsearchUtils;
let root: Root;

Some files were not shown because too many files have changed in this diff Show more