-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract modules from core #711
Extract modules from core #711
Conversation
...lemetry/android/common/internal/features/networkattrs/CurrentNetworkAttributesExtractor.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I think it's a good start. I do believe we should move SystemTime to common though, as you mentioned:
Moved SystemTime class here as well as it is a good contender for a shared utility. It is currently only used by the PeriodicWorkService. Alternatively, We can move it to :common module
It's pretty common having to use the current time and it's tricky to test those use cases without something like SystemTime. Here's an example of a usage outside of the services scope where having it in common should help.
Other than that I think we can move forward with these changes, though I'll leave this PR open until next week to give a chance for people in the US to have a look too, as I've noticed that this week has been pretty quiet in OTel in general due to the holidays.
f27815a
to
a49ff87
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like progress. Thanks for contributing this!
As a first step towards #669 , I've extracted following 3 modules from core:
:common
networkattrs->data
andCurrentNetworkAttributesExtarctor
here as it is utilized by both:services
inCurrentNetworkProvider
and:core
inNetworkAttributesSpanAppender.
RuntimeDetailsExtractor
used by crash instrumentation here.:services
services
folder incore
is extracted as a moduleSystemTime
class here as well as it is a good contender for a shared utility. It is currently only used by thePeriodicWorkService
. Alternatively, We can move it to :common module (Update - moved to:common
now):instrumentation:android-instrumentation
Other callouts:
Preferences.java
in service module depended on the generatedBuildConfig.java
for LIBRARY_PACKAGE_NAME for getting the shared preference object. It does not make sense to generateBuildConfig.java
in any other module other than :core as it is project specific. So, I've replaced the dependence by direct replacement with "io.opentelemetry.android" string. Also, it did not make sense to add this string to RumConstants and use from there.test/resources/META-INF/services
andTestAndroidInstrumentation
is replicated right now in :core and :instrumentation:android-instrumentation modules as it is just providing an AndroidInstrumentation AutoService on the classpath for tests in both modules as those tests are specific to the individual modules (AgentInitTest
,OpentelemetryRumBuilderTest
,AndroidInstrumentationLoaderImplTest
). (While writing this, it comes to my mind that we can perhaps moveTestAndroidInstrumentation
as a shared test class in test-common module.)This is just a first step, we've a long way to go in determining the future possibilities of how we can support instrumentations to be used independently of this SDKs core (initializing and configuring) module. Those discussions are covered in following issues - #658, #669 , #702.
Screenshots of the new modules structure from android studio project explorer: