Skip to content

Commit

Permalink
Merge branch 'main' into 114625/datatable-embeddable-supports-column-…
Browse files Browse the repository at this point in the history
…sorting
  • Loading branch information
kibanamachine authored Nov 11, 2021
2 parents e49d6cb + 6b25eca commit 6ce61ba
Show file tree
Hide file tree
Showing 714 changed files with 9,495 additions and 6,685 deletions.
5 changes: 4 additions & 1 deletion .buildkite/scripts/common/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ export ELASTIC_APM_TRANSACTION_SAMPLE_RATE=0.1
if is_pr; then
if [[ "${GITHUB_PR_LABELS:-}" == *"ci:collect-apm"* ]]; then
export ELASTIC_APM_ACTIVE=true
export ELASTIC_APM_CONTEXT_PROPAGATION_ONLY=false
else
export ELASTIC_APM_ACTIVE=false
export ELASTIC_APM_ACTIVE=true
export ELASTIC_APM_CONTEXT_PROPAGATION_ONLY=true
fi

if [[ "${GITHUB_STEP_COMMIT_STATUS_ENABLED:-}" != "true" ]]; then
Expand All @@ -61,6 +63,7 @@ if is_pr; then
export PR_TARGET_BRANCH="$GITHUB_PR_TARGET_BRANCH"
else
export ELASTIC_APM_ACTIVE=true
export ELASTIC_APM_CONTEXT_PROPAGATION_ONLY=false
export CHECKS_REPORTER_ACTIVE=false
fi

Expand Down
22 changes: 16 additions & 6 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
/examples/url_generators_explorer/ @elastic/kibana-app-services
/examples/field_formats_example/ @elastic/kibana-app-services
/examples/partial_results_example/ @elastic/kibana-app-services
/examples/search_examples/ @elastic/kibana-app-services
/packages/elastic-datemath/ @elastic/kibana-app-services
/packages/kbn-interpreter/ @elastic/kibana-app-services
/packages/kbn-react-field/ @elastic/kibana-app-services
Expand All @@ -78,24 +79,33 @@
/src/plugins/ui_actions/ @elastic/kibana-app-services
/src/plugins/index_pattern_field_editor @elastic/kibana-app-services
/src/plugins/screenshot_mode @elastic/kibana-app-services
/src/plugins/bfetch/ @elastic/kibana-app-services
/src/plugins/index_pattern_management/ @elastic/kibana-app-services
/src/plugins/inspector/ @elastic/kibana-app-services
/x-pack/examples/ui_actions_enhanced_examples/ @elastic/kibana-app-services
/x-pack/plugins/data_enhanced/ @elastic/kibana-app-services
/x-pack/plugins/embeddable_enhanced/ @elastic/kibana-app-services
/x-pack/plugins/ui_actions_enhanced/ @elastic/kibana-app-services
/x-pack/plugins/runtime_fields @elastic/kibana-app-services
/x-pack/test/search_sessions_integration/ @elastic/kibana-app-services
#CC# /src/plugins/bfetch/ @elastic/kibana-app-services
#CC# /src/plugins/index_pattern_management/ @elastic/kibana-app-services
#CC# /src/plugins/inspector/ @elastic/kibana-app-services
#CC# /src/plugins/share/ @elastic/kibana-app-services
#CC# /x-pack/plugins/drilldowns/ @elastic/kibana-app-services
#CC# /packages/kbn-interpreter/ @elastic/kibana-app-services

### Observability Plugins

# Observability Shared
/x-pack/plugins/observability/ @elastic/observability-ui

# Unified Observability
/x-pack/plugins/observability/public/pages/overview @elastic/unified-observability
/x-pack/plugins/observability/public/pages/home @elastic/unified-observability
/x-pack/plugins/observability/public/pages/landing @elastic/unified-observability
/x-pack/plugins/observability/public/context @elastic/unified-observability

