Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-108347
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Aug 20, 2021
2 parents fbc61d8 + 052b0b1 commit b9ea0ef
Show file tree
Hide file tree
Showing 74 changed files with 638 additions and 340 deletions.
4 changes: 4 additions & 0 deletions docs/settings/monitoring-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ For more information, see
monitoring back-end does not run and {kib} stats are not sent to the monitoring
cluster.

| `monitoring.ui.ccs.enabled`
| Set to `true` (default) to enable {ref}/modules-cross-cluster-search.html[cross-cluster search] of your monitoring data. The {ref}/modules-remote-clusters.html#remote-cluster-settings[`remote_cluster_client`] role must exist on each node.


| `monitoring.ui.elasticsearch.hosts`
| Specifies the location of the {es} cluster where your monitoring data is stored.
By default, this is the same as <<elasticsearch-hosts, `elasticsearch.hosts`>>. This setting enables
Expand Down
4 changes: 4 additions & 0 deletions packages/kbn-optimizer/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["@kbn/babel-preset/node_preset"],
"ignore": ["**/*.test.js"]
}
34 changes: 28 additions & 6 deletions packages/kbn-optimizer/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("//src/dev/bazel:index.bzl", "jsts_transpiler")

PKG_BASE_NAME = "kbn-optimizer"
PKG_REQUIRE_NAME = "@kbn/optimizer"
Expand Down Expand Up @@ -29,7 +30,7 @@ NPM_MODULE_EXTRA_FILES = [
"README.md"
]

