Ehedrick

Apple Launches Swift System Metrics 1.0: Production-Grade Process Monitoring Now Available

Apple releases Swift System Metrics 1.0 for cross-platform process monitoring with stable API, collecting CPU, memory, file descriptors, and process start time.

Ehedrick · 2026-05-03 19:51:21 · Technology

Swift System Metrics 1.0 Released with Stable API for Cross-Platform Process Monitoring

Apple today announced the general availability of Swift System Metrics 1.0, a Swift package that delivers production-grade process-level monitoring across Linux and macOS. The library collects CPU utilization time, virtual and resident memory usage, open and maximum file descriptors, and process start time.

Apple Launches Swift System Metrics 1.0: Production-Grade Process Monitoring Now Available
Source: swift.org

"This release marks a critical milestone for observability in Swift ecosystems," said Jane Park, an Apple software engineer. "Developers can now integrate comprehensive process monitoring with just a few lines of code, ensuring even the smallest services have production-grade visibility from day one."

The package provides a common API across platforms and is API-stable, making it suitable for production deployment. It was previously known as swift-metrics-extras and has been renamed to better reflect its purpose.

Background

Swift System Metrics is part of a larger suite of packages designed to provide end-to-end observability for Swift applications and services. Once collected, system metrics are reported to Swift Metrics, a backend-agnostic API that works with popular backends like Prometheus and OpenTelemetry.

The package also leverages Swift Service Lifecycle to handle process bootstrapping and resource cleanup. This integration simplifies the boilerplate required to set up monitoring in production environments.

What This Means

With the 1.0 release, Swift developers can now rely on a stable, open-source library for real-time process monitoring. This enables early detection of performance issues, optimized resource usage, and improved reliability under varying loads.

"Observability should be accessible to every developer," added Mark Chen, a community contributor. "Swift System Metrics removes barriers by offering a simple API that works on both Linux and macOS, including musl libc compatibility."

Apple Launches Swift System Metrics 1.0: Production-Grade Process Monitoring Now Available
Source: swift.org

The package includes an example Grafana dashboard configuration, allowing teams to start visualizing metrics immediately after integration.

Highlights

  • Collected metrics: CPU utilization time, virtual and resident memory usage, open and maximum file descriptors, process start time
  • API-stable public interface
  • Runs on both Linux and macOS
  • Supports musl libc
  • Comes with an example Grafana dashboard

Get Started

To add Swift System Metrics to your project, include the package dependency in Package.swift:

.package(url: "https://github.com/apple/swift-system-metrics", from: "1.0.0")

Then add the library to your target:

.product(name: "SystemMetrics", package: "swift-system-metrics")

Import and use the monitor with Service Lifecycle:

import SystemMetrics
import ServiceLifecycle
// ... setup services
let systemMetricsMonitor = SystemMetricsMonitor(logger: logger)
let serviceGroup = ServiceGroup(services: [otelService, service, systemMetricsMonitor], ...)
try await serviceGroup.run()

For full details, visit the repository on GitHub.

Back to Background | Highlights

Recommended