Skip to content

Commit

Permalink
Merge branch 'master' into reduce-uptime-plugin-initial-bundle-size
Browse files Browse the repository at this point in the history
  • Loading branch information
mshustov committed May 7, 2020
2 parents 2a0259a + 4a6ecc8 commit 68dbb1d
Show file tree
Hide file tree
Showing 2,820 changed files with 41,391 additions and 13,918 deletions.
1 change: 1 addition & 0 deletions .backportrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"targetBranchChoices": [
{ "name": "master", "checked": true },
{ "name": "7.x", "checked": true },
"7.8",
"7.7",
"7.6",
"7.5",
Expand Down
4 changes: 2 additions & 2 deletions .ci/end2end.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pipeline {
BASE_DIR = 'src/github.com/elastic/kibana'
HOME = "${env.WORKSPACE}"
APM_ITS = 'apm-integration-testing'
CYPRESS_DIR = 'x-pack/legacy/plugins/apm/e2e'
CYPRESS_DIR = 'x-pack/plugins/apm/e2e'
PIPELINE_LOG_LEVEL = 'DEBUG'
}
options {
Expand All @@ -39,7 +39,7 @@ pipeline {
shallow: false, reference: "/var/lib/jenkins/.git-references/kibana.git")
script {
dir("${BASE_DIR}"){
def regexps =[ "^x-pack/legacy/plugins/apm/.*" ]
def regexps =[ "^x-pack/plugins/apm/.*" ]
env.APM_UPDATED = isGitRegionMatch(patterns: regexps)
}
}
Expand Down
75 changes: 40 additions & 35 deletions .ci/es-snapshots/Jenkinsfile_verify_es
Original file line number Diff line number Diff line change
Expand Up @@ -19,43 +19,48 @@ currentBuild.description = "ES: ${SNAPSHOT_VERSION}<br />Kibana: ${params.branch

def SNAPSHOT_MANIFEST = "https://storage.googleapis.com/kibana-ci-es-snapshots-daily/${SNAPSHOT_VERSION}/archives/${SNAPSHOT_ID}/manifest.json"

kibanaPipeline(timeoutMinutes: 120) {
kibanaPipeline(timeoutMinutes: 150) {
catchErrors {
retryable.enable(2)
withEnv(["ES_SNAPSHOT_MANIFEST=${SNAPSHOT_MANIFEST}"]) {
parallel([
'kibana-intake-agent': workers.intake('kibana-intake', './test/scripts/jenkins_unit.sh'),
'x-pack-intake-agent': workers.intake('x-pack-intake', './test/scripts/jenkins_xpack.sh'),
'kibana-oss-agent': workers.functional('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
'oss-ciGroup1': kibanaPipeline.ossCiGroupProcess(1),
'oss-ciGroup2': kibanaPipeline.ossCiGroupProcess(2),
'oss-ciGroup3': kibanaPipeline.ossCiGroupProcess(3),
'oss-ciGroup4': kibanaPipeline.ossCiGroupProcess(4),
'oss-ciGroup5': kibanaPipeline.ossCiGroupProcess(5),
'oss-ciGroup6': kibanaPipeline.ossCiGroupProcess(6),
'oss-ciGroup7': kibanaPipeline.ossCiGroupProcess(7),
'oss-ciGroup8': kibanaPipeline.ossCiGroupProcess(8),
'oss-ciGroup9': kibanaPipeline.ossCiGroupProcess(9),
'oss-ciGroup10': kibanaPipeline.ossCiGroupProcess(10),
'oss-ciGroup11': kibanaPipeline.ossCiGroupProcess(11),
'oss-ciGroup12': kibanaPipeline.ossCiGroupProcess(12),
]),
'kibana-xpack-agent': workers.functional('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
'xpack-ciGroup1': kibanaPipeline.xpackCiGroupProcess(1),
'xpack-ciGroup2': kibanaPipeline.xpackCiGroupProcess(2),
'xpack-ciGroup3': kibanaPipeline.xpackCiGroupProcess(3),
'xpack-ciGroup4': kibanaPipeline.xpackCiGroupProcess(4),
'xpack-ciGroup5': kibanaPipeline.xpackCiGroupProcess(5),
'xpack-ciGroup6': kibanaPipeline.xpackCiGroupProcess(6),
'xpack-ciGroup7': kibanaPipeline.xpackCiGroupProcess(7),
'xpack-ciGroup8': kibanaPipeline.xpackCiGroupProcess(8),
'xpack-ciGroup9': kibanaPipeline.xpackCiGroupProcess(9),
'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10),
]),
])
}
slackNotifications.onFailure(
title: ":broken_heart: *<${env.BUILD_URL}|[${SNAPSHOT_VERSION}] ES Snapshot Verification Failure>*",
message: ":broken_heart: [${SNAPSHOT_VERSION}] ES Snapshot Verification Failure",
) {
retryable.enable(2)
withEnv(["ES_SNAPSHOT_MANIFEST=${SNAPSHOT_MANIFEST}"]) {
parallel([
'kibana-intake-agent': workers.intake('kibana-intake', './test/scripts/jenkins_unit.sh'),
'x-pack-intake-agent': workers.intake('x-pack-intake', './test/scripts/jenkins_xpack.sh'),
'kibana-oss-agent': workers.functional('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
'oss-ciGroup1': kibanaPipeline.ossCiGroupProcess(1),
'oss-ciGroup2': kibanaPipeline.ossCiGroupProcess(2),
'oss-ciGroup3': kibanaPipeline.ossCiGroupProcess(3),
'oss-ciGroup4': kibanaPipeline.ossCiGroupProcess(4),
'oss-ciGroup5': kibanaPipeline.ossCiGroupProcess(5),
'oss-ciGroup6': kibanaPipeline.ossCiGroupProcess(6),
'oss-ciGroup7': kibanaPipeline.ossCiGroupProcess(7),
'oss-ciGroup8': kibanaPipeline.ossCiGroupProcess(8),
'oss-ciGroup9': kibanaPipeline.ossCiGroupProcess(9),
'oss-ciGroup10': kibanaPipeline.ossCiGroupProcess(10),
'oss-ciGroup11': kibanaPipeline.ossCiGroupProcess(11),
'oss-ciGroup12': kibanaPipeline.ossCiGroupProcess(12),
]),
'kibana-xpack-agent': workers.functional('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
'xpack-ciGroup1': kibanaPipeline.xpackCiGroupProcess(1),
'xpack-ciGroup2': kibanaPipeline.xpackCiGroupProcess(2),
'xpack-ciGroup3': kibanaPipeline.xpackCiGroupProcess(3),
'xpack-ciGroup4': kibanaPipeline.xpackCiGroupProcess(4),
'xpack-ciGroup5': kibanaPipeline.xpackCiGroupProcess(5),
'xpack-ciGroup6': kibanaPipeline.xpackCiGroupProcess(6),
'xpack-ciGroup7': kibanaPipeline.xpackCiGroupProcess(7),
'xpack-ciGroup8': kibanaPipeline.xpackCiGroupProcess(8),
'xpack-ciGroup9': kibanaPipeline.xpackCiGroupProcess(9),
'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10),
]),
])
}

promoteSnapshot(SNAPSHOT_VERSION, SNAPSHOT_ID)
promoteSnapshot(SNAPSHOT_VERSION, SNAPSHOT_ID)
}
}

