From dd9e0e9fd07484b8dc094039d44537901bc08741 Mon Sep 17 00:00:00 2001 From: jobykorahgeorge Date: Wed, 15 May 2024 18:28:56 +0530 Subject: [PATCH 1/7] Exposed an API to add metadetails and screen name from bridged agents --- .../Beacons/Beacons Types/ViewChange.swift | 7 ++++++- .../Beacons/CoreBeacon/CoreBeaconFactory.swift | 5 +++++ Sources/InstanaAgent/Instana.swift | 18 ++++++++++++++++-- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Sources/InstanaAgent/Beacons/Beacons Types/ViewChange.swift b/Sources/InstanaAgent/Beacons/Beacons Types/ViewChange.swift index c202a77..d0c5f44 100644 --- a/Sources/InstanaAgent/Beacons/Beacons Types/ViewChange.swift +++ b/Sources/InstanaAgent/Beacons/Beacons Types/ViewChange.swift @@ -8,11 +8,13 @@ class ViewChange: Beacon { var accessibilityLabel: String? var navigationItemTitle: String? var className: String? + var viewInternalMetaMap: [String: String] init(timestamp: Instana.Types.Milliseconds = Date().millisecondsSince1970, viewName: String? = nil, accessibilityLabel: String? = nil, navigationItemTitle: String? = nil, - className: String? = nil, isSwiftUI: Bool = false) { + className: String? = nil, isSwiftUI: Bool = false, viewInternalMetaMap: [String: String] = [:]) { + self.viewInternalMetaMap = [:] var canonicalName: String? = viewName var prefix = "" if accessibilityLabel != nil, !accessibilityLabel!.isEmpty { @@ -32,6 +34,9 @@ class ViewChange: Beacon { canonicalName = prefix.isEmpty ? "@\(self.className!)" : prefix } } + for (key, value) in viewInternalMetaMap { + self.viewInternalMetaMap[key] = value + } super.init(timestamp: timestamp, viewName: canonicalName) } diff --git a/Sources/InstanaAgent/Beacons/CoreBeacon/CoreBeaconFactory.swift b/Sources/InstanaAgent/Beacons/CoreBeacon/CoreBeaconFactory.swift index 642d9fe..9db0009 100644 --- a/Sources/InstanaAgent/Beacons/CoreBeacon/CoreBeaconFactory.swift +++ b/Sources/InstanaAgent/Beacons/CoreBeacon/CoreBeaconFactory.swift @@ -109,6 +109,11 @@ extension CoreBeacon { if beacon.className != nil { im![internalMetaDataKeyView_className] = beacon.className! } + if !beacon.viewInternalMetaMap.isEmpty { + for (key, value) in beacon.viewInternalMetaMap { + im![key] = value + } + } if im!.isEmpty { im = nil } diff --git a/Sources/InstanaAgent/Instana.swift b/Sources/InstanaAgent/Instana.swift index 7cd5c07..e162a98 100644 --- a/Sources/InstanaAgent/Instana.swift +++ b/Sources/InstanaAgent/Instana.swift @@ -412,11 +412,24 @@ import Foundation Instana.current?.setViewInternal(name: name) } + /// Set the screen name and its meta details from crossplatfrom services (Flutter & React Native agents) + /// + /// This is exposed for internal use, for the communication between the instana agents, not to be consumed by developers + /// Call this method from instana cross platform agents when need to provide auto capture of screen names and its meta details + /// - Parameters: + /// - name: The screen name identified from cross platform agents + /// - viewInternalMetaMap: Dictionary of keys and values of meta details from cross platform agents + @objc + public static func setViewMetaCPInternal(name: String, viewInternalMetaMap: [String: String] = [:]) { + Instana.current?.setViewInternal(name: name, viewInternalMetaMap: viewInternalMetaMap) + } + public func setViewInternal(name: String?, accessibilityLabel: String? = nil, navigationItemTitle: String? = nil, className: String? = nil, - isSwiftUI: Bool = false) { + isSwiftUI: Bool = false, + viewInternalMetaMap: [String: String] = [:]) { guard let propertyHandler = Instana.current?.session.propertyHandler else { return } let isIdentical = propertyHandler.properties.view?.isSame(name: name, accessibilityLabel: accessibilityLabel, @@ -427,7 +440,8 @@ import Foundation accessibilityLabel: accessibilityLabel, navigationItemTitle: navigationItemTitle, className: className, - isSwiftUI: isSwiftUI) + isSwiftUI: isSwiftUI, + viewInternalMetaMap: viewInternalMetaMap) propertyHandler.properties.view = view guard view.viewName != nil else { return } From f11da68303e780bd4ed7de28512192cf4ae8f634 Mon Sep 17 00:00:00 2001 From: jobykorahgeorge Date: Sun, 19 May 2024 22:50:56 +0530 Subject: [PATCH 2/7] added unit test --- .../Beacon Types/ViewChangeBeaconTests.swift | 15 +++++++++++ Tests/InstanaAgentTests/InstanaTests.swift | 26 +++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/Tests/InstanaAgentTests/Beacons/Beacon Types/ViewChangeBeaconTests.swift b/Tests/InstanaAgentTests/Beacons/Beacon Types/ViewChangeBeaconTests.swift index 1010a37..c7acc7f 100644 --- a/Tests/InstanaAgentTests/Beacons/Beacon Types/ViewChangeBeaconTests.swift +++ b/Tests/InstanaAgentTests/Beacons/Beacon Types/ViewChangeBeaconTests.swift @@ -13,6 +13,7 @@ class ViewChangeBeaconTests: InstanaTestCase { let testViewName = "test view name 0" let testAcsbLabel = "test accessibilityLabel 1" let testNavItemTitle = "test navigationItemTitle 2" + let testViewInternalMetaMap = ["key1": "value1", "key2": "value2"] override func setUp() { super.setUp() @@ -113,4 +114,18 @@ class ViewChangeBeaconTests: InstanaTestCase { vcAfterSwizzle.viewDidAppear(false) Thread.sleep(forTimeInterval: 1) } + + func test_init_viewInternalMetaMap() { + let vcBeacon = ViewChange(timestamp: testTimestamp, viewName: testViewName, + accessibilityLabel: nil, navigationItemTitle: nil, className: nil,viewInternalMetaMap: testViewInternalMetaMap) + XCTAssertEqual(vcBeacon.viewInternalMetaMap,testViewInternalMetaMap) + } + + func test_init_viewInternalMetaMap_empty() { + let vcBeacon = ViewChange(timestamp: testTimestamp, viewName: testViewName, + accessibilityLabel: nil, navigationItemTitle: nil, className: nil) + XCTAssertEqual(vcBeacon.viewInternalMetaMap,[:]) + } + + } diff --git a/Tests/InstanaAgentTests/InstanaTests.swift b/Tests/InstanaAgentTests/InstanaTests.swift index 490f3a9..e3ab93e 100644 --- a/Tests/InstanaAgentTests/InstanaTests.swift +++ b/Tests/InstanaAgentTests/InstanaTests.swift @@ -827,4 +827,30 @@ class InstanaTests: InstanaTestCase { Instana.current = nil AssertFalse(Instana.collectionEnabled) } + + func test_setViewMetaCPInternal_called(){ + // Given + let session = InstanaSession.mock(configuration: .mock()) + + var viewChangeBeaconCount = 0 + var capturedViewInternalMetaMap: [String: String]? = nil + let reporter = MockReporter { + if let viewChange = $0 as? ViewChange { + capturedViewInternalMetaMap = viewChange.viewInternalMetaMap + viewChangeBeaconCount += 1 + } + } + Instana.current = Instana(session: session, monitors: Monitors(session, reporter: reporter)) + + let testViewInternalMetaMap = ["key1": "value1", "key2": "value2"] + // When + Instana.setViewMetaCPInternal(name: "ScreenName", viewInternalMetaMap:testViewInternalMetaMap) + + Instana.current?.setViewInternal(name: nil) // nil view name should not trigger ViewChange beacon + Thread.sleep(forTimeInterval: 1) + + // Then + AssertEqualAndNotNil(viewChangeBeaconCount, 1) + AssertEqualAndNotNil(capturedViewInternalMetaMap, testViewInternalMetaMap) + } } From dc111f323d72358f6b6bfb3434af1aa7322be055 Mon Sep 17 00:00:00 2001 From: jobykorahgeorge Date: Mon, 20 May 2024 16:32:05 +0530 Subject: [PATCH 3/7] Now only defined key can be transfered via internal meta --- .../Beacons/Beacons Types/ViewChange.swift | 10 ++++----- .../CoreBeacon/CoreBeaconFactory.swift | 4 ++-- .../InstanaAgent/Configuration/Defines.swift | 2 ++ Sources/InstanaAgent/Instana.swift | 21 ++++++++++++++----- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/Sources/InstanaAgent/Beacons/Beacons Types/ViewChange.swift b/Sources/InstanaAgent/Beacons/Beacons Types/ViewChange.swift index d0c5f44..9d9a66a 100644 --- a/Sources/InstanaAgent/Beacons/Beacons Types/ViewChange.swift +++ b/Sources/InstanaAgent/Beacons/Beacons Types/ViewChange.swift @@ -8,13 +8,13 @@ class ViewChange: Beacon { var accessibilityLabel: String? var navigationItemTitle: String? var className: String? - var viewInternalMetaMap: [String: String] + var viewInternalCPMetaMap: [String: String] init(timestamp: Instana.Types.Milliseconds = Date().millisecondsSince1970, viewName: String? = nil, accessibilityLabel: String? = nil, navigationItemTitle: String? = nil, - className: String? = nil, isSwiftUI: Bool = false, viewInternalMetaMap: [String: String] = [:]) { - self.viewInternalMetaMap = [:] + className: String? = nil, isSwiftUI: Bool = false, viewInternalCPMetaMap: [String: String] = [:]) { + self.viewInternalCPMetaMap = [:] var canonicalName: String? = viewName var prefix = "" if accessibilityLabel != nil, !accessibilityLabel!.isEmpty { @@ -34,8 +34,8 @@ class ViewChange: Beacon { canonicalName = prefix.isEmpty ? "@\(self.className!)" : prefix } } - for (key, value) in viewInternalMetaMap { - self.viewInternalMetaMap[key] = value + for (key, value) in viewInternalCPMetaMap { + self.viewInternalCPMetaMap[key] = value } super.init(timestamp: timestamp, viewName: canonicalName) } diff --git a/Sources/InstanaAgent/Beacons/CoreBeacon/CoreBeaconFactory.swift b/Sources/InstanaAgent/Beacons/CoreBeacon/CoreBeaconFactory.swift index 9db0009..924834b 100644 --- a/Sources/InstanaAgent/Beacons/CoreBeacon/CoreBeaconFactory.swift +++ b/Sources/InstanaAgent/Beacons/CoreBeacon/CoreBeaconFactory.swift @@ -109,8 +109,8 @@ extension CoreBeacon { if beacon.className != nil { im![internalMetaDataKeyView_className] = beacon.className! } - if !beacon.viewInternalMetaMap.isEmpty { - for (key, value) in beacon.viewInternalMetaMap { + if !beacon.viewInternalCPMetaMap.isEmpty { + for (key, value) in beacon.viewInternalCPMetaMap { im![key] = value } } diff --git a/Sources/InstanaAgent/Configuration/Defines.swift b/Sources/InstanaAgent/Configuration/Defines.swift index 436dad6..02408e1 100644 --- a/Sources/InstanaAgent/Configuration/Defines.swift +++ b/Sources/InstanaAgent/Configuration/Defines.swift @@ -56,6 +56,8 @@ let internalMetaDataKeyView_accbltyLabel = "view.accLabel" // accessibilityLabel let internalMetaDataKeyView_navItemTitle = "view.navItemTitle" // navigationItemTitle let internalMetaDataKeyView_className = "view.clsName" // className +let internalMetaFlutterKeys = ["settings.route.name", "widget.name", "child.widget.name", "child.widget.title", "go.router.path"] // keys given from flutter agent + /// /// Mobile Features /// diff --git a/Sources/InstanaAgent/Instana.swift b/Sources/InstanaAgent/Instana.swift index e162a98..01f3d17 100644 --- a/Sources/InstanaAgent/Instana.swift +++ b/Sources/InstanaAgent/Instana.swift @@ -414,14 +414,25 @@ import Foundation /// Set the screen name and its meta details from crossplatfrom services (Flutter & React Native agents) /// + /// ONLY TO BE USED BY FLUTTER/REACT NATIVE AGENTS! + /// /// This is exposed for internal use, for the communication between the instana agents, not to be consumed by developers /// Call this method from instana cross platform agents when need to provide auto capture of screen names and its meta details /// - Parameters: /// - name: The screen name identified from cross platform agents - /// - viewInternalMetaMap: Dictionary of keys and values of meta details from cross platform agents + /// - viewInternalCPMetaMap: Dictionary of keys and values of meta details from CROSS PLATFORM agents @objc - public static func setViewMetaCPInternal(name: String, viewInternalMetaMap: [String: String] = [:]) { - Instana.current?.setViewInternal(name: name, viewInternalMetaMap: viewInternalMetaMap) + public static func setViewMetaCPInternal(name: String, viewInternalCPMetaMap: [String: String] = [:]) { + var isAllKeyValid = true + for key in viewInternalCPMetaMap.keys { + if !internalMetaFlutterKeys.contains(key) { + isAllKeyValid = false + break + } + } + if isAllKeyValid { + Instana.current?.setViewInternal(name: name, viewInternalCPMetaMap: viewInternalCPMetaMap) + } } public func setViewInternal(name: String?, @@ -429,7 +440,7 @@ import Foundation navigationItemTitle: String? = nil, className: String? = nil, isSwiftUI: Bool = false, - viewInternalMetaMap: [String: String] = [:]) { + viewInternalCPMetaMap: [String: String] = [:]) { guard let propertyHandler = Instana.current?.session.propertyHandler else { return } let isIdentical = propertyHandler.properties.view?.isSame(name: name, accessibilityLabel: accessibilityLabel, @@ -441,7 +452,7 @@ import Foundation navigationItemTitle: navigationItemTitle, className: className, isSwiftUI: isSwiftUI, - viewInternalMetaMap: viewInternalMetaMap) + viewInternalCPMetaMap: viewInternalCPMetaMap) propertyHandler.properties.view = view guard view.viewName != nil else { return } From dad4233ec159b9cca4d19dae9f3168e69e4230e3 Mon Sep 17 00:00:00 2001 From: jobykorahgeorge Date: Mon, 20 May 2024 16:54:23 +0530 Subject: [PATCH 4/7] unit test added and updated --- .../Beacons/Beacons Types/ViewChange.swift | 2 ++ .../CoreBeacon/CoreBeaconFactory.swift | 1 + .../Beacon Types/ViewChangeBeaconTests.swift | 6 ++-- Tests/InstanaAgentTests/InstanaTests.swift | 34 +++++++++++++++++-- 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/Sources/InstanaAgent/Beacons/Beacons Types/ViewChange.swift b/Sources/InstanaAgent/Beacons/Beacons Types/ViewChange.swift index 9d9a66a..2a99e33 100644 --- a/Sources/InstanaAgent/Beacons/Beacons Types/ViewChange.swift +++ b/Sources/InstanaAgent/Beacons/Beacons Types/ViewChange.swift @@ -8,6 +8,8 @@ class ViewChange: Beacon { var accessibilityLabel: String? var navigationItemTitle: String? var className: String? + + // Internal Meta only to be consumed by Flutter/React agents var viewInternalCPMetaMap: [String: String] init(timestamp: Instana.Types.Milliseconds = Date().millisecondsSince1970, diff --git a/Sources/InstanaAgent/Beacons/CoreBeacon/CoreBeaconFactory.swift b/Sources/InstanaAgent/Beacons/CoreBeacon/CoreBeaconFactory.swift index 924834b..4cdec29 100644 --- a/Sources/InstanaAgent/Beacons/CoreBeacon/CoreBeaconFactory.swift +++ b/Sources/InstanaAgent/Beacons/CoreBeacon/CoreBeaconFactory.swift @@ -109,6 +109,7 @@ extension CoreBeacon { if beacon.className != nil { im![internalMetaDataKeyView_className] = beacon.className! } + // Only when there is view meta available from crossplatfrom agents(Flutter/React-Native) thats added with every view change if !beacon.viewInternalCPMetaMap.isEmpty { for (key, value) in beacon.viewInternalCPMetaMap { im![key] = value diff --git a/Tests/InstanaAgentTests/Beacons/Beacon Types/ViewChangeBeaconTests.swift b/Tests/InstanaAgentTests/Beacons/Beacon Types/ViewChangeBeaconTests.swift index c7acc7f..1bbd40e 100644 --- a/Tests/InstanaAgentTests/Beacons/Beacon Types/ViewChangeBeaconTests.swift +++ b/Tests/InstanaAgentTests/Beacons/Beacon Types/ViewChangeBeaconTests.swift @@ -117,14 +117,14 @@ class ViewChangeBeaconTests: InstanaTestCase { func test_init_viewInternalMetaMap() { let vcBeacon = ViewChange(timestamp: testTimestamp, viewName: testViewName, - accessibilityLabel: nil, navigationItemTitle: nil, className: nil,viewInternalMetaMap: testViewInternalMetaMap) - XCTAssertEqual(vcBeacon.viewInternalMetaMap,testViewInternalMetaMap) + accessibilityLabel: nil, navigationItemTitle: nil, className: nil,viewInternalCPMetaMap: testViewInternalMetaMap) + XCTAssertEqual(vcBeacon.viewInternalCPMetaMap,testViewInternalMetaMap) } func test_init_viewInternalMetaMap_empty() { let vcBeacon = ViewChange(timestamp: testTimestamp, viewName: testViewName, accessibilityLabel: nil, navigationItemTitle: nil, className: nil) - XCTAssertEqual(vcBeacon.viewInternalMetaMap,[:]) + XCTAssertEqual(vcBeacon.viewInternalCPMetaMap,[:]) } diff --git a/Tests/InstanaAgentTests/InstanaTests.swift b/Tests/InstanaAgentTests/InstanaTests.swift index e3ab93e..36862fb 100644 --- a/Tests/InstanaAgentTests/InstanaTests.swift +++ b/Tests/InstanaAgentTests/InstanaTests.swift @@ -828,7 +828,7 @@ class InstanaTests: InstanaTestCase { AssertFalse(Instana.collectionEnabled) } - func test_setViewMetaCPInternal_called(){ + func test_setViewMetaCPInternal_called_negative(){ // Given let session = InstanaSession.mock(configuration: .mock()) @@ -836,7 +836,7 @@ class InstanaTests: InstanaTestCase { var capturedViewInternalMetaMap: [String: String]? = nil let reporter = MockReporter { if let viewChange = $0 as? ViewChange { - capturedViewInternalMetaMap = viewChange.viewInternalMetaMap + capturedViewInternalMetaMap = viewChange.viewInternalCPMetaMap viewChangeBeaconCount += 1 } } @@ -844,7 +844,35 @@ class InstanaTests: InstanaTestCase { let testViewInternalMetaMap = ["key1": "value1", "key2": "value2"] // When - Instana.setViewMetaCPInternal(name: "ScreenName", viewInternalMetaMap:testViewInternalMetaMap) + Instana.setViewMetaCPInternal(name: "ScreenName", viewInternalCPMetaMap:testViewInternalMetaMap) + + Instana.current?.setViewInternal(name: nil) // nil view name should not trigger ViewChange beacon + Thread.sleep(forTimeInterval: 1) + + // Then + AssertEqualAndNotNil(viewChangeBeaconCount, 0) + AssertEqualAndNotNil(capturedViewInternalMetaMap, nil) + } + + func test_setViewMetaCPInternal_called_positive(){ + // Given + let session = InstanaSession.mock(configuration: .mock()) + + var viewChangeBeaconCount = 0 + var capturedViewInternalMetaMap: [String: String]? = nil + let reporter = MockReporter { + if let viewChange = $0 as? ViewChange { + capturedViewInternalMetaMap = viewChange.viewInternalCPMetaMap + viewChangeBeaconCount += 1 + } + } + Instana.current = Instana(session: session, monitors: Monitors(session, reporter: reporter)) + + let testViewInternalMetaMap = ["settings.route.name": "value1", "widget.name": "value2"] + + + // When + Instana.setViewMetaCPInternal(name: "ScreenName", viewInternalCPMetaMap:testViewInternalMetaMap) Instana.current?.setViewInternal(name: nil) // nil view name should not trigger ViewChange beacon Thread.sleep(forTimeInterval: 1) From ad98be94bbbde51f48f391e48b903025525fe9bf Mon Sep 17 00:00:00 2001 From: jobykorahgeorge Date: Mon, 20 May 2024 16:56:47 +0530 Subject: [PATCH 5/7] typo fixed --- Sources/InstanaAgent/Instana.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/InstanaAgent/Instana.swift b/Sources/InstanaAgent/Instana.swift index 01f3d17..638d524 100644 --- a/Sources/InstanaAgent/Instana.swift +++ b/Sources/InstanaAgent/Instana.swift @@ -423,14 +423,14 @@ import Foundation /// - viewInternalCPMetaMap: Dictionary of keys and values of meta details from CROSS PLATFORM agents @objc public static func setViewMetaCPInternal(name: String, viewInternalCPMetaMap: [String: String] = [:]) { - var isAllKeyValid = true + var isAllKeysValid = true for key in viewInternalCPMetaMap.keys { if !internalMetaFlutterKeys.contains(key) { - isAllKeyValid = false + isAllKeysValid = false break } } - if isAllKeyValid { + if isAllKeysValid { Instana.current?.setViewInternal(name: name, viewInternalCPMetaMap: viewInternalCPMetaMap) } } From 6329f6a4941147e14dd37cd85e512f6fea10c754 Mon Sep 17 00:00:00 2001 From: jobykorahgeorge Date: Tue, 21 May 2024 15:04:32 +0530 Subject: [PATCH 6/7] added ut for max count, added max count logic --- .../Beacons/Beacons Types/ViewChange.swift | 4 +-- .../CoreBeacon/CoreBeaconFactory.swift | 1 - Tests/InstanaAgentTests/InstanaTests.swift | 33 +++++++++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/Sources/InstanaAgent/Beacons/Beacons Types/ViewChange.swift b/Sources/InstanaAgent/Beacons/Beacons Types/ViewChange.swift index 2a99e33..947cad0 100644 --- a/Sources/InstanaAgent/Beacons/Beacons Types/ViewChange.swift +++ b/Sources/InstanaAgent/Beacons/Beacons Types/ViewChange.swift @@ -8,7 +8,7 @@ class ViewChange: Beacon { var accessibilityLabel: String? var navigationItemTitle: String? var className: String? - + // Internal Meta only to be consumed by Flutter/React agents var viewInternalCPMetaMap: [String: String] @@ -37,7 +37,7 @@ class ViewChange: Beacon { } } for (key, value) in viewInternalCPMetaMap { - self.viewInternalCPMetaMap[key] = value + self.viewInternalCPMetaMap[key] = ViewChange.validate(viewName: value) } super.init(timestamp: timestamp, viewName: canonicalName) } diff --git a/Sources/InstanaAgent/Beacons/CoreBeacon/CoreBeaconFactory.swift b/Sources/InstanaAgent/Beacons/CoreBeacon/CoreBeaconFactory.swift index 4cdec29..924834b 100644 --- a/Sources/InstanaAgent/Beacons/CoreBeacon/CoreBeaconFactory.swift +++ b/Sources/InstanaAgent/Beacons/CoreBeacon/CoreBeaconFactory.swift @@ -109,7 +109,6 @@ extension CoreBeacon { if beacon.className != nil { im![internalMetaDataKeyView_className] = beacon.className! } - // Only when there is view meta available from crossplatfrom agents(Flutter/React-Native) thats added with every view change if !beacon.viewInternalCPMetaMap.isEmpty { for (key, value) in beacon.viewInternalCPMetaMap { im![key] = value diff --git a/Tests/InstanaAgentTests/InstanaTests.swift b/Tests/InstanaAgentTests/InstanaTests.swift index 36862fb..8f70985 100644 --- a/Tests/InstanaAgentTests/InstanaTests.swift +++ b/Tests/InstanaAgentTests/InstanaTests.swift @@ -881,4 +881,37 @@ class InstanaTests: InstanaTestCase { AssertEqualAndNotNil(viewChangeBeaconCount, 1) AssertEqualAndNotNil(capturedViewInternalMetaMap, testViewInternalMetaMap) } + + func test_setViewMetaCPInternal_called_with_max_value_length(){ + // Given + let session = InstanaSession.mock(configuration: .mock()) + + var viewChangeBeaconCount = 0 + var capturedViewInternalMetaMap: [String: String]? = nil + let reporter = MockReporter { + if let viewChange = $0 as? ViewChange { + capturedViewInternalMetaMap = viewChange.viewInternalCPMetaMap + viewChangeBeaconCount += 1 + } + } + Instana.current = Instana(session: session, monitors: Monitors(session, reporter: reporter)) + var randomString = "" + for _ in 0.. Date: Tue, 21 May 2024 20:51:48 +0530 Subject: [PATCH 7/7] version updated --- Changelog.md | 3 +++ InstanaAgent.podspec | 2 +- Sources/InstanaAgent/Configuration/VersionConfig.swift | 2 +- .../Configuration/InstanaSystemUtilsTests.swift | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index f8af3e2..dc11802 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,8 @@ # Changelog +## 1.8.1 +- added functionality to accept internal metadata from cross-platform agents + ## 1.8.0 - add to mobile feature list if `autoCaptureScreenNames` is enabled - add Privacy Manifest File PrivacyInfo.xcprivacy to iOSAgent diff --git a/InstanaAgent.podspec b/InstanaAgent.podspec index 26a0e39..d97f78f 100644 --- a/InstanaAgent.podspec +++ b/InstanaAgent.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "InstanaAgent" - s.version = "1.8.0" + s.version = "1.8.1" s.summary = "Instana iOS agent." # This description is used to generate tags and improve search results. diff --git a/Sources/InstanaAgent/Configuration/VersionConfig.swift b/Sources/InstanaAgent/Configuration/VersionConfig.swift index 9020aaf..2572fd7 100644 --- a/Sources/InstanaAgent/Configuration/VersionConfig.swift +++ b/Sources/InstanaAgent/Configuration/VersionConfig.swift @@ -1,3 +1,3 @@ struct VersionConfig { - static let agentVersion = "1.8.0" + static let agentVersion = "1.8.1" } diff --git a/Tests/InstanaAgentTests/Configuration/InstanaSystemUtilsTests.swift b/Tests/InstanaAgentTests/Configuration/InstanaSystemUtilsTests.swift index 831dacb..cb5556c 100644 --- a/Tests/InstanaAgentTests/Configuration/InstanaSystemUtilsTests.swift +++ b/Tests/InstanaAgentTests/Configuration/InstanaSystemUtilsTests.swift @@ -5,7 +5,7 @@ class InstanaSystemUtilsTests: InstanaTestCase { func test_AgentVersion() { // Then - AssertTrue(InstanaSystemUtils.agentVersion == "1.8.0") + AssertTrue(InstanaSystemUtils.agentVersion == "1.8.1") } func test_systemVersion() {