Meter icon indicating copy to clipboard operation
Meter copied to clipboard

How to use Meter to catch crash infomations?

Open kami-kgu opened this issue 1 year ago • 10 comments

I integrated this library to my project, but now I have no idea about how to use Meter. Is there have any documents about how to using Meter? Thank you.

kami-kgu avatar Jun 27 '24 07:06 kami-kgu

There defnitely should be more.

Can I ask why you opted for Meter specifically over using MetricKit directly? What were you looking for? MetricKit-captured crashes are already presented in the Xcode crash viewer.

mattmassicotte avatar Jun 27 '24 09:06 mattmassicotte

Actually, my leader suggest this library to me and ask me to investigate how to integrate this library to our project. I just want to catch crash informations and then write those infos into out log system.

kami-kgu avatar Jun 27 '24 09:06 kami-kgu

Have you already integrated MetricKit into your app? Here's how you do that:

https://developer.apple.com/documentation/metrickit/mxmetricmanager

And here's a library that uses Meter to do, among other things, symbolication. I guess that's what you want from Meter over raw MetricKit data.

https://github.com/ChimeHQ/MeterReporter/blob/main/Sources/MeterReporter/MeterReporter.swift

I'll also work on a more minimal example for this project's readme. Definitely needs to there. And please don't be shy with questions!

mattmassicotte avatar Jun 27 '24 11:06 mattmassicotte

@mattmassicotte

I want to track crashes occurring in my third-party library and report only those crashes to our backend.

Since our framework is vendored, we can't use other crash reporting tools as they may interfere with the host app.

We initially found MetricKit to be a good fit, but the crash reports it provides are difficult to interpret. Eventually, we came across Meter.

I would like to know if Meter can help libraries filter out only the crashes happening within their own code and upload them to our backend, rather than relying on the host app to report crashes related to our SDK.

mnive93 avatar Feb 25 '25 08:02 mnive93

Meter can help work with MetricKit in general, but here's a stack overflow answer I gave on the general problem. It's actually extremely tricky!

https://stackoverflow.com/questions/50867813/crash-analyzing-tool-in-framework/51294888#51294888

mattmassicotte avatar Feb 25 '25 17:02 mattmassicotte

Can I use Meter along with MetricKit to filter the MetricKit payload and send only crashes related to my library to our backend? @mattmassicotte

mnive93 avatar Feb 28 '25 10:02 mnive93

You can use Meter to inspect reports. In many cases you’ll be able to examine the symbolic information of frames too. If that is enough for you to do the filtering you want, then yes!

mattmassicotte avatar Feb 28 '25 11:02 mattmassicotte

Understood thank you so much for this information. @mattmassicotte

mnive93 avatar Feb 28 '25 11:02 mnive93

After a few attempts, we realized that filtering based on symbolic information is proving to be challenging. Is there any way for a third party to track the performance and metrics of a library to provide insights like crash-free percentage and other key metrics?

@mattmassicotte

mnive93 avatar Mar 03 '25 07:03 mnive93

Hello @mnive93 ! Did you read the comment I linked from Stack Overflow? Basically, want you want to do is very challenging. You might be able to get a small amount of actionable information, but because your SDK is a guest within a hosting application, it just isn't really possible to isolate your SDK from everything else.

mattmassicotte avatar Mar 11 '25 15:03 mattmassicotte