mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Fixed Sentry ajax error tags (#19034)
no issue - Fixed an issue where the ajax_url tag was exceeding the allowed length of tags in Sentry - Fixed the mechanism for deleting the ajax tags when the error is not an ajax error - Removed the isAjaxError tag, since we can use the other ajax tags to filter for ajax errors now
This commit is contained in:
parent
32d0d2b293
commit
d6c5ce3d02
2 changed files with 4 additions and 6 deletions
|
@ -197,13 +197,11 @@ export default Route.extend(ShortcutsRoute, {
|
||||||
event.exception.values[0].type = `${error.type}: ${error.context}`;
|
event.exception.values[0].type = `${error.type}: ${error.context}`;
|
||||||
event.exception.values[0].value = error.message;
|
event.exception.values[0].value = error.message;
|
||||||
event.exception.values[0].context = error.context;
|
event.exception.values[0].context = error.context;
|
||||||
event.tags.isAjaxError = true;
|
|
||||||
} else {
|
} else {
|
||||||
event.tags.isAjaxError = false;
|
|
||||||
delete event.contexts.ajax;
|
delete event.contexts.ajax;
|
||||||
delete event.tags.ajaxStatus;
|
delete event.tags.ajax_status;
|
||||||
delete event.tags.ajaxMethod;
|
delete event.tags.ajax_method;
|
||||||
delete event.tags.ajaxUrl;
|
delete event.tags.ajax_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
return event;
|
return event;
|
||||||
|
|
|
@ -306,7 +306,7 @@ class ajaxService extends AjaxService {
|
||||||
status
|
status
|
||||||
});
|
});
|
||||||
Sentry.setTag('ajax_status', status);
|
Sentry.setTag('ajax_status', status);
|
||||||
Sentry.setTag('ajax_url', request.url);
|
Sentry.setTag('ajax_url', request.url.slice(0, 200)); // the max length of a tag value is 200 characters
|
||||||
Sentry.setTag('ajax_method', request.method);
|
Sentry.setTag('ajax_method', request.method);
|
||||||
|
|
||||||
if (headers['content-version']) {
|
if (headers['content-version']) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue