Skip to content

Commit

Permalink
Merge branch 'master' into add-filter-key
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankHassanabad committed Sep 2, 2021
2 parents c31fccd + 4f0a63f commit 42d0a9e
Show file tree
Hide file tree
Showing 95 changed files with 1,606 additions and 905 deletions.
2 changes: 1 addition & 1 deletion .buildkite/scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -euo pipefail
source .buildkite/scripts/common/util.sh

echo "--- yarn install and bootstrap"
yarn kbn bootstrap --verbose
yarn kbn bootstrap

###
### upload ts-refs-cache artifacts as quickly as possible so they are available for download
Expand Down
3 changes: 1 addition & 2 deletions .buildkite/scripts/build_kibana_plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ node scripts/build_kibana_platform_plugins \
--scan-dir "$XPACK_DIR/test/licensing_plugin/plugins" \
--scan-dir "$XPACK_DIR/test/usage_collection/plugins" \
--scan-dir "$XPACK_DIR/test/security_functional/fixtures/common" \
--scan-dir "$XPACK_DIR/examples" \
--verbose
--scan-dir "$XPACK_DIR/examples"

echo "--- Archive built plugins"
shopt -s globstar
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/sync-main-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Synchronize all pushes to 'master' branch with 'main' branch to facilitate migration
name: "Sync main branch"
on:
push:
branches:
- master

jobs:
sync_latest_from_upstream:
runs-on: ubuntu-latest
name: Sync latest commits from master branch

steps:
- name: Checkout target repo
uses: actions/checkout@v2
with:
ref: main

- name: Sync upstream changes
id: sync
uses: aormsby/[email protected]
with:
target_sync_branch: main
target_repo_token: ${{ secrets.KIBANAMACHINE_TOKEN }}
upstream_sync_branch: master
upstream_sync_repo: elastic/kibana
25 changes: 12 additions & 13 deletions docs/apm/correlations.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,33 @@ piece of hardware, like a host or pod. Or, perhaps a set of users, based on IP
address or region, is facing increased latency due to local data center issues.

To find correlations, select a service on the *Services* page in the {apm-app}
and click **View correlations**.
then select a transaction group from the *Transactions* tab.

NOTE: Queries within the {apm-app} are also applied to the correlations.

[discrete]
[[correlations-latency]]
==== Find high transaction latency correlations

The correlations on the *Latency* tab help you discover which attributes are
contributing to increased transaction latency.
The correlations on the *Latency correlations* tab help you discover which
attributes are contributing to increased transaction latency.

[role="screenshot"]
image::apm/images/correlations-hover.png[Latency correlations]

The progress bar indicates the status of the asynchronous analysis, which
performs statistical searches across a large number of attributes. For large
time ranges and services with high transaction throughput this might take some
time. To improve performance, reduce the time range on the service overview
page.
time ranges and services with high transaction throughput, this might take some
time. To improve performance, reduce the time range.

The latency distribution chart visualizes the overall latency of the
transactions in the service. If there are attributes that have a statistically
significant correlation with slow response times, they are listed in a table
below the chart. The table is sorted by correlation coefficients that range from
0 to 1. Attributes with higher correlation values are more likely to contribute
to high latency transactions. By default, the attribute with the highest
correlation value is added to the chart. To see the latency distribution for
other attributes, hover over their row in the table.
transactions in the transaction group. If there are attributes that have a
statistically significant correlation with slow response times, they are listed
in a table below the chart. The table is sorted by correlation coefficients that
range from 0 to 1. Attributes with higher correlation values are more likely to
contribute to high latency transactions. By default, the attribute with the
highest correlation value is added to the chart. To see the latency distribution
for other attributes, hover over their row in the table.

If a correlated attribute seems noteworthy, use the **Filter** quick links:

