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:
Chris Raible 2023-11-16 12:27:07 -08:00 committed by GitHub
parent 32d0d2b293
commit d6c5ce3d02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -197,13 +197,11 @@ export default Route.extend(ShortcutsRoute, {
event.exception.values[0].type = `${error.type}: ${error.context}`;
event.exception.values[0].value = error.message;
event.exception.values[0].context = error.context;
event.tags.isAjaxError = true;
} else {
event.tags.isAjaxError = false;
delete event.contexts.ajax;
delete event.tags.ajaxStatus;
delete event.tags.ajaxMethod;
delete event.tags.ajaxUrl;
delete event.tags.ajax_status;
delete event.tags.ajax_method;
delete event.tags.ajax_url;
}
return event;

View File

@ -306,7 +306,7 @@ class ajaxService extends AjaxService {
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);
if (headers['content-version']) {