Skip to content

Commit

Permalink
continue debug
Browse files Browse the repository at this point in the history
  • Loading branch information
khmyznikov committed Nov 2, 2023
1 parent 5ad2cf0 commit 98d593a
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 83 deletions.
2 changes: 1 addition & 1 deletion build/analytics.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 9 additions & 11 deletions build/analytics.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
setup,
defaultClient,
DistributedTracingModes,
import appInsights, {
DistributedTracingModes
} from 'applicationinsights';

enum AppInsightsStatus {
Expand All @@ -13,7 +11,7 @@ enum AppInsightsStatus {
var appInsightsStatus: AppInsightsStatus = AppInsightsStatus.DEFAULT;
export function setupAnalytics() {
try {
setup()
appInsights.setup()
.setDistributedTracingMode(DistributedTracingModes.AI_AND_W3C)
.setAutoDependencyCorrelation(true)
.setAutoCollectRequests(false)
Expand Down Expand Up @@ -41,11 +39,11 @@ export function trackEvent(
setupAnalytics();
}
if (
defaultClient == null ||
defaultClient == undefined ||
appInsights.defaultClient == null ||
appInsights.defaultClient == undefined ||
appInsightsStatus == AppInsightsStatus.DISABLED
) {
console.error("App insights couldn't be enabled");
console.error("App insights no defaultClient");
return;
}

Expand All @@ -62,17 +60,17 @@ export function trackEvent(
analyticsInfo.correlationId != undefined &&
typeof analyticsInfo.correlationId == 'string'
) {
defaultClient.context.tags[defaultClient.context.keys.operationId] =
appInsights.defaultClient.context.tags[appInsights.defaultClient.context.keys.operationId] =
analyticsInfo.correlationId;
}
if (success) {
defaultClient.trackEvent({
appInsights.defaultClient.trackEvent({
name: 'AndroidPackageEvent',
properties: properties,
});
} else {
properties.error = error;
defaultClient.trackEvent({
appInsights.defaultClient.trackEvent({
name: 'AndroidPackageFailureEvent',
properties: properties,
});
Expand Down
147 changes: 78 additions & 69 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@types/fs-extra": "^8.0.1",
"@types/q": "^1.5.2",
"@types/tmp": "^0.1.0",
"applicationinsights": "^2.5.1",
"applicationinsights": "^2.9.0",
"concurrently": "^5.1.0",
"cors": "^2.8.5",
"ts-node": "^10.9.1",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.tsbuildinfo

Large diffs are not rendered by default.

0 comments on commit 98d593a

Please sign in to comment.