kibanaPipeline.sendMail()
Expand Down
10 changes: 5 additions & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ target
/src/plugins/vis_type_timelion/public/_generated_/**
/src/plugins/vis_type_timelion/public/webpackShims/jquery.flot.*
/x-pack/legacy/plugins/**/__tests__/fixtures/**
/x-pack/legacy/plugins/apm/e2e/cypress/**/snapshots.js
/x-pack/legacy/plugins/canvas/canvas_plugin
/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts
/x-pack/legacy/plugins/canvas/shareable_runtime/build
/x-pack/legacy/plugins/canvas/storybook
/x-pack/plugins/apm/e2e/cypress/**/snapshots.js
/x-pack/plugins/canvas/canvas_plugin
/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts
/x-pack/plugins/canvas/shareable_runtime/build
/x-pack/plugins/canvas/storybook
/x-pack/plugins/monitoring/public/lib/jquery_flot
/x-pack/legacy/plugins/infra/common/graphql/types.ts
/x-pack/legacy/plugins/infra/public/graphql/types.ts
Expand Down
45 changes: 30 additions & 15 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ module.exports = {
},
},
{
files: ['x-pack/legacy/plugins/canvas/**/*.{js,ts,tsx}'],
files: ['x-pack/plugins/canvas/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
Expand Down Expand Up @@ -151,6 +151,16 @@ module.exports = {
},
},

/**
* New Platform client-side
*/
{
files: ['{src,x-pack}/plugins/*/public/**/*.{js,ts,tsx}'],
rules: {
'import/no-commonjs': 'error',
},
},

/**
* Files that require Elastic license headers instead of Apache 2.0 header
*/
Expand Down Expand Up @@ -183,6 +193,11 @@ module.exports = {
{
basePath: __dirname,
zones: [
{
target: ['(src|x-pack)/**/*', '!src/core/**/*'],
from: ['src/core/utils/**/*'],
errorMessage: `Plugins may only import from src/core/server and src/core/public.`,
},
{
target: [
'(src|x-pack)/legacy/**/*',
Expand Down Expand Up @@ -306,7 +321,7 @@ module.exports = {
{
files: [
'x-pack/test/functional/apps/**/*.js',
'x-pack/legacy/plugins/apm/**/*.js',
'x-pack/plugins/apm/**/*.js',
'test/*/config.ts',
'test/*/config_open.ts',
'test/*/{tests,test_suites,apis,apps}/**/*',
Expand Down Expand Up @@ -393,7 +408,7 @@ module.exports = {
'x-pack/**/*.test.js',
'x-pack/test_utils/**/*',
'x-pack/gulpfile.js',
'x-pack/legacy/plugins/apm/public/utils/testHelpers.js',
'x-pack/plugins/apm/public/utils/testHelpers.js',
],
rules: {
'import/no-extraneous-dependencies': [
Expand Down Expand Up @@ -519,15 +534,15 @@ module.exports = {
* APM overrides
*/
{
files: ['x-pack/legacy/plugins/apm/**/*.js'],
files: ['x-pack/plugins/apm/**/*.js'],
rules: {
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
'no-console': ['warn', { allow: ['error'] }],
},
},
{
plugins: ['react-hooks'],
files: ['x-pack/legacy/plugins/apm/**/*.{ts,tsx}'],
files: ['x-pack/plugins/apm/**/*.{ts,tsx}'],
rules: {
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': ['error', { additionalHooks: '^useFetcher$' }],
Expand Down Expand Up @@ -878,7 +893,7 @@ module.exports = {
* Canvas overrides
*/
{
files: ['x-pack/legacy/plugins/canvas/**/*.js'],
files: ['x-pack/plugins/canvas/**/*.js'],
rules: {
radix: 'error',

Expand Down Expand Up @@ -922,12 +937,12 @@ module.exports = {
},
{
files: [
'x-pack/legacy/plugins/canvas/gulpfile.js',
'x-pack/legacy/plugins/canvas/scripts/*.js',
'x-pack/legacy/plugins/canvas/tasks/*.js',
'x-pack/legacy/plugins/canvas/tasks/**/*.js',
'x-pack/legacy/plugins/canvas/__tests__/**/*.js',
'x-pack/legacy/plugins/canvas/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__}/**/*.js',
'x-pack/plugins/canvas/gulpfile.js',
'x-pack/plugins/canvas/scripts/*.js',
'x-pack/plugins/canvas/tasks/*.js',
'x-pack/plugins/canvas/tasks/**/*.js',
'x-pack/plugins/canvas/__tests__/**/*.js',
'x-pack/plugins/canvas/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__}/**/*.js',
],
rules: {
'import/no-extraneous-dependencies': [
Expand All @@ -940,7 +955,7 @@ module.exports = {
},
},
{
files: ['x-pack/legacy/plugins/canvas/canvas_plugin_src/**/*.js'],
files: ['x-pack/plugins/canvas/canvas_plugin_src/**/*.js'],
globals: { canvas: true, $: true },
rules: {
'import/no-unresolved': [
Expand All @@ -952,13 +967,13 @@ module.exports = {
},
},
{
files: ['x-pack/legacy/plugins/canvas/public/**/*.js'],
files: ['x-pack/plugins/canvas/public/**/*.js'],
env: {
browser: true,
},
},
{
files: ['x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/**/*.js'],
files: ['x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/**/*.js'],
env: {
jquery: true,
},
Expand Down
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
/x-pack/plugins/drilldowns/ @elastic/kibana-app-arch

# APM
/x-pack/legacy/plugins/apm/ @elastic/apm-ui
/x-pack/plugins/apm/ @elastic/apm-ui
/x-pack/plugins/apm/ @elastic/apm-ui
/x-pack/test/functional/apps/apm/ @elastic/apm-ui
/src/legacy/core_plugins/apm_oss/ @elastic/apm-ui
Expand All @@ -77,7 +77,7 @@
/x-pack/legacy/plugins/beats_management/ @elastic/beats

# Canvas
/x-pack/legacy/plugins/canvas/ @elastic/kibana-canvas
/x-pack/plugins/canvas/ @elastic/kibana-canvas

# Observability UIs
/x-pack/legacy/plugins/infra/ @elastic/logs-metrics-ui
Expand Down
5 changes: 2 additions & 3 deletions .github/paths-labeller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
- "Feature:ExpressionLanguage":
- "src/plugins/expressions/**/*.*"
- "src/plugins/bfetch/**/*.*"
- "Team:apm"
- "Team:apm":
- "x-pack/plugins/apm/**/*.*"
- "x-pack/plugins/apm/**/*.*"
- "x-pack/legacy/plugins/apm/**/*.*"
- "Team:uptime":
- "x-pack/plugins/uptime/**/*.*"
- "x-pack/legacy/plugins/uptime/**/*.*"
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ package-lock.json
*.sublime-*
npm-debug.log*
.tern-project
x-pack/legacy/plugins/apm/tsconfig.json
x-pack/plugins/apm/tsconfig.json
apm.tsconfig.json
/x-pack/legacy/plugins/apm/e2e/snapshots.js
/x-pack/plugins/apm/e2e/snapshots.js
2 changes: 1 addition & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"src/plugins/telemetry",
"src/plugins/telemetry_management_section"
],
"tileMap": "src/legacy/core_plugins/tile_map",
"tileMap": "src/plugins/tile_map",
"timelion": ["src/legacy/core_plugins/timelion", "src/plugins/vis_type_timelion"],
"uiActions": "src/plugins/ui_actions",
"visDefaultEditor": "src/plugins/vis_default_editor",
Expand Down
4 changes: 2 additions & 2 deletions .sass-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ files:
- 'src/plugins/vis_type_vislib/**/*.s+(a|c)ss'
- 'src/plugins/vis_type_xy/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/security/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/canvas/**/*.s+(a|c)ss'
- 'x-pack/plugins/canvas/**/*.s+(a|c)ss'
- 'x-pack/plugins/triggers_actions_ui/**/*.s+(a|c)ss'
- 'x-pack/plugins/lens/**/*.s+(a|c)ss'
- 'x-pack/plugins/cross_cluster_replication/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/maps/**/*.s+(a|c)ss'
- 'x-pack/plugins/maps/**/*.s+(a|c)ss'
ignore:
- 'x-pack/legacy/plugins/canvas/shareable_runtime/**/*.s+(a|c)ss'
- 'x-pack/plugins/canvas/shareable_runtime/**/*.s+(a|c)ss'
rules:
quotes:
- 2
Expand Down
2 changes: 1 addition & 1 deletion config/kibana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
# the username and password that the Kibana server uses to perform maintenance on the Kibana
# index at startup. Your Kibana users still need to authenticate with Elasticsearch, which
# is proxied through the Kibana server.
#elasticsearch.username: "kibana"
#elasticsearch.username: "kibana_system"
#elasticsearch.password: "pass"

# Enables SSL and paths to the PEM-format SSL certificate and SSL key files, respectively.
Expand Down
33 changes: 24 additions & 9 deletions docs/apm/spans.asciidoc
Original file line number Diff line number Diff line change
@@ -1,38 +1,53 @@
[role="xpack"]
[[spans]]
=== Span timeline
=== Trace sample timeline

TIP: A {apm-overview-ref-v}/transaction-spans.html[span] is the duration of a single event.
Spans are automatically captured by APM agents, and you can also define custom spans.
Each span has a type and is defined by a different color in the timeline/waterfall visualization.

The span timeline visualization is a bird's-eye view of what your application was doing while it was trying to respond to the request that came in.
The trace sample timeline visualization is a bird's-eye view of what your application was doing while it was trying to respond to a request.
This makes it useful for visualizing where the selected transaction spent most of its time.

[role="screenshot"]
image::apm/images/apm-transaction-sample.png[Example of distributed trace colors in the APM app in Kibana]

View a span in detail by clicking on it in the timeline waterfall.
When you click on an SQL Select database query,
For example, when you click on an SQL Select database query,
the information displayed includes the actual SQL that was executed, how long it took,
and the percentage of the trace's total time.
You also get a stack trace, which shows the SQL query in your code.
Finally, APM knows which files are your code and which are just modules or libraries that you've installed.
These library frames will be minimized by default in order to show you the most relevant stack trace.

TIP: A {apm-overview-ref-v}/transaction-spans.html[span] is the duration of a single event.
Spans are automatically captured by APM agents, and you can also define custom spans.
Each span has a type and is defined by a different color in the timeline/waterfall visualization.

[role="screenshot"]
image::apm/images/apm-span-detail.png[Example view of a span detail in the APM app in Kibana]

If your span timeline is colorful, it's indicative of a <<distributed-tracing,distributed trace>>.
[float]
[[distributed-tracing]]
==== Distributed tracing

If your trace sample timeline is colorful, it's indicative of a distributed trace.
Services in a distributed trace are separated by color and listed in the order they occur.

[role="screenshot"]
image::apm/images/apm-services-trace.png[Example of distributed trace colors in the APM app in Kibana]

Don't forget; a distributed trace includes more than one transaction.
As application architectures are shifting from monolithic to more distributed, service-based architectures,
distributed tracing has become a crucial feature of modern application performance monitoring.
It allows you to trace requests through your service architecture automatically, and visualize those traces in one single view in the APM app.
From initial web requests to your front-end service, to queries made to your back-end services,
this makes finding possible bottlenecks throughout your application much easier and faster.

[role="screenshot"]
image::apm/images/apm-distributed-tracing.png[Example view of the distributed tracing in APM app in Kibana]

Don't forget; by definition, a distributed trace includes more than one transaction.
When viewing these distributed traces in the timeline waterfall, you'll see this image:apm/images/transaction-icon.png[APM icon] icon,
which indicates the next transaction in the trace.
These transactions can be expanded and viewed in detail by clicking on them.

After exploring these traces,
you can return to the full trace by clicking *View full trace*.

TIP: Distributed tracing is supported by all APM agents, and there's no additional configuration needed.
Loading

0 comments on commit 68dbb1d

Please sign in to comment.