Skip to content

Conversation

@jkasten2
Copy link
Member

@jkasten2 jkasten2 commented Nov 6, 2025

Description

One Line Summary

Add OpenTelemetry libraries to report crashes to improve SDK reliability.

Details

Motivation

Allows us to quickly identify and fix issues caused by this SDK.

Scope

Only adds OpenTelemetry to track crashes.

Testing

Unit testing

TODO: Need to add unit testing yet.

Manual testing

Tested on an Android 14 Emulator:

  • Throw RuntimeException from example app and ensure SDK can catch it
  • Ensured our crash handler saves it to a file, even when it is offline
  • Ensured the last crash is sent to a remote server when the app is opened again.

Tested has only been done with a known working Otel backend, HoneyComb, until we
have our own backend to receive the payload.

Remaning Tasks

  • Add unit tests
  • Turn on only if in remote parameters
  • uncaughtException
    • Add try-catch, so any of our logic can't cause side-effects if something goes wrong
    • Shutdown any in progress uploading of crashes
  • Look into if we can use older libraries so we don't have to use Kotlin 2.2
  • Crash handling only works with Android 8, due to Otel libraries, look into if it easy to support olde version of Android.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
    • If it is hard to explain how any codes changes are related to each other then it most likely needs to be more than one PR
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
    • Simplify with less code, followed by splitting up code into well named functions and variables, followed by adding comments to the code.
  • I have reviewed this PR myself, ensuring it meets each checklist item
    • WIP (Work In Progress) is ok, but explain what is still in progress and what you would like feedback on. Start the PR title with "WIP" to indicate this.

This change is Reviewable

Adding disk-buffering to otel logging required bumping to Kotlin 2.2.
Adding the code to implement this in a follow up commit.
When the app is started again we send any pending crash reports.
Also refactored crash handle classes into their own namespace.

Refactored IOneSignalOpenTelemetry properties into suspend functions,
as some values we want to add to all Otel requests were suspend.
Also made all otel types internal and a few other misc cleanup.
@jkasten2 jkasten2 added the WIP Work In Progress label Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WIP Work In Progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants