Skip to content

Commit

Permalink
Merge branch 'master' into code-coverage-r-and-d-indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Jun 30, 2020
2 parents 36f70c9 + ad01223 commit 85ac883
Show file tree
Hide file tree
Showing 364 changed files with 12,058 additions and 2,967 deletions.
73 changes: 45 additions & 28 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,63 +64,63 @@ module.exports = {
* Temporarily disable some react rules for specific plugins, remove in separate PRs
*/
{
files: ['packages/kbn-ui-framework/**/*.{js,ts,tsx}'],
files: ['packages/kbn-ui-framework/**/*.{js,mjs,ts,tsx}'],
rules: {
'jsx-a11y/no-onchange': 'off',
},
},
{
files: ['src/plugins/es_ui_shared/**/*.{js,ts,tsx}'],
files: ['src/plugins/es_ui_shared/**/*.{js,mjs,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/plugins/kibana_react/**/*.{js,ts,tsx}'],
files: ['src/plugins/kibana_react/**/*.{js,mjs,ts,tsx}'],
rules: {
'react-hooks/rules-of-hooks': 'off',
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/plugins/kibana_utils/**/*.{js,ts,tsx}'],
files: ['src/plugins/kibana_utils/**/*.{js,mjs,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['x-pack/plugins/canvas/**/*.{js,ts,tsx}'],
files: ['x-pack/plugins/canvas/**/*.{js,mjs,ts,tsx}'],
rules: {
'jsx-a11y/click-events-have-key-events': 'off',
},
},
{
files: ['x-pack/plugins/cross_cluster_replication/**/*.{js,ts,tsx}'],
files: ['x-pack/plugins/cross_cluster_replication/**/*.{js,mjs,ts,tsx}'],
rules: {
'jsx-a11y/click-events-have-key-events': 'off',
},
},
{
files: ['x-pack/legacy/plugins/index_management/**/*.{js,ts,tsx}'],
files: ['x-pack/legacy/plugins/index_management/**/*.{js,mjs,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
'react-hooks/rules-of-hooks': 'off',
},
},
{
files: ['x-pack/plugins/lens/**/*.{js,ts,tsx}'],
files: ['x-pack/plugins/lens/**/*.{js,mjs,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['x-pack/plugins/ml/**/*.{js,ts,tsx}'],
files: ['x-pack/plugins/ml/**/*.{js,mjs,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['x-pack/legacy/plugins/snapshot_restore/**/*.{js,ts,tsx}'],
files: ['x-pack/legacy/plugins/snapshot_restore/**/*.{js,mjs,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
Expand All @@ -132,7 +132,7 @@ module.exports = {
* Licence headers
*/
{
files: ['**/*.{js,ts,tsx}', '!plugins/**/*'],
files: ['**/*.{js,mjs,ts,tsx}', '!plugins/**/*'],
rules: {
'@kbn/eslint/require-license-header': [
'error',
Expand All @@ -153,7 +153,7 @@ module.exports = {
* New Platform client-side
*/
{
files: ['{src,x-pack}/plugins/*/public/**/*.{js,ts,tsx}'],
files: ['{src,x-pack}/plugins/*/public/**/*.{js,mjs,ts,tsx}'],
rules: {
'import/no-commonjs': 'error',
},
Expand All @@ -163,7 +163,7 @@ module.exports = {
* Files that require Elastic license headers instead of Apache 2.0 header
*/
{
files: ['x-pack/**/*.{js,ts,tsx}'],
files: ['x-pack/**/*.{js,mjs,ts,tsx}'],
rules: {
'@kbn/eslint/require-license-header': [
'error',
Expand All @@ -184,7 +184,7 @@ module.exports = {
* Restricted paths
*/
{
files: ['**/*.{js,ts,tsx}'],
files: ['**/*.{js,mjs,ts,tsx}'],
rules: {
'@kbn/eslint/no-restricted-paths': [
'error',
Expand Down Expand Up @@ -251,8 +251,8 @@ module.exports = {
],
from: [
'(src|x-pack)/plugins/**/(public|server)/**/*',
'!(src|x-pack)/plugins/**/(public|server)/mocks/index.{js,ts}',
'!(src|x-pack)/plugins/**/(public|server)/(index|mocks).{js,ts,tsx}',
'!(src|x-pack)/plugins/**/(public|server)/mocks/index.{js,mjs,ts}',
'!(src|x-pack)/plugins/**/(public|server)/(index|mocks).{js,mjs,ts,tsx}',
],
allowSameFolder: true,
errorMessage: 'Plugins may only import from top-level public and server modules.',
Expand All @@ -264,11 +264,11 @@ module.exports = {

'src/legacy/core_plugins/**/*',
'!src/legacy/core_plugins/**/server/**/*',
'!src/legacy/core_plugins/**/index.{js,ts,tsx}',
'!src/legacy/core_plugins/**/index.{js,mjs,ts,tsx}',

'x-pack/legacy/plugins/**/*',
'!x-pack/legacy/plugins/**/server/**/*',
'!x-pack/legacy/plugins/**/index.{js,ts,tsx}',
'!x-pack/legacy/plugins/**/index.{js,mjs,ts,tsx}',

'examples/**/*',
'!examples/**/server/**/*',
Expand Down Expand Up @@ -530,7 +530,7 @@ module.exports = {
* Jest specific rules
*/
{
files: ['**/*.test.{js,ts,tsx}'],
files: ['**/*.test.{js,mjs,ts,tsx}'],
rules: {
'jest/valid-describe': 'error',
},
Expand Down Expand Up @@ -595,8 +595,8 @@ module.exports = {
{
// front end and common typescript and javascript files only
files: [
'x-pack/plugins/security_solution/public/**/*.{js,ts,tsx}',
'x-pack/plugins/security_solution/common/**/*.{js,ts,tsx}',
'x-pack/plugins/security_solution/public/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/security_solution/common/**/*.{js,mjs,ts,tsx}',
],
rules: {
'import/no-nodejs-modules': 'error',
Expand Down Expand Up @@ -646,7 +646,7 @@ module.exports = {
// {
// // will introduced after the other warns are fixed
// // typescript and javascript for front end react performance
// files: ['x-pack/plugins/security_solution/public/**/!(*.test).{js,ts,tsx}'],
// files: ['x-pack/plugins/security_solution/public/**/!(*.test).{js,mjs,ts,tsx}'],
// plugins: ['react-perf'],
// rules: {
// // 'react-perf/jsx-no-new-object-as-prop': 'error',
Expand All @@ -657,7 +657,7 @@ module.exports = {
// },
{
// typescript and javascript for front and back end
files: ['x-pack/{,legacy/}plugins/security_solution/**/*.{js,ts,tsx}'],
files: ['x-pack/{,legacy/}plugins/security_solution/**/*.{js,mjs,ts,tsx}'],
plugins: ['eslint-plugin-node', 'react'],
env: {
mocha: true,
Expand Down Expand Up @@ -776,8 +776,8 @@ module.exports = {
{
// front end and common typescript and javascript files only
files: [
'x-pack/plugins/lists/public/**/*.{js,ts,tsx}',
'x-pack/plugins/lists/common/**/*.{js,ts,tsx}',
'x-pack/plugins/lists/public/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/lists/common/**/*.{js,mjs,ts,tsx}',
],
rules: {
'import/no-nodejs-modules': 'error',
Expand All @@ -792,7 +792,7 @@ module.exports = {
},
{
// typescript and javascript for front and back end
files: ['x-pack/plugins/lists/**/*.{js,ts,tsx}'],
files: ['x-pack/plugins/lists/**/*.{js,mjs,ts,tsx}'],
plugins: ['eslint-plugin-node'],
env: {
mocha: true,
Expand Down Expand Up @@ -1020,8 +1020,8 @@ module.exports = {
*/
{
files: [
'src/plugins/vis_type_timeseries/**/*.{js,ts,tsx}',
'src/legacy/core_plugins/vis_type_timeseries/**/*.{js,ts,tsx}',
'src/plugins/vis_type_timeseries/**/*.{js,mjs,ts,tsx}',
'src/legacy/core_plugins/vis_type_timeseries/**/*.{js,mjs,ts,tsx}',
],
rules: {
'import/no-default-export': 'error',
Expand All @@ -1039,5 +1039,22 @@ module.exports = {
...require('eslint-config-prettier/@typescript-eslint').rules,
},
},

{
files: [
// platform-team owned code
'src/core/**',
'x-pack/plugins/features/**',
'x-pack/plugins/licensing/**',
'x-pack/plugins/global_search/**',
'x-pack/plugins/cloud/**',
'packages/kbn-config-schema',
'src/plugins/status_page/**',
'src/plugins/saved_objects_management/**',
],
rules: {
'@typescript-eslint/prefer-ts-expect-error': 'error',
},
},
],
};
66 changes: 66 additions & 0 deletions docs/apm/troubleshooting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ your proposed changes at https://github.com/elastic/kibana.

Also, check out the https://discuss.elastic.co/c/apm[APM discussion forum].

* <<no-apm-data-found>>
* <<troubleshooting-too-many-transactions>>
* <<troubleshooting-unknown-route>>
* <<troubleshooting-fields-unsearchable>>

[float]
[[no-apm-data-found]]
=== No APM data found
Expand Down Expand Up @@ -58,6 +63,66 @@ Navigate to *APM* > *Settings* > *Indices*, and change all `apm_oss.*Pattern` va
include the new index pattern. For example: `customIndexName-*`.

[float]
[[troubleshooting-too-many-transactions]]
=== Too many unique transaction names

Transaction names are defined in each APM Agent; when an Agent supports a framework,
it includes logic for naming the transactions that the framework creates.
In some cases though, like when using an Agent's API to create custom transactions,
it is up to the user to define a pattern for transaction naming.
When transactions are named incorrectly, each unique URL can be associated with a unique transaction group—causing
an explosion in the number of transaction groups per service, and leading to inaccuracies in the APM app.

To fix a large number of unique transaction names,
you need to change how you are using the Agent API to name your transactions.
To do this, ensure you are **not** naming based on parameters that can change.
For example, user ids, product ids, order numbers, query parameters, etc.,
should be stripped away, and commonality should be found between your unique URLs.

Let's look at an example from the RUM Agent documentation. Here are a few URLs you might find on Elastic.co:

[source,yml]
----
// Blog Posts
https://www.elastic.co/blog/reflections-on-three-years-in-the-elastic-public-sector
https://www.elastic.co/blog/say-heya-to-the-elastic-search-awards
https://www.elastic.co/blog/and-the-winner-of-the-elasticon-2018-training-subscription-drawing-is
// Documentation
https://www.elastic.co/guide/en/elastic-stack/current/index.html
https://www.elastic.co/guide/en/apm/get-started/current/index.html
https://www.elastic.co/guide/en/infrastructure/guide/current/index.html
----

These URLs, like most, include unique names.
If we named transactions based on each unique URL, we'd end up with the problem described above—a
very large number of different transaction names.
Instead, we should strip away the unique information and group our transactions based on common information.
In this case, that means naming all blog transactions, `/blog`, and all documentation transactions, `/guide`.

If you feel like you'd be losing valuable information by following this naming convention, don't fret!
You can always add additional metadata to your transactions using {apm-overview-ref-v}/metadata.html#labels-fields[labels] (indexed) or
{apm-overview-ref-v}/metadata.html#custom-fields[custom context] (non-indexed).

After ensuring you've correctly named your transactions,
you might still see an error in the APM app related to too many transaction names.
If this is the case, you can increase the default number of transaction groups displayed in the APM app by configuring
<<apm-settings-kb,`xpack.apm.ui.transactionGroupBucketSize`>>.

**More information**

While this can happen with any APM Agent, it typically occurs with the RUM Agent.
For more information on how to correctly set `transaction.name` in the RUM Agent,
see {apm-rum-ref}/custom-transaction-name.html[custom initial page load transaction names].

The RUM Agent can also set the `transaction.name` when observing for transaction events.
See {apm-rum-ref}/agent-api.html#observe[`apm.observe()`] for more information.

If your problem is occurring in a different Agent, the tips above still apply.
See the relevant {apm-agents-ref}[Agent API documentation] to adjust how you're naming your transactions.

[float]
[[troubleshooting-unknown-route]]
=== Unknown route

The {apm-app-ref}/transactions.html[transaction overview] will only display helpful information
Expand All @@ -78,6 +143,7 @@ Specifically, view the Agent's supported technologies page.
You can also use the Agent's public API to manually set a name for the transaction.

[float]
[[troubleshooting-fields-unsearchable]]
=== Fields are not searchable

In Elasticsearch, index templates are used to define settings and mappings that determine how fields should be analyzed.
Expand Down
2 changes: 1 addition & 1 deletion docs/developer/core/development-unit-tests.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ yarn test:mocha

[float]
==== Jest
Jest tests are stored in the same directory as source code files with the `.test.{js,ts,tsx}` suffix.
Jest tests are stored in the same directory as source code files with the `.test.{js,mjs,ts,tsx}` suffix.

*Running Jest Unit Tests*

Expand Down
1 change: 0 additions & 1 deletion docs/development/core/public/kibana-plugin-core-public.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [PublicAppInfo](./kibana-plugin-core-public.publicappinfo.md) | Public information about a registered [application](./kibana-plugin-core-public.app.md) |
| [PublicLegacyAppInfo](./kibana-plugin-core-public.publiclegacyappinfo.md) | Information about a registered [legacy application](./kibana-plugin-core-public.legacyapp.md) |
| [PublicUiSettingsParams](./kibana-plugin-core-public.publicuisettingsparams.md) | A sub-set of [UiSettingsParams](./kibana-plugin-core-public.uisettingsparams.md) exposed to the client-side. |
| [RecursiveReadonly](./kibana-plugin-core-public.recursivereadonly.md) | |
| [SavedObjectAttribute](./kibana-plugin-core-public.savedobjectattribute.md) | Type definition for a Saved Object attribute value |
| [SavedObjectAttributeSingle](./kibana-plugin-core-public.savedobjectattributesingle.md) | Don't use this type, it's simply a helper type for [SavedObjectAttribute](./kibana-plugin-core-public.savedobjectattribute.md) |
| [SavedObjectsClientContract](./kibana-plugin-core-public.savedobjectsclientcontract.md) | SavedObjectsClientContract as implemented by the [SavedObjectsClient](./kibana-plugin-core-public.savedobjectsclient.md) |
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion docs/development/core/server/kibana-plugin-core-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [PluginName](./kibana-plugin-core-server.pluginname.md) | Dedicated type for plugin name/id that is supposed to make Map/Set/Arrays that use it as a key or value more obvious. |
| [PluginOpaqueId](./kibana-plugin-core-server.pluginopaqueid.md) | |
| [PublicUiSettingsParams](./kibana-plugin-core-server.publicuisettingsparams.md) | A sub-set of [UiSettingsParams](./kibana-plugin-core-server.uisettingsparams.md) exposed to the client-side. |
| [RecursiveReadonly](./kibana-plugin-core-server.recursivereadonly.md) | |
| [RedirectResponseOptions](./kibana-plugin-core-server.redirectresponseoptions.md) | HTTP response parameters for redirection response |
| [RequestHandler](./kibana-plugin-core-server.requesthandler.md) | A function executed when route path matched requested resource path. Request handler is expected to return a result of one of [KibanaResponseFactory](./kibana-plugin-core-server.kibanaresponsefactory.md) functions. |
| [RequestHandlerContextContainer](./kibana-plugin-core-server.requesthandlercontextcontainer.md) | An object that handles registration of http request context providers. |
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
QueryStringInput: React.FC<Pick<Props, "query" | "placeholder" | "onChange" | "onSubmit" | "prepend" | "indexPatterns" | "dataTestSubj" | "screenTitle" | "disableAutoFocus" | "persistedLog" | "bubbleSubmitEvent" | "languageSwitcherPopoverAnchorPosition">>
QueryStringInput: React.FC<Pick<Props, "query" | "prepend" | "placeholder" | "onChange" | "onSubmit" | "indexPatterns" | "dataTestSubj" | "screenTitle" | "disableAutoFocus" | "persistedLog" | "bubbleSubmitEvent" | "languageSwitcherPopoverAnchorPosition">>
```
Loading

0 comments on commit 85ac883

Please sign in to comment.