@dynatrace/react-native-plugin 2.311.1 → 2.313.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 +8 -5
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceUtils.kt +6 -8
- package/files/plugin.gradle +1 -1
- package/lib/core/Dynatrace.js +3 -0
- package/lib/core/configuration/ConfigurationDefaults.js +2 -1
- package/lib/core/configuration/ConfigurationHandler.js +2 -1
- package/lib/core/logging/ConsoleLogger.js +2 -1
- package/lib/core/logging/LogLevel.js +7 -2
- package/lib/dynatrace-transformer.js +12 -6
- package/lib/next/Dynatrace.js +9 -0
- package/lib/next/appstart/AppStartType.js +6 -6
- package/lib/next/events/modifier/BaseDataEventModifier.js +2 -2
- package/package.json +11 -4
- package/react-native-dynatrace.podspec +1 -1
- package/scripts/Android.js +1 -1
- package/scripts/Config.js +1 -1
- package/scripts/Ios.js +3 -1
package/README.md
CHANGED
|
@@ -32,8 +32,8 @@ If you want to start using this plugin and are not a Dynatrace customer yet, hea
|
|
|
32
32
|
## Agent Versions
|
|
33
33
|
This agent versions are configured in this plugin:
|
|
34
34
|
|
|
35
|
-
* Android Agent: 8.
|
|
36
|
-
* iOS Agent: 8.
|
|
35
|
+
* Android Agent: 8.313.1.1004
|
|
36
|
+
* iOS Agent: 8.313.1.1016
|
|
37
37
|
|
|
38
38
|
## Quick Setup
|
|
39
39
|
|
|
@@ -177,8 +177,6 @@ Define a mobile app in Dynatrace and open the Mobile app instrumentation setting
|
|
|
177
177
|
|
|
178
178
|
> **Note**: Define the components that you want to see lifecycle instrumented ([example](#lifecycle)). This is important as you will only see Application startup and Touches out of the box.
|
|
179
179
|
|
|
180
|
-
> **Note for Expo**: If you are using expo make sure to use the upstreamTransformer property in the `dynatrace.config.js` file: `upstreamTransformer: require.resolve('@expo/metro-config/babel-transformer')`
|
|
181
|
-
|
|
182
180
|
For more details about the configuration, see [Advanced topics](#structure-of-the-dynatracejs-file).
|
|
183
181
|
|
|
184
182
|
## 4. Update Babel Configuration
|
|
@@ -1463,7 +1461,12 @@ If you are struggling with a problem, submit a support ticket to Dynatrace (supp
|
|
|
1463
1461
|
<br/><br/>
|
|
1464
1462
|
## Changelog
|
|
1465
1463
|
|
|
1466
|
-
2.
|
|
1464
|
+
2.313.1
|
|
1465
|
+
* Updated Android (8.313.1.1004) & iOS Agent (8.313.1.1016)
|
|
1466
|
+
* Expo transformer is now automatically used, if available.
|
|
1467
|
+
* LogLevel was broken for manual startup
|
|
1468
|
+
|
|
1469
|
+
2.311.2
|
|
1467
1470
|
* Updated Android (8.311.1.1007) & iOS Agent (8.311.1.1013)
|
|
1468
1471
|
* Configuration copied to android folder which supports cloud builds
|
|
1469
1472
|
* Removed dynamic import for jsx runtime as it was causing issue
|
package/android/build.gradle
CHANGED
|
@@ -72,7 +72,7 @@ repositories {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
dependencies {
|
|
75
|
-
implementation 'com.dynatrace.agent:agent-android:8.
|
|
75
|
+
implementation 'com.dynatrace.agent:agent-android:8.313.1.1004'
|
|
76
76
|
implementation "com.facebook.react:react-native:${safeExtGet('reactNative', '+')}"
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -25,16 +25,15 @@ internal object DynatraceUtils {
|
|
|
25
25
|
) {
|
|
26
26
|
// This is a int
|
|
27
27
|
arrayList.add(array.getDouble(i).toInt())
|
|
28
|
-
}
|
|
29
|
-
if (value >= Long.MIN_VALUE && value <= Long.MAX_VALUE && value == value.toLong()
|
|
28
|
+
} else if (value >= Long.MIN_VALUE && value <= Long.MAX_VALUE && value == value.toLong()
|
|
30
29
|
.toDouble()
|
|
31
30
|
) {
|
|
32
31
|
// This is a long
|
|
33
32
|
arrayList.add(array.getDouble(i).toLong())
|
|
34
33
|
}
|
|
35
|
-
|
|
34
|
+
} else {
|
|
35
|
+
arrayList.add(array.getDouble(i))
|
|
36
36
|
}
|
|
37
|
-
arrayList.add(array.getDouble(i))
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
ReadableType.String -> arrayList.add(array.getString(i))
|
|
@@ -63,16 +62,15 @@ internal object DynatraceUtils {
|
|
|
63
62
|
) {
|
|
64
63
|
// This is a int
|
|
65
64
|
hashMap[key] = map.getDouble(key).toInt()
|
|
66
|
-
}
|
|
67
|
-
if (value >= Long.MIN_VALUE && value <= Long.MAX_VALUE && value == value.toLong()
|
|
65
|
+
} else if (value >= Long.MIN_VALUE && value <= Long.MAX_VALUE && value == value.toLong()
|
|
68
66
|
.toDouble()
|
|
69
67
|
) {
|
|
70
68
|
// This is a long
|
|
71
69
|
hashMap[key] = map.getDouble(key).toLong()
|
|
72
70
|
}
|
|
73
|
-
|
|
71
|
+
} else {
|
|
72
|
+
hashMap[key] = map.getDouble(key)
|
|
74
73
|
}
|
|
75
|
-
hashMap[key] = map.getDouble(key)
|
|
76
74
|
}
|
|
77
75
|
|
|
78
76
|
ReadableType.String -> hashMap[key] = map.getString(key)
|
package/files/plugin.gradle
CHANGED
package/lib/core/Dynatrace.js
CHANGED
|
@@ -350,4 +350,7 @@ exports.Dynatrace = {
|
|
|
350
350
|
sendSessionPropertyEvent: (properties) => {
|
|
351
351
|
Dynatrace_1.Dynatrace.sendSessionPropertyEvent(properties);
|
|
352
352
|
},
|
|
353
|
+
sendExceptionEvent: (error, fields) => {
|
|
354
|
+
Dynatrace_1.Dynatrace.sendExceptionEvent(error, fields);
|
|
355
|
+
},
|
|
353
356
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DEFAULT_ACTION_NAME_PRIVACY = exports.DEFAULT_USER_OPT_IN = exports.DEFAULT_LOGLEVEL = exports.DEFAULT_FATAL_AS_CRASH = exports.DEFAULT_ERROR_HANDLER = exports.DEFAULT_REPORT_CRASH = exports.DEFAULT_LIFECYCLE_UPDATE = void 0;
|
|
4
|
+
const LogLevel_1 = require("../logging/LogLevel");
|
|
4
5
|
exports.DEFAULT_LIFECYCLE_UPDATE = false;
|
|
5
6
|
exports.DEFAULT_REPORT_CRASH = true;
|
|
6
7
|
exports.DEFAULT_ERROR_HANDLER = true;
|
|
7
8
|
exports.DEFAULT_FATAL_AS_CRASH = true;
|
|
8
|
-
exports.DEFAULT_LOGLEVEL =
|
|
9
|
+
exports.DEFAULT_LOGLEVEL = LogLevel_1.LogLevel.Info;
|
|
9
10
|
exports.DEFAULT_USER_OPT_IN = false;
|
|
10
11
|
exports.DEFAULT_ACTION_NAME_PRIVACY = false;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ConfigurationHandler = void 0;
|
|
4
|
+
const LogLevel_1 = require("../logging/LogLevel");
|
|
4
5
|
let _configuration;
|
|
5
6
|
exports.ConfigurationHandler = {
|
|
6
7
|
setConfiguration(configuration) {
|
|
@@ -10,7 +11,7 @@ exports.ConfigurationHandler = {
|
|
|
10
11
|
isErrorHandlerEnabled: () => _configuration.errorHandler,
|
|
11
12
|
isReportFatalErrorAsCrash: () => _configuration.reportFatalErrorAsCrash,
|
|
12
13
|
isDebugEnabled: () => exports.ConfigurationHandler.isConfigurationAvailable() &&
|
|
13
|
-
_configuration.logLevel ===
|
|
14
|
+
_configuration.logLevel === LogLevel_1.LogLevel.Debug,
|
|
14
15
|
isLifecycleUpdateEnabled: () => _configuration.lifecycleUpdate,
|
|
15
16
|
isActionNamePrivacyEnabled: () => _configuration.actionNamePrivacy,
|
|
16
17
|
getBundleName: () => _configuration.bundleName,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ConsoleLogger = void 0;
|
|
4
4
|
const ConfigurationHandler_1 = require("../configuration/ConfigurationHandler");
|
|
5
|
+
const LogLevel_1 = require("./LogLevel");
|
|
5
6
|
class ConsoleLogger {
|
|
6
7
|
constructor(name, logLevel) {
|
|
7
8
|
this.name = name;
|
|
@@ -19,7 +20,7 @@ class ConsoleLogger {
|
|
|
19
20
|
console.log(`[${this.name}]: ${msg}`);
|
|
20
21
|
}
|
|
21
22
|
isDebugEnabled() {
|
|
22
|
-
return (this.level ===
|
|
23
|
+
return (this.level === LogLevel_1.LogLevel.Debug ||
|
|
23
24
|
(ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable() &&
|
|
24
25
|
ConfigurationHandler_1.ConfigurationHandler.isDebugEnabled()));
|
|
25
26
|
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LogLevelToString = void 0;
|
|
3
|
+
exports.LogLevelToString = exports.LogLevel = void 0;
|
|
4
|
+
var LogLevel;
|
|
5
|
+
(function (LogLevel) {
|
|
6
|
+
LogLevel[LogLevel["Debug"] = 0] = "Debug";
|
|
7
|
+
LogLevel[LogLevel["Info"] = 1] = "Info";
|
|
8
|
+
})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
|
|
4
9
|
const LogLevelToString = (level) => {
|
|
5
|
-
if (level ===
|
|
10
|
+
if (level === LogLevel.Debug) {
|
|
6
11
|
return 'Debug';
|
|
7
12
|
}
|
|
8
13
|
else {
|
|
@@ -40,18 +40,24 @@ const transform = (src, filename, options) => {
|
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
42
|
exports.transform = transform;
|
|
43
|
+
const safeRequire = (modulePath) => {
|
|
44
|
+
try {
|
|
45
|
+
return require(modulePath);
|
|
46
|
+
}
|
|
47
|
+
catch (_a) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
43
51
|
const getUpstreamTransformer = (reactOptions) => {
|
|
44
52
|
if (reactOptions !== undefined &&
|
|
45
53
|
reactOptions.upstreamTransformer !== undefined) {
|
|
46
54
|
return require(reactOptions.upstreamTransformer);
|
|
47
55
|
}
|
|
48
56
|
else {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return require('@react-native/metro-babel-transformer');
|
|
54
|
-
}
|
|
57
|
+
const transformer = safeRequire('@expo/metro-config/babel-transformer') ||
|
|
58
|
+
safeRequire('metro-react-native-babel-transformer/src/index') ||
|
|
59
|
+
safeRequire('@react-native/metro-babel-transformer');
|
|
60
|
+
return transformer;
|
|
55
61
|
}
|
|
56
62
|
};
|
|
57
63
|
exports.getUpstreamTransformer = getUpstreamTransformer;
|
package/lib/next/Dynatrace.js
CHANGED
|
@@ -67,6 +67,15 @@ class DynatraceImpl {
|
|
|
67
67
|
}
|
|
68
68
|
EventPipeline_1.EventPipeline.insertEvent(event);
|
|
69
69
|
}
|
|
70
|
+
sendExceptionEvent(error, fields) {
|
|
71
|
+
const fieldsCheck = !fields ? null : fields;
|
|
72
|
+
this.logger.debug(`sendExceptionEvent(${JSON.stringify(error)}, ${JSON.stringify(fieldsCheck)})`);
|
|
73
|
+
const event = Object.assign({}, (0, EventCreator_1.createErrorEvent)(error.name, error.message, error.stack));
|
|
74
|
+
let eventValidated = SendEventValidation_1.SendEventValidation.modifyEvent(fieldsCheck);
|
|
75
|
+
eventValidated = Object.assign(Object.assign({}, event), eventValidated);
|
|
76
|
+
eventValidated["characteristics.is_api_reported"] = true;
|
|
77
|
+
EventPipeline_1.EventPipeline.insertEvent(eventValidated);
|
|
78
|
+
}
|
|
70
79
|
sendEvent(properties, context) {
|
|
71
80
|
this.logger.debug(`sendEvent(${JSON.stringify(properties, context)})`);
|
|
72
81
|
const eventValidated = SendEventValidation_1.SendEventValidation.modifyEvent(properties);
|
|
@@ -13,26 +13,26 @@ var AppStartType;
|
|
|
13
13
|
exports.AppStartTypeKeyMapping = [
|
|
14
14
|
{
|
|
15
15
|
type: AppStartType.RELOAD,
|
|
16
|
-
key: "app_start.react_native.
|
|
16
|
+
key: "app_start.react_native.run_js_bundle.load_time",
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
type: AppStartType.DOWNLOAD_START,
|
|
20
|
-
key: "app_start.react_native.
|
|
20
|
+
key: "app_start.react_native.download.start_time",
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
type: AppStartType.RUN_JS_BUNDLE_START,
|
|
24
|
-
key: "app_start.react_native.
|
|
24
|
+
key: "app_start.react_native.run_js_bundle.start_time",
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
type: AppStartType.DOWNLOAD_END,
|
|
28
|
-
key: "app_start.react_native.
|
|
28
|
+
key: "app_start.react_native.download.end_time",
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
type: AppStartType.RUN_JS_BUNDLE_END,
|
|
32
|
-
key: "app_start.react_native.
|
|
32
|
+
key: "app_start.react_native.run_js_bundle.end_time",
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
type: AppStartType.CONTENT_APPEARED,
|
|
36
|
-
key: "app_start.react_native.
|
|
36
|
+
key: "app_start.react_native.content_appeared",
|
|
37
37
|
},
|
|
38
38
|
];
|
|
@@ -17,12 +17,12 @@ class BaseDataEventModifier {
|
|
|
17
17
|
event["dt.rum.event.source.type"] = 'react_native';
|
|
18
18
|
const bundleName = ConfigurationHandler_1.ConfigurationHandler.getBundleName();
|
|
19
19
|
if (bundleName !== undefined) {
|
|
20
|
-
event["
|
|
20
|
+
event["react_native.bundle.name"] =
|
|
21
21
|
bundleName;
|
|
22
22
|
}
|
|
23
23
|
const bundleVersion = ConfigurationHandler_1.ConfigurationHandler.getBundleVersion();
|
|
24
24
|
if (bundleVersion !== undefined) {
|
|
25
|
-
event["
|
|
25
|
+
event["react_native.bundle.version"] =
|
|
26
26
|
bundleVersion;
|
|
27
27
|
}
|
|
28
28
|
return event;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynatrace/react-native-plugin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.313.1",
|
|
4
4
|
"description": "This plugin gives you the ability to use the Dynatrace Mobile agent in your react native application.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "typings/react-native-dynatrace.d.ts",
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
"uninstall": "node ./scripts/Uninstall.js",
|
|
25
25
|
"test": "jest --runInBand",
|
|
26
26
|
"test:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand",
|
|
27
|
+
"test:local": "npm run lint && node runner.js test",
|
|
28
|
+
"tsc:local": "tsc -p tsconfig.local.json",
|
|
27
29
|
"tsc": "tsc",
|
|
28
30
|
"tsc:prod": "tsc -p tsconfig.release.json",
|
|
29
31
|
"lint": "eslint --cache src/**/*.ts --ignore-pattern .gitignore",
|
|
@@ -35,6 +37,11 @@
|
|
|
35
37
|
"jest": {
|
|
36
38
|
"displayName": "@dynatrace/react-native-plugin",
|
|
37
39
|
"preset": "react-native",
|
|
40
|
+
"moduleNameMapper": {
|
|
41
|
+
"@expo/metro-config/babel-transformer": "<rootDir>/__mocks__/@expo/metro-config/babel-transformer.js",
|
|
42
|
+
"metro-react-native-babel-transformer/src/index": "<rootDir>/__mocks__/metro-react-native-babel-transformer.js",
|
|
43
|
+
"@react-native/metro-babel-transformer": "<rootDir>/__mocks__/@react-native/metro-babel-transformer.js"
|
|
44
|
+
},
|
|
38
45
|
"moduleDirectories": [
|
|
39
46
|
"node_modules"
|
|
40
47
|
],
|
|
@@ -66,7 +73,7 @@
|
|
|
66
73
|
},
|
|
67
74
|
"jest-junit": {
|
|
68
75
|
"suiteName": "jest tests",
|
|
69
|
-
"outputDirectory": "
|
|
76
|
+
"outputDirectory": "test_report",
|
|
70
77
|
"outputName": "junit.xml",
|
|
71
78
|
"uniqueOutputName": "true",
|
|
72
79
|
"ancestorSeparator": " › ",
|
|
@@ -75,11 +82,11 @@
|
|
|
75
82
|
"author": "Dynatrace",
|
|
76
83
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
77
84
|
"dependencies": {
|
|
78
|
-
"@babel/runtime": "^7.27.
|
|
85
|
+
"@babel/runtime": "^7.27.1",
|
|
79
86
|
"jscodeshift": "^17.3.0",
|
|
80
87
|
"plist": "^3.1.0",
|
|
81
88
|
"proxy-polyfill": "^0.3.2",
|
|
82
|
-
"semver": "^7.7.
|
|
89
|
+
"semver": "^7.7.2"
|
|
83
90
|
},
|
|
84
91
|
"homepage": "https://www.dynatrace.com/",
|
|
85
92
|
"peerDependencies": {
|
|
@@ -111,7 +111,7 @@ Pod::Spec.new do |s|
|
|
|
111
111
|
#
|
|
112
112
|
|
|
113
113
|
s.dependency "React"
|
|
114
|
-
s.dependency 'Dynatrace', '~> 8.
|
|
114
|
+
s.dependency 'Dynatrace', '~> 8.313.1.1016'
|
|
115
115
|
|
|
116
116
|
# Allows for better compatibility for older and newer versions
|
|
117
117
|
if defined?(install_modules_dependencies)
|
package/scripts/Android.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.copyGradleConfigFile = exports.writeGradleConfig = exports.instrumentAndroidPlatform = exports.GRADLE_APPLY_BUILDSCRIPT = exports.GRADLE_DYNATRACE_FILE = void 0;
|
|
5
|
+
const path_1 = require("path");
|
|
5
6
|
const Logger_1 = require("./Logger");
|
|
6
7
|
const FileOperationHelper_1 = require("./FileOperationHelper");
|
|
7
8
|
const PathsConstants_1 = require("./PathsConstants");
|
|
8
|
-
const path_1 = require("path");
|
|
9
9
|
const GRADLE_CONFIG_IDENTIFIER = '// AUTO - INSERTED';
|
|
10
10
|
exports.GRADLE_DYNATRACE_FILE = `apply from: "./${PathsConstants_1.DYNATRACE_CONFIG_GRADLE_FILE}"`;
|
|
11
11
|
const GRADLE_BUILDSCRIPT_IDENTIFIER = 'buildscript';
|
package/scripts/Config.js
CHANGED
package/scripts/Ios.js
CHANGED
|
@@ -130,7 +130,9 @@ const updatedExcludedStr = (config) => {
|
|
|
130
130
|
const controlsArr = Object.keys(PlistConstants_1.CONTROLS_PROP_OPTIONS);
|
|
131
131
|
let updatedStr = `${PlistConstants_1.START_CONTROLS_PROP}${PlistConstants_1.CONTROLS_PROP_OPTIONS.PickerView}${PlistConstants_1.CONTROLS_PROP_OPTIONS.Switch}`;
|
|
132
132
|
for (let index = 0; index < controlsArr.length; index++) {
|
|
133
|
-
if (controlsArr[index] !== 'PickerView'
|
|
133
|
+
if (controlsArr[index] !== 'PickerView'
|
|
134
|
+
&& controlsArr[index] !== 'Switch'
|
|
135
|
+
&& config.indexOf(PlistConstants_1.CONTROLS_PROP_OPTIONS[controlsArr[index]].trim()) >= 0) {
|
|
134
136
|
updatedStr = updatedStr + PlistConstants_1.CONTROLS_PROP_OPTIONS[controlsArr[index]];
|
|
135
137
|
}
|
|
136
138
|
}
|