-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(angular): Add Angular version to event contexts #5260
Conversation
Query and send the Angular version to Sentry to help us investigate which Angular versions are used by our users to make support decisions
packages/angular/src/errorhandler.ts
Outdated
const angularVersion = VERSION && VERSION.major ? parseInt(VERSION.major, 10) : 0; | ||
const eventId = runOutsideAngular(() => | ||
Sentry.captureException(extractedError, { contexts: { angular: { version: angularVersion } } }), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we configure the scope globally on init to do this?
packages/angular/src/sdk.ts
export function init(options: BrowserOptions): void {
options._metadata = options._metadata || {};
options._metadata.sdk = {
name: 'sentry.javascript.angular',
packages: [
{
name: 'npm:@sentry/angular',
version: SDK_VERSION,
},
],
version: SDK_VERSION,
};
const angularVersion = VERSION && VERSION.major ? parseInt(VERSION.major, 10) : undefined;
if (angularVersion) {
checkAngularVersion(version);
Sentry.setContext('angular', { version: angularVersion });
}
browserInit(options);
}
Also regarding const angularVersion = VERSION && VERSION.major ? parseInt(VERSION.major, 10) : undefined;
. Should we store the entire version? Or just the major like we do now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea, thanks! will change it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About entire vs major: Not sure what's better for data querying. I think for the particular use case why we're doing this, the major should be enough but overall it might be worth collecting the full version (which begs the question if we should collect it in one string or in major, minor, patch properties). Do you know what's the better way of handling this (w.r.t indexing/querying in looker)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Realized this didn't comment 😓
I think let's stick with the major for now since we get the most insights out of it. We can change this in the future if needed.
size-limit report 📦
|
d930b3b
to
829d3d2
Compare
829d3d2
to
4e50b52
Compare
Query and send the Angular version in events to Sentry to let us know which Angular versions are used by our users. This should help us make data-based Angular version support decisions in the future.