Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions packages/nativescript-appdynamics/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ interface SessionFrame {
}

export enum LoggingLevel {
Off = 0,
Error = 1,
Warn = 2,
Info = 3,
Debug = 4,
Verbose = 5,
All = 6,
None = 0,
Info = 1,
Verbose = 2,
}

// you can find the relevant URLs at https://docs.appdynamics.com/paa/saas-domains-and-ip-ranges
Expand Down
10 changes: 8 additions & 2 deletions packages/nativescript-appdynamics/index.android.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
import { HttpErrorResponse } from '@angular/common/http';
import { Utils } from '@nativescript/core';
import { AppdynamicsConfiguration, IAppdynamics, LoggingLevel, IRequestTracker } from './common';
import lazy from '@nativescript/core/utils/lazy';
import { AppdynamicsConfiguration, IAppdynamics, IRequestTracker, LoggingLevel } from './common';

const Instrumentation = lazy(() => com.appdynamics.eumagent.runtime.Instrumentation);

// https://docs.appdynamics.com/appd/21.x/21.9/en/end-user-monitoring/mobile-real-user-monitoring/instrument-android-applications

export class Appdynamics implements IAppdynamics {
private logLevelMapper = {
[LoggingLevel.None]: com.appdynamics.eumagent.runtime.Instrumentation.LOGGING_LEVEL_NONE,
[LoggingLevel.Info]: com.appdynamics.eumagent.runtime.Instrumentation.LOGGING_LEVEL_INFO,
[LoggingLevel.Verbose]: com.appdynamics.eumagent.runtime.Instrumentation.LOGGING_LEVEL_VERBOSE,
};

public init(config: AppdynamicsConfiguration) {
const instrumentationConfig = com.appdynamics.eumagent.runtime.AgentConfiguration.builder()
.withAppKey(config.appKey)
.withContext(Utils.android.getApplicationContext())
.withCollectorURL(config.collectorURL)
.withScreenshotURL(config.screenshotURL)
.withLoggingLevel(config.loggingLevel || LoggingLevel.Off)
.withLoggingLevel(this.logLevelMapper[config.loggingLevel || LoggingLevel.None])
.withApplicationName(config.applicationName)
.withJSAgentAjaxEnabled(config.jsAgentAjaxEnabled)
.withJSAgentInjectionEnabled(config.jsAgentInjectionEnabled)
Expand Down
10 changes: 8 additions & 2 deletions packages/nativescript-appdynamics/index.ios.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import { HttpErrorResponse } from '@angular/common/http';
import { AppdynamicsConfiguration, IAppdynamics, LoggingLevel, IRequestTracker } from './common';
import { AppdynamicsConfiguration, IAppdynamics, IRequestTracker, LoggingLevel } from './common';

// https://docs.appdynamics.com/appd/21.x/21.9/en/end-user-monitoring/mobile-real-user-monitoring/instrument-ios-applications/customize-the-ios-instrumentation

export class Appdynamics implements IAppdynamics {
private logLevelMapper = {
[LoggingLevel.None]: ADEumLoggingLevel.Off,
[LoggingLevel.Info]: ADEumLoggingLevel.Info,
[LoggingLevel.Verbose]: ADEumLoggingLevel.Verbose,
};

public init(config: AppdynamicsConfiguration) {
const adeumConfig = ADEumAgentConfiguration.alloc().initWithAppKey(config.appKey);
adeumConfig.collectorURL = config.collectorURL;
adeumConfig.screenshotURL = config.screenshotURL;
adeumConfig.loggingLevel = (config.loggingLevel || LoggingLevel.Off) as unknown as ADEumLoggingLevel;
adeumConfig.loggingLevel = this.logLevelMapper[config.loggingLevel || LoggingLevel.None];
adeumConfig.applicationName = config.applicationName;
adeumConfig.jsAgentAjaxEnabled = config.jsAgentAjaxEnabled;
adeumConfig.jsAgentEnabled = config.jsAgentInjectionEnabled;
Expand Down
2 changes: 1 addition & 1 deletion packages/nativescript-appdynamics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@essent/nativescript-appdynamics",
"version": "22.8.0",
"version": "22.8.2",
"description": "Add a plugin description",
"main": "index",
"typings": "index.d.ts",
Expand Down
11 changes: 11 additions & 0 deletions tools/workspace-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ module.exports = {
description: '@essent/nativescript-adobe-experience-cloud: Build',
},
},
// @essent/nativescript-appdynamics
'nativescript-appdynamics': {
build: {
script: 'nx run nativescript-appdynamics:build.all',
description: '@essent/nativescript-appdynamics: Build',
},
},
// @essent/nativescript-ng-sentry
'nativescript-ng-sentry': {
build: {
Expand Down Expand Up @@ -122,6 +129,10 @@ module.exports = {
script: 'nx run nativescript-adobe-experience-cloud:focus',
description: 'Focus on @essent/nativescript-adobe-experience-cloud',
},
'nativescript-appdynamics': {
script: 'nx run nativescript-appdynamics:focus',
description: 'Focus on @essent/nativescript-appdynamics',
},
'nativescript-ng-sentry': {
script: 'nx run nativescript-ng-sentry:focus',
description: 'Focus on @essent/nativescript-ng-sentry',
Expand Down