Skip to content

Commit 32d3328

Browse files
Merge branch 'tech-debt/rename_examples' of github.com:clintandrewhall/kibana into tech-debt/rename_examples
2 parents 6949957 + de8799f commit 32d3328

File tree

312 files changed

+2977
-2683
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

312 files changed

+2977
-2683
lines changed

src/plugins/discover/public/application/angular/context/api/utils/date_conversion.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@ export function extractNanos(timeFieldValue: string = ''): string {
3131
return fractionSeconds.length !== 9 ? fractionSeconds.padEnd(9, '0') : fractionSeconds;
3232
}
3333

34-
/**
35-
* extract the nanoseconds as string of a given ISO formatted timestamp
36-
*/
37-
export function convertIsoToNanosAsStr(isoValue: string): string {
38-
const nanos = extractNanos(isoValue);
39-
const millis = convertIsoToMillis(isoValue);
40-
return `${millis}${nanos.substr(3, 6)}`;
41-
}
42-
4334
/**
4435
* convert an iso formatted string to number of milliseconds since
4536
* 1970-01-01T00:00:00.000Z

src/plugins/discover/public/application/angular/context/api/utils/get_es_query_search_after.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
import { convertIsoToNanosAsStr } from './date_conversion';
2019
import { SurrDocType, EsHitRecordList, EsHitRecord } from '../context';
2120

2221
export type EsQuerySearchAfter = [string | number, string | number];
@@ -38,15 +37,10 @@ export function getEsQuerySearchAfter(
3837
// already surrounding docs -> first or last record is used
3938
const afterTimeRecIdx = type === 'successors' && documents.length ? documents.length - 1 : 0;
4039
const afterTimeDoc = documents[afterTimeRecIdx];
41-
const afterTimeValue = nanoSeconds
42-
? convertIsoToNanosAsStr(afterTimeDoc.fields[timeFieldName][0])
43-
: afterTimeDoc.sort[0];
40+
const afterTimeValue = nanoSeconds ? afterTimeDoc._source[timeFieldName] : afterTimeDoc.sort[0];
4441
return [afterTimeValue, afterTimeDoc.sort[1]];
4542
}
4643
// if data_nanos adapt timestamp value for sorting, since numeric value was rounded by browser
4744
// ES search_after also works when number is provided as string
48-
return [
49-
nanoSeconds ? convertIsoToNanosAsStr(anchor.fields[timeFieldName][0]) : anchor.sort[0],
50-
anchor.sort[1],
51-
];
45+
return [nanoSeconds ? anchor._source[timeFieldName] : anchor.sort[0], anchor.sort[1]];
5246
}

test/functional/apps/context/_date_nanos.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ export default function ({ getService, getPageObjects }) {
3030
const PageObjects = getPageObjects(['common', 'context', 'timePicker', 'discover']);
3131
const esArchiver = getService('esArchiver');
3232

33-
// FLAKY/FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/58815
34-
describe.skip('context view for date_nanos', () => {
33+
describe('context view for date_nanos', () => {
3534
before(async function () {
3635
await security.testUser.setRoles(['kibana_admin', 'kibana_date_nanos']);
3736
await esArchiver.loadIfNeeded('date_nanos');

test/functional/apps/context/_date_nanos_custom_timestamp.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ export default function ({ getService, getPageObjects }) {
3030
const PageObjects = getPageObjects(['common', 'context', 'timePicker', 'discover']);
3131
const esArchiver = getService('esArchiver');
3232

33-
// skipped due to a recent change in ES that caused search_after queries with data containing
34-
// custom timestamp formats like in the testdata to fail
35-
// https://github.com/elastic/kibana/issues/58815
36-
describe.skip('context view for date_nanos with custom timestamp', () => {
33+
describe('context view for date_nanos with custom timestamp', () => {
3734
before(async function () {
3835
await security.testUser.setRoles(['kibana_admin', 'kibana_date_nanos_custom']);
3936
await esArchiver.loadIfNeeded('date_nanos_custom');

test/functional/page_objects/discover_page.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@
1717
* under the License.
1818
*/
1919

20-
import expect from '@kbn/expect';
2120
import { FtrProviderContext } from '../ftr_provider_context';
2221

2322
export function DiscoverPageProvider({ getService, getPageObjects }: FtrProviderContext) {
24-
const log = getService('log');
2523
const retry = getService('retry');
2624
const testSubjects = getService('testSubjects');
2725
const find = getService('find');
@@ -51,19 +49,25 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider
5149
}
5250