# Actionable Observability
/x-pack/plugins/observability/common/rules @elastic/actionable-observability
/x-pack/plugins/observability/public/rules @elastic/actionable-observability
/x-pack/plugins/observability/public/pages/alerts @elastic/actionable-observability
/x-pack/plugins/observability/public/pages/cases @elastic/actionable-observability

# Infra Monitoring
/x-pack/plugins/infra/ @elastic/infra-monitoring-ui
/x-pack/test/functional/apps/infra @elastic/infra-monitoring-ui
Expand Down
54 changes: 27 additions & 27 deletions api_docs/apm.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ readonly links: {
readonly range: string;
readonly significant_terms: string;
readonly terms: string;
readonly terms_doc_count_error: string;
readonly avg: string;
readonly avg_bucket: string;
readonly max_bucket: string;
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/user/alerting/rule-types/es-query.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Define properties to detect the condition.
[role="screenshot"]
image::user/alerting/images/rule-types-es-query-conditions.png[Five clauses define the condition to detect]

Index:: This clause requires an *index or index pattern* and a *time field* that will be used for the *time window*.
Index:: This clause requires an *index or data view* and a *time field* that will be used for the *time window*.
Size:: This clause specifies the number of documents to pass to the configured actions when the the threshold condition is met.
{es} query:: This clause specifies the ES DSL query to execute. The number of documents that match this query will be evaluated against the threshold
condition. Aggregations are not supported at this time.
Expand Down
10 changes: 5 additions & 5 deletions docs/user/alerting/rule-types/geo-rule-types.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ In the event that an entity is contained within a boundary, an alert may be gene
==== Requirements
To create a Tracking containment rule, the following requirements must be present:

- *Tracks index or index pattern*: An index containing a `geo_point` field, `date` field,
- *Tracks index or data view*: An index containing a `geo_point` field, `date` field,
and some form of entity identifier. An entity identifier is a `keyword` or `number`
field that consistently identifies the entity to be tracked. The data in this index should be dynamically
updating so that there are entity movements to alert upon.
- *Boundaries index or index pattern*: An index containing `geo_shape` data, such as boundary data and bounding box data.
- *Boundaries index or data view*: An index containing `geo_shape` data, such as boundary data and bounding box data.
This data is presumed to be static (not updating). Shape data matching the query is
harvested once when the rule is created and anytime after when the rule is re-enabled
after disablement.

By design, current interval entity locations (_current_ is determined by `date` in
the *Tracked index or index pattern*) are queried to determine if they are contained
the *Tracked index or data view*) are queried to determine if they are contained
within any monitored boundaries. Entity
data should be somewhat "real time", meaning the dates of new documents aren’t older
than the current time minus the amount of the interval. If data older than
Expand All @@ -39,13 +39,13 @@ as well as 2 Kuery bars used to provide additional filtering context for each of
[role="screenshot"]
image::user/alerting/images/alert-types-tracking-containment-conditions.png[Five clauses define the condition to detect]

Index (entity):: This clause requires an *index or index pattern*, a *time field* that will be used for the *time window*, and a *`geo_point` field* for tracking.
Index (entity):: This clause requires an *index or data view*, a *time field* that will be used for the *time window*, and a *`geo_point` field* for tracking.
When entity:: This clause specifies which crossing option to track. The values
*Entered*, *Exited*, and *Crossed* can be selected to indicate which crossing conditions
should trigger a rule. *Entered* alerts on entry into a boundary, *Exited* alerts on exit
from a boundary, and *Crossed* alerts on all boundary crossings whether they be entrances
or exits.
Index (Boundary):: This clause requires an *index or index pattern*, a *`geo_shape` field*
Index (Boundary):: This clause requires an *index or data view*, a *`geo_shape` field*
identifying boundaries, and an optional *Human-readable boundary name* for better alerting
messages.

Expand Down
2 changes: 1 addition & 1 deletion docs/user/alerting/rule-types/index-threshold.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Define properties to detect the condition.
[role="screenshot"]
image::user/alerting/images/rule-types-index-threshold-conditions.png[Five clauses define the condition to detect]

