open-telemetry / opentelemetry-android

OpenTelemetry Tooling for Android
Apache License 2.0
114 stars 22 forks source link

Instrumentation API part 6 #446

Closed LikeTheSalad closed 4 days ago

LikeTheSalad commented 2 weeks ago

I think this will be the most complicated migration. It's for the activity module, which is currently coupled with the fragment, startup, and the lifecycle ones.

Also, similarly to the network module, the activity one had 2 responsibilities:

The second responsibility is needed during the OTel instance initialization, so the tool VisibleScreenTracker was converted into a service (VisibleScreenService) which is used by the init process as well as by the activity instrumentation and will also be used by the fragment module in a follow-up PR.

Since all these modules are related: activity, fragment, startup, and lifecycle, I was planning to migrate them all at once, but then it turned out to be too many code changes, so most of the changes I left for this part are related to the activity module, but might contain some smaller changes into the other modules so that they could compile and we could get a green build for this PR.