Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APM] Use apmEventClient for querying APM event indices #3

Closed
wants to merge 54 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
43f55a5
[APM] Optimize service overview queries
dgieselaar Jun 22, 2020
da21e45
Merge branch 'master' of github.com:elastic/kibana into optimize-serv…
dgieselaar Jun 27, 2020
f774b47
Review feedback
dgieselaar Jun 27, 2020
068c170
Use correct indices/filters for service overview metrics
dgieselaar Jun 27, 2020
0546489
Merge branch 'master' of github.com:elastic/kibana into optimize-serv…
dgieselaar Jun 29, 2020
03e40a7
Merge branch 'master' of github.com:elastic/kibana into optimize-serv…
dgieselaar Jun 30, 2020
ca17e1e
[APM] Don't fetch dynamic index pattern in setupRequest
dgieselaar Jun 30, 2020
0970198
Merge branch 'remove-dynamic-index-pattern' into apm-events
dgieselaar Jun 30, 2020
4b201c2
Merge branch 'master' into remove-dynamic-index-pattern
elasticmachine Jun 30, 2020
5e14e42
use join utility function to merge requests
dgieselaar Jun 30, 2020
b180c1b
Merge branch 'master' of github.com:elastic/kibana into optimize-serv…
dgieselaar Jun 30, 2020
e9ee799
Merge branch 'master' of github.com:elastic/kibana into remove-dynami…
dgieselaar Jun 30, 2020
1affcdf
Merge branch 'remove-dynamic-index-pattern' of github.com:dgieselaar/…
dgieselaar Jun 30, 2020
54cfa13
Correct path for UI_SETTINGS import
dgieselaar Jun 30, 2020
129aeab
Merge branch 'optimize-services-overview' into apm-events
dgieselaar Jun 30, 2020
67a177a
Merge branch 'optimize-traces-overview' into apm-events
dgieselaar Jun 30, 2020
3343936
Merge branch 'remove-dynamic-index-pattern' into apm-events
dgieselaar Jun 30, 2020
7a689ba
Merge branch 'master' of github.com:elastic/kibana into apm-events
dgieselaar Jun 30, 2020
83326f2
Query transaction indices in getEnvironments()
dgieselaar Jul 1, 2020
40e28f9
Merge branch 'optimize-services-overview' into apm-events
dgieselaar Jul 1, 2020
e9f6448
Merge branch 'master' of github.com:elastic/kibana into apm-events
dgieselaar Jul 1, 2020
7af5b9f
[APM] Introduce apm.types
dgieselaar Jul 1, 2020
1c1d526
Merge branch 'master' of github.com:elastic/kibana into optimize-serv…
dgieselaar Jul 1, 2020
a645758
Set size of terms agg on error rate aggregation
dgieselaar Jul 2, 2020
f5d2b0b
Merge branch 'optimize-services-overview' into apm-events
dgieselaar Jul 2, 2020
3227847
Merge branch 'master' of github.com:elastic/kibana into apm-events
dgieselaar Jul 2, 2020
602b659
Merge branch 'master' of github.com:elastic/kibana into apm-events
dgieselaar Jul 2, 2020
fd9bfd1
Use separate clients for apm events and other uses
dgieselaar Jul 3, 2020
5db9fe2
Merge branch 'optimize-traces-overview' into apm-events
dgieselaar Jul 3, 2020
30d8fef
use UIProcessorEvent type in IURLParams type
dgieselaar Jul 3, 2020
00a0a75
Remove unused import
dgieselaar Jul 3, 2020
aa5de09
Use cloneDeep in apmEventClient.search
dgieselaar Jul 5, 2020
c50a08a
Merge branch 'master' of github.com:elastic/kibana into apm-events
dgieselaar Jul 5, 2020
620c784
Merge branch 'optimize-traces-overview' into apm-events
dgieselaar Jul 6, 2020
1b65979
Merge branch 'optimize-traces-overview' into apm-events
dgieselaar Jul 6, 2020
7b29ecf
[Functional Tests] Fix flakiness on TSVB chart on switching index pat…
stratoula Jul 28, 2020
a696f6c
[Functional Tests] Increase waitTime for timelion to fetch the result…
stratoula Jul 28, 2020
9b570a9
fix dashboard index pattern race condition (#72899)
Dosant Jul 28, 2020
abfda1f
Use "Apply_filter_trigger" in dashboard drilldown (#71468)
Dosant Jul 28, 2020
5ea2870
[Functional Tests] Increase the timeout when locating the tableview] …
stratoula Jul 28, 2020
c0826a3
Fix App status flaky test (#72853)
mshustov Jul 28, 2020
1c791f3
[SIEM][Timelines] Updates timeline template callout text (#73334)
MadameSheema Jul 28, 2020
95668d4
[Search] add server logs (#72454)
lizozom Jul 28, 2020
12d5b8d
executes cypress tests when there is a change in parts of alerting te…
MadameSheema Jul 28, 2020
46fb847
[Security Solutions] Show popovers inside modals (#73264)
cnasikas Jul 28, 2020
09b11b6
Introduce reserved ml privilege for the apm_user role (#72266)
legrego Jul 28, 2020
b5a920d
[Uptime] Convert kuery bar to ts (#70310)
shahzad31 Jul 28, 2020
7a10077
[Security Solution] Template unit tests (#72399)
angorayc Jul 28, 2020
8c710aa
[ Functional test ] Increase the waiting time for the filter bar requ…
dej611 Jul 28, 2020
acd8a10
Merge branch 'optimize-traces-overview' into apm-events
dgieselaar Jul 28, 2020
4984683
[SIEM] Unskips and fixes Cypress tests (#73322)
MadameSheema Jul 28, 2020
19532fc
[APM] Optimize traces overview (#70200)
dgieselaar Jul 28, 2020
fb4ee91
[Security Solution][Resolver] Fix resolver isStart event bug (#73357)
jonathan-buttner Jul 28, 2020
3ed5ad6
Merge branch 'master' of github.com:elastic/kibana into apm-events
dgieselaar Jul 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ kibanaPipeline(timeoutMinutes: 155, checkPrChanges: true, setCommitStatus: true)
'xpack-accessibility': kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh'),
'xpack-savedObjectsFieldMetrics': kibanaPipeline.functionalTestProcess('xpack-savedObjectsFieldMetrics', './test/scripts/jenkins_xpack_saved_objects_field_metrics.sh'),
'xpack-securitySolutionCypress': { processNumber ->
whenChanged(['x-pack/plugins/security_solution/', 'x-pack/test/security_solution_cypress/']) {
whenChanged(['x-pack/plugins/security_solution/', 'x-pack/test/security_solution_cypress/', 'x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/', 'x-pack/plugins/triggers_actions_ui/public/application/context/actions_connectors_context.tsx']) {
kibanaPipeline.functionalTestProcess('xpack-securitySolutionCypress', './test/scripts/jenkins_security_solution_cypress.sh')(processNumber)
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@ esFilters: {
convertRangeFilterToTimeRangeString: typeof convertRangeFilterToTimeRangeString;
mapAndFlattenFilters: (filters: import("../common").Filter[]) => import("../common").Filter[];
extractTimeFilter: typeof extractTimeFilter;
extractTimeRange: typeof extractTimeRange;
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import React, { useState, ReactElement } from 'react';
import ReactDOM from 'react-dom';
import angular from 'angular';

import { Subscription } from 'rxjs';
import { map } from 'rxjs/operators';
import { Observable, pipe, Subscription } from 'rxjs';
import { filter, map, mapTo, startWith, switchMap } from 'rxjs/operators';
import { History } from 'history';
import { SavedObjectSaveOpts } from 'src/plugins/saved_objects/public';
import { NavigationPublicPluginStart as NavigationStart } from 'src/plugins/navigation/public';
Expand Down Expand Up @@ -253,11 +253,7 @@ export class DashboardAppController {
navActions[TopNavIds.VISUALIZE]();
};

const updateIndexPatterns = (container?: DashboardContainer) => {
if (!container || isErrorEmbeddable(container)) {
return;
}

function getDashboardIndexPatterns(container: DashboardContainer): IndexPattern[] {
let panelIndexPatterns: IndexPattern[] = [];
Object.values(container.getChildIds()).forEach((id) => {
const embeddableInstance = container.getChild(id);
Expand All @@ -267,19 +263,34 @@ export class DashboardAppController {
panelIndexPatterns.push(...embeddableIndexPatterns);
});
panelIndexPatterns = uniqBy(panelIndexPatterns, 'id');
return panelIndexPatterns;
}

if (panelIndexPatterns && panelIndexPatterns.length > 0) {
$scope.$evalAsync(() => {
$scope.indexPatterns = panelIndexPatterns;
});
} else {
indexPatterns.getDefault().then((defaultIndexPattern) => {
$scope.$evalAsync(() => {
$scope.indexPatterns = [defaultIndexPattern as IndexPattern];
});
const updateIndexPatternsOperator = pipe(
filter((container: DashboardContainer) => !!container && !isErrorEmbeddable(container)),
map(getDashboardIndexPatterns),
// using switchMap for previous task cancellation
switchMap((panelIndexPatterns: IndexPattern[]) => {
return new Observable((observer) => {
if (panelIndexPatterns && panelIndexPatterns.length > 0) {
$scope.$evalAsync(() => {
if (observer.closed) return;
$scope.indexPatterns = panelIndexPatterns;
observer.complete();
});
} else {
indexPatterns.getDefault().then((defaultIndexPattern) => {
if (observer.closed) return;
$scope.$evalAsync(() => {
if (observer.closed) return;
$scope.indexPatterns = [defaultIndexPattern as IndexPattern];
observer.complete();
});
});
}
});
}
};
})
);

const getEmptyScreenProps = (
shouldShowEditHelp: boolean,
Expand Down Expand Up @@ -384,11 +395,17 @@ export class DashboardAppController {
) : null;
};

updateIndexPatterns(dashboardContainer);

outputSubscription = dashboardContainer.getOutput$().subscribe(() => {
updateIndexPatterns(dashboardContainer);
});
outputSubscription = new Subscription();
outputSubscription.add(
dashboardContainer
.getOutput$()
.pipe(
mapTo(dashboardContainer),
startWith(dashboardContainer), // to trigger initial index pattern update
updateIndexPatternsOperator
)
.subscribe()
);

inputSubscription = dashboardContainer.getInput$().subscribe(() => {
let dirty = false;
Expand Down
6 changes: 5 additions & 1 deletion src/plugins/dashboard/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ export {
export { DashboardConstants, createDashboardEditUrl } from './dashboard_constants';

export { DashboardStart, DashboardUrlGenerator } from './plugin';
export { DASHBOARD_APP_URL_GENERATOR, createDashboardUrlGenerator } from './url_generator';
export {
DASHBOARD_APP_URL_GENERATOR,
createDashboardUrlGenerator,
DashboardUrlGeneratorState,
} from './url_generator';
export { addEmbeddableToDashboardUrl } from './url_utils/url_helper';
export { SavedObjectDashboard } from './saved_dashboards';
export { SavedDashboardPanel } from './types';
Expand Down
7 changes: 4 additions & 3 deletions src/plugins/dashboard/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import {
ACTION_REPLACE_PANEL,
ClonePanelAction,
ClonePanelActionContext,
createDashboardContainerByValueRenderer,
DASHBOARD_CONTAINER_TYPE,
DashboardContainerFactory,
DashboardContainerFactoryDefinition,
Expand All @@ -77,17 +78,17 @@ import {
import {
createDashboardUrlGenerator,
DASHBOARD_APP_URL_GENERATOR,
DashboardAppLinkGeneratorState,
DashboardUrlGeneratorState,
} from './url_generator';
import { createSavedDashboardLoader } from './saved_dashboards';
import { DashboardConstants } from './dashboard_constants';
import { addEmbeddableToDashboardUrl } from './url_utils/url_helper';
import { PlaceholderEmbeddableFactory } from './application/embeddable/placeholder';
import { createDashboardContainerByValueRenderer } from './application';
import { UrlGeneratorState } from '../../share/public';

declare module '../../share/public' {
export interface UrlGeneratorStateMapping {
[DASHBOARD_APP_URL_GENERATOR]: DashboardAppLinkGeneratorState;
[DASHBOARD_APP_URL_GENERATOR]: UrlGeneratorState<DashboardUrlGeneratorState>;
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/plugins/dashboard/public/url_generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
RefreshInterval,
} from '../../data/public';
import { setStateToKbnUrl } from '../../kibana_utils/public';
import { UrlGeneratorsDefinition, UrlGeneratorState } from '../../share/public';
import { UrlGeneratorsDefinition } from '../../share/public';
import { SavedObjectLoader } from '../../saved_objects/public';
import { ViewMode } from '../../embeddable/public';

Expand All @@ -35,7 +35,7 @@ export const GLOBAL_STATE_STORAGE_KEY = '_g';

export const DASHBOARD_APP_URL_GENERATOR = 'DASHBOARD_APP_URL_GENERATOR';

export type DashboardAppLinkGeneratorState = UrlGeneratorState<{
export interface DashboardUrlGeneratorState {
/**
* If given, the dashboard saved object with this id will be loaded. If not given,
* a new, unsaved dashboard will be loaded up.
Expand Down Expand Up @@ -79,7 +79,7 @@ export type DashboardAppLinkGeneratorState = UrlGeneratorState<{
* View mode of the dashboard.
*/
viewMode?: ViewMode;
}>;
}

export const createDashboardUrlGenerator = (
getStartServices: () => Promise<{
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/data/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import {
changeTimeFilter,
mapAndFlattenFilters,
extractTimeFilter,
extractTimeRange,
convertRangeFilterToTimeRangeString,
} from './query';

Expand Down Expand Up @@ -99,6 +100,7 @@ export const esFilters = {
convertRangeFilterToTimeRangeString,
mapAndFlattenFilters,
extractTimeFilter,
extractTimeRange,
};

export {
Expand Down
Loading