Commit e1631825 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '217680-health-metric-instrumentation' into 'master'

Track Sentry error status updates with dedicated actions

See merge request gitlab-org/gitlab!33623
parents 673ccccf 5d35ec1d
...@@ -233,8 +233,8 @@ export default { ...@@ -233,8 +233,8 @@ export default {
Tracking.event(category, action); Tracking.event(category, action);
}, },
trackStatusUpdate(status) { trackStatusUpdate(status) {
const { category, action, label } = trackErrorStatusUpdateOptions; const { category, action } = trackErrorStatusUpdateOptions(status);
Tracking.event(category, action, { label, property: status }); Tracking.event(category, action);
}, },
}, },
}; };
......
...@@ -218,8 +218,8 @@ export default { ...@@ -218,8 +218,8 @@ export default {
Tracking.event(category, action); Tracking.event(category, action);
}, },
trackStatusUpdate(status) { trackStatusUpdate(status) {
const { category, action, label } = trackErrorStatusUpdateOptions; const { category, action } = trackErrorStatusUpdateOptions(status);
Tracking.event(category, action, { label, property: status }); Tracking.event(category, action);
}, },
}, },
}; };
......
...@@ -30,8 +30,7 @@ export const trackErrorDetailsViewsOptions = { ...@@ -30,8 +30,7 @@ export const trackErrorDetailsViewsOptions = {
/** /**
* Tracks snowplow event when error status is updated * Tracks snowplow event when error status is updated
*/ */
export const trackErrorStatusUpdateOptions = { export const trackErrorStatusUpdateOptions = status => ({
category: 'Error Tracking', category: 'Error Tracking',
action: 'update_error_status', action: `update_${status}_status`,
label: 'Status', });
};
---
title: Track Sentry error status updates with dedicated actions
merge_request: 33623
author:
type: changed
...@@ -519,11 +519,8 @@ describe('ErrorDetails', () => { ...@@ -519,11 +519,8 @@ describe('ErrorDetails', () => {
Tracking.event.mockClear(); Tracking.event.mockClear();
findUpdateIgnoreStatusButton().vm.$emit('click'); findUpdateIgnoreStatusButton().vm.$emit('click');
setImmediate(() => { setImmediate(() => {
const { category, action, label } = trackErrorStatusUpdateOptions; const { category, action } = trackErrorStatusUpdateOptions('ignored');
expect(Tracking.event).toHaveBeenCalledWith(category, action, { expect(Tracking.event).toHaveBeenCalledWith(category, action);
label,
property: 'ignored',
});
}); });
}); });
...@@ -531,11 +528,8 @@ describe('ErrorDetails', () => { ...@@ -531,11 +528,8 @@ describe('ErrorDetails', () => {
Tracking.event.mockClear(); Tracking.event.mockClear();
findUpdateResolveStatusButton().vm.$emit('click'); findUpdateResolveStatusButton().vm.$emit('click');
setImmediate(() => { setImmediate(() => {
const { category, action, label } = trackErrorStatusUpdateOptions; const { category, action } = trackErrorStatusUpdateOptions('resolved');
expect(Tracking.event).toHaveBeenCalledWith(category, action, { expect(Tracking.event).toHaveBeenCalledWith(category, action);
label,
property: 'resolved',
});
}); });
}); });
......
...@@ -491,11 +491,8 @@ describe('ErrorTrackingList', () => { ...@@ -491,11 +491,8 @@ describe('ErrorTrackingList', () => {
}); });
setImmediate(() => { setImmediate(() => {
const { category, action, label } = trackErrorStatusUpdateOptions; const { category, action } = trackErrorStatusUpdateOptions(status);
expect(Tracking.event).toHaveBeenCalledWith(category, action, { expect(Tracking.event).toHaveBeenCalledWith(category, action);
label,
property: status,
});
}); });
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment