mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
track ad hoc data view renders (#141030)
This commit is contained in:
parent
c713550e17
commit
0b38c410dd
2 changed files with 26 additions and 6 deletions
|
@ -79,6 +79,7 @@ import {
|
|||
selectChangesApplied,
|
||||
VisualizationState,
|
||||
DatasourceStates,
|
||||
DataViewsState,
|
||||
} from '../../../state_management';
|
||||
import type { LensInspector } from '../../../lens_inspector_service';
|
||||
import { inferTimeField, DONT_CLOSE_DIMENSION_CONTAINER_ON_CLICK_CLASS } from '../../../utils';
|
||||
|
@ -178,17 +179,20 @@ export const InnerWorkspacePanel = React.memo(function InnerWorkspacePanel({
|
|||
visualization: VisualizationState;
|
||||
visualizationMap: VisualizationMap;
|
||||
datasourceLayers: DatasourceLayers;
|
||||
dataViews: DataViewsState;
|
||||
}>();
|
||||
|
||||
const { dataViews } = framePublicAPI;
|
||||
|
||||
renderDeps.current = {
|
||||
datasourceMap,
|
||||
datasourceStates,
|
||||
visualization,
|
||||
visualizationMap,
|
||||
datasourceLayers,
|
||||
dataViews,
|
||||
};
|
||||
|
||||
const { dataViews } = framePublicAPI;
|
||||
const onRender$ = useCallback(() => {
|
||||
if (renderDeps.current) {
|
||||
const datasourceEvents = Object.values(renderDeps.current.datasourceMap).reduce<string[]>(
|
||||
|
@ -207,8 +211,16 @@ export const InnerWorkspacePanel = React.memo(function InnerWorkspacePanel({
|
|||
renderDeps.current.visualization.activeId
|
||||
].getRenderEventCounters?.(renderDeps.current.visualization.state) ?? [];
|
||||
}
|
||||
const events = ['vis_editor', ...datasourceEvents, ...visualizationEvents];
|
||||
|
||||
trackUiCounterEvents(['vis_editor', ...datasourceEvents, ...visualizationEvents]);
|
||||
const adHocDataViews = Object.values(renderDeps.current.dataViews.indexPatterns || {}).filter(
|
||||
(indexPattern) => !indexPattern.isPersisted
|
||||
);
|
||||
adHocDataViews.forEach(() => {
|
||||
events.push('ad_hoc_data_view');
|
||||
});
|
||||
|
||||
trackUiCounterEvents(events);
|
||||
}
|
||||
}, []);
|
||||
|
||||
|
|
|
@ -563,10 +563,18 @@ export class Embeddable
|
|||
|
||||
const executionContext = this.getExecutionContext();
|
||||
|
||||
trackUiCounterEvents(
|
||||
[...datasourceEvents, ...visualizationEvents, ...getExecutionContextEvents(executionContext)],
|
||||
executionContext
|
||||
);
|
||||
const events = [
|
||||
...datasourceEvents,
|
||||
...visualizationEvents,
|
||||
...getExecutionContextEvents(executionContext),
|
||||
];
|
||||
|
||||
const adHocDataViews = Object.values(this.savedVis?.state.adHocDataViews || {});
|
||||
adHocDataViews.forEach(() => {
|
||||
events.push('ad_hoc_data_view');
|
||||
});
|
||||
|
||||
trackUiCounterEvents(events, executionContext);
|
||||
|
||||
this.renderComplete.dispatchComplete();
|
||||
this.updateOutput({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue