@mhubcloud/tms_core 3.3.0-beta.1 → 3.3.0-beta.2
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/dist/index.js +5 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -57,7 +57,7 @@ var crypto = __toESM(require("crypto"));
|
|
|
57
57
|
var appInsights = __toESM(require("applicationinsights"));
|
|
58
58
|
var aiClient = null;
|
|
59
59
|
if (process.env.APPLICATIONINSIGHTS_CONNECTION_STRING || process.env.APPINSIGHTS_INSTRUMENTATIONKEY) {
|
|
60
|
-
const samplingLevel = process.env.
|
|
60
|
+
const samplingLevel = process.env.SamplingLevel ?? "12.5";
|
|
61
61
|
appInsights.setup().setAutoCollectDependencies(false).setAutoCollectConsole(true, false).setSendLiveMetrics(false).setAutoCollectRequests(false).setAutoCollectPerformance(false).setUseDiskRetryCaching(false);
|
|
62
62
|
appInsights.defaultClient.config.samplingPercentage = parseFloat(samplingLevel);
|
|
63
63
|
appInsights.start();
|
|
@@ -92,12 +92,12 @@ function logMessage(level, message, properties) {
|
|
|
92
92
|
properties
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
-
function logEvent(publisher2, event, region
|
|
95
|
+
function logEvent(publisher2, event, region) {
|
|
96
96
|
const properties = {
|
|
97
97
|
publisher: publisher2,
|
|
98
98
|
event,
|
|
99
99
|
region,
|
|
100
|
-
sampling
|
|
100
|
+
sampling: process.env.SamplingLevel
|
|
101
101
|
};
|
|
102
102
|
logMessage(1, "Event dispatched to platform", properties);
|
|
103
103
|
}
|
|
@@ -229,10 +229,10 @@ async function handlePlatformRequest({
|
|
|
229
229
|
rawPlatformResponse,
|
|
230
230
|
event.event
|
|
231
231
|
);
|
|
232
|
-
logEvent(source, event.event, event.region
|
|
232
|
+
logEvent(source, event.event, event.region);
|
|
233
233
|
return processedPlatformResponse;
|
|
234
234
|
} else {
|
|
235
|
-
logEvent(source, event.event, event.region
|
|
235
|
+
logEvent(source, event.event, event.region);
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
async function handleTestRequest(params) {
|