0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Misc Sentry tweaks (#18900)

no refs

- Removed redundant duplicated `save_revision` tag when capturing slow
saves
- Standardised Sentry tags casing (`snake_case`)
- Renamed tag `adminX settings component-` to
`adminx_settings_component`
This commit is contained in:
Michael Barrett 2023-11-09 14:10:53 +00:00 committed by GitHub
parent c490fb0940
commit bcfb8e1291
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 7 deletions

View file

@ -24,7 +24,7 @@ class ErrorBoundary extends React.Component<ErrorBoundaryProps> {
componentDidCatch(error: unknown, info: ErrorInfo) {
Sentry.withScope((scope) => {
scope.setTag('adminX settings component-', info.componentStack);
scope.setTag('adminx_settings_component', info.componentStack);
Sentry.captureException(error);
});
// eslint-disable-next-line no-console

View file

@ -695,7 +695,6 @@ export default class LexicalEditorController extends Controller {
scope.setTag('post_type', post.isPage ? 'page' : 'post');
scope.setTag('save_revision', options.adapterOptions?.saveRevision);
scope.setTag('email_segment', options.adapterOptions?.emailSegment);
scope.setTag('save_revision', options.adapterOptions?.saveRevision);
scope.setTag('convert_to_lexical', options.adapterOptions?.convertToLexical);
});
}
@ -708,7 +707,6 @@ export default class LexicalEditorController extends Controller {
scope.setTag('post_type', post.isPage ? 'page' : 'post');
scope.setTag('save_revision', options.adapterOptions?.saveRevision);
scope.setTag('email_segment', options.adapterOptions?.emailSegment);
scope.setTag('save_revision', options.adapterOptions?.saveRevision);
scope.setTag('convert_to_lexical', options.adapterOptions?.convertToLexical);
});
}

View file

@ -305,9 +305,9 @@ class ajaxService extends AjaxService {
method: request.method,
status
});
Sentry.setTag('ajaxStatus', status);
Sentry.setTag('ajaxUrl', request.url);
Sentry.setTag('ajaxMethod', request.method);
Sentry.setTag('ajax_status', status);
Sentry.setTag('ajax_url', request.url);
Sentry.setTag('ajax_method', request.method);
if (headers['content-version']) {
const contentVersion = semverCoerce(headers['content-version']);

View file

@ -39,7 +39,7 @@ if (sentryConfig && !sentryConfig.disabled) {
event.tags.type = exception.errorType;
event.tags.code = exception.code;
event.tags.id = exception.id;
event.tags.statusCode = exception.statusCode;
event.tags.status_code = exception.statusCode;
}
return event;
}