Service Graph connectors for Observability - Appdynamics - REST API Transaction Timeouts/CancellationsIssue Issue: Due to a coding error in the Event Connector Script for SGC Observability - AppDynamics, the incoming REST API transactions take between approximately 15000ms and 300000ms to complete.These longer transaction times create excessive wait times for other incoming REST API transactions causing them to timeout and cancel. In the Transaction Table you'll find the below in the URL field: CANCELLED: /api/sn_em_connector/em/inbound_event?source=SGO-AppDynamics&api=api In the Node Logs you'll find the below exception for the Transaction: 2023-07-13 11:29:47 (893) API_INT-thread-1 SYSTEM txid=c408e945b4c0 WARNING *** WARNING *** GlideServlet:Transaction waited excessive time to run: 297266ms, semaphore wait: 8ms, session wait: 297258ms - transaction: #124454 /api/sn_em_connector/em/inbound_event, user: AppDynamicsAPIhost = app128045.dub101.service-now.comsource = /bankofirelandgroupdev2017/glide-utah-12-21-2022__patch4-hotfix2-06-23-2023/subprod/active/mysql-10.2.27samurai0.1.7opensslcentos-mariadb-log/logs/localhost_log.2023-07-13.txtsourcetype = appnode_localhost_log localhost2023-07-13 11:29:51 (535) glide.quota.manager WARNING *** WARNING *** Transaction: Cancelling transaction #124454 /api/sn_em_connector/em/inbound_event (maximum execution time exceeded): Thread API_INT-thread-1 (AppDynamicsAPI, A56CEA201B807D109BD2F436464BCBD5), after 300910mshost = app128045.dub101.service-now.comsource = /bankofirelandgroupdev2017/glide-utah-12-21-2022__patch4-hotfix2-06-23-2023/subprod/active/mysql-10.2.27samurai0.1.7opensslcentos-mariadb-log/logs/localhost_log.2023-07-13.txtsourcetype = appnode_localhost_log localhost 2023-07-13 11:29:18 (523) API_INT-thread-2 45AD379D1BDECD94508BEB53604BCB70 txid=89ad379d1bde WARNING *** WARNING *** Large Table: Table handling an extremely large result set: 7528745Query that got us here is: TABLENAME = sys_object_source ENCODED_QUERY = ReleaseServiceNow Store Plugin - Service Graph Connector for Observability - AppDynamics Version: 1.2.1 Compatibility : Utah, Tokyo, San Diego https://store.servicenow.com/sn_appstore_store.do#!/store/application/115a3472732110102b6265a751ab9eb0/1.2.1?referer=%2Fstore%2Fsearch%3Flistingtype%3Dallintegrations%25253Bancillary_app%25253Bcertified_apps%25253Bcontent%25253Bindustry_solution%25253Boem%25253Butility%25253Btemplate%26q%3Dservice%2520graph%2520connector%2520for%2520observability%2520-%2520appdynamics&sl=shCause• Service Graph connectors for Appdynamics Event Management connector script has a coding error on line 20 that runs a GlideRecord query on table sys_obj_source before adding conditions to the query. • Without the conditions added to the query all records on sys_obj_source are returned. • Snippet of Code where defect can be located in the Script (Lines 18 through 32) // Lookup the CI on sys_object_source var sysObjectSource = new GlideRecord("sys_object_source"); sysObjectSource.query(); sysObjectSource.addQuery("name", this.DISCOVERY_SOURCE); sysObjectSource.addQuery("id", sourceNativeKey); sysObjectSource.query(); if (sysObjectSource.next()) { gr.ci_type = sysObjectSource.getValue("target_table"); gr.cmdb_ci = sysObjectSource.getValue("target_sys_id"); } else { if (!requestBody.action.name.startsWith("Test ")) { // Don't create events for notifications to resources we don't ingest and aren't test requests. return; } } Commenting the line 20 " sysObjectSource.query();" will fix the issue. Resolution1. Switch scopes from "Global" to "Service Graph Connector for Observability - AppDynamics" to update the script. 2. Open the Service Graph connectors for Appdynamics Event Management connector script and comment out line 20 as in below example. https://<instancename>.service-now.com/sys_script_include.do?sys_id=9c52d00f776a30100dfa1bfaae5a9911&sysparm_view=&sysparm_domain=null&sysparm_domain_scope=null 3. Locate line 20 and comment it out as in below example. // Lookup the CI on sys_object_source var sysObjectSource = new GlideRecord("sys_object_source"); //sysObjectSource.query(); sysObjectSource.addQuery("name", this.DISCOVERY_SOURCE); sysObjectSource.addQuery("id", sourceNativeKey); sysObjectSource.query(); if (sysObjectSource.next()) { gr.ci_type = sysObjectSource.getValue("target_table"); gr.cmdb_ci = sysObjectSource.getValue("target_sys_id"); } else { if (!requestBody.action.name.startsWith("Test ")) { // Don't create events for notifications to resources we don't ingest and aren't test requests. return; } } 4. Save the script and trigger events from AppDynamics.