Need MetricKit Implementation details for MacOS background Application, mainly for

Hi, We are trying to integrate Metric Kit into our MacOS Application. Our application is a background process. We are interested in getting CPU and Memory metrics for our process. MXMetricPayload is the one we are looking at. We tried to integrate metric Kit and left the background app for 24 hours, we did not get any callback. So, does metric kit work for background app in MacOS? Also does it for Network Extension?

Also one more point, when i integrated metric Kit and used Xcode to simulate MetricKit payloads, i was getting the callback i.e func didReceive(_ payloads: [MXMetricPayload])

Main issue was that when i launched my app with changes and waited for more than 24 hours, but i did not get any callback, so wanted to know if it works on background apps or not? Also does it work on MacOS or not? Could u pls help to answer it

MetricKit definitely works on macOS.

I’m not sure about how it interacts with Network Extension processes. Let’s start with some basics:

  • Is your NE provider packaged as an app extension or a system extension?
  • If it’s an sysex, are you distributing it directly? Or on the Mac App Store.

TN3134 Network Extension provider deployment talks more about NE provider packaging and deployment options.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thanks for looking into this. Here is a complete summary of our setup and what we have confirmed so far.

App configuration:

  • macOS app distributed via Developer ID (PKG installer) — not the Mac App Store
  • Host app runs as a menu bar agent (LSUIElement = YES in Info.plist) NSApplicationActivationPolicy = .accessory
  • The app runs continuously as a login item — it is always alive
  • Network Extension is a System Extension (NEAppProxyProvider), always running alongside the host app

What we have implemented:

  • MXMetricManager.shared().addSubscriber(self) is called in applicationDidFinishLaunching in the host app — as early as possible
  • A separate MXMetricManagerSubscriber is registered inside the Network Extension process at tunnel start
  • Both didReceiveMetricPayloads: and didReceiveDiagnosticPayloads: are implemented
  • On startup we also drain pastPayloads and pastDiagnosticPayloads to catch anything queued while the process was not running
  • The subscriber object is kept alive for the full lifetime of both processes

What we have confirmed:

  • Xcode's "Simulate MetricKit Payloads" works correctly in the host app. Our delegates fire, payloads are received. The code is correct.
  • Real production payloads: zero callbacks after 24+ hours in both processes i.e Host app and NE process

Our questions:

  1. Does MetricKit's real 24h payload delivery require App Store or TestFlight distribution? We are using Developer ID — does metrickitd require an App Store receipt to mark an app eligible for delivery?

  2. Does metrickitd deliver payloads to LSUIElement = YES menu bar agents (.accessory activation policy)? Since these apps never become the "active application" in the OS sense, we are concerned the delivery trigger may never fire for our process.

  3. If both of the above are blockers — is there any supported path to get real MetricKit payload delivery for a Developer ID distributed, LSUIElement menu bar app with a System Extension?

Need MetricKit Implementation details for MacOS background Application, mainly for
 
 
Q