Expand Down
Binary file modified docs/apm/images/correlations-hover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
```typescript
readonly links: {
readonly settings: string;
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
};
readonly canvas: {
readonly guide: string;
};
Expand Down
2 changes: 1 addition & 1 deletion docs/settings/reporting-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ With Security enabled, Reporting has two forms of access control: each user can

[NOTE]
============================================================================
The `xpack.reporting.roles` settings are for a deprecated system of access control in Reporting. It does not allow API Keys to generate reports, and it doesn't allow {kib} application privileges. We recommend you explicitly turn off reporting's deprecated access control feature by adding `xpack.reporting.roles.enabled: false` in kibana.yml. This will enable application privileges for reporting, as described in <<grant-user-access, granting users access to reporting>>.
The `xpack.reporting.roles` settings are for a deprecated system of access control in Reporting. It does not allow API Keys to generate reports, and it doesn't allow {kib} application privileges. We recommend you explicitly turn off reporting's deprecated access control feature by adding `xpack.reporting.roles.enabled: false` in kibana.yml. This will enable you to create custom roles that provide application privileges for reporting, as described in <<grant-user-access, granting users access to reporting>>.
============================================================================

[[xpack-reporting-roles-enabled]] `xpack.reporting.roles.enabled`::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,12 @@ export class CiStatsReporter {
? `${error.response.status} response`
: 'no response';

const seconds = attempt * 10;
this.log.warning(
`failed to reach ci-stats service [reason=${reason}], retrying in ${attempt} seconds`
`failed to reach ci-stats service, retrying in ${seconds} seconds, [reason=${reason}], [error=${error.message}]`
);

await new Promise((resolve) => setTimeout(resolve, attempt * 1000));
await new Promise((resolve) => setTimeout(resolve, seconds * 1000));
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-pm/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59656,8 +59656,9 @@ class CiStatsReporter {


const reason = error !== null && error !== void 0 && (_error$response = error.response) !== null && _error$response !== void 0 && _error$response.status ? `${error.response.status} response` : 'no response';
this.log.warning(`failed to reach ci-stats service [reason=${reason}], retrying in ${attempt} seconds`);
await new Promise(resolve => setTimeout(resolve, attempt * 1000));
const seconds = attempt * 10;
this.log.warning(`failed to reach ci-stats service, retrying in ${seconds} seconds, [reason=${reason}], [error=${error.message}]`);
await new Promise(resolve => setTimeout(resolve, seconds * 1000));
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/kbn-rule-data-utils/src/technical_field_names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const ALERT_DURATION = `${ALERT_NAMESPACE}.duration.us` as const;
const ALERT_END = `${ALERT_NAMESPACE}.end` as const;
const ALERT_EVALUATION_THRESHOLD = `${ALERT_NAMESPACE}.evaluation.threshold` as const;
const ALERT_EVALUATION_VALUE = `${ALERT_NAMESPACE}.evaluation.value` as const;
const ALERT_ID = `${ALERT_NAMESPACE}.id` as const;
const ALERT_INSTANCE_ID = `${ALERT_NAMESPACE}.instance.id` as const;
const ALERT_REASON = `${ALERT_NAMESPACE}.reason` as const;
const ALERT_RISK_SCORE = `${ALERT_NAMESPACE}.risk_score` as const;
const ALERT_SEVERITY = `${ALERT_NAMESPACE}.severity` as const;
Expand Down Expand Up @@ -94,7 +94,7 @@ const fields = {
ALERT_END,
ALERT_EVALUATION_THRESHOLD,
ALERT_EVALUATION_VALUE,
ALERT_ID,
ALERT_INSTANCE_ID,
ALERT_RULE_CONSUMER,
ALERT_RULE_PRODUCER,
ALERT_REASON,
Expand Down Expand Up @@ -143,7 +143,7 @@ export {
ALERT_END,
ALERT_EVALUATION_THRESHOLD,
ALERT_EVALUATION_VALUE,
ALERT_ID,
ALERT_INSTANCE_ID,
ALERT_NAMESPACE,
ALERT_RULE_NAMESPACE,
ALERT_RULE_CONSUMER,
Expand Down
8 changes: 8 additions & 0 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ export class DocLinksService {
ELASTIC_WEBSITE_URL,
links: {
settings: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/settings.html`,
apm: {
kibanaSettings: `${KIBANA_DOCS}apm-settings-in-kibana.html`,
supportedServiceMaps: `${KIBANA_DOCS}service-maps.html#service-maps-supported`,
},
canvas: {
guide: `${KIBANA_DOCS}canvas.html`,
},
Expand Down Expand Up @@ -451,6 +455,10 @@ export interface DocLinksStart {
readonly ELASTIC_WEBSITE_URL: string;
readonly links: {
readonly settings: string;
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
};
readonly canvas: {
readonly guide: string;
};
Expand Down
4 changes: 4 additions & 0 deletions src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,10 @@ export interface DocLinksStart {
// (undocumented)
readonly links: {
readonly settings: string;
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
};
readonly canvas: {
readonly guide: string;
};
Expand Down
2 changes: 1 addition & 1 deletion test/scripts/checks/commit/commit_check_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ If you want, you can still manually install the pre-commit hook locally by runni
!!!!!!!!!!!!!!!!!!!!!!!!!!!
"

node scripts/precommit_hook.js --ref HEAD~1..HEAD --max-files 200 --verbose
node scripts/precommit_hook.js --ref HEAD~1..HEAD --max-files 200
}

run_quick_commit_checks
2 changes: 1 addition & 1 deletion test/scripts/jenkins_apm_cypress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo " -> Running APM cypress tests"
cd "$XPACK_DIR"

checks-reporter-with-killswitch "APM Cypress Tests" \
node plugins/apm/scripts/ftr_e2e/cypress_run
node plugins/apm/scripts/test/e2e.js

echo ""
echo ""
4 changes: 2 additions & 2 deletions test/scripts/jenkins_unit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ if [[ -z "$CODE_COVERAGE" ]] ; then
./test/scripts/checks/test_hardening.sh
else
echo " -> Running jest tests with coverage"
node scripts/jest --ci --verbose --maxWorkers=8 --coverage || true;
node scripts/jest --ci --maxWorkers=8 --coverage || true;

echo " -> Running jest integration tests with coverage"
node scripts/jest_integration --ci --verbose --coverage || true;
node scripts/jest_integration --ci --coverage || true;

echo " -> Combine code coverage in a single report"
yarn nyc report --nycrc-path src/dev/code_coverage/nyc_config/nyc.jest.config.js
Expand Down
3 changes: 1 addition & 2 deletions test/scripts/jenkins_xpack_build_plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ node scripts/build_kibana_platform_plugins \
--scan-dir "$XPACK_DIR/test/security_functional/fixtures/common" \
--scan-dir "$KIBANA_DIR/examples" \
--scan-dir "$XPACK_DIR/examples" \
--workers 12 \
--verbose
--workers 12
2 changes: 1 addition & 1 deletion test/scripts/test/jest_integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
source src/dev/ci_setup/setup_env.sh

checks-reporter-with-killswitch "Jest Integration Tests" \
node scripts/jest_integration --ci --verbose
node scripts/jest_integration --ci
2 changes: 1 addition & 1 deletion test/scripts/test/jest_unit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
source src/dev/ci_setup/setup_env.sh

checks-reporter-with-killswitch "Jest Unit Tests" \
node scripts/jest --ci --verbose --maxWorkers=6
node scripts/jest --ci --maxWorkers=6
8 changes: 4 additions & 4 deletions x-pack/plugins/alerting/server/health/get_state.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ describe('getHealthServiceStatusWithRetryAndErrorHandling', () => {
})
).toPromise();

