Production Issue - MetricKit is not generating daily metric payloads as expected since iOS 18

I'm a big fan of MetricKit. I decided to see how my apps are performing with iOS 18 and well, I'm not getting any metric payloads from those devices. Metric payloads received from my test devices adopting iOS 18 has pretty much bottomed out to zero.

Is anyone getting MetricKit MXMetricPayloads from iOS 18 devices?

FB15461298 - MetricKit: Production issue / regression with iOS 18 - Significant dropout or metric payloads being generated since 18.0 - nearly no reports

To demonstrate the issue, I decided to graph the metric payloads my infrastructure receives for all of my apps across all of my devices over the last 16 months starting with WWDC23 timeframe. This data is grouped by count per month. A trend can easily be seen starting in June 2024 where I started to adopt iOS 18 betas.

Zooming in since WWDC24, grouped by week, it is much easier to see the decline.

Note, the second screenshot shows data collected from Xcode builds, TestFlight, and App Store. The last data point from today was a manual creation from Xcode's Debug window, so at least that triggering mechanism works and I can confirm all of my code to upload off device works as expected.

On the bright side, I guess I will ship this 'payload received over time' feature in my MetricKit payload analyzer app with a scrolling window and group by features that make up these screenshots.

Answered by edorphy in 808712022

This was an issue on my end that I didn't catch until now. In adding Shortcuts support earlier this summer I had to rename my Product Name to include a space due to how the system renders things. So my filters needed updating.

Accepted Answer

This was an issue on my end that I didn't catch until now. In adding Shortcuts support earlier this summer I had to rename my Product Name to include a space due to how the system renders things. So my filters needed updating.

@edorphy I am facing an issue in logging metrics from Metric kit to my FileSystem. I was able to initially get metrics immediately for simulated crash or high CPU consumption situation. But not able to get the same for 24h cycle. https://forums.developer.apple.com/forums/thread/765149

Can you share a snippet of how you have been able to do it from your end.

I have in initialised this metric manager instance in didFinishLaunchingWithOptions


var metricManager: MetricManager?


final class MetricManager: NSObject, MXMetricManagerSubscriber {
    override init() {
        super.init()
        MXMetricManager.shared.add(self)
    }
    
    deinit {
        MXMetricManager.shared.remove(self)
    }
    
    func didReceive(_ payloads: [MXDiagnosticPayload]) {
        for payload in payloads {
            let data = payload.jsonRepresentation()
            // Logging in File System
        }
    }
}
```
are you following the same process?
Production Issue - MetricKit is not generating daily metric payloads as expected since iOS 18
 
 
Q