Telemetry is an easy-to-use unified pipeline for engineering logging and business analytics.
Applications and frameworks want to record data corresponding to both user initiated and internal events. Sometimes this is for engineering purposes (debugging and instrumentation) and sometimes this is for business analytics. In many cases, these events are overlapping. When the event happens, we want to collect engineering information AND business analytics.
Telemetry makes it easy to define a single event to be recorded and interpreted correctly as it arrives at different destinations.
Abstracting your engineering and analytics events into small, concise types yields clean call-sites and helps organize the code backing up the data reported for each event.
- Xcode 14.0+
- Swift 5.5+
The easiest way to install Telemetry is by adding a dependency via SPM.
.package(
name: "Telemetry",
url: "https://github.com/krogerco/telemetry-ios.git",
.upToNextMajor(from: Version(1, 0, 0))
)
Getting basic telemetry working is quick and easy:
-
Create a telemeter for the application to use.
var telemeter = StandardTelemeter()
-
Add your relays to the telemeter.
telemeter.add(relay: ConsoleRelay()) telemeter.add(relay: ExternalServiceRelay())
-
Define events
enum CartEvent: Metron { case addedToCart case removedFromCart var message: String { switch self { case .addedToCart: return "Added product to cart." case .removedFromCart: return "Removed product from cart." } }
-
Record events
telemeter.record(CartEvent.addedToCart)
Events are routed to each relay and processed if applicable.
Gauntlet has full DocC documentation. After adding to your project, Build Documentation
to add to your documentation viewer.
Getting Started Full Documentation
If you have issues or suggestions, please open an issue on GitHub.