5351
public async saveSearch(searchName: string) {
54-
log.debug('saveSearch');
5552
await this.clickSaveSearchButton();
56-
await testSubjects.setValue('savedObjectTitle', searchName);
53+
// preventing an occasional flakiness when the saved object wasn't set and the form can't be submitted
54+
await retry.waitFor(
55+
`saved search title is set to ${searchName} and save button is clickable`,
56+
async () => {
57+
const saveButton = await testSubjects.find('confirmSaveSavedObjectButton');
58+
await testSubjects.setValue('savedObjectTitle', searchName);
59+
return (await saveButton.getAttribute('disabled')) !== 'true';
60+
}
61+
);
5762
await testSubjects.click('confirmSaveSavedObjectButton');
5863
await header.waitUntilLoadingHasFinished();
5964
// LeeDr - this additional checking for the saved search name was an attempt
6065
// to cause this method to wait for the reloading of the page to complete so
6166
// that the next action wouldn't have to retry. But it doesn't really solve
6267
// that issue. But it does typically take about 3 retries to
6368
// complete with the expected searchName.
64-
await retry.try(async () => {
65-
const name = await this.getCurrentQueryName();
66-
expect(name).to.be(searchName);
69+
await retry.waitFor(`saved search was persisted with name ${searchName}`, async () => {
70+
return (await this.getCurrentQueryName()) === searchName;
6771
});
6872
}
6973

@@ -96,11 +100,11 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider
96100

97101
// We need this try loop here because previous actions in Discover like
98102
// saving a search cause reloading of the page and the "Open" menu item goes stale.
99-
await retry.try(async () => {
103+
await retry.waitFor('saved search panel is opened', async () => {
100104
await this.clickLoadSavedSearchButton();
101105
await header.waitUntilLoadingHasFinished();
102106
isOpen = await testSubjects.exists('loadSearchForm');
103-
expect(isOpen).to.be(true);
107+
return isOpen === true;
104108
});
105109
}
106110

x-pack/plugins/apm/common/processor_event.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,18 @@ export enum ProcessorEvent {
88
transaction = 'transaction',
99
error = 'error',
1010
metric = 'metric',
11+
span = 'span',
12+
onboarding = 'onboarding',
13+
sourcemap = 'sourcemap',
1114
}
15+
/**
16+
* Processor events that are searchable in the UI via the query bar.
17+
*
18+
* Some client-sideroutes will define 1 or more processor events that
19+
* will be used to fetch the dynamic index pattern for the query bar.
20+
*/
21+
22+
export type UIProcessorEvent =
23+
| ProcessorEvent.transaction
24+
| ProcessorEvent.error
25+
| ProcessorEvent.metric;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
export enum Projection {
8+
services = 'services',
9+
transactionGroups = 'transactionGroups',
10+
traces = 'traces',
11+
transactions = 'transactions',
12+
metrics = 'metrics',
13+
errorGroups = 'errorGroups',
14+
serviceNodes = 'serviceNodes',
15+
rumOverview = 'rumOverview',
16+
}

x-pack/plugins/apm/common/projections/services.ts

Lines changed: 0 additions & 64 deletions
This file was deleted.

x-pack/plugins/apm/public/components/app/ErrorGroupOverview/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
import { i18n } from '@kbn/i18n';
1515
import React, { useMemo } from 'react';
1616
import { useTrackPageview } from '../../../../../observability/public';
17-
import { PROJECTION } from '../../../../common/projections/typings';
17+
import { Projection } from '../../../../common/projections';
1818
import { useFetcher } from '../../../hooks/useFetcher';
1919
import { useUrlParams } from '../../../hooks/useUrlParams';
2020
import { callApmApi } from '../../../services/rest/createCallApmApi';
@@ -79,7 +79,7 @@ function ErrorGroupOverview() {
7979
params: {
8080
serviceName,
8181
},
82-
projection: PROJECTION.ERROR_GROUPS,
82+
projection: Projection.errorGroups,
8383
};
8484

8585
return config;

x-pack/plugins/apm/public/components/app/RumDashboard/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from '@elastic/eui';
1414
import { useTrackPageview } from '../../../../../observability/public';
1515
import { LocalUIFilters } from '../../shared/LocalUIFilters';
16-
import { PROJECTION } from '../../../../common/projections/typings';
16+
import { Projection } from '../../../../common/projections';
1717
import { RumDashboard } from './RumDashboard';
1818
import { ServiceNameFilter } from '../../shared/LocalUIFilters/ServiceNameFilter';
1919
import { useUrlParams } from '../../../hooks/useUrlParams';
@@ -28,7 +28,7 @@ export function RumOverview() {
2828
const localUIFiltersConfig = useMemo(() => {
2929
const config: React.ComponentProps<typeof LocalUIFilters> = {
3030
filterNames: ['transactionUrl', 'location', 'device', 'os', 'browser'],
31-
projection: PROJECTION.RUM_OVERVIEW,
31+
projection: Projection.rumOverview,
3232
};
3333

3434
return config;

0 commit comments

Comments
 (0)