-
Notifications
You must be signed in to change notification settings - Fork 134
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
Make Crash Reporter Plugin Public #2116
Make Crash Reporter Plugin Public #2116
Conversation
Hello @naftaly 👋 Thank you very much for your contribution! Enabling the injection of a different crash reporting library is a great idea. I have a few questions and comments regarding the proposed changes:
Thank you again for your effort in improving our crash reporting! |
Thank you, I was hoping you'd like it :)
The source I'm working with ends up importing through Cocoapod which for some reason leads to "CrashReporter" not being available. I didn't get into it too much, but I thought it would be a good solution until I got around to making a feature request to split out the plugin implementation from the CrashReporting infrastructure since we'd prefer to not include it since we wouldn't be using it, PLCrashReporter that is.
You're totally right, that is a typical scenario. But there are also other scenarios where dependencies might not be ready yet, or simply that the infra responsible to crashes wants to send them at some other point in time, such as during downtime, or not during startup. In our case, we have crash data coming from some other locations, and we enhance it with multiple different sets of data that for some reason or another are not ready as early as we need to call CrashReporter.enable(). Overall though, we want to start up the reporting system very very early to ensure we have the most complete set of data, and we want to report the crashes when we feel it is appropriate later during the session, or even in some future session (not necessarily the next session).
The attributes can really be anything, but they are the extended set of data I was talking about earlier that come from other datasets. They don't always refer to the previous session, but they refer to the session of report we are sending.
Thank you for considering our PR, we love using Datadog and hope we can continue helping out as much we can. |
Hello @naftaly Thank you for the additional context and clarification, it makes sense.
Our podspec depends on PLCR, so I'm curious—what specific issue are you trying to address? It seems preferable to resolve the CocoaPods problem directly rather than introducing conditional imports into the source code. Splitting the plugin interface from its implementation would have a broader impact, as it would require architectural changes, including adding a new module. Submitting a feature request is the way to go 👍 Regarding attributes, I believe it would make sense to add them as a property of One other change I noticed: making the Thank you again for your contribution! 🙏 |
We end up working with a Bazel build system which does special things with Pods, so it's probably an issue on our side that I guess I simply swept away :) I'll figure it out on our side so we can simply forget about those import checks I think.
Great, sounds good. Can we consider this a feature request or is there another route?
That sounds good to me, thank you.
It could be internal instead. Due to |
/merge |
Devflow running:
|
058a326
into
DataDog:RUM-7421/expose-crash-plugin
This PR makes the crash reporter public and adds some hooks to send reports at other times than startup.
This pull request includes several changes to the
DatadogCrashReporting
module, focusing on enhancing crash reporting functionality and improving compatibility with conditional imports. The most important changes include adding a new method to merge RUM attributes inCrashContext
, updating theCrashReporting
class to handle conditional imports, and making theCrashReportingFeature
class andCrashReportingPlugin
protocol public.Enhancements to crash reporting functionality:
DatadogCrashReporting/Sources/CrashContext/CrashContext.swift
: Added a new methodmerging(rumAttributes:)
to theCrashContext
struct for merging RUM attributes.DatadogCrashReporting/Sources/CrashReporting.swift
: Introduced a new methodsend(_:attributes:in:)
to theCrashReporting
class for sending crash reports with optional attributes.Improvements for conditional imports:
DatadogCrashReporting/Sources/CrashReporting.swift
: Updated theenable(in:)
method to conditionally compile code based on the availability of theCrashReporter
module. [1] [2]DatadogCrashReporting/Sources/PLCrashReporterIntegration/
: Added#if canImport(CrashReporter)
checks to conditionally compile code depending on the availability of theCrashReporter
module. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Public API changes:
DatadogCrashReporting/Sources/CrashReportingFeature.swift
: Changed theCrashReportingFeature
class and itsname
andmessageReceiver
properties to be public. [1] [2] [3]DatadogCrashReporting/Sources/CrashReportingPlugin.swift
: Made theCrashReportingPlugin
protocol public and added a newNoopCrashReportingPlugin
class. [1] [2]