-
-
Notifications
You must be signed in to change notification settings - Fork 333
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
Custom Instrumentation produces unreliable data #4616
Comments
Hello @ehu0716, thanks for reaching out. Can you share more how are you using custom instructions? Maybe share a repro with us. |
Hey @brustolin, thanks for your reply. I can't share the repo with you unfortunately. But we did a really basic custom instrumental with following implementation during App launch.
I suspect that while the sentrySpan starts and before the finish method is called, if the user moves the app to the background, the finish method might not be executed until the app is brought back to the foreground. Do you think this is possible? |
Hello @ehu0716. And thants for the repro. I dont think moving the app to the background would halt the function in such way, but I need to test. But aren't you using something like this: do {
sentryTransaction = SentrySDK.startTransaction(
name: "Transaction",
operation: "init"
)
sentrySpan = sentryTransaction?.startChild(operation: "span")
try functionToMeasure()
sentrySpan?.finish()
sentryTransaction?.finish()
} catch {
} In this case, if the function throws an exception, the span is never finished, and if the user moves the app to the background and comes back later, somehow you finish the span, then I believe you would end up with the scenario that you described. |
@brustolin 😓 my bad, misread your initial reply. |
Got it. We will investigate this. |
Platform
iOS
Environment
Production
Installed
Swift Package Manager
Version
8.37
Xcode Version
16.0
Did it work on previous versions?
No response
Steps to Reproduce
Our team are employing custom instrumentation to assess the performance of a specific function in our application. However, the data displayed on the dashboard is highly inaccurate, with numerous entries showing durations of days or even weeks, and many others indicating a duration of 0 milliseconds. This makes the data unreliable for evaluating performance effectively.
Expected Result
We shouldn't see data with duration of days, weeks or 0ms.
Actual Result
Wrong data
Are you willing to submit a PR?
No response
The text was updated successfully, but these errors were encountered: