12 Jan 2023 01:26 PM
Hello,
My team is currently working on a mobile SDK which we want to include in different apps in the future. We want to monitor our components in dynatrace, but the developers in their tests indicated that it was not possible to create another instance of dynatrace since the App where it is used our SDK is already instrumented with Dynatrace which would be incompatible.
it is possible to have two instances of Dynatrace in the same app?
Solved! Go to Solution.
12 Jan 2023 01:49 PM - edited 12 Jan 2023 02:15 PM
Simple answer: no, not possible
Sidenote: if this is not for an SDK that is only used in-house/for apps built by same company as the SDK this might create legal oder privacy related issues
Complex answer: maybe (in theory, untested)
12 Jan 2023 02:19 PM
Similar to iOS, there can only be one instance of the OneAgent for Android in every Android app. Unfortunately it is not possible to have an independent library instrumentation and report it to different Dynatrace environments or applications.
When the library and app are owned by the same company, then the customer can customize the instrumentation of the library. When the library and app are part of the same Gradle project, then the customer can use the snippets from this documentation section. When they are part of different Gradle project, then the customer can add the OneAgent library as dependency and instrument it. The OneAgent will be automatically started, when the app is auto-instrumented. In this case, the monitored data will be sent to the same Dynatrace mobile applications.
13 Jan 2023 01:12 PM
Thanks for the answers!
Dynatrace API would be a option for these cases or is there something better?