Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Exploring Mobile Observability with OpenTelemetry

Jitin
November 30, 2024

Exploring Mobile Observability with OpenTelemetry

An exploration of using Opentelemetry APIs and android agent to build a better observability system for Android apps.

Jitin

November 30, 2024
Tweet

More Decks by Jitin

Other Decks in Technology

Transcript

  1. Mobile App Cell Tower CDN/ Gateway Backend • OEM •

    Performance • OS Versions • Network state • User lifecycle
  2. Mobile App Cell Tower CDN/ Gateway Backend • OEM •

    Performance • OS Versions • Network state • User lifecycle Background Jobs Noti fi cations
  3. Mobile App Cell Tower CDN/ Gateway Backend • OEM •

    Performance • OS Versions • Network state • User lifecycle Background Jobs Noti fi cations Backend Code
  4. Custom Events App Monitoring - Crashes - Performance - …

    App Events - Navigation - Attributes - Custom events - …
  5. What is OpenTelemetry - Framework to collect telemetry data -

    Vendor agnostic - Works across frameworks using agent libraries - Allows control over export of data
  6. Span - Network Call Request Start • user identi fi

    er • os version • device model • network type Response Received
  7. Mobile App Network Storage UI System Retro fi t Workmanager

    Sqlite Shared Pref Recyclerview Device Lifecycle Memory CPU
  8. Mobile App Network Storage UI System Retro fi t Workmanager

    Sqlite Shared Pref Recyclerview Device Lifecycle Memory CPU Server Gateway Kafka DB
  9. Mobile App Network Storage UI System Retro fi t Workmanager

    Sqlite Shared Pref Recyclerview Device Lifecycle Memory CPU Server Gateway Kafka DB Span Span Span Span Span Span
  10. Additional Data Metrics - Counter - Timer - Histogram -

    Gauge Logs - Bridge to existing log libraries
  11. // Build instance val openTelemetry = otelRumBuilder.build().openTelemetry // Create a

    tracer openTelemetry.getTracer("network.call") // Create span val span = tracer.spanBuilder(spanName) .setAllAttributes(attributes) .startSpan()
  12. // Create span processor val processor = BatchSpanProcessor.builder( OtlpHttpSpanExporter.builder() .setEndpoint(endPoint)

    .build() ) // Attach processor to instance otelRumBuilder.addTracerProviderCustomizer { builder -> builder.addSpanProcessor(processor) }
  13. // Build instance val openTelemetry = otelRumBuilder.build().openTelemetry // Create meter

    val meter = openTelemetry.getMeter("success.responses") // Build counter metric meter.counterBuilder(name) .setDescription(description) .setUnit(unit) .build()
  14. Auto Instrumentation • App Launch trace • Lifecycle traces •

    Network call traces • Slow rendering traces • Crash detection • Network change detection • Disk persistence • Automatic device attributes
  15. • Powerful API • Open and mature ecosystem • Total

    control over data • Collaborative development • Observability beyond crashes
  16. • It depends • Without scale, existing solutions might just

    work. • Ecosystem under active development
  17. Fin