mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
* Track user actions in the SIEM app For now, we're tracking: * Top navigation changes (`tab_X`) * Opening a timeline (`open_timeline`) * added type * This seems to solve the 'yarn run build' issue * Addressed comments * Use the APP_ID from the top level
This commit is contained in:
parent
3bc571e22a
commit
e7ec433db3
4 changed files with 19 additions and 2 deletions
|
@ -10,7 +10,7 @@ import { Server } from 'hapi';
|
|||
|
||||
import { getConfigSchema, initServerWithKibana } from './server/kibana.index';
|
||||
|
||||
const APP_ID = 'siem';
|
||||
export const APP_ID = 'siem';
|
||||
export const APP_NAME = 'SIEM';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
|
|
@ -19,6 +19,7 @@ import { FlyoutButton } from './button';
|
|||
import { Pane } from './pane';
|
||||
import { timelineActions } from '../../store/actions';
|
||||
import { DEFAULT_TIMELINE_WIDTH } from '../timeline/body/helpers';
|
||||
import { trackUiAction as track } from '../../lib/track_usage';
|
||||
|
||||
/** The height in pixels of the flyout header, exported for use in height calculations */
|
||||
export const flyoutHeaderHeight: number = 48;
|
||||
|
@ -100,7 +101,10 @@ export const FlyoutComponent = pure<Props>(
|
|||
dataProviders={dataProviders!}
|
||||
show={!show}
|
||||
timelineId={timelineId}
|
||||
onOpen={() => showTimeline!({ id: timelineId, show: true })}
|
||||
onOpen={() => {
|
||||
track('open_timeline');
|
||||
showTimeline!({ id: timelineId, show: true });
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
|
|
|
@ -7,6 +7,7 @@ import { EuiTab, EuiTabs } from '@elastic/eui';
|
|||
import * as React from 'react';
|
||||
|
||||
import { getHostsUrl, getNetworkUrl, getOverviewUrl, getTimelinesUrl } from '../../link_to';
|
||||
import { trackUiAction as track } from '../../../lib/track_usage';
|
||||
|
||||
import * as i18n from '../translations';
|
||||
|
||||
|
@ -89,6 +90,7 @@ export class TabNavigation extends React.PureComponent<TabNavigationProps, TabNa
|
|||
...this.state,
|
||||
selectedTabId: id,
|
||||
});
|
||||
track(`tab_${id}`);
|
||||
window.location.assign(href);
|
||||
};
|
||||
|
||||
|
|
11
x-pack/plugins/siem/public/lib/track_usage/index.ts
Normal file
11
x-pack/plugins/siem/public/lib/track_usage/index.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
// @ts-ignore
|
||||
import { trackUiMetric } from '../../../../../../src/legacy/core_plugins/ui_metric/public';
|
||||
import { APP_ID } from '../../..';
|
||||
|
||||
export const trackUiAction = (metricType: string) => trackUiMetric(APP_ID, metricType);
|
Loading…
Add table
Add a link
Reference in a new issue