Skip to content

Commit

Permalink
[Discover] Add metric on adding filter (#82961)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maja Grubic authored Nov 10, 2020
1 parent 0b99841 commit dc489e4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/plugins/discover/public/application/angular/discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const {
timefilter,
toastNotifications,
uiSettings: config,
trackUiMetric,
} = getServices();

import { getRootBreadcrumbs, getSavedSearchBreadcrumbs } from '../helpers/breadcrumbs';
Expand All @@ -81,6 +82,7 @@ import {
DOC_HIDE_TIME_COLUMN_SETTING,
MODIFY_COLUMNS_ON_SWITCH,
} from '../../../common';
import { METRIC_TYPE } from '@kbn/analytics';

const fetchStatuses = {
UNINITIALIZED: 'uninitialized',
Expand Down Expand Up @@ -990,6 +992,9 @@ function discoverController($element, $route, $scope, $timeout, $window, Promise
operation,
$scope.indexPattern.id
);
if (trackUiMetric) {
trackUiMetric(METRIC_TYPE.CLICK, 'filter_added');
}
return filterManager.addFilters(newFilters);
};

Expand Down

0 comments on commit dc489e4

Please sign in to comment.