Index:: This clause requires an *index or index pattern* and a *time field* that will be used for the *time window*.
Index:: This clause requires an *index or data view* and a *time field* that will be used for the *time window*.
When:: This clause specifies how the value to be compared to the threshold is calculated. The value is calculated by aggregating a numeric field a the *time window*. The aggregation options are: `count`, `average`, `sum`, `min`, and `max`. When using `count` the document count is used, and an aggregation field is not necessary.
Over/Grouped Over:: This clause lets you configure whether the aggregation is applied over all documents, or should be split into groups using a grouping field. If grouping is used, an <<alerting-concepts-alerts, alert>> will be created for each group when it exceeds the threshold. To limit the number of alerts on high cardinality fields, you must specify the number of groups to check against the threshold. Only the *top* groups are checked.
Threshold:: This clause defines a threshold value and a comparison operator (one of `is above`, `is above or equals`, `is below`, `is below or equals`, or `is between`). The result of the aggregation is compared to this threshold.
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@
"archiver": "^5.2.0",
"axios": "^0.21.1",
"base64-js": "^1.3.1",
"bluebird": "3.5.5",
"brace": "0.11.1",
"broadcast-channel": "^4.2.0",
"chalk": "^4.1.0",
Expand Down Expand Up @@ -223,7 +222,7 @@
"deep-freeze-strict": "^1.1.1",
"deepmerge": "^4.2.2",
"del": "^5.1.0",
"elastic-apm-node": "^3.23.0",
"elastic-apm-node": "3.24.0",
"execa": "^4.0.2",
"exit-hook": "^2.2.0",
"expiry-js": "0.1.7",
Expand Down Expand Up @@ -494,7 +493,6 @@
"@types/archiver": "^5.1.0",
"@types/babel__core": "^7.1.16",
"@types/base64-js": "^1.2.5",
"@types/bluebird": "^3.1.1",
"@types/chance": "^1.0.0",
"@types/chroma-js": "^1.4.2",
"@types/chromedriver": "^81.0.0",
Expand Down
10 changes: 10 additions & 0 deletions packages/elastic-eslint-config-kibana/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ module.exports = {
exclude: USES_STYLED_COMPONENTS,
disallowedMessage: `Prefer using @emotion/react instead. To use styled-components, ensure you plugin is enabled in @kbn/dev-utils/src/babel.ts.`
},
...[
'@elastic/eui/dist/eui_theme_light.json',
'@elastic/eui/dist/eui_theme_dark.json',
'@elastic/eui/dist/eui_theme_amsterdam_light.json',
'@elastic/eui/dist/eui_theme_amsterdam_dark.json',
].map(from => ({
from,
to: false,
disallowedMessage: `Use "@kbn/ui-shared-deps-src/theme" to access theme vars.`
})),
],
],

Expand Down
139 changes: 133 additions & 6 deletions packages/kbn-apm-config-loader/src/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('ApmConfiguration', () => {
beforeEach(() => {
// start with an empty env to avoid CI from spoiling snapshots, env is unique for each jest file
process.env = {};

devConfigMock.raw = {};
packageMock.raw = {
version: '8.0.0',
build: {
Expand Down Expand Up @@ -86,10 +86,11 @@ describe('ApmConfiguration', () => {
let config = new ApmConfiguration(mockedRootDir, {}, false);
expect(config.getConfig('serviceName')).toMatchInlineSnapshot(`
Object {
"active": false,
"active": true,
"breakdownMetrics": true,
"captureSpanStackTraces": false,
"centralConfig": false,
"contextPropagationOnly": true,
"environment": "development",
"globalLabels": Object {},
"logUncaughtExceptions": true,
Expand All @@ -105,12 +106,13 @@ describe('ApmConfiguration', () => {
config = new ApmConfiguration(mockedRootDir, {}, true);
expect(config.getConfig('serviceName')).toMatchInlineSnapshot(`
Object {
"active": false,
"active": true,
"breakdownMetrics": false,
"captureBody": "off",
"captureHeaders": false,
"captureSpanStackTraces": false,
"centralConfig": false,
"contextPropagationOnly": true,
"environment": "development",
"globalLabels": Object {
"git_rev": "sha",
Expand Down Expand Up @@ -162,13 +164,12 @@ describe('ApmConfiguration', () => {

it('does not load the configuration from the dev config in distributable', () => {
devConfigMock.raw = {
active: true,
serverUrl: 'https://dev-url.co',
active: false,
};
const config = new ApmConfiguration(mockedRootDir, {}, true);
expect(config.getConfig('serviceName')).toEqual(
expect.objectContaining({
active: false,
active: true,
})
);
});
Expand Down Expand Up @@ -224,4 +225,130 @@ describe('ApmConfiguration', () => {
})
);
});

describe('contextPropagationOnly', () => {
it('sets "active: true" and "contextPropagationOnly: true" by default', () => {
expect(new ApmConfiguration(mockedRootDir, {}, false).getConfig('serviceName')).toEqual(
expect.objectContaining({
active: true,
contextPropagationOnly: true,
})
);

expect(new ApmConfiguration(mockedRootDir, {}, true).getConfig('serviceName')).toEqual(
expect.objectContaining({
active: true,
contextPropagationOnly: true,
})
);
});

it('value from config overrides the default', () => {
const kibanaConfig = {
elastic: {
apm: {
active: false,
contextPropagationOnly: false,
},
},
};

expect(
new ApmConfiguration(mockedRootDir, kibanaConfig, false).getConfig('serviceName')
).toEqual(
expect.objectContaining({
active: false,
contextPropagationOnly: false,
})
);

expect(
new ApmConfiguration(mockedRootDir, kibanaConfig, true).getConfig('serviceName')
).toEqual(
expect.objectContaining({
active: false,
contextPropagationOnly: false,
})
);
});

it('is "false" if "active: true" configured and "contextPropagationOnly" is not specified', () => {
const kibanaConfig = {
elastic: {
apm: {
active: true,
},
},
};

expect(
new ApmConfiguration(mockedRootDir, kibanaConfig, false).getConfig('serviceName')
).toEqual(
expect.objectContaining({
active: true,
contextPropagationOnly: false,
})
);

expect(
new ApmConfiguration(mockedRootDir, kibanaConfig, true).getConfig('serviceName')
).toEqual(
expect.objectContaining({
active: true,
contextPropagationOnly: false,
})
);
});

it('throws if "active: false" set without configuring "contextPropagationOnly: false"', () => {
const kibanaConfig = {
elastic: {
apm: {
active: false,
},
},
};

expect(() =>
new ApmConfiguration(mockedRootDir, kibanaConfig, false).getConfig('serviceName')
).toThrowErrorMatchingInlineSnapshot(
`"APM is disabled, but context propagation is enabled. Please disable context propagation with contextPropagationOnly:false"`
);

expect(() =>
new ApmConfiguration(mockedRootDir, kibanaConfig, true).getConfig('serviceName')
).toThrowErrorMatchingInlineSnapshot(
`"APM is disabled, but context propagation is enabled. Please disable context propagation with contextPropagationOnly:false"`
);
});

it('does not throw if "active: false" and "contextPropagationOnly: false" configured', () => {
const kibanaConfig = {
elastic: {
apm: {
active: false,
contextPropagationOnly: false,
},
},
};

expect(
new ApmConfiguration(mockedRootDir, kibanaConfig, false).getConfig('serviceName')
).toEqual(
expect.objectContaining({
active: false,
contextPropagationOnly: false,
})
);

expect(
new ApmConfiguration(mockedRootDir, kibanaConfig, true).getConfig('serviceName')
).toEqual(
expect.objectContaining({
active: false,
contextPropagationOnly: false,
})
);
});
});
});
Loading

0 comments on commit 6ce61ba

Please sign in to comment.