@dynatrace/react-native-plugin 2.305.1 → 2.309.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -10
- package/android/build.gradle +3 -1
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceAppStartModule.kt +128 -0
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceInternalModule.kt +22 -0
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceRNBridgeImpl.kt +411 -0
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceReactPackage.kt +54 -0
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceUtils.kt +86 -0
- package/android/src/main/java/com/dynatrace/android/agent/model/AppStartMeasurement.kt +15 -0
- package/android/src/main/java/com/dynatrace/android/agent/model/AppStartMeasurementType.kt +18 -0
- package/android/src/new/java/com/dynatrace/android/agent/DynatraceRNBridge.kt +228 -0
- package/android/src/old/java/com/dynatrace/android/agent/DynatraceRNBridge.kt +258 -0
- package/files/plugin.gradle +1 -1
- package/index.js +10 -10
- package/instrumentation/DynatraceInstrumentation.js +1 -0
- package/{lib → instrumentation/jsx}/CreateElement.js +6 -5
- package/{lib/instrumentor/base → instrumentation/jsx}/ElementHelper.js +14 -12
- package/{lib/jsx-dev-runtime.js → instrumentation/jsx/JsxDevRuntime.js} +10 -19
- package/instrumentation/jsx/JsxRuntime.js +63 -0
- package/instrumentation/jsx/JsxRuntimeUtil.js +31 -0
- package/instrumentation/jsx/components/ClassComponent.js +49 -0
- package/instrumentation/jsx/components/ComponentUtil.js +33 -0
- package/instrumentation/jsx/components/FunctionalComponent.js +20 -0
- package/{lib/instrumentor/base → instrumentation/jsx/components}/Picker.js +1 -1
- package/{lib/instrumentor/base → instrumentation/jsx/components}/RefreshControl.js +1 -1
- package/{lib/instrumentor/base → instrumentation/jsx/components}/Switch.js +1 -1
- package/{lib/instrumentor/base → instrumentation/jsx/components}/Touchable.js +5 -5
- package/instrumentation/libs/community/Picker.InstrInfo.js +20 -0
- package/{lib → instrumentation/libs}/community/Picker.js +1 -1
- package/instrumentation/libs/community/gesture-handler/Touchables.InstrInfo.js +23 -0
- package/{lib → instrumentation/libs}/community/gesture-handler/Touchables.js +1 -1
- package/{lib → instrumentation/libs}/react-native/RefreshControl.InstrInfo.js +2 -2
- package/{lib → instrumentation/libs}/react-native/RefreshControl.js +5 -5
- package/{lib → instrumentation/libs}/react-native/Switch.InstrInfo.js +2 -2
- package/{lib → instrumentation/libs}/react-native/Switch.js +5 -5
- package/instrumentation/libs/react-native/Touchables.InstrInfo.js +25 -0
- package/{lib → instrumentation/libs}/react-native/Touchables.js +1 -1
- package/{lib → instrumentation/libs}/react-navigation/ReactNavigation.js +6 -5
- package/{lib/instrumentor → instrumentation}/model/Types.js +1 -14
- package/instrumentation/model/TypesUtil.js +17 -0
- package/ios/DynatraceRNBridge.h +10 -1
- package/ios/DynatraceRNBridge.mm +152 -0
- package/jsx-dev-runtime.js +1 -1
- package/jsx-runtime.js +1 -1
- package/lib/core/Application.js +20 -0
- package/lib/{instrumentor/base → core}/Dynatrace.js +57 -48
- package/lib/{instrumentor/base → core}/DynatraceAction.js +23 -22
- package/lib/core/DynatraceInternal.js +46 -0
- package/lib/{instrumentor/base → core}/DynatraceRootAction.js +5 -4
- package/lib/{instrumentor/base → core}/DynatraceWebRequestTiming.js +6 -5
- package/lib/{instrumentor/base → core}/ErrorHandler.js +6 -5
- package/lib/{instrumentor/base → core}/configuration/Configuration.js +1 -1
- package/lib/{instrumentor/base → core}/configuration/ConfigurationDefaults.js +1 -2
- package/lib/{instrumentor/base → core}/configuration/ConfigurationHandler.js +2 -2
- package/lib/{instrumentor/base → core}/configuration/ManualStartupConfiguration.js +1 -1
- package/lib/core/logging/ConsoleLogger.js +27 -0
- package/lib/core/logging/LogLevel.js +12 -0
- package/lib/dynatrace-transformer.js +1 -1
- package/lib/next/Dynatrace.js +86 -0
- package/lib/next/DynatraceSecondGenForwarder.js +17 -0
- package/lib/next/IDynatrace.js +2 -0
- package/lib/next/IDynatraceForwarder.js +2 -0
- package/lib/next/appstart/AppStartObserver.js +32 -0
- package/lib/next/appstart/AppStartType.js +38 -0
- package/lib/next/events/EventCreator.js +77 -0
- package/lib/next/events/EventPipeline.js +57 -0
- package/lib/next/events/EventTimestamp.js +24 -0
- package/lib/next/events/ViewInfoCreator.js +27 -0
- package/lib/next/events/modifier/BaseDataEventModifier.js +31 -0
- package/lib/next/events/modifier/EventLimitation.js +69 -0
- package/lib/next/events/modifier/EventModifierUtil.js +88 -0
- package/lib/next/events/modifier/IEventModifier.js +2 -0
- package/lib/next/events/modifier/ModifyEventValidation.js +187 -0
- package/lib/next/events/modifier/NonFiniteNumbersModifier.js +50 -0
- package/lib/next/events/modifier/SendEventValidation.js +84 -0
- package/lib/next/events/spec/EventFieldKeysEnum.js +2 -0
- package/lib/next/events/spec/EventSpecContstants.js +46 -0
- package/lib/next/events/spec/IAppStartEvent.js +2 -0
- package/lib/next/events/spec/ICrashEvent.js +2 -0
- package/lib/next/events/spec/IErrorCodeEvent.js +2 -0
- package/lib/next/events/spec/IErrorExceptionEvent.js +2 -0
- package/lib/next/events/spec/IReactNativeEvent.js +2 -0
- package/lib/next/events/spec/IRumEvent.js +2 -0
- package/lib/next/provider/ITimestampProvider.js +2 -0
- package/lib/next/provider/TimestampProvider.js +10 -0
- package/package.json +51 -40
- package/react-native-dynatrace.podspec +1 -1
- package/src/lib/{instrumentor/base → core}/interface/NativeDynatraceBridge.ts +10 -0
- package/typings/react-native-dynatrace.d.ts +0 -1
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceRNBridgeImpl.java +0 -362
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceReactPackage.java +0 -67
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceUtils.java +0 -76
- package/android/src/main/java/com/dynatrace/android/agent/PrivateDTBridge.java +0 -28
- package/android/src/new/java/com/dynatrace/android/agent/DynatraceRNBridge.java +0 -187
- package/android/src/old/java/com/dynatrace/android/agent/DynatraceRNBridge.java +0 -189
- package/lib/community/Picker.InstrInfo.js +0 -20
- package/lib/community/gesture-handler/Touchables.InstrInfo.js +0 -56
- package/lib/instrumentor/DynatraceInstrumentation.js +0 -1
- package/lib/instrumentor/base/Application.js +0 -16
- package/lib/instrumentor/base/DynatraceInternal.js +0 -34
- package/lib/instrumentor/base/Logger.js +0 -16
- package/lib/instrumentor/base/model/LogLevel.js +0 -17
- package/lib/jsx-runtime.js +0 -69
- package/lib/react/Component.js +0 -90
- package/lib/react-native/Touchables.InstrInfo.js +0 -60
- /package/{lib/instrumentor/base/interface → instrumentation/jsx}/IDynatraceProperties.js +0 -0
- /package/{lib → instrumentation/libs}/community/gesture-handler/index.js +0 -0
- /package/{lib → instrumentation/libs}/gesture-handler.js +0 -0
- /package/{lib → instrumentation/libs}/react-native/index.js +0 -0
- /package/{lib → instrumentation/libs}/react-native.js +0 -0
- /package/{lib/instrumentor → instrumentation}/model/Reference.js +0 -0
- /package/{lib/instrumentor → instrumentation}/parser/Babel.js +0 -0
- /package/lib/{instrumentor/base → core}/DynatraceBridge.js +0 -0
- /package/lib/{instrumentor/base → core}/NullAction.js +0 -0
- /package/lib/{instrumentor/base → core}/NullRootAction.js +0 -0
- /package/lib/{instrumentor/base → core}/NullWebRequestTiming.js +0 -0
- /package/lib/{instrumentor/base → core}/UserPrivacyOptions.js +0 -0
- /package/lib/{instrumentor/base → core}/configuration/ConfigurationBuilder.js +0 -0
- /package/lib/{instrumentor/base → core}/configuration/ConfigurationPreset.js +0 -0
- /package/lib/{instrumentor/base → core}/configuration/IConfiguration.js +0 -0
- /package/lib/{instrumentor/base → core}/interface/IDynatrace.js +0 -0
- /package/lib/{instrumentor/base → core}/interface/IDynatraceAction.js +0 -0
- /package/lib/{instrumentor/base → core}/interface/IDynatraceInternal.js +0 -0
- /package/lib/{instrumentor/base → core}/interface/IDynatraceRootAction.js +0 -0
- /package/lib/{instrumentor/base → core}/interface/IWebRequestTiming.js +0 -0
- /package/lib/{instrumentor/base → core}/interface/NativeDynatraceBridge.js +0 -0
- /package/lib/{instrumentor/base/interface → core/logging}/ILogger.js +0 -0
- /package/lib/{instrumentor/base → core}/model/DataCollectionLevel.js +0 -0
- /package/lib/{instrumentor/base → core}/model/Json.js +0 -0
- /package/lib/{instrumentor/base → core}/model/Platform.js +0 -0
- /package/lib/{instrumentor/base → core}/util/StringUtils.js +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
package com.dynatrace.android.agent
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.ReactPackage
|
|
4
|
+
import com.facebook.react.TurboReactPackage
|
|
5
|
+
import com.facebook.react.bridge.NativeModule
|
|
6
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
7
|
+
import com.facebook.react.module.model.ReactModuleInfo
|
|
8
|
+
import com.facebook.react.module.model.ReactModuleInfoProvider
|
|
9
|
+
import com.facebook.react.uimanager.ViewManager
|
|
10
|
+
import java.util.Arrays
|
|
11
|
+
|
|
12
|
+
class DynatraceReactPackage : TurboReactPackage() {
|
|
13
|
+
init {
|
|
14
|
+
setupAppStartListener()
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
|
|
18
|
+
return emptyList()
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
|
|
22
|
+
val bridge = DynatraceInternalModule(reactContext)
|
|
23
|
+
val appStart = DynatraceAppStartModule(reactContext)
|
|
24
|
+
return Arrays.asList<NativeModule>(
|
|
25
|
+
DynatraceRNBridge(reactContext, bridge),
|
|
26
|
+
bridge,
|
|
27
|
+
appStart
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
|
|
32
|
+
val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
|
|
33
|
+
val isTurboModule: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
|
|
34
|
+
moduleInfos[BRIDGE_NAME] = ReactModuleInfo(
|
|
35
|
+
BRIDGE_NAME,
|
|
36
|
+
BRIDGE_NAME,
|
|
37
|
+
false, // canOverrideExistingModule
|
|
38
|
+
false, // needsEagerInit
|
|
39
|
+
true, // hasConstants
|
|
40
|
+
false, // isCxxModule
|
|
41
|
+
isTurboModule // isTurboModule
|
|
42
|
+
)
|
|
43
|
+
return ReactModuleInfoProvider { moduleInfos }
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
|
|
47
|
+
return if (name == BRIDGE_NAME) {
|
|
48
|
+
DynatraceAppStartModule(reactContext)
|
|
49
|
+
DynatraceRNBridge(reactContext, DynatraceInternalModule(reactContext))
|
|
50
|
+
} else {
|
|
51
|
+
null
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
package com.dynatrace.android.agent
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReadableArray
|
|
4
|
+
import com.facebook.react.bridge.ReadableMap
|
|
5
|
+
import com.facebook.react.bridge.ReadableType
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @author matthias.hochrieser
|
|
9
|
+
*/
|
|
10
|
+
internal object DynatraceUtils {
|
|
11
|
+
// https://github.com/facebook/react-native/blob/1e8f3b11027fe0a7514b4fc97d0798d3c64bc895/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableNativeArray.java#L56
|
|
12
|
+
private fun toArrayList(array: ReadableArray?): ArrayList<Any?> {
|
|
13
|
+
val arrayList = ArrayList<Any?>(array!!.size())
|
|
14
|
+
var i = 0
|
|
15
|
+
val size = array.size()
|
|
16
|
+
while (i < size) {
|
|
17
|
+
when (array.getType(i)) {
|
|
18
|
+
ReadableType.Null -> arrayList.add(null)
|
|
19
|
+
ReadableType.Boolean -> arrayList.add(array.getBoolean(i))
|
|
20
|
+
ReadableType.Number -> {
|
|
21
|
+
val value = array.getDouble(i)
|
|
22
|
+
if (java.lang.Double.isFinite(value)) {
|
|
23
|
+
if (value >= Int.MIN_VALUE && value <= Int.MAX_VALUE && value == value.toInt()
|
|
24
|
+
.toDouble()
|
|
25
|
+
) {
|
|
26
|
+
// This is a int
|
|
27
|
+
arrayList.add(array.getDouble(i).toInt())
|
|
28
|
+
}
|
|
29
|
+
if (value >= Long.MIN_VALUE && value <= Long.MAX_VALUE && value == value.toLong()
|
|
30
|
+
.toDouble()
|
|
31
|
+
) {
|
|
32
|
+
// This is a long
|
|
33
|
+
arrayList.add(array.getDouble(i).toLong())
|
|
34
|
+
}
|
|
35
|
+
break
|
|
36
|
+
}
|
|
37
|
+
arrayList.add(array.getDouble(i))
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
ReadableType.String -> arrayList.add(array.getString(i))
|
|
41
|
+
ReadableType.Map -> arrayList.add(toHashMap(array.getMap(i)))
|
|
42
|
+
ReadableType.Array -> arrayList.add(toArrayList(array.getArray(i)))
|
|
43
|
+
else -> throw IllegalArgumentException("Could not convert object at index: $i.")
|
|
44
|
+
}
|
|
45
|
+
i++
|
|
46
|
+
}
|
|
47
|
+
return arrayList
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
fun toHashMap(map: ReadableMap?): HashMap<String, Any?> {
|
|
51
|
+
val hashMap = HashMap<String, Any?>()
|
|
52
|
+
val iterator = map!!.keySetIterator()
|
|
53
|
+
while (iterator.hasNextKey()) {
|
|
54
|
+
val key = iterator.nextKey()
|
|
55
|
+
when (map.getType(key)) {
|
|
56
|
+
ReadableType.Null -> hashMap[key] = null
|
|
57
|
+
ReadableType.Boolean -> hashMap[key] = map.getBoolean(key)
|
|
58
|
+
ReadableType.Number -> {
|
|
59
|
+
val value = map.getDouble(key)
|
|
60
|
+
if (java.lang.Double.isFinite(value)) {
|
|
61
|
+
if (value >= Int.MIN_VALUE && value <= Int.MAX_VALUE && value == value.toInt()
|
|
62
|
+
.toDouble()
|
|
63
|
+
) {
|
|
64
|
+
// This is a int
|
|
65
|
+
hashMap[key] = map.getDouble(key).toInt()
|
|
66
|
+
}
|
|
67
|
+
if (value >= Long.MIN_VALUE && value <= Long.MAX_VALUE && value == value.toLong()
|
|
68
|
+
.toDouble()
|
|
69
|
+
) {
|
|
70
|
+
// This is a long
|
|
71
|
+
hashMap[key] = map.getDouble(key).toLong()
|
|
72
|
+
}
|
|
73
|
+
break
|
|
74
|
+
}
|
|
75
|
+
hashMap[key] = map.getDouble(key)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
ReadableType.String -> hashMap[key] = map.getString(key)
|
|
79
|
+
ReadableType.Map -> hashMap[key] = toHashMap(map.getMap(key))
|
|
80
|
+
ReadableType.Array -> hashMap[key] = toArrayList(map.getArray(key))
|
|
81
|
+
else -> throw IllegalArgumentException("Could not convert object with key: $key.")
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return hashMap
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
package com.dynatrace.android.agent.model
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Class which holds the values for app start measurements
|
|
5
|
+
*/
|
|
6
|
+
data class AppStartMeasurement(
|
|
7
|
+
/**
|
|
8
|
+
* Name of the app start measurement so it can be identified on the js side
|
|
9
|
+
*/
|
|
10
|
+
val name: String,
|
|
11
|
+
/**
|
|
12
|
+
* timestamp when the measurement happened
|
|
13
|
+
*/
|
|
14
|
+
val timestamp: Long
|
|
15
|
+
)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
package com.dynatrace.android.agent.model
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Enum to identify the different measurement types and handle them in js as well
|
|
5
|
+
*/
|
|
6
|
+
enum class AppStartMeasurementType(
|
|
7
|
+
/**
|
|
8
|
+
* Name of the app start measurement so it can be identified on the js side
|
|
9
|
+
*/
|
|
10
|
+
val value: String
|
|
11
|
+
) {
|
|
12
|
+
DOWNLOAD_START("downloadStart"),
|
|
13
|
+
DOWNLOAD_END("downloadEnd"),
|
|
14
|
+
RELOAD("reload"),
|
|
15
|
+
RUN_JS_BUNDLE_START("runJsBundleStart"),
|
|
16
|
+
RUN_JS_BUNDLE_END("runJsBundleEnd"),
|
|
17
|
+
CONTENT_APPEARED("contentAppeared")
|
|
18
|
+
}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
package com.dynatrace.android.agent
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.Promise
|
|
4
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
5
|
+
import com.facebook.react.bridge.ReadableMap
|
|
6
|
+
|
|
7
|
+
class DynatraceRNBridge(
|
|
8
|
+
reactContext: ReactApplicationContext,
|
|
9
|
+
internalModule: DynatraceInternalModule
|
|
10
|
+
) : NativeDynatraceBridgeSpec(reactContext) {
|
|
11
|
+
private val impl: DynatraceRNBridgeImpl
|
|
12
|
+
|
|
13
|
+
init {
|
|
14
|
+
impl = DynatraceRNBridgeImpl(reactContext, internalModule)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
override fun getName(): String {
|
|
18
|
+
return BRIDGE_NAME;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
override fun getTypedExportedConstants(): Map<String, Any> {
|
|
22
|
+
return impl.getConstants()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
override fun start(configuration: ReadableMap, promise: Promise) {
|
|
26
|
+
impl.start(configuration, promise)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
override fun enterAction(name: String, key: String, platform: String?) {
|
|
30
|
+
impl.enterAction(name, key, platform)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
override fun enterManualAction(name: String, key: String, platform: String?) {
|
|
34
|
+
impl.enterManualAction(name, key, platform)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
override fun enterManualActionWithParent(
|
|
38
|
+
name: String,
|
|
39
|
+
key: String,
|
|
40
|
+
parentKey: String,
|
|
41
|
+
platform: String?
|
|
42
|
+
) {
|
|
43
|
+
impl.enterManualActionWithParent(name, key, parentKey, platform)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
override fun leaveAction(key: String, leave: Boolean, platform: String?) {
|
|
47
|
+
impl.leaveAction(key, leave, platform)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
override fun cancelAction(key: String, platform: String?) {
|
|
51
|
+
impl.cancelAction(key, platform)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
override fun endVisit(platform: String?) {
|
|
55
|
+
impl.endVisit(platform)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
override fun reportErrorWithoutStacktrace(errorName: String, errorCode: Double, platform: String?) {
|
|
59
|
+
impl.reportErrorWithoutStacktrace(errorName, errorCode.toInt(), platform)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
override fun reportError(
|
|
63
|
+
errorName: String,
|
|
64
|
+
errorValue: String,
|
|
65
|
+
reason: String,
|
|
66
|
+
stacktrace: String,
|
|
67
|
+
platform: String?
|
|
68
|
+
) {
|
|
69
|
+
impl.reportError(errorName, errorValue, reason, stacktrace, platform)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
override fun reportCrash(
|
|
73
|
+
errorName: String,
|
|
74
|
+
reason: String,
|
|
75
|
+
stacktrace: String,
|
|
76
|
+
isRealError: Boolean,
|
|
77
|
+
platform: String?
|
|
78
|
+
) {
|
|
79
|
+
impl.reportCrash(errorName, reason, stacktrace, isRealError, platform)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
override fun storeCrash(errorName: String, reason: String, stacktrace: String) {
|
|
83
|
+
// Empty on Purpose
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
override fun reportErrorInAction(
|
|
87
|
+
key: String,
|
|
88
|
+
errorName: String,
|
|
89
|
+
errorCode: Double,
|
|
90
|
+
platform: String?
|
|
91
|
+
) {
|
|
92
|
+
impl.reportErrorInAction(key, errorName, errorCode.toInt(), platform)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
override fun reportValue(key: String, valueName: String, value: String, platform: String?) {
|
|
96
|
+
impl.reportValue(key, valueName, value, platform)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
override fun getRequestTag(key: String, url: String, promise: Promise) {
|
|
100
|
+
impl.getRequestTag(key, url, promise)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
override fun startWebRequestTiming(requestTag: String?, url: String) {
|
|
104
|
+
impl.startWebRequestTiming(requestTag, url)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
override fun stopWebRequestTiming(
|
|
108
|
+
requestTag: String?,
|
|
109
|
+
url: String,
|
|
110
|
+
responseCode: Double,
|
|
111
|
+
responseMessage: String
|
|
112
|
+
) {
|
|
113
|
+
impl.stopWebRequestTiming(requestTag, url, responseCode.toInt(), responseMessage)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
override fun stopWebRequestTimingWithSize(
|
|
117
|
+
requestTag: String?,
|
|
118
|
+
url: String,
|
|
119
|
+
responseCode: Double,
|
|
120
|
+
responseMessage: String,
|
|
121
|
+
requestSize: Double,
|
|
122
|
+
responseSize: Double
|
|
123
|
+
) {
|
|
124
|
+
impl.stopWebRequestTimingWithSize(
|
|
125
|
+
requestTag,
|
|
126
|
+
url,
|
|
127
|
+
responseCode.toInt(),
|
|
128
|
+
responseMessage,
|
|
129
|
+
requestSize.toLong(),
|
|
130
|
+
responseSize.toLong()
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
override fun identifyUser(user: String, platform: String?) {
|
|
135
|
+
impl.identifyUser(user, platform)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
override fun reportEventInAction(actionKey: String, name: String, platform: String?) {
|
|
139
|
+
impl.reportEventInAction(actionKey, name, platform)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
override fun reportStringValueInAction(
|
|
143
|
+
actionKey: String,
|
|
144
|
+
name: String,
|
|
145
|
+
value: String,
|
|
146
|
+
platform: String?
|
|
147
|
+
) {
|
|
148
|
+
impl.reportStringValueInAction(actionKey, name, value, platform)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
override fun reportIntValueInAction(
|
|
152
|
+
actionKey: String,
|
|
153
|
+
name: String,
|
|
154
|
+
value: Double,
|
|
155
|
+
platform: String?
|
|
156
|
+
) {
|
|
157
|
+
impl.reportIntValueInAction(actionKey, name, value.toInt(), platform)
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
override fun reportDoubleValueInAction(
|
|
161
|
+
actionKey: String,
|
|
162
|
+
name: String,
|
|
163
|
+
value: Double,
|
|
164
|
+
platform: String?
|
|
165
|
+
) {
|
|
166
|
+
impl.reportDoubleValueInAction(actionKey, name, value, platform)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
override fun sendBizEvent(type: String, attributes: ReadableMap, platform: String?) {
|
|
170
|
+
impl.sendBizEvent(type, attributes, platform)
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
override fun forwardEvent(attributes: ReadableMap) {
|
|
174
|
+
impl.forwardEvent(attributes)
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
override fun startView(name: String) {
|
|
178
|
+
impl.startView(name)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
override fun stopView() {
|
|
182
|
+
impl.stopView()
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
override fun setGPSLocation(latitude: Double, longitude: Double, platform: String?) {
|
|
186
|
+
impl.setGPSLocation(latitude, longitude, platform)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
override fun flushEvents(platform: String?) {
|
|
190
|
+
impl.flushEvents(platform)
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
override fun isCrashReportingOptedIn(platform: String?, promise: Promise) {
|
|
194
|
+
impl.isCrashReportingOptedIn(platform, promise)
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
override fun setCrashReportingOptedIn(crashReporting: Boolean, platform: String?) {
|
|
198
|
+
impl.setCrashReportingOptedIn(crashReporting, platform)
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
override fun setDataCollectionLevel(collectionLevel: String, platform: String?) {
|
|
202
|
+
impl.setDataCollectionLevel(collectionLevel, platform)
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
override fun getDataCollectionLevel(platform: String?, promise: Promise) {
|
|
206
|
+
impl.getDataCollectionLevel(platform, promise)
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
override fun setBeaconHeaders(headers: ReadableMap?, platform: String?) {
|
|
210
|
+
impl.setBeaconHeaders(headers, platform)
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
override fun applyUserPrivacyOptions(userPrivacyOptions: ReadableMap, platform: String?) {
|
|
214
|
+
impl.applyUserPrivacyOptions(userPrivacyOptions, platform)
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
override fun getUserPrivacyOptions(platform: String?, promise: Promise) {
|
|
218
|
+
impl.getUserPrivacyOptions(platform, promise)
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
override fun addListener(eventName: String) {
|
|
222
|
+
impl.addListener(eventName)
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
override fun removeListeners(count: Double) {
|
|
226
|
+
impl.removeListeners(count)
|
|
227
|
+
}
|
|
228
|
+
}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
package com.dynatrace.android.agent
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.Promise
|
|
4
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
5
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
6
|
+
import com.facebook.react.bridge.ReactMethod
|
|
7
|
+
import com.facebook.react.bridge.ReadableMap
|
|
8
|
+
|
|
9
|
+
class DynatraceRNBridge(
|
|
10
|
+
reactContext: ReactApplicationContext,
|
|
11
|
+
internalModule: DynatraceInternalModule
|
|
12
|
+
) : ReactContextBaseJavaModule(reactContext) {
|
|
13
|
+
private val impl: DynatraceRNBridgeImpl
|
|
14
|
+
|
|
15
|
+
init {
|
|
16
|
+
impl = DynatraceRNBridgeImpl(reactContext, internalModule)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
override fun getName(): String {
|
|
20
|
+
return BRIDGE_NAME;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
override fun getConstants(): Map<String, Any>? {
|
|
24
|
+
return impl.getConstants()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@ReactMethod
|
|
28
|
+
fun start(configuration: ReadableMap, promise: Promise) {
|
|
29
|
+
impl.start(configuration, promise)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@ReactMethod
|
|
33
|
+
fun enterAction(name: String, key: String, platform: String?) {
|
|
34
|
+
impl.enterAction(name, key, platform)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@ReactMethod
|
|
38
|
+
fun enterManualAction(name: String, key: String, platform: String?) {
|
|
39
|
+
impl.enterManualAction(name, key, platform)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@ReactMethod
|
|
43
|
+
fun enterManualActionWithParent(
|
|
44
|
+
name: String,
|
|
45
|
+
key: String,
|
|
46
|
+
parentKey: String,
|
|
47
|
+
platform: String?
|
|
48
|
+
) {
|
|
49
|
+
impl.enterManualActionWithParent(name, key, parentKey, platform)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@ReactMethod
|
|
53
|
+
fun leaveAction(key: String, leave: Boolean, platform: String?) {
|
|
54
|
+
impl.leaveAction(key, leave, platform)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@ReactMethod
|
|
58
|
+
fun cancelAction(key: String, platform: String?) {
|
|
59
|
+
impl.cancelAction(key, platform)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@ReactMethod
|
|
63
|
+
fun endVisit(platform: String?) {
|
|
64
|
+
impl.endVisit(platform)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@ReactMethod
|
|
68
|
+
fun reportErrorWithoutStacktrace(errorName: String, errorCode: Int, platform: String?) {
|
|
69
|
+
impl.reportErrorWithoutStacktrace(errorName, errorCode, platform)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@ReactMethod
|
|
73
|
+
fun reportError(
|
|
74
|
+
errorName: String,
|
|
75
|
+
errorValue: String,
|
|
76
|
+
reason: String,
|
|
77
|
+
stacktrace: String,
|
|
78
|
+
platform: String?
|
|
79
|
+
) {
|
|
80
|
+
impl.reportError(errorName, errorValue, reason, stacktrace, platform)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@ReactMethod
|
|
84
|
+
fun reportCrash(
|
|
85
|
+
errorName: String,
|
|
86
|
+
reason: String,
|
|
87
|
+
stacktrace: String,
|
|
88
|
+
isRealError: Boolean,
|
|
89
|
+
platform: String?
|
|
90
|
+
) {
|
|
91
|
+
impl.reportCrash(errorName, reason, stacktrace, isRealError, platform)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@Suppress("UNUSED_PARAMETER")
|
|
95
|
+
@ReactMethod
|
|
96
|
+
fun storeCrash(errorName: String, reason: String, stacktrace: String) {
|
|
97
|
+
// Empty on Purpose
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@ReactMethod
|
|
101
|
+
fun reportErrorInAction(key: String, errorName: String, errorCode: Int, platform: String?) {
|
|
102
|
+
impl.reportErrorInAction(key, errorName, errorCode, platform)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@ReactMethod
|
|
106
|
+
fun reportValue(key: String, valueName: String, value: String, platform: String?) {
|
|
107
|
+
impl.reportValue(key, valueName, value, platform)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@ReactMethod
|
|
111
|
+
fun getRequestTag(key: String, url: String, promise: Promise) {
|
|
112
|
+
impl.getRequestTag(key, url, promise)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@ReactMethod
|
|
116
|
+
fun startWebRequestTiming(requestTag: String?, url: String) {
|
|
117
|
+
impl.startWebRequestTiming(requestTag, url)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@ReactMethod
|
|
121
|
+
fun stopWebRequestTiming(
|
|
122
|
+
requestTag: String?,
|
|
123
|
+
url: String,
|
|
124
|
+
responseCode: Int,
|
|
125
|
+
responseMessage: String
|
|
126
|
+
) {
|
|
127
|
+
impl.stopWebRequestTiming(requestTag, url, responseCode, responseMessage)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
@ReactMethod
|
|
131
|
+
fun stopWebRequestTimingWithSize(
|
|
132
|
+
requestTag: String?,
|
|
133
|
+
url: String,
|
|
134
|
+
responseCode: Int,
|
|
135
|
+
responseMessage: String,
|
|
136
|
+
requestSize: Double,
|
|
137
|
+
responseSize: Double
|
|
138
|
+
) {
|
|
139
|
+
impl.stopWebRequestTimingWithSize(
|
|
140
|
+
requestTag,
|
|
141
|
+
url,
|
|
142
|
+
responseCode,
|
|
143
|
+
responseMessage,
|
|
144
|
+
requestSize.toLong(),
|
|
145
|
+
responseSize.toLong()
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
@ReactMethod
|
|
150
|
+
fun identifyUser(user: String, platform: String?) {
|
|
151
|
+
impl.identifyUser(user, platform)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@ReactMethod
|
|
155
|
+
fun reportEventInAction(actionKey: String, name: String, platform: String?) {
|
|
156
|
+
impl.reportEventInAction(actionKey, name, platform)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
@ReactMethod
|
|
160
|
+
fun reportStringValueInAction(
|
|
161
|
+
actionKey: String,
|
|
162
|
+
name: String,
|
|
163
|
+
value: String,
|
|
164
|
+
platform: String?
|
|
165
|
+
) {
|
|
166
|
+
impl.reportStringValueInAction(actionKey, name, value, platform)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
@ReactMethod
|
|
170
|
+
fun reportIntValueInAction(actionKey: String, name: String, value: Int, platform: String?) {
|
|
171
|
+
impl.reportIntValueInAction(actionKey, name, value, platform)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@ReactMethod
|
|
175
|
+
fun reportDoubleValueInAction(
|
|
176
|
+
actionKey: String,
|
|
177
|
+
name: String,
|
|
178
|
+
value: Double,
|
|
179
|
+
platform: String?
|
|
180
|
+
) {
|
|
181
|
+
impl.reportDoubleValueInAction(actionKey, name, value, platform)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@ReactMethod
|
|
185
|
+
fun sendBizEvent(type: String, attributes: ReadableMap, platform: String?) {
|
|
186
|
+
impl.sendBizEvent(type, attributes, platform)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
@ReactMethod
|
|
190
|
+
fun forwardEvent(attributes: ReadableMap) {
|
|
191
|
+
impl.forwardEvent(attributes)
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@ReactMethod
|
|
195
|
+
fun startView(name: String) {
|
|
196
|
+
impl.startView(name)
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@ReactMethod
|
|
200
|
+
fun stopView() {
|
|
201
|
+
impl.stopView()
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
@ReactMethod
|
|
205
|
+
fun setGPSLocation(latitude: Double, longitude: Double, platform: String?) {
|
|
206
|
+
impl.setGPSLocation(latitude, longitude, platform)
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@ReactMethod
|
|
210
|
+
fun flushEvents(platform: String?) {
|
|
211
|
+
impl.flushEvents(platform)
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
@ReactMethod
|
|
215
|
+
fun isCrashReportingOptedIn(platform: String?, promise: Promise) {
|
|
216
|
+
impl.isCrashReportingOptedIn(platform, promise)
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@ReactMethod
|
|
220
|
+
fun setCrashReportingOptedIn(crashReporting: Boolean, platform: String?) {
|
|
221
|
+
impl.setCrashReportingOptedIn(crashReporting, platform)
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
@ReactMethod
|
|
225
|
+
fun setDataCollectionLevel(collectionLevel: String, platform: String?) {
|
|
226
|
+
impl.setDataCollectionLevel(collectionLevel, platform)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
@ReactMethod
|
|
230
|
+
fun getDataCollectionLevel(platform: String?, promise: Promise) {
|
|
231
|
+
impl.getDataCollectionLevel(platform, promise)
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
@ReactMethod
|
|
235
|
+
fun setBeaconHeaders(headers: ReadableMap?, platform: String?) {
|
|
236
|
+
impl.setBeaconHeaders(headers, platform)
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
@ReactMethod
|
|
240
|
+
fun applyUserPrivacyOptions(userPrivacyOptions: ReadableMap, platform: String?) {
|
|
241
|
+
impl.applyUserPrivacyOptions(userPrivacyOptions, platform)
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
@ReactMethod
|
|
245
|
+
fun getUserPrivacyOptions(platform: String?, promise: Promise) {
|
|
246
|
+
impl.getUserPrivacyOptions(platform, promise)
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
@ReactMethod
|
|
250
|
+
fun addListener(eventName: String) {
|
|
251
|
+
impl.addListener(eventName)
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
@ReactMethod
|
|
255
|
+
fun removeListeners(count: Double) {
|
|
256
|
+
impl.removeListeners(count)
|
|
257
|
+
}
|
|
258
|
+
}
|
package/files/plugin.gradle
CHANGED
package/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { Dynatrace } from './lib/
|
|
2
|
-
export { DataCollectionLevel } from './lib/
|
|
3
|
-
export { ManualStartupConfiguration } from './lib/
|
|
4
|
-
export { ConfigurationBuilder } from './lib/
|
|
5
|
-
export { Platform } from './lib/
|
|
6
|
-
export { LogLevel } from './lib/
|
|
7
|
-
export { ApplicationHandler } from './lib/
|
|
8
|
-
export { UserPrivacyOptions } from './lib/
|
|
9
|
-
export { DynatraceWebRequestTiming } from './lib/
|
|
10
|
-
export { createElement } from './
|
|
1
|
+
export { Dynatrace } from './lib/core/Dynatrace';
|
|
2
|
+
export { DataCollectionLevel } from './lib/core/model/DataCollectionLevel';
|
|
3
|
+
export { ManualStartupConfiguration } from './lib/core/configuration/ManualStartupConfiguration';
|
|
4
|
+
export { ConfigurationBuilder } from './lib/core/configuration/ConfigurationBuilder';
|
|
5
|
+
export { Platform } from './lib/core/model/Platform';
|
|
6
|
+
export { LogLevel } from './lib/core/logging/LogLevel';
|
|
7
|
+
export { ApplicationHandler } from './lib/core/Application';
|
|
8
|
+
export { UserPrivacyOptions } from './lib/core/UserPrivacyOptions';
|
|
9
|
+
export { DynatraceWebRequestTiming } from './lib/core/DynatraceWebRequestTiming';
|
|
10
|
+
export { createElement } from './instrumentation/jsx/CreateElement';
|