Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
38496f16
Commit
38496f16
authored
Feb 13, 2020
by
Jose Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Sentry messages to the monitoring dashboard
parent
6dbac390
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
app/assets/javascripts/monitoring/stores/actions.js
app/assets/javascripts/monitoring/stores/actions.js
+17
-6
No files found.
app/assets/javascripts/monitoring/stores/actions.js
View file @
38496f16
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
*
as
types
from
'
./mutation_types
'
;
import
*
as
types
from
'
./mutation_types
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
createFlash
from
'
~/flash
'
;
import
createFlash
from
'
~/flash
'
;
...
@@ -94,11 +95,14 @@ export const fetchDashboard = ({ state, dispatch }) => {
...
@@ -94,11 +95,14 @@ export const fetchDashboard = ({ state, dispatch }) => {
return
backOffRequest
(()
=>
axios
.
get
(
state
.
dashboardEndpoint
,
{
params
}))
return
backOffRequest
(()
=>
axios
.
get
(
state
.
dashboardEndpoint
,
{
params
}))
.
then
(
resp
=>
resp
.
data
)
.
then
(
resp
=>
resp
.
data
)
.
then
(
response
=>
dispatch
(
'
receiveMetricsDashboardSuccess
'
,
{
response
,
params
}))
.
then
(
response
=>
dispatch
(
'
receiveMetricsDashboardSuccess
'
,
{
response
,
params
}))
.
catch
(
e
=>
{
.
catch
(
error
=>
{
dispatch
(
'
receiveMetricsDashboardFailure
'
,
e
);
Sentry
.
captureException
(
error
);
dispatch
(
'
receiveMetricsDashboardFailure
'
,
error
);
if
(
state
.
showErrorBanner
)
{
if
(
state
.
showErrorBanner
)
{
if
(
e
.
response
.
data
&&
e
.
response
.
data
.
message
)
{
if
(
e
rror
.
response
.
data
&&
error
.
response
.
data
.
message
)
{
const
{
message
}
=
e
.
response
.
data
;
const
{
message
}
=
e
rror
.
response
.
data
;
createFlash
(
createFlash
(
sprintf
(
sprintf
(
s__
(
'
Metrics|There was an error while retrieving metrics. %{message}
'
),
s__
(
'
Metrics|There was an error while retrieving metrics. %{message}
'
),
...
@@ -152,6 +156,8 @@ export const fetchPrometheusMetric = ({ commit }, { metric, params }) => {
...
@@ -152,6 +156,8 @@ export const fetchPrometheusMetric = ({ commit }, { metric, params }) => {
commit
(
types
.
RECEIVE_METRIC_RESULT_SUCCESS
,
{
metricId
:
metric
.
metric_id
,
result
});
commit
(
types
.
RECEIVE_METRIC_RESULT_SUCCESS
,
{
metricId
:
metric
.
metric_id
,
result
});
})
})
.
catch
(
error
=>
{
.
catch
(
error
=>
{
Sentry
.
captureException
(
error
);
commit
(
types
.
RECEIVE_METRIC_RESULT_FAILURE
,
{
metricId
:
metric
.
metric_id
,
error
});
commit
(
types
.
RECEIVE_METRIC_RESULT_FAILURE
,
{
metricId
:
metric
.
metric_id
,
error
});
// Continue to throw error so the dashboard can notify using createFlash
// Continue to throw error so the dashboard can notify using createFlash
throw
error
;
throw
error
;
...
@@ -197,7 +203,8 @@ export const fetchDeploymentsData = ({ state, dispatch }) => {
...
@@ -197,7 +203,8 @@ export const fetchDeploymentsData = ({ state, dispatch }) => {
dispatch
(
'
receiveDeploymentsDataSuccess
'
,
response
.
deployments
);
dispatch
(
'
receiveDeploymentsDataSuccess
'
,
response
.
deployments
);
})
})
.
catch
(()
=>
{
.
catch
(
error
=>
{
Sentry
.
captureException
(
error
);
dispatch
(
'
receiveDeploymentsDataFailure
'
);
dispatch
(
'
receiveDeploymentsDataFailure
'
);
createFlash
(
s__
(
'
Metrics|There was an error getting deployment information.
'
));
createFlash
(
s__
(
'
Metrics|There was an error getting deployment information.
'
));
});
});
...
@@ -225,7 +232,8 @@ export const fetchEnvironmentsData = ({ state, dispatch }) => {
...
@@ -225,7 +232,8 @@ export const fetchEnvironmentsData = ({ state, dispatch }) => {
dispatch
(
'
receiveEnvironmentsDataSuccess
'
,
environments
);
dispatch
(
'
receiveEnvironmentsDataSuccess
'
,
environments
);
})
})
.
catch
(()
=>
{
.
catch
(
err
=>
{
Sentry
.
captureException
(
err
);
dispatch
(
'
receiveEnvironmentsDataFailure
'
);
dispatch
(
'
receiveEnvironmentsDataFailure
'
);
createFlash
(
s__
(
'
Metrics|There was an error getting environments information.
'
));
createFlash
(
s__
(
'
Metrics|There was an error getting environments information.
'
));
});
});
...
@@ -254,7 +262,10 @@ export const duplicateSystemDashboard = ({ state }, payload) => {
...
@@ -254,7 +262,10 @@ export const duplicateSystemDashboard = ({ state }, payload) => {
.
then
(
response
=>
response
.
data
)
.
then
(
response
=>
response
.
data
)
.
then
(
data
=>
data
.
dashboard
)
.
then
(
data
=>
data
.
dashboard
)
.
catch
(
error
=>
{
.
catch
(
error
=>
{
Sentry
.
captureException
(
error
);
const
{
response
}
=
error
;
const
{
response
}
=
error
;
if
(
response
&&
response
.
data
&&
response
.
data
.
error
)
{
if
(
response
&&
response
.
data
&&
response
.
data
.
error
)
{
throw
sprintf
(
s__
(
'
Metrics|There was an error creating the dashboard. %{error}
'
),
{
throw
sprintf
(
s__
(
'
Metrics|There was an error creating the dashboard. %{error}
'
),
{
error
:
response
.
data
.
error
,
error
:
response
.
data
.
error
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment