Commit c3cdbc57 authored by Sarah Groff Hennigh-Palermo's avatar Sarah Groff Hennigh-Palermo

Merge branch 'jivanvl-add-sentry-trigger-graph-component-wrapper' into 'master'

Add Sentry to graph_component_wrapper

See merge request gitlab-org/gitlab!50787
parents 94b086a8 f0127089
...@@ -4,7 +4,7 @@ import { __ } from '~/locale'; ...@@ -4,7 +4,7 @@ import { __ } from '~/locale';
import { DEFAULT, LOAD_FAILURE } from '../../constants'; import { DEFAULT, LOAD_FAILURE } from '../../constants';
import getPipelineDetails from '../../graphql/queries/get_pipeline_details.query.graphql'; import getPipelineDetails from '../../graphql/queries/get_pipeline_details.query.graphql';
import PipelineGraph from './graph_component.vue'; import PipelineGraph from './graph_component.vue';
import { unwrapPipelineData, toggleQueryPollingByVisibility } from './utils'; import { unwrapPipelineData, toggleQueryPollingByVisibility, reportToSentry } from './utils';
export default { export default {
name: 'PipelineGraphWrapper', name: 'PipelineGraphWrapper',
...@@ -86,6 +86,7 @@ export default { ...@@ -86,6 +86,7 @@ export default {
reportFailure(type) { reportFailure(type) {
this.showAlert = true; this.showAlert = true;
this.failureType = type; this.failureType = type;
reportToSentry(this.$options.name, this.failureType);
}, },
}, },
}; };
......
...@@ -3,7 +3,7 @@ import getPipelineDetails from '../../graphql/queries/get_pipeline_details.query ...@@ -3,7 +3,7 @@ import getPipelineDetails from '../../graphql/queries/get_pipeline_details.query
import LinkedPipeline from './linked_pipeline.vue'; import LinkedPipeline from './linked_pipeline.vue';
import { LOAD_FAILURE } from '../../constants'; import { LOAD_FAILURE } from '../../constants';
import { UPSTREAM } from './constants'; import { UPSTREAM } from './constants';
import { unwrapPipelineData, toggleQueryPollingByVisibility } from './utils'; import { unwrapPipelineData, toggleQueryPollingByVisibility, reportToSentry } from './utils';
export default { export default {
components: { components: {
...@@ -80,8 +80,13 @@ export default { ...@@ -80,8 +80,13 @@ export default {
result() { result() {
this.loadingPipelineId = null; this.loadingPipelineId = null;
}, },
error() { error(err, _vm, _key, type) {
this.$emit('error', LOAD_FAILURE); this.$emit('error', LOAD_FAILURE);
reportToSentry(
'linked_pipelines_column',
`error type: ${LOAD_FAILURE}, error: ${err}, apollo error type: ${type}`,
);
}, },
}); });
......
import Visibility from 'visibilityjs'; import Visibility from 'visibilityjs';
import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import * as Sentry from '~/sentry/wrapper';
import { unwrapStagesWithNeeds } from '../unwrapping_utils'; import { unwrapStagesWithNeeds } from '../unwrapping_utils';
const addMulti = (mainPipelineProjectPath, linkedPipeline) => { const addMulti = (mainPipelineProjectPath, linkedPipeline) => {
...@@ -55,3 +56,10 @@ const toggleQueryPollingByVisibility = (queryRef, interval = 10000) => { ...@@ -55,3 +56,10 @@ const toggleQueryPollingByVisibility = (queryRef, interval = 10000) => {
}; };
export { unwrapPipelineData, toggleQueryPollingByVisibility }; export { unwrapPipelineData, toggleQueryPollingByVisibility };
export const reportToSentry = (component, failureType) => {
Sentry.withScope((scope) => {
scope.setTag('component', component);
Sentry.captureException(failureType);
});
};
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