Skip to content

Commit

Permalink
Merge branch 'main' into apm-fleet-apm-integration-e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Feb 16, 2022
2 parents 1ad497c + 09f8eef commit 5a52586
Show file tree
Hide file tree
Showing 129 changed files with 1,620 additions and 740 deletions.
2 changes: 1 addition & 1 deletion docs/apm/transactions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Learn more about a trace sample in the *Metadata* tab:
* User - Requires additional configuration, but allows you to see which user experienced the current transaction.

TIP: All of this data is stored in documents in Elasticsearch.
This means you can select "Actions - View sample document" to see the actual Elasticsearch document under the discover tab.
This means you can select "Actions - View transaction in Discover" to see the actual Elasticsearch document under the discover tab.

*Trace sample logs*

Expand Down
7 changes: 7 additions & 0 deletions packages/kbn-pm/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8987,6 +8987,13 @@ const BootstrapCommand = {
}, {
prefix: '[vscode]',
debug: false
});
await Object(_utils_child_process__WEBPACK_IMPORTED_MODULE_3__["spawnStreaming"])(process.execPath, ['scripts/build_ts_refs', '--ignore-type-failures'], {
cwd: kbn.getAbsolute(),
env: process.env
}, {
prefix: '[ts refs]',
debug: false
}); // send timings

await reporter.timings({
Expand Down
10 changes: 10 additions & 0 deletions packages/kbn-pm/src/commands/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,16 @@ export const BootstrapCommand: ICommand = {
{ prefix: '[vscode]', debug: false }
);

await spawnStreaming(
process.execPath,
['scripts/build_ts_refs', '--ignore-type-failures'],
{
cwd: kbn.getAbsolute(),
env: process.env,
},
{ prefix: '[ts refs]', debug: false }
);

// send timings
await reporter.timings({
upstreamBranch: kbn.kibanaProject.json.branch,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,14 @@ export const DiscoverGrid = ({

if (!rowCount) {
return (
<div className="euiDataGrid__noResults">
<div
className="euiDataGrid__noResults"
data-render-complete={!isLoading}
data-shared-item=""
data-title={searchTitle}
data-description={searchDescription}
data-document-number={0}
>
<EuiText size="xs" color="subdued">
<EuiIcon type="discoverApp" size="m" color="subdued" />
<EuiSpacer size="s" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
EuiFlyout,
EuiFlyoutBody,
EuiFlyoutHeader,
EuiIconTip,
EuiTitle,
EuiButtonEmpty,
EuiText,
Expand Down Expand Up @@ -147,7 +148,8 @@ export function DiscoverGridFlyout({
</EuiHideFor>
<EuiFlexItem grow={false}>
<EuiButtonEmpty
size="xs"
size="s"
iconSize="s"
iconType="document"
flush="left"
data-test-subj="docTableRowAction"
Expand All @@ -159,19 +161,42 @@ export function DiscoverGridFlyout({
</EuiButtonEmpty>
</EuiFlexItem>
{indexPattern.isTimeBased() && indexPattern.id && (
<EuiFlexItem grow={false}>
<EuiButtonEmpty
size="xs"
iconType="documents"
flush="left"
{...surrDocsProps}
data-test-subj="docTableRowAction"
>
{i18n.translate('discover.grid.tableRow.viewSurroundingDocumentsLinkTextSimple', {
defaultMessage: 'Surrounding documents',
})}
</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexGroup alignItems="center" responsive={false} gutterSize="none">
<EuiFlexItem grow={false}>
<EuiButtonEmpty
size="s"
iconSize="s"
iconType="documents"
flush="left"
{...surrDocsProps}
data-test-subj="docTableRowAction"
>
{i18n.translate(
'discover.grid.tableRow.viewSurroundingDocumentsLinkTextSimple',
{
defaultMessage: 'Surrounding documents',
}
)}
</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiIconTip
content={i18n.translate(
'discover.grid.tableRow.viewSurroundingDocumentsHover',
{
defaultMessage:
'Inspect documents that occurred before and after this document. Only pinned filters remain active in the Surrounding documents view.',
}
)}
type="questionInCircle"
color="subdued"
position="right"
iconProps={{
className: 'eui-alignTop',
}}
/>
</EuiFlexItem>
</EuiFlexGroup>
)}
{activePage !== -1 && (
<EuiFlexItem data-test-subj={`dscDocNavigationPage-${activePage}`}>
Expand Down
8 changes: 7 additions & 1 deletion src/plugins/discover/public/embeddable/saved_search_grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ export function DiscoverGridEmbeddable(props: DiscoverGridEmbeddableProps) {
const [expandedDoc, setExpandedDoc] = useState<ElasticSearchHit | undefined>(undefined);

return (
<EuiFlexGroup style={{ width: '100%' }} direction="column" gutterSize="xs" responsive={false}>
<EuiFlexGroup
style={{ width: '100%' }}
direction="column"
gutterSize="xs"
responsive={false}
data-test-subj="embeddedSavedSearchDocTable"
>
{props.totalHitCount !== 0 && (
<EuiFlexItem grow={false} style={{ alignSelf: 'flex-end' }}>
<TotalDocuments totalHitCount={props.totalHitCount} />
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/discover/server/ui_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export const getUiSettings: (docLinks: DocLinksServiceSetup) => Record<string, U
name: i18n.translate('discover.advancedSettings.disableDocumentExplorer', {
defaultMessage: 'Document Explorer or classic view',
}),
value: true,
value: false,
description: i18n.translate('discover.advancedSettings.disableDocumentExplorerDescription', {
defaultMessage:
'To use the new Document Explorer instead of the classic view, turn off this option. ' +
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/context/_date_nanos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await kibanaServer.uiSettings.update({
'context:defaultSize': `${TEST_DEFAULT_CONTEXT_SIZE}`,
'context:step': `${TEST_STEP_SIZE}`,
'doc_table:legacy': true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await kibanaServer.uiSettings.update({
'context:defaultSize': `${TEST_DEFAULT_CONTEXT_SIZE}`,
'context:step': `${TEST_STEP_SIZE}`,
'doc_table:legacy': true,
});
});

Expand Down
9 changes: 9 additions & 0 deletions test/functional/apps/context/_filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,19 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const docTable = getService('docTable');
const filterBar = getService('filterBar');
const retry = getService('retry');
const kibanaServer = getService('kibanaServer');

const PageObjects = getPageObjects(['common', 'context']);

describe('context filters', function contextSize() {
before(async function () {
await kibanaServer.uiSettings.update({ 'doc_table:legacy': true });
});

after(async function () {
await kibanaServer.uiSettings.replace({});
});

beforeEach(async function () {
await PageObjects.context.navigateTo(TEST_INDEX_PATTERN, TEST_ANCHOR_ID, {
columns: TEST_COLUMN_NAMES,
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/context/_size.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await kibanaServer.uiSettings.update({
'context:defaultSize': `${TEST_DEFAULT_CONTEXT_SIZE}`,
'context:step': `${TEST_STEP_SIZE}`,
'doc_table:legacy': true,
});
await PageObjects.context.navigateTo(TEST_INDEX_PATTERN, TEST_ANCHOR_ID);
});
Expand Down
4 changes: 2 additions & 2 deletions test/functional/apps/dashboard/dashboard_time_picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
);
await dashboardExpect.docTableFieldCount(0);
} else {
const initialRows = await dataGrid.getDocTableRows();
expect(initialRows.length).to.above(10);
const docCount = await dataGrid.getDocCount();
expect(docCount).to.above(10);

// Set to time range with no data
await PageObjects.timePicker.setAbsoluteRange(
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/dashboard/saved_search_embeddable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const marks = $('mark')
.toArray()
.map((mark) => $(mark).text());
expect(marks.length).to.above(10);
expect(marks.length).to.above(0);
});

it('removing a filter removes highlights', async function () {
Expand Down
8 changes: 3 additions & 5 deletions test/functional/apps/discover/_discover_fields_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import { FtrProviderContext } from './ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const log = getService('log');
const docTable = getService('docTable');
const retry = getService('retry');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker', 'settings']);
const defaultSettings = {
defaultIndex: 'logstash-*',
'discover:searchFieldsFromSource': false,
'doc_table:legacy': true,
};
describe('discover uses fields API test', function describeIndexTests() {
before(async function () {
Expand All @@ -27,13 +27,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json');
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
await kibanaServer.uiSettings.replace(defaultSettings);
log.debug('discover');
await PageObjects.common.navigateToApp('discover');
await PageObjects.timePicker.setDefaultAbsoluteRange();
});

after(async () => {
await kibanaServer.uiSettings.replace({ 'discover:searchFieldsFromSource': true });
await kibanaServer.uiSettings.replace({});
});

it('should correctly display documents', async function () {
Expand Down Expand Up @@ -61,8 +60,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});

it('displays _source viewer in doc viewer', async function () {
await docTable.clickRowToggle({ rowIndex: 0 });

await PageObjects.discover.clickDocTableRowToggle(0);
await PageObjects.discover.isShowingDocViewer();
await PageObjects.discover.clickDocViewerTab(1);
await PageObjects.discover.expectSourceViewerToExist();
Expand Down
7 changes: 6 additions & 1 deletion test/functional/page_objects/discover_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export class DiscoverPageObject extends FtrService {
}

public async useLegacyTable() {
return (await this.kibanaServer.uiSettings.get('doc_table:legacy')) !== false;
return (await this.kibanaServer.uiSettings.get('doc_table:legacy')) === true;
}

public async getDocTableIndex(index: number) {
Expand Down Expand Up @@ -276,6 +276,11 @@ export class DiscoverPageObject extends FtrService {
return result[usedCellIdx];
}

public async clickDocTableRowToggle(rowIndex: number = 0) {
const docTable = await this.getDocTable();
await docTable.clickRowToggle({ rowIndex });
}

public async skipToEndOfDocTable() {
// add the focus to the button to make it appear
const skipButton = await this.testSubjects.find('discoverSkipTableButton');
Expand Down
19 changes: 14 additions & 5 deletions test/functional/services/dashboard/expectations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,20 @@ export class DashboardExpectService extends FtrService {
async savedSearchRowCount(expectedMinCount: number) {
this.log.debug(`DashboardExpect.savedSearchRowCount(${expectedMinCount})`);
await this.retry.try(async () => {
const savedSearchRows = await this.testSubjects.findAll(
'docTableExpandToggleColumn',
this.findTimeout
);
expect(savedSearchRows.length).to.be.above(expectedMinCount);
const gridExists = await this.find.existsByCssSelector('[data-document-number]');
if (gridExists) {
const grid = await this.find.byCssSelector('[data-document-number]');
// in this case it's the document explorer
const docNr = Number(await grid.getAttribute('data-document-number'));
expect(docNr).to.be.above(expectedMinCount);
} else {
// in this case it's the classic table
const savedSearchRows = await this.testSubjects.findAll(
'docTableExpandToggleColumn',
this.findTimeout
);
expect(savedSearchRows.length).to.be.above(expectedMinCount);
}
});
}

Expand Down
8 changes: 6 additions & 2 deletions test/functional/services/inspector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,12 @@ export class InspectorService extends FtrService {
*/
public async openInspectorView(viewId: string): Promise<void> {
this.log.debug(`Open Inspector view ${viewId}`);
await this.testSubjects.click('inspectorViewChooser');
await this.testSubjects.click(viewId);
await this.retry.try(async () => {
await this.testSubjects.click('inspectorViewChooser');
// check whether popover menu opens, if not, fail and retry opening
await this.testSubjects.existOrFail(viewId, { timeout: 2000 });
await this.testSubjects.click(viewId);
});
}

/**
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 @@ -6,7 +6,6 @@
*/

import {
EuiButtonEmpty,
EuiIcon,
EuiPanel,
EuiSpacer,
Expand Down Expand Up @@ -100,16 +99,14 @@ export function DetailView({ errorGroup, urlParams, kuery }: Props) {
</h3>
</EuiTitle>
<DiscoverErrorLink error={error} kuery={kuery}>
<EuiButtonEmpty iconType="discoverApp">
{i18n.translate(
'xpack.apm.errorGroupDetails.viewOccurrencesInDiscoverButtonLabel',
{
defaultMessage:
'View {occurrencesCount} {occurrencesCount, plural, one {occurrence} other {occurrences}} in Discover.',
values: { occurrencesCount },
}
)}
</EuiButtonEmpty>
{i18n.translate(
'xpack.apm.errorGroupDetails.viewOccurrencesInDiscoverButtonLabel',
{
defaultMessage:
'View {occurrencesCount} {occurrencesCount, plural, one {occurrence} other {occurrences}} in Discover.',
values: { occurrencesCount },
}
)}
</DiscoverErrorLink>
</HeaderContainer>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import {
EuiBadge,
EuiButtonEmpty,
EuiCallOut,
EuiFlexGroup,
EuiFlexItem,
Expand Down Expand Up @@ -126,14 +125,12 @@ export function SpanFlyout({
</EuiFlexItem>
<EuiFlexItem grow={false}>
<DiscoverSpanLink span={span}>
<EuiButtonEmpty iconType="discoverApp">
{i18n.translate(
'xpack.apm.transactionDetails.spanFlyout.viewSpanInDiscoverButtonLabel',
{
defaultMessage: 'View span in Discover',
}
)}
</EuiButtonEmpty>
{i18n.translate(
'xpack.apm.transactionDetails.spanFlyout.viewSpanInDiscoverButtonLabel',
{
defaultMessage: 'View span in Discover',
}
)}
</DiscoverSpanLink>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
Loading

0 comments on commit 5a52586

Please sign in to comment.