expect(status.level).toEqual(ServiceStatusLevels.unavailable);
expect(status.summary).toEqual('Alerting framework is unavailable');
expect(status.level).toEqual(ServiceStatusLevels.degraded);
expect(status.summary).toEqual('Alerting framework is degraded');
expect(status.meta).toBeUndefined();
});

Expand Down Expand Up @@ -275,8 +275,8 @@ describe('getHealthServiceStatusWithRetryAndErrorHandling', () => {
}),
retryDelay
).subscribe((status) => {
expect(status.level).toEqual(ServiceStatusLevels.unavailable);
expect(status.summary).toEqual('Alerting framework is unavailable');
expect(status.level).toEqual(ServiceStatusLevels.degraded);
expect(status.summary).toEqual('Alerting framework is degraded');
expect(status.meta).toEqual({ error: err });
});

Expand Down
10 changes: 4 additions & 6 deletions x-pack/plugins/alerting/server/health/get_state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ const getHealthServiceStatus = async (
const level =
doc.state?.health_status === HealthStatus.OK
? ServiceStatusLevels.available
: doc.state?.health_status === HealthStatus.Warning
? ServiceStatusLevels.degraded
: ServiceStatusLevels.unavailable;
: ServiceStatusLevels.degraded;
return {
level,
summary: LEVEL_SUMMARY[level.toString()],
Expand All @@ -102,10 +100,10 @@ export const getHealthServiceStatusWithRetryAndErrorHandling = (
);
}),
catchError((error) => {
logger.warn(`Alerting framework is unavailable due to the error: ${error}`);
logger.warn(`Alerting framework is degraded due to the error: ${error}`);
return of({
level: ServiceStatusLevels.unavailable,
summary: LEVEL_SUMMARY[ServiceStatusLevels.unavailable.toString()],
level: ServiceStatusLevels.degraded,
summary: LEVEL_SUMMARY[ServiceStatusLevels.degraded.toString()],
meta: { error },
});
})
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/alerting/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export class AlertingPlugin {
);

