Skip to content

Commit 63fb0e9

Browse files
committed
Merge branch 'master' into signals_migration
Conflicts: x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.ts
2 parents d0c2634 + f961e90 commit 63fb0e9

88 files changed

Lines changed: 9349 additions & 3645 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ci/teamcity/tests/xpack_list_cyclic_dependency.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

.ci/teamcity/tests/xpack_siem_cyclic_dependency.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

.teamcity/src/builds/test/QuickTests.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ object QuickTests : BuildType({
1313

1414
val testScripts = mapOf(
1515
"Test Hardening" to ".ci/teamcity/tests/test_hardening.sh",
16-
"X-Pack List cyclic dependency" to ".ci/teamcity/tests/xpack_list_cyclic_dependency.sh",
17-
"X-Pack SIEM cyclic dependency" to ".ci/teamcity/tests/xpack_siem_cyclic_dependency.sh",
1816
"Test Projects" to ".ci/teamcity/tests/test_projects.sh",
1917
"Mocha Tests" to ".ci/teamcity/tests/mocha.sh"
2018
)

docs/developer/getting-started/debugging.asciidoc

Lines changed: 80 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,17 @@ For information about how to debug unit tests, refer to <<debugging-unit-tests>>
1515
https://github.com/elastic/apm-agent-nodejs[Elastic APM Node.js Agent]
1616
built-in for debugging purposes.
1717

18-
Its default configuration is meant to be used by core {kib} developers
18+
With an application as varied and complex as Kibana has become, it's not practical or scalable to craft all possible performance measurements by hand ahead of time. As such, we need to rely on tooling to help us catch things we may otherwise have missed.
19+
20+
For example, say you implement a brand new feature, plugin or service but don't quite know how it will impact Kibana's performance as a whole. APM allows us to not only spot that something is slow, but also hints at why it might be performing slowly. For example, if a function is slow on specific types of inputs, we can see where the time is spent by viewing the trace for that function call in the APM UI.
21+
22+
image::images/apm_example_trace.png[]
23+
24+
The net of metrics captured by APM are both a wide and deep because the entire application is instrumented at runtime and we simply take a sample of these metrics. This means that we don't have to know what we need to measure ahead of time, we'll instead just get (most) of the data we're likely going to need by default.
25+
26+
This type of data can help us identify unknown bottlenecks, spot when a performance regression may have been introduced, and inform how the performance of Kibana is changing between releases. Using APM allows us to be proactive in getting ahead of potential performance regressions before they are released.
27+
28+
The default APM configuration is meant to be used by core {kib} developers
1929
only, but it can easily be re-configured to your needs. In its default
2030
configuration it’s disabled and will, once enabled, send APM data to a
2131
centrally managed {es} cluster accessible only to Elastic
@@ -27,11 +37,8 @@ APM config option. To activate the APM agent, use the
2737
https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuration.html#active[`active`]
2838
APM config option.
2939

30-
All config options can be set either via environment variables, or by
31-
creating an appropriate config file under `config/apm.dev.js`. For
32-
more information about configuring the APM agent, please refer to
33-
https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuring-the-agent.html[the
34-
documentation].
40+
All config options can be set by
41+
creating an appropriate config file under `config/apm.dev.js`.
3542

3643
Example `config/apm.dev.js` file:
3744

@@ -56,4 +63,70 @@ ELASTIC_APM_ACTIVE=true yarn start
5663
Once the agent is active, it will trace all incoming HTTP requests to
5764
{kib}, monitor for errors, and collect process-level metrics. The
5865
collected data will be sent to the APM Server and is viewable in the APM
59-
UI in {kib}.
66+
UI in {kib}.
67+
68+
[discrete]
69+
=== Running Kibana with the APM Agent Locally
70+
71+
The easiest and recommended way of running Kibana with the APM agent locally is to use the solution provided by the https://github.com/elastic/apm-integration-testing[apm-integration-testing] repo. You’ll need https://www.docker.com/community-edition[Docker] and https://docs.docker.com/compose/install/[Docker Compose] to use the tool.
72+
73+
[discrete]
74+
==== Quick start guide
75+
76+
. Clone the https://github.com/elastic/apm-integration-testing[elastic/apm-integration-testing] repo.
77+
. Change into the apm-integration-testing repo:
78+
+
79+
[source,bash]
80+
----
81+
cd apm-integration-testing
82+
----
83+
84+
. Run {es} and the APM servers without running Kibana:
85+
+
86+
[source,bash]
87+
----
88+
./scripts/compose.py start master --no-kibana
89+
----
90+
91+
. Change into the {kib} repo:
92+
+
93+
[source,bash]
94+
----
95+
cd ../kibana
96+
----
97+
98+
. Change the elasticsearch credentials in your `kibana.yml` configuration file to match those needed by elasticsearch and the APM server (see the apm-integration-testing repo's https://github.com/elastic/apm-integration-testing#logging-in[README] for users provided to test different scenarios).
99+
. Make sure that the APM agent is active and points to the local APM server by adding the following configuration settings to to a config file under `config/apm.dev.js`:
100+
+
101+
Example `config/apm.dev.js` file:
102+
+
103+
[source,js]
104+
----
105+
module.exports = {
106+
active: true,
107+
serverUrl: 'http://127.0.0.1:8200', // supports `http://localhost:8200`
108+
centralConfig: false,
109+
breakdownMetrics: false,
110+
transactionSampleRate: 0.1,
111+
metricsInterval: '120s'
112+
};
113+
----
114+
115+
. Start Kibana with APM active using:
116+
+
117+
[source,bash]
118+
----
119+
yarn start
120+
----
121+
122+
. After Kibana starts up, navigate to the APM app, where you should see some transactions.
123+
124+
image::images/apm_ui_transactions.png[]
125+
126+
You can now continue doing what you want to in Kibana (e.g. install sample data sets, issue queries in dashboards, build new visualizations etc).
127+
Once you're finished, you can stop Kibana normally, then stop the {es} and APM servers in the apm-integration-testing clone with the following script:
128+
129+
[source,bash]
130+
----
131+
./scripts/compose.py stop
132+
----
557 KB
Loading
192 KB
Loading

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,6 @@
731731
"loader-utils": "^1.2.3",
732732
"log-symbols": "^2.2.0",
733733
"lz-string": "^1.4.4",
734-
"madge": "3.4.4",
735734
"mapbox-gl": "^1.12.0",
736735
"mapbox-gl-draw-rectangle-mode": "^1.0.4",
737736
"marge": "^1.0.1",

packages/kbn-monaco/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import './register_globals';
2222

2323
export { monaco } from './monaco_imports';
2424
export { XJsonLang } from './xjson';
25-
export { PainlessLang, PainlessContext } from './painless';
25+
export { PainlessLang, PainlessContext, PainlessAutocompleteField } from './painless';
2626

2727
/* eslint-disable-next-line @kbn/eslint/module_migration */
2828
import * as BarePluginApi from 'monaco-editor/esm/vs/editor/editor.api';

packages/kbn-monaco/src/painless/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ import { getSuggestionProvider } from './language';
2323

2424
export const PainlessLang = { ID, getSuggestionProvider, lexerRules };
2525

26-
export { PainlessContext } from './types';
26+
export { PainlessContext, PainlessAutocompleteField } from './types';

packages/kbn-monaco/src/painless/language.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { monaco } from '../monaco_imports';
2121

2222
import { WorkerProxyService, EditorStateService } from './services';
2323
import { ID } from './constants';
24-
import { PainlessContext, Field } from './types';
24+
import { PainlessContext, PainlessAutocompleteField } from './types';
2525
import { PainlessWorker } from './worker';
2626
import { PainlessCompletionAdapter } from './completion_adapter';
2727

@@ -38,7 +38,10 @@ monaco.languages.onLanguage(ID, async () => {
3838
workerProxyService.setup();
3939
});
4040

41-
export const getSuggestionProvider = (context: PainlessContext, fields?: Field[]) => {
41+
export const getSuggestionProvider = (
42+
context: PainlessContext,
43+
fields?: PainlessAutocompleteField[]
44+
) => {
4245
editorStateService.setup(context, fields);
4346

4447
return new PainlessCompletionAdapter(worker, editorStateService);

0 commit comments

Comments
 (0)