Skip to content

Commit

Permalink
Release 1.0.1 (#30)
Browse files Browse the repository at this point in the history
* Shutdown feature nd (#26)

* Flutter GA release Version 0.0.1 (#24)

* Flutter GA release Version 0.0.1

* Flutter GA release Version 0.0.1

Signed-off-by: ndesai-newrelic <89222514+ndesai-newrelic@users.noreply.github.com>

---------

Signed-off-by: ndesai-newrelic <89222514+ndesai-newrelic@users.noreply.github.com>
Co-authored-by: Nisarg Desai <ndesai@@newrelic.com>

* Updated READ.me with Secure apache URL

* added shutdown,record metric,currentsessionId,Incremnet Attribute static Method

Signed-off-by: ndesai-newrelic <89222514+ndesai-newrelic@users.noreply.github.com>

---------

Signed-off-by: ndesai-newrelic <89222514+ndesai-newrelic@users.noreply.github.com>
Co-authored-by: Nisarg Desai <ndesai@@newrelic.com>

* Feat: Adding Fedramp Support and Updating ios native agent version 7.4.5

Signed-off-by: ndesai-newrelic <89222514+ndesai-newrelic@users.noreply.github.com>

* Feat: Adding Fedramp Support and Updating ios native agent version 7.4.5

Signed-off-by: ndesai-newrelic <89222514+ndesai-newrelic@users.noreply.github.com>

* release 1.0.1

Signed-off-by: ndesai-newrelic <89222514+ndesai-newrelic@users.noreply.github.com>

---------

Signed-off-by: ndesai-newrelic <89222514+ndesai-newrelic@users.noreply.github.com>
Co-authored-by: Nisarg Desai <ndesai@@newrelic.com>
  • Loading branch information
ndesai-newrelic and Nisarg Desai committed Jun 12, 2023
1 parent c7cd522 commit 36b1601
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 18 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.0.1

* Upgrade native iOS agent to v7.4.5
* Added FedRAMP configuration flag on agent start.

## 1.0.0

The native Android Agent has been upgraded to version 6.11.1.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,19 @@ class NewrelicMobilePlugin : FlutterPlugin, MethodCallHandler {
NewRelic.disableFeature(FeatureFlag.InteractionTracing)
}

if (call.argument<Boolean>("fedRampEnabled") as Boolean) {
NewRelic.enableFeature(FeatureFlag.FedRampEnabled)
} else {
NewRelic.disableFeature(FeatureFlag.FedRampEnabled)
}

NewRelic.withApplicationToken(
applicationToken
).withLoggingEnabled(loggingEnabled!!)
.withLogLevel(5)
.withApplicationFramework(ApplicationFramework.Flutter, "1.0.0").start(context)
.withApplicationFramework(ApplicationFramework.Flutter, "1.0.1").start(context)
NewRelic.setAttribute("DartVersion", dartVersion)
StatsEngine.get().inc("Supportability/Mobile/Android/Flutter/Agent/1.0.0");
StatsEngine.get().inc("Supportability/Mobile/Android/Flutter/Agent/1.0.1");
result.success("Agent Started")
}
"setUserId" -> {
Expand Down
6 changes: 5 additions & 1 deletion ios/Classes/SwiftNewrelicMobilePlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ public class SwiftNewrelicMobilePlugin: NSObject, FlutterPlugin {
if(args?["interactionTracingEnabled"] as! Bool == false) {
NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_InteractionTracing)
}

if(args?["fedRampEnabled"] as! Bool == true) {
NewRelic.enableFeatures(NRMAFeatureFlags.NRFeatureFlag_FedRampEnabled)
}

if(args?["loggingEnabled"] as! Bool == true) {
NRLogger.setLogLevels(NRLogLevelALL.rawValue)
Expand Down Expand Up @@ -108,7 +112,7 @@ public class SwiftNewrelicMobilePlugin: NSObject, FlutterPlugin {
let reason = args!["reason"] as? String
let fatal = args!["fatal"] as? Bool
let stackTraceElements = args!["stackTraceElements"] as? [[String : Any]] ?? [[String : Any]]()
let version = Bundle.main.infoDictionary?["CFBundleVersion"] ?? "1.0.0"
let version = Bundle.main.infoDictionary?["CFBundleVersion"] ?? "1.0.1"

let attributes: [String:Any] = [
"name": exceptionMessage ?? "Exception name not found",
Expand Down
2 changes: 1 addition & 1 deletion ios/newrelic_mobile.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Flutter plugin for NewRelic Mobile.
s.dependency 'Flutter'
s.platform = :ios, '9.0'

s.dependency 'NewRelicAgent', '7.4.4'
s.dependency 'NewRelicAgent', '7.4.5'

# Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
Expand Down
4 changes: 3 additions & 1 deletion lib/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Config {
final bool webViewInstrumentation;
final bool printStatementAsEventsEnabled;
final bool httpInstrumentationEnabled;
final bool fedRampEnabled;

Config(
{required this.accessToken,
Expand All @@ -27,5 +28,6 @@ class Config {
this.networkRequestEnabled = true,
this.webViewInstrumentation = true,
this.printStatementAsEventsEnabled = true,
this.httpInstrumentationEnabled = true});
this.httpInstrumentationEnabled = true,
this.fedRampEnabled = false});
}
5 changes: 3 additions & 2 deletions lib/newrelic_mobile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class NewrelicMobile {
await NewrelicMobile.instance.startAgent(config);
runApp();
await NewrelicMobile.instance
.setAttribute("Flutter Agent Version", "1.0.0");
.setAttribute("Flutter Agent Version", "1.0.1");
}, (Object error, StackTrace stackTrace) {
NewrelicMobile.instance.recordError(error, stackTrace);
FlutterError.presentError(
Expand Down Expand Up @@ -116,7 +116,8 @@ class NewrelicMobile {
'networkRequestEnabled': config.networkRequestEnabled,
'networkErrorRequestEnabled': config.networkErrorRequestEnabled,
'httpResponseBodyCaptureEnabled': config.httpResponseBodyCaptureEnabled,
'loggingEnabled': config.loggingEnabled
'loggingEnabled': config.loggingEnabled,
'fedRampEnabled':config.fedRampEnabled
};

if (config.printStatementAsEventsEnabled) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: newrelic_mobile
description: Flutter plugin for NewRelic Mobile. This plugin allows you to instrument Flutter apps with help of native New Relic Android and iOS agents.
version: 1.0.0
version: 1.0.1
homepage: https://github.com/newrelic/newrelic-flutter-agent

environment:
Expand Down
78 changes: 68 additions & 10 deletions test/newrelic_mobile_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/annotations.dart';
import 'package:mockito/mockito.dart';
import 'package:newrelic_mobile/MetricUnit.dart';
import 'package:newrelic_mobile/config.dart';
import 'package:newrelic_mobile/network_failure.dart';
import 'package:newrelic_mobile/newrelic_dt_trace.dart';
Expand Down Expand Up @@ -658,7 +657,8 @@ void main() {
'networkRequestEnabled': true,
'networkErrorRequestEnabled': true,
'httpResponseBodyCaptureEnabled': true,
'loggingEnabled': true
'loggingEnabled': true,
'fedRampEnabled': false
};

expect(methodCalLogs, <Matcher>[
Expand Down Expand Up @@ -686,7 +686,8 @@ void main() {
'networkRequestEnabled': false,
'networkErrorRequestEnabled': false,
'httpResponseBodyCaptureEnabled': true,
'loggingEnabled': true
'loggingEnabled': true,
'fedRampEnabled': false
};

expect(methodCalLogs, <Matcher>[
Expand All @@ -712,7 +713,60 @@ void main() {
'networkRequestEnabled': true,
'networkErrorRequestEnabled': true,
'httpResponseBodyCaptureEnabled': true,
'loggingEnabled': true
'loggingEnabled': true,
'fedRampEnabled': false
};

expect(methodCalLogs, <Matcher>[
isMethodCall(
'startAgent',
arguments: params,
)
]);
});

test('agent should start with AppToken with fedRamp disabled', () async {
Config config = Config(accessToken: "test1234");
await NewrelicMobile.instance.startAgent(config);

final Map<String, dynamic> params = <String, dynamic>{
'applicationToken': config.accessToken,
'dartVersion': Platform.version,
'webViewInstrumentation': true,
'analyticsEventEnabled': true,
'crashReportingEnabled': true,
'interactionTracingEnabled': true,
'networkRequestEnabled': true,
'networkErrorRequestEnabled': true,
'httpResponseBodyCaptureEnabled': true,
'loggingEnabled': true,
'fedRampEnabled': false
};

expect(methodCalLogs, <Matcher>[
isMethodCall(
'startAgent',
arguments: params,
)
]);
});

test('agent should start with AppToken with fedRamp Enabled', () async {
Config config = Config(accessToken: "test1234", fedRampEnabled: true);
await NewrelicMobile.instance.startAgent(config);

final Map<String, dynamic> params = <String, dynamic>{
'applicationToken': config.accessToken,
'dartVersion': Platform.version,
'webViewInstrumentation': true,
'analyticsEventEnabled': true,
'crashReportingEnabled': true,
'interactionTracingEnabled': true,
'networkRequestEnabled': true,
'networkErrorRequestEnabled': true,
'httpResponseBodyCaptureEnabled': true,
'loggingEnabled': true,
'fedRampEnabled': true
};

expect(methodCalLogs, <Matcher>[
Expand Down Expand Up @@ -775,7 +829,8 @@ void main() {
'networkRequestEnabled': true,
'networkErrorRequestEnabled': true,
'httpResponseBodyCaptureEnabled': true,
'loggingEnabled': true
'loggingEnabled': true,
'fedRampEnabled': false
};

expect(
Expand Down Expand Up @@ -814,7 +869,8 @@ void main() {
'networkRequestEnabled': true,
'networkErrorRequestEnabled': true,
'httpResponseBodyCaptureEnabled': true,
'loggingEnabled': false
'loggingEnabled': false,
'fedRampEnabled': false
};

final Map<String, String> eventParams = <String, String>{'message': 'test'};
Expand All @@ -827,7 +883,7 @@ void main() {

final Map<String, dynamic> attributeParams = <String, dynamic>{
'name': 'Flutter Agent Version',
'value': '1.0.0',
'value': '1.0.1',
};

expect(methodCalLogs, <Matcher>[
Expand Down Expand Up @@ -868,12 +924,13 @@ void main() {
'networkRequestEnabled': true,
'networkErrorRequestEnabled': true,
'httpResponseBodyCaptureEnabled': true,
'loggingEnabled': true
'loggingEnabled': true,
'fedRampEnabled': false
};

final Map<String, dynamic> attributeParams = <String, dynamic>{
'name': 'Flutter Agent Version',
'value': '1.0.0',
'value': '1.0.1',
};

expect(methodCalLogs, <Matcher>[
Expand Down Expand Up @@ -910,7 +967,8 @@ void main() {
'networkRequestEnabled': true,
'networkErrorRequestEnabled': true,
'httpResponseBodyCaptureEnabled': true,
'loggingEnabled': true
'loggingEnabled': true,
'fedRampEnabled': false
};

expect(
Expand Down

0 comments on commit 36b1601

Please sign in to comment.