const serviceStatus$ = new BehaviorSubject<ServiceStatus>({
level: ServiceStatusLevels.unavailable,
level: ServiceStatusLevels.degraded,
summary: 'Alerting is initializing',
});
core.status.set(serviceStatus$);
Expand Down
21 changes: 1 addition & 20 deletions x-pack/plugins/apm/ftr_e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,4 @@ APM uses [FTR](../../../../packages/kbn-test/README.md) (functional test runner)

## Running tests

**Run all tests**

```sh
//kibana directory
node x-pack/plugins/apm/scripts/ftr_e2e/cypress_run.js
```

**Run specific test**

```sh
//kibana directory
node x-pack/plugins/apm/scripts/ftr_e2e/cypress_run.js --spec ./cypress/integration/read_only_user/home.spec.ts
```

## Opening tests

```sh
//kibana directory
node x-pack/plugins/apm/scripts/ftr_e2e/cypress_open.js
```
Go to [tests documentation](../scripts/test#e2e-tests-cypress/README.md)
4 changes: 4 additions & 0 deletions x-pack/plugins/apm/ftr_e2e/cypress_start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* 2.0.
*/

/* eslint-disable no-console */

import Url from 'url';
import cypress from 'cypress';
import { FtrProviderContext } from './ftr_provider_context';
Expand Down Expand Up @@ -59,6 +61,7 @@ async function cypressStart(
},
});

console.log('Loading esArchiver...');
await esArchiverLoad('apm_8.0.0');

const res = await cypressExecution({
Expand All @@ -71,6 +74,7 @@ async function cypressStart(
},
});

console.log('Removing esArchiver...');
await esArchiverUnload('apm_8.0.0');

return res;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function LatencyCorrelationsHelpPopover() {
<p>
<FormattedMessage
id="xpack.apm.correlations.latencyPopoverChartExplanation"
defaultMessage="The latency distribution chart visualizes the overall latency of the transactions in the service. When you hover over attributes in the table, their latency distribution is added to the chart."
defaultMessage="The latency distribution chart visualizes the overall latency of the transactions in the transaction group. When you hover over attributes in the table, their latency distribution is added to the chart."
/>
</p>
<p>
Expand Down
Loading

0 comments on commit 42d0a9e

Please sign in to comment.