Skip to content

Commit

Permalink
[APM] Telemetry: Add UI usage telemetry on the Timeseries comparison …
Browse files Browse the repository at this point in the history
…feature (#91439) (#94715)

* adding telemetry and removing time comparison

* adding telemetry and removing time comparison

* adding telemetry

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
cauemarcondes and kibanamachine authored Mar 16, 2021
1 parent 8d453cd commit 61d66c1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ export function TransactionOverview({ serviceName }: TransactionOverviewProps) {
return (
<>
<SearchBar showCorrelations />

<EuiPage>
<EuiFlexGroup direction="column" gutterSize="s">
<EuiSpacer size="s" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { i18n } from '@kbn/i18n';
import moment from 'moment';
import React from 'react';
import { useHistory } from 'react-router-dom';
import { useUiTracker } from '../../../../../observability/public';
import { euiStyled } from '../../../../../../../src/plugins/kibana_react/common';
import { getDateDifference } from '../../../../common/utils/formatters';
import { useUrlParams } from '../../../context/url_params_context/use_url_params';
Expand Down Expand Up @@ -132,6 +133,7 @@ function getSelectOptions({
}

export function TimeComparison() {
const trackApmEvent = useUiTracker({ app: 'apm' });
const history = useHistory();
const { isMedium, isLarge } = useBreakPoints();
const {
Expand Down Expand Up @@ -181,16 +183,27 @@ export function TimeComparison() {
})}
checked={comparisonEnabled}
onChange={() => {
const nextComparisonEnabledValue = !comparisonEnabled;
if (nextComparisonEnabledValue === false) {
trackApmEvent({
metric: 'time_comparison_disabled',
});
}
urlHelpers.push(history, {
query: {
comparisonEnabled: Boolean(!comparisonEnabled).toString(),
comparisonEnabled: Boolean(
nextComparisonEnabledValue
).toString(),
},
});
}}
/>
</PrependContainer>
}
onChange={(e) => {
trackApmEvent({
metric: `time_comparison_type_change_${e.target.value}`,
});
urlHelpers.push(history, {
query: {
comparisonType: e.target.value,
Expand Down

0 comments on commit 61d66c1

Please sign in to comment.