Loading

EDOT iOS instrumentations

Stack Serverless Observability EDOT iOS

The following list describes the various instrumentation provided with the Elastic Distribution of OpenTelemetry iOS (EDOT iOS). These instrumentations can be configured as described in instrumentation configuration.

The SDK will automatically capture and upload crashes to the APM server. These crashes are stored in the format as described in the mobile SDK event spec.

URLSession instrumentation is provided by the OpenTelemetry Swift SDK, and automatically generates traces for all network requests generated with URLSessions. Refer to URL Session instrumentation Open Telemetry documentation.

The SDK provides SwiftUI.View and UIViewController instrumentation, where the load time of a View is measured using spans. All Views simultaneously loaded will be grouped under the same starting span. The spans' names will be dictated by the following rules, from least to highest precedence:

  1. <view's class name> - view appearing
  2. <navigation title> - view appearing
  3. The name passed to View extension method reportName(_ name: String) -> View

The View’s class name will be a swift name-mangled string, and is the least desirable naming method. If it’s possible, set a navigation title on your views:

AllProductsList.swift

struct AllProductsList: View {
    @EnvironmentObject var modelData : ModelData

    var body: some View {
        VStack {
            List(modelData.products, id: \.id) { product in
                AdminProductRow(product: product)

            }
        }.onAppear  {
            modelData.loadProducts()
        }.navigationTitle("All Products")
    }
}

The All Products - view appearing will show up in Kibana.

If it isn’t possible to set a navigation title, use reportName(_ name: String) -> View to set the name that will show in Kibana:

AllProductsList.swift

struct AllProductsList: View {
    @EnvironmentObject var modelData : ModelData

    var body: some View {
        VStack {
            List(modelData.products, id: \.id) { product in
                AdminProductRow(product: product)

            }
        }.onAppear  {
            modelData.loadProducts()
        }.reportName("All Products - view appearing")
    }
}
Note

You must insert the entire string All Products - view appearing to match the default formatting used for the other two naming options.

System-metric instrumentation records CPU and memory usage minutely as metrics. CPU metrics are recorded as system.cpu.usage and memory usage is recorded as system.memory.usage.

Available for iOS 13 and higher, the SDK provides instrumentation of key MetricKit data points:

  • Application Launch times
  • Application responsiveness
  • Application exit counts

Find technical details on the metric generated in the Mobile spec

This histogram metric provides launch duration broken down by first draw, first draw (optimized), and resumed. Find more details about the MetricKit data point in the Apple documentation.

A histogram of the different durations of time in which the app is too busy to handle user interaction responsively. Find more details about the MetricKit data point in the Apple documentation.

A count of application exits categorized by various attributes: foreground or background, and normal or abnormal, where abnormal exits are further subdivided. Find more details about the MetricKit data point in the Apple documentation.

In v0.5.0 the application lifecycle events are automatically instrumented. Find the technical details in the Mobile spec.