Skip to content
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: Add tags to UI Startup sentry transaction #12286

Merged
merged 5 commits into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions app/util/sentry/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { store } from '../../store';
import { Performance } from '../../core/Performance';
import Device from '../device';
import { TraceName } from '../trace';
import { getTraceTags } from './tags';
/**
* This symbol matches all object properties when used in a mask
*/
Expand Down Expand Up @@ -402,15 +403,19 @@ function rewriteReport(report) {
*/
export function excludeEvents(event) {
// This is needed because store starts to initialise before performance observers completes to measure app start time
if (event?.transaction === TraceName.UIStartup && Device.isAndroid()) {
const appLaunchTime = Performance.appLaunchTime;
const formattedAppLaunchTime = (event.start_timestamp = Number(
`${appLaunchTime.toString().slice(0, 10)}.${appLaunchTime
.toString()
.slice(10)}`,
));
if (event.start_timestamp !== formattedAppLaunchTime) {
event.start_timestamp = formattedAppLaunchTime;
if (event?.transaction === TraceName.UIStartup) {
event.tags = getTraceTags(store.getState());

if (Device.isAndroid()) {
const appLaunchTime = Performance.appLaunchTime;
const formattedAppLaunchTime = (event.start_timestamp = Number(
`${appLaunchTime.toString().slice(0, 10)}.${appLaunchTime
.toString()
.slice(10)}`,
));
if (event.start_timestamp !== formattedAppLaunchTime) {
event.start_timestamp = formattedAppLaunchTime;
}
}
}
//Modify or drop event here
Expand Down
Loading