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

[Plat-12123] trace id in errors #1649

Merged
merged 1 commit into from
May 17, 2024
Merged

Conversation

kstenerud
Copy link
Contributor

@kstenerud kstenerud commented May 15, 2024

Goal

Add the current trace and span IDs to errors whenever possible.

It must work (i.e. not crash):

  • When BugsnagPerformance is not present
  • When BugsnagPerformance is not configured yet

Design

Use bugsnag-cocoa-performance cross-talk API to fetch the current trace ID and span ID whenever an error occurs and we are in an environment that doesn't restrict us to async-safe calls.

This information (when available) is added to a new top-level "correlation" field in the event:

"correlation": {
    "spanid": "84fe24c394f0b2fd",
    "traceid": "762ad72e35102a516a8f20895f9770a4"
}

Testing

New unit tests for the cross-talk bridge.
Manual testing in an app with bugsnag-cocoa-performance linked, and not linked.

@kstenerud kstenerud force-pushed the PLAT-12123-trace-id-in-errors branch 3 times, most recently from 4510510 to c5120bc Compare May 15, 2024 08:26
Copy link

Bugsnag.framework binary size increased by 4,784 bytes from 713,392 to 718,176

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +1.8% +2.89Ki  +1.8% +2.89Ki    String Table
  +1.4% +1.72Ki  +1.4% +1.72Ki    Symbol Table
  +0.7% +1.63Ki  +0.7% +1.63Ki    __TEXT,__text
  +2.0%    +776  +2.0%    +776    __DATA,__objc_const
  +1.7%    +319  +1.7%    +319    __TEXT,__objc_methname
  +1.3%    +256  +1.3%    +256    __DATA,__cfstring
  +1.0%    +183  +1.0%    +183    __TEXT,__cstring
  +4.5%    +160  +4.5%    +160    __DATA,__objc_data
  +1.7%     +80  +1.7%     +80    __DATA,__objc_selrefs
  +5.5%     +59  +5.5%     +59    __TEXT,__objc_classname
  +1.8%     +36  +1.8%     +36    __TEXT,__objc_methtype
  +1.8%     +32  +1.8%     +32    Rebase Info
  +1.0%     +32  +1.0%     +32    __TEXT,__unwind_info
  +1.7%     +20  +0.3%     +28    [3 Others]
  +0.6%     +16  +0.6%     +16    Binding Info
  +1.0%     +16  +1.0%     +16    Function Start Addresses
  +4.5%     +16  +4.5%     +16    __DATA,__objc_classlist
  +2.4%     +16  +2.4%     +16    __DATA,__objc_classrefs
 -19.5% -1.29Ki -10.0% -1.30Ki    [__DATA]
 -12.2% -2.24Ki -12.2% -2.24Ki    [__TEXT]
  [ = ]       0 -63.8% -4.67Ki    [__LINKEDIT]
  +0.7% +4.67Ki  [ = ]       0    TOTAL

Generated by 🚫 Danger

@kstenerud kstenerud force-pushed the PLAT-12123-trace-id-in-errors branch from c5120bc to 2b377ef Compare May 15, 2024 08:43
@kstenerud kstenerud merged commit 79f0893 into next May 17, 2024
40 checks passed
@kstenerud kstenerud deleted the PLAT-12123-trace-id-in-errors branch May 17, 2024 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants