Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into nls/rm-beta-badge
Browse files Browse the repository at this point in the history
  • Loading branch information
smith committed Sep 22, 2020
2 parents e505217 + 4dc0c12 commit 56245dc
Show file tree
Hide file tree
Showing 80 changed files with 1,033 additions and 1,923 deletions.
4 changes: 2 additions & 2 deletions .ci/Jenkinsfile_baseline_capture
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ kibanaPipeline(timeoutMinutes: 120) {
]) {
parallel([
'oss-baseline': {
workers.ci(name: 'oss-baseline', size: 's-highmem', ramDisk: true, runErrorReporter: false) {
workers.ci(name: 'oss-baseline', size: 'l', ramDisk: true, runErrorReporter: false) {
kibanaPipeline.functionalTestProcess('oss-baseline', './test/scripts/jenkins_baseline.sh')()
}
},
'xpack-baseline': {
workers.ci(name: 'xpack-baseline', size: 's-highmem', ramDisk: true, runErrorReporter: false) {
workers.ci(name: 'xpack-baseline', size: 'l', ramDisk: true, runErrorReporter: false) {
kibanaPipeline.functionalTestProcess('xpack-baseline', './test/scripts/jenkins_xpack_baseline.sh')()
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,77 @@
*/

import { i18n } from '@kbn/i18n';
import { get } from 'lodash';

export function getPainlessError(error: Error) {
const rootCause: Array<{ lang: string; script: string }> | undefined = get(
error,
'body.attributes.error.root_cause'
);
const message: string = get(error, 'body.message');
interface FailedShards {
shard: number;
index: string;
node: string;
reason: {
type: string;
reason: string;
script_stack: string[];
script: string;
lang: string;
position: {
offset: number;
start: number;
end: number;
};
caused_by: {
type: string;
reason: string;
};
};
}

interface EsError {
body: {
statusCode: number;
error: string;
message: string;
attributes?: {
error?: {
root_cause?: [
{
lang: string;
script: string;
}
];
type: string;
reason: string;
caused_by: {
type: string;
reason: string;
phase: string;
grouped: boolean;
failed_shards: FailedShards[];
};
};
};
};
}

export function getCause(error: EsError) {
const cause = error.body?.attributes?.error?.root_cause;
if (cause) {
return cause[0];
}

const failedShards = error.body?.attributes?.error?.caused_by?.failed_shards;

if (failedShards && failedShards[0] && failedShards[0].reason) {
return error.body?.attributes?.error?.caused_by?.failed_shards[0].reason;
}
}

export function getPainlessError(error: EsError) {
const cause = getCause(error);

if (!rootCause) {
if (!cause) {
return;
}

const [{ lang, script }] = rootCause;
const { lang, script } = cause;

if (lang !== 'painless') {
return;
Expand All @@ -44,6 +101,6 @@ export function getPainlessError(error: Error) {
defaultMessage: "Error with Painless scripted field '{script}'.",
values: { script },
}),
error: message,
error: error.body?.message,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';

export default function ({ getService, getPageObjects }) {
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const testSubjects = getService('testSubjects');
const PageObjects = getPageObjects(['common', 'discover', 'timePicker']);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ export const generalSettings: RawSettingDefinition[] = [
key: 'transaction_max_spans',
type: 'integer',
min: 0,
max: 32000,
defaultValue: '500',
label: i18n.translate('xpack.apm.agentConfig.transactionMaxSpans.label', {
defaultMessage: 'Transaction max spans',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';
import { EuiButton, EuiCallOut, EuiSpacer, EuiText } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { useApmPluginContext } from '../../../hooks/useApmPluginContext';

export function ClientSideMonitoringCallout() {
const { core } = useApmPluginContext();
const clientSideMonitoringHref = core.http.basePath.prepend(`/app/csm`);

return (
<EuiCallOut
iconType="cheer"
title={i18n.translate(
'xpack.apm.transactionOverview.clientSideMonitoring.calloutTitle',
{ defaultMessage: 'Introducing: Client Side Monitoring' }
)}
>
<EuiText>
{i18n.translate(
'xpack.apm.transactionOverview.clientSideMonitoring.calloutText',
{
defaultMessage:
'We are beyond excited to introduce a new experience for analyzing the user experience metrics specifically for your RUM services. It provides insights into the core vitals and visitor breakdown by browser and location. The app is always available in the left sidebar among the other Observability views.',
}
)}
</EuiText>
<EuiSpacer size="m" />
<EuiButton href={clientSideMonitoringHref}>
{i18n.translate(
'xpack.apm.transactionOverview.clientSideMonitoring.linkLabel',
{ defaultMessage: 'Take me there' }
)}
</EuiButton>
</EuiCallOut>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import { LocalUIFilters } from '../../shared/LocalUIFilters';
import { TransactionTypeFilter } from '../../shared/LocalUIFilters/TransactionTypeFilter';
import { TransactionList } from './TransactionList';
import { useRedirect } from './useRedirect';
import { TRANSACTION_PAGE_LOAD } from '../../../../common/transaction_types';
import { ClientSideMonitoringCallout } from './ClientSideMonitoringCallout';

function getRedirectLocation({
urlParams,
Expand Down Expand Up @@ -125,6 +127,12 @@ export function TransactionOverview({ serviceName }: TransactionOverviewProps) {
</LocalUIFilters>
</EuiFlexItem>
<EuiFlexItem grow={7}>
{transactionType === TRANSACTION_PAGE_LOAD && (
<>
<ClientSideMonitoringCallout />
<EuiSpacer size="s" />
</>
)}
<ChartsSyncContextProvider>
<TransactionCharts
charts={transactionCharts}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('MLJobLink', () => {
);

expect(href).toMatchInlineSnapshot(
`"/basepath/app/ml#/timeseriesexplorer?_g=(ml:(jobIds:!(myservicename-mytransactiontype-high_mean_response_time)),refreshInterval:(pause:!t,value:0),time:(from:now/w,to:now-4h))&_a=(mlTimeSeriesExplorer:(entities:(service.name:opbeans-test,transaction.type:request),zoom:(from:now/w,to:now-4h)))"`
`"/basepath/app/ml#/timeseriesexplorer?_g=(ml:(jobIds:!(myservicename-mytransactiontype-high_mean_response_time)),refreshInterval:(pause:!t,value:0),time:(from:now/w,to:now-4h))&_a=(mlTimeSeriesExplorer:(entities:(service.name:opbeans-test,transaction.type:request)))"`
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('useTimeSeriesExplorerHref', () => {
});

expect(href).toMatchInlineSnapshot(
`"/app/ml#/timeseriesexplorer?_g=(ml:(jobIds:!(apm-production-485b-high_mean_transaction_duration)),refreshInterval:(pause:!t,value:10000),time:(from:'2020-07-29T17:27:29.000Z',to:'2020-07-29T18:45:00.000Z'))&_a=(mlTimeSeriesExplorer:(entities:(service.name:opbeans-java,transaction.type:request),zoom:(from:'2020-07-29T17:27:29.000Z',to:'2020-07-29T18:45:00.000Z')))"`
`"/app/ml#/timeseriesexplorer?_g=(ml:(jobIds:!(apm-production-485b-high_mean_transaction_duration)),refreshInterval:(pause:!t,value:10000),time:(from:'2020-07-29T17:27:29.000Z',to:'2020-07-29T18:45:00.000Z'))&_a=(mlTimeSeriesExplorer:(entities:(service.name:opbeans-java,transaction.type:request)))"`
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export function useTimeSeriesExplorerHref({
'service.name': serviceName,
'transaction.type': transactionType,
},
zoom: time,
},
}),
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 56245dc

Please sign in to comment.