Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into nls/bubble-tips
Browse files Browse the repository at this point in the history
  • Loading branch information
smith committed Apr 1, 2021
2 parents 3d1cf42 + 8f2db91 commit df2fbdc
Show file tree
Hide file tree
Showing 105 changed files with 2,365 additions and 999 deletions.
5 changes: 4 additions & 1 deletion .bazelignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
.idea
.teamcity
.yarn-local-mirror
/bazel
bazel-bin
bazel-kibana
bazel-out
bazel-testlogs
build
node_modules
target
5 changes: 2 additions & 3 deletions .bazelrc.common
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@ build --disk_cache=~/.bazel-cache/disk-cache
build --repository_cache=~/.bazel-cache/repository-cache

# Bazel will create symlinks from the workspace directory to output artifacts.
# Build results will be placed in a directory called "bazel/bin"
# Build results will be placed in a directory called "bazel-bin"
# This will still create a bazel-out symlink in
# the project directory, which must be excluded from the
# editor's search path.
build --symlink_prefix=bazel/
# To disable the symlinks altogether (including bazel-out) we can use
# build --symlink_prefix=/
# however this makes it harder to find outputs.

# Prevents the creation of bazel-out dir
build --experimental_no_product_name_out_symlink
# build --experimental_no_product_name_out_symlink

# Make direct file system calls to create symlink trees
build --experimental_inprocess_symlink_creation
Expand Down
6 changes: 4 additions & 2 deletions .ci/packer_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

set -e

# cache image used by kibana-load-testing project
docker pull "maven:3.6.3-openjdk-8-slim"
if [[ "$(which docker)" != "" && "$(command uname -m)" != "aarch64" ]]; then
# cache image used by kibana-load-testing project
docker pull "maven:3.6.3-openjdk-8-slim"
fi

./.ci/packer_cache_for_branch.sh master
./.ci/packer_cache_for_branch.sh 7.x
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ snapshots.js
/packages/kbn-monaco/src/painless/antlr

# Bazel
/bazel
/bazel-*
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,6 @@ report.asciidoc
.yarn-local-mirror

# Bazel
/bazel
/.bazelrc.user
bazel
bazel-*
.bazelrc.user
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
x-pack/plugins/canvas/shareable_runtime/**/*.s+(a|c)ss
build
target
bazel-*
3 changes: 1 addition & 2 deletions docs/maps/maps-aggregations.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ then accumulates the most relevant documents based on sort order for each entry

To enable top hits:

. Click *Add layer*, then select the *Documents* layer.
. Click *Add layer*, then select the *Top hits per entity* layer.
. Configure *Index pattern* and *Geospatial field*.
. In *Scaling*, select *Show top hits per entity*.
. Set *Entity* to the field that identifies entities in your documents.
This field will be used in the terms aggregation to group your documents into entity buckets.
. Set *Documents per entity* to configure the maximum number of documents accumulated per entity.
Expand Down
5 changes: 3 additions & 2 deletions docs/maps/vector-layer.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ Select the appropriate *Scaling* option for your use case.
* *Limit results to 10000.* The layer displays features from the first `index.max_result_window` documents.
Results exceeding `index.max_result_window` are not displayed.

* *Show top hits per entity.* The layer displays the <<maps-top-hits-aggregation, most relevant documents per entity>>.

* *Show clusters when results exceed 10000.* When results exceed `index.max_result_window`, the layer uses {ref}/search-aggregations-bucket-geotilegrid-aggregation.html[GeoTile grid aggregation] to group your documents into clusters and displays metrics for each cluster. When results are less then `index.max_result_window`, the layer displays features from individual documents.

* *Use vector tiles.* Vector tiles partition your map into 6 to 8 tiles.
Expand All @@ -36,6 +34,9 @@ Tiles exceeding `index.max_result_window` have a visual indicator when there are
*Point to point*:: Aggregated data paths between the source and destination.
The index must contain at least 2 fields mapped as {ref}/geo-point.html[geo_point], source and destination.

*Top hits per entity*:: The layer displays the <<maps-top-hits-aggregation, most relevant documents per entity>>.
The index must contain at least one field mapped as {ref}/geo-point.html[geo_point] or {ref}/geo-shape.html[geo_shape].

*Tracks*:: Create lines from points.
The index must contain at least one field mapped as {ref}/geo-point.html[geo_point].

Expand Down
8 changes: 4 additions & 4 deletions packages/kbn-pm/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22981,7 +22981,7 @@ class Project {

ensureValidProjectDependency(project) {
const relativePathToProject = normalizePath(path__WEBPACK_IMPORTED_MODULE_1___default.a.relative(this.path, project.path));
const relativePathToProjectIfBazelPkg = normalizePath(path__WEBPACK_IMPORTED_MODULE_1___default.a.relative(this.path, `bazel/bin/packages/${path__WEBPACK_IMPORTED_MODULE_1___default.a.basename(project.path)}`));
const relativePathToProjectIfBazelPkg = normalizePath(path__WEBPACK_IMPORTED_MODULE_1___default.a.relative(this.path, `bazel-bin/packages/${path__WEBPACK_IMPORTED_MODULE_1___default.a.basename(project.path)}`));
const versionInPackageJson = this.allDependencies[project.name];
const expectedVersionInPackageJson = `link:${relativePathToProject}`;
const expectedVersionInPackageJsonIfBazelPkg = `link:${relativePathToProjectIfBazelPkg}`; // TODO: after introduce bazel to build all the packages and completely remove the support for kbn packages
Expand Down Expand Up @@ -23143,7 +23143,7 @@ const createProductionPackageJson = pkgJson => _objectSpread(_objectSpread({}, p
dependencies: transformDependencies(pkgJson.dependencies)
});
const isLinkDependency = depVersion => depVersion.startsWith('link:');
const isBazelPackageDependency = depVersion => depVersion.startsWith('link:bazel/bin/');
const isBazelPackageDependency = depVersion => depVersion.startsWith('link:bazel-bin/');
/**
* Replaces `link:` dependencies with `file:` dependencies. When installing
* dependencies, these `file:` dependencies will be copied into `node_modules`
Expand All @@ -23153,7 +23153,7 @@ const isBazelPackageDependency = depVersion => depVersion.startsWith('link:bazel
* will then _copy_ the `file:` dependencies into `node_modules` instead of
* symlinking like we do in development.
*
* Additionally it also taken care of replacing `link:bazel/bin/` with
* Additionally it also taken care of replacing `link:bazel-bin/` with
* `file:` so we can also support the copy of the Bazel packages dist already into
* build/packages to be copied into the node_modules
*/
Expand All @@ -23170,7 +23170,7 @@ function transformDependencies(dependencies = {}) {
}

if (isBazelPackageDependency(depVersion)) {
newDeps[name] = depVersion.replace('link:bazel/bin/', 'file:');
newDeps[name] = depVersion.replace('link:bazel-bin/', 'file:');
continue;
}

Expand Down
6 changes: 3 additions & 3 deletions packages/kbn-pm/src/utils/package_json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const createProductionPackageJson = (pkgJson: IPackageJson) => ({
export const isLinkDependency = (depVersion: string) => depVersion.startsWith('link:');

export const isBazelPackageDependency = (depVersion: string) =>
depVersion.startsWith('link:bazel/bin/');
depVersion.startsWith('link:bazel-bin/');

/**
* Replaces `link:` dependencies with `file:` dependencies. When installing
Expand All @@ -46,7 +46,7 @@ export const isBazelPackageDependency = (depVersion: string) =>
* will then _copy_ the `file:` dependencies into `node_modules` instead of
* symlinking like we do in development.
*
* Additionally it also taken care of replacing `link:bazel/bin/` with
* Additionally it also taken care of replacing `link:bazel-bin/` with
* `file:` so we can also support the copy of the Bazel packages dist already into
* build/packages to be copied into the node_modules
*/
Expand All @@ -61,7 +61,7 @@ export function transformDependencies(dependencies: IPackageDependencies = {}) {
}

if (isBazelPackageDependency(depVersion)) {
newDeps[name] = depVersion.replace('link:bazel/bin/', 'file:');
newDeps[name] = depVersion.replace('link:bazel-bin/', 'file:');
continue;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-pm/src/utils/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class Project {
public ensureValidProjectDependency(project: Project) {
const relativePathToProject = normalizePath(Path.relative(this.path, project.path));
const relativePathToProjectIfBazelPkg = normalizePath(
Path.relative(this.path, `bazel/bin/packages/${Path.basename(project.path)}`)
Path.relative(this.path, `bazel-bin/packages/${Path.basename(project.path)}`)
);

const versionInPackageJson = this.allDependencies[project.name];
Expand Down
3 changes: 2 additions & 1 deletion test/functional/apps/management/_import_objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(isSuccessful).to.be(true);
});

it('should allow the user to confirm overriding multiple duplicate saved objects', async function () {
// https://github.com/elastic/kibana/issues/95660
it.skip('should allow the user to confirm overriding multiple duplicate saved objects', async function () {
// This data has already been loaded by the "visualize" esArchive. We'll load it again
// so that we can override the existing visualization.
await PageObjects.savedObjects.importFile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ import { ImpactBar } from '../../shared/ImpactBar';
import { useUiTracker } from '../../../../../observability/public';

type CorrelationsApiResponse =
| APIReturnType<'GET /api/apm/correlations/failed_transactions'>
| APIReturnType<'GET /api/apm/correlations/slow_transactions'>;
| APIReturnType<'GET /api/apm/correlations/errors/failed_transactions'>
| APIReturnType<'GET /api/apm/correlations/latency/slow_transactions'>;

type SignificantTerm = NonNullable<
NonNullable<CorrelationsApiResponse>['significantTerms']
>[0];
type SignificantTerm = CorrelationsApiResponse['significantTerms'][0];

export type SelectedSignificantTerm = Pick<
SignificantTerm,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ import { useFieldNames } from './use_field_names';
import { useLocalStorage } from '../../../hooks/useLocalStorage';
import { useUiTracker } from '../../../../../observability/public';

type OverallErrorsApiResponse = NonNullable<
APIReturnType<'GET /api/apm/correlations/errors/overall_timeseries'>
>;

type CorrelationsApiResponse = NonNullable<
APIReturnType<'GET /api/apm/correlations/failed_transactions'>
APIReturnType<'GET /api/apm/correlations/errors/failed_transactions'>
>;

interface Props {
Expand Down Expand Up @@ -65,11 +69,41 @@ export function ErrorCorrelations({ onClose }: Props) {
);
const hasFieldNames = fieldNames.length > 0;

const { data, status } = useFetcher(
const { data: overallData, status: overallStatus } = useFetcher(
(callApmApi) => {
if (start && end) {
return callApmApi({
endpoint: 'GET /api/apm/correlations/errors/overall_timeseries',
params: {
query: {
environment,
kuery,
serviceName,
transactionName,
transactionType,
start,
end,
},
},
});
}
},
[
environment,
kuery,
serviceName,
start,
end,
transactionName,
transactionType,
]
);

const { data: correlationsData, status: correlationsStatus } = useFetcher(
(callApmApi) => {
if (start && end && hasFieldNames) {
return callApmApi({
endpoint: 'GET /api/apm/correlations/failed_transactions',
endpoint: 'GET /api/apm/correlations/errors/failed_transactions',
params: {
query: {
environment,
Expand Down Expand Up @@ -125,8 +159,9 @@ export function ErrorCorrelations({ onClose }: Props) {
</EuiFlexItem>
<EuiFlexItem>
<ErrorTimeseriesChart
data={hasFieldNames ? data : undefined}
status={status}
overallData={overallData}
correlationsData={hasFieldNames ? correlationsData : undefined}
status={overallStatus}
selectedSignificantTerm={selectedSignificantTerm}
/>
</EuiFlexItem>
Expand All @@ -136,8 +171,12 @@ export function ErrorCorrelations({ onClose }: Props) {
'xpack.apm.correlations.error.percentageColumnName',
{ defaultMessage: '% of failed transactions' }
)}
significantTerms={hasFieldNames ? data?.significantTerms : []}
status={status}
significantTerms={
hasFieldNames && correlationsData?.significantTerms
? correlationsData.significantTerms
: []
}
status={correlationsStatus}
setSelectedSignificantTerm={setSelectedSignificantTerm}
onFilter={onClose}
/>
Expand All @@ -151,10 +190,9 @@ export function ErrorCorrelations({ onClose }: Props) {
}

function getSelectedTimeseries(
data: CorrelationsApiResponse,
significantTerms: CorrelationsApiResponse['significantTerms'],
selectedSignificantTerm: SelectedSignificantTerm
) {
const { significantTerms } = data;
if (!significantTerms) {
return [];
}
Expand All @@ -168,19 +206,21 @@ function getSelectedTimeseries(
}

function ErrorTimeseriesChart({
data,
overallData,
correlationsData,
selectedSignificantTerm,
status,
}: {
data?: CorrelationsApiResponse;
overallData?: OverallErrorsApiResponse;
correlationsData?: CorrelationsApiResponse;
selectedSignificantTerm: SelectedSignificantTerm | null;
status: FETCH_STATUS;
}) {
const theme = useTheme();
const dateFormatter = timeFormatter('HH:mm:ss');

return (
<ChartContainer height={200} hasData={!!data} status={status}>
<ChartContainer height={200} hasData={!!overallData} status={status}>
<Chart size={{ height: px(200), width: '100%' }}>
<Settings showLegend legendPosition={Position.Bottom} />

Expand All @@ -206,11 +246,11 @@ function ErrorTimeseriesChart({
yScaleType={ScaleType.Linear}
xAccessor={'x'}
yAccessors={['y']}
data={data?.overall?.timeseries ?? []}
data={overallData?.overall?.timeseries ?? []}
curve={CurveType.CURVE_MONOTONE_X}
/>

{data && selectedSignificantTerm ? (
{correlationsData && selectedSignificantTerm ? (
<LineSeries
id={i18n.translate(
'xpack.apm.correlations.error.chart.selectedTermErrorRateLabel',
Expand All @@ -227,7 +267,10 @@ function ErrorTimeseriesChart({
xAccessor={'x'}
yAccessors={['y']}
color={theme.eui.euiColorAccent}
data={getSelectedTimeseries(data, selectedSignificantTerm)}
data={getSelectedTimeseries(
correlationsData.significantTerms,
selectedSignificantTerm
)}
curve={CurveType.CURVE_MONOTONE_X}
/>
) : null}
Expand Down
Loading

0 comments on commit df2fbdc

Please sign in to comment.