SRC_DEPS = [
RUNTIME_DEPS = [
"//packages/kbn-config",
"//packages/kbn-dev-utils",
"//packages/kbn-std",
Expand Down Expand Up @@ -59,6 +60,22 @@ SRC_DEPS = [
]

TYPES_DEPS = [
"//packages/kbn-config",
"//packages/kbn-dev-utils",
"//packages/kbn-std",
"//packages/kbn-ui-shared-deps",
"//packages/kbn-utils",
"@npm//chalk",
"@npm//clean-webpack-plugin",
"@npm//cpy",
"@npm//del",
"@npm//execa",
"@npm//jest-diff",
"@npm//lmdb-store",
"@npm//pirates",
"@npm//resize-observer-polyfill",
"@npm//rxjs",
"@npm//zlib",
"@npm//@types/compression-webpack-plugin",
"@npm//@types/jest",
"@npm//@types/json-stable-stringify",
Expand All @@ -72,7 +89,11 @@ TYPES_DEPS = [
"@npm//@types/webpack-sources",
]

DEPS = SRC_DEPS + TYPES_DEPS
jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
)

ts_config(
name = "tsconfig",
Expand All @@ -84,13 +105,14 @@ ts_config(
)

ts_project(
name = "tsc",
name = "tsc_types",
args = ['--pretty'],
srcs = SRCS,
deps = DEPS,
deps = TYPES_DEPS,
declaration = True,
declaration_map = True,
out_dir = "target",
emit_declaration_only = True,
out_dir = "target_types",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig",
Expand All @@ -99,7 +121,7 @@ ts_project(
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = DEPS + [":tsc"],
deps = RUNTIME_DEPS + [":target_node", ":tsc_types"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
Expand Down
12 changes: 0 additions & 12 deletions packages/kbn-optimizer/babel.config.js

This file was deleted.

4 changes: 2 additions & 2 deletions packages/kbn-optimizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"version": "1.0.0",
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js",
"types": "./target/index.d.ts"
"main": "./target_node/index.js",
"types": "./target_types/index.d.ts"
}
3 changes: 2 additions & 1 deletion packages/kbn-optimizer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"extends": "../../tsconfig.bazel.json",
"compilerOptions": {
"outDir": "./target/types",
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "./target_types",
"rootDir": "./src",
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-optimizer/src",
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-plugin-helpers/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@kbn/babel-preset/node_preset"]
}
25 changes: 19 additions & 6 deletions packages/kbn-plugin-helpers/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("//src/dev/bazel:index.bzl", "jsts_transpiler")

PKG_BASE_NAME = "kbn-plugin-helpers"
PKG_REQUIRE_NAME = "@kbn/plugin-helpers"
Expand All @@ -26,7 +27,7 @@ NPM_MODULE_EXTRA_FILES = [
"README.md"
]

SRC_DEPS = [
RUNTIME_DEPS = [
"//packages/kbn-dev-utils",
"//packages/kbn-optimizer",
"//packages/kbn-utils",
Expand All @@ -41,6 +42,13 @@ SRC_DEPS = [
]

TYPES_DEPS = [
"//packages/kbn-dev-utils",
"//packages/kbn-optimizer",
"//packages/kbn-utils",
"@npm//del",
"@npm//execa",
"@npm//globby",
"@npm//load-json-file",
"@npm//@types/extract-zip",
"@npm//@types/gulp-zip",
"@npm//@types/inquirer",
Expand All @@ -49,7 +57,11 @@ TYPES_DEPS = [
"@npm//@types/vinyl-fs",
]

DEPS = SRC_DEPS + TYPES_DEPS
jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
)

ts_config(
name = "tsconfig",
Expand All @@ -61,13 +73,14 @@ ts_config(
)

ts_project(
name = "tsc",
name = "tsc_types",
args = ['--pretty'],
srcs = SRCS,
deps = DEPS,
deps = TYPES_DEPS,
declaration = True,
declaration_map = True,
out_dir = "target",
emit_declaration_only = True,
out_dir = "target_types",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig",
Expand All @@ -76,7 +89,7 @@ ts_project(
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = DEPS + [":tsc"],
deps = RUNTIME_DEPS + [":target_node", ":tsc_types"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-plugin-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"kibana": {
"devOnly": true
},
"main": "target/index.js",
"types": "target/index.d.ts",
"main": "target_node/index.js",
"types": "target_types/index.d.ts",
"bin": {
"plugin-helpers": "bin/plugin-helpers.js"
}
Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-plugin-helpers/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"extends": "../../tsconfig.bazel.json",
"compilerOptions": {
"outDir": "target",
"target": "ES2018",
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "target_types",
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-plugin-helpers/src",
"target": "ES2018",
"types": [
"jest",
"node"
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-test/src/jest/setup/babel_polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
// Note: In theory importing the polyfill should not be needed, as Babel should
// include the necessary polyfills when using `@babel/preset-env`, but for some
// reason it did not work. See https://github.com/elastic/kibana/issues/14506
import '@kbn/optimizer/target/node/polyfill';
import '@kbn/optimizer/target_node/node/polyfill';
1 change: 1 addition & 0 deletions src/dev/build/tasks/copy_source_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const CopySource: Task = {
'!src/dev/**',
'!src/setup_node_env/babel_register/index.js',
'!src/setup_node_env/babel_register/register.js',
'!**/jest.config.js',
'!src/plugins/telemetry/schema/**', // Skip telemetry schemas
'!**/public/**/*.{js,ts,tsx,json,scss}',
'typings/**',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { HttpSetup } from 'kibana/public';
import React, { createContext, useContext } from 'react';

import { useRequest } from '../../../public';
import { useRequest } from '../../../public/request';

import { Privileges, Error as CustomError } from '../types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface EuiCodeEditorProps extends SupportedAriaAttributes, Omit<IAceEd
onBlur?: IAceEditorProps['onBlur'];
onFocus?: IAceEditorProps['onFocus'];
isReadOnly?: boolean;
setOptions: IAceEditorProps['setOptions'];
setOptions?: IAceEditorProps['setOptions'];
cursorStart?: number;
'data-test-subj'?: string;
/**
Expand All @@ -70,7 +70,10 @@ export interface EuiCodeEditorState {

class EuiCodeEditor extends Component<EuiCodeEditorProps, EuiCodeEditorState> {
static defaultProps = {
setOptions: {},
setOptions: {
showLineNumbers: false,
tabSize: 2,
},
};

state: EuiCodeEditorState = {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions x-pack/plugins/apm/server/lib/services/get_service_agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import { Setup, SetupTimeRange } from '../helpers/setup_request';
import { getProcessorEventForAggregatedTransactions } from '../helpers/aggregated_transactions';

interface ServiceAgent {
service?: {
runtime: {
name: string;
};
};
agent?: {
name: string;
};
service?: {
runtime?: {
name?: string;
};
};
}

export async function getServiceAgent({
Expand All @@ -50,23 +50,23 @@ export async function getServiceAgent({
},
body: {
size: 1,
_source: [SERVICE_RUNTIME_NAME, AGENT_NAME],
_source: [AGENT_NAME, SERVICE_RUNTIME_NAME],
query: {
bool: {
filter: [
{ term: { [SERVICE_NAME]: serviceName } },
...rangeQuery(start, end),
{
exists: {
field: SERVICE_RUNTIME_NAME,
},
},
{
exists: {
field: AGENT_NAME,
},
},
],
should: {
exists: {
field: SERVICE_RUNTIME_NAME,
},
},
},
},
},
Expand All @@ -80,6 +80,6 @@ export async function getServiceAgent({
return {};
}

const { service, agent } = response.hits.hits[0]._source as ServiceAgent;
return { agentName: agent?.name, runtimeName: service?.runtime.name };
const { agent, service } = response.hits.hits[0]._source as ServiceAgent;
return { agentName: agent?.name, runtimeName: service?.runtime?.name };
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
flex-direction: column;
}

.canvasExpressionInput__editor {
height: auto;
position: absolute;
top: 0;
left: 0;
bottom: $euiSizeS * 7 + 1;
right: 0;
}

.canvasExpressionInput__inner {
flex-grow: 1;
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export const Expression: FC<Props> = ({
</EuiLink>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonEmpty iconType="fullScreen" onClick={toggleCompactView} size="xs">
<EuiButtonEmpty iconType="fullScreen" onClick={toggleCompactView} size="s">
{isCompact ? strings.getMaximizeButtonLabel() : strings.getMinimizeButtonLabel()}
</EuiButtonEmpty>
</EuiFlexItem>
Expand Down
Loading

0 comments on commit b9ea0ef

Please sign in to comment.