Splunk AppDynamics

AppDynamics Native Agent Not Loading with Nexe-bundled NodeJS Application

extalt
Observer

AppDynamics Native Agent Not Loading with Nexe-bundled NodeJS Application

Environment
- Node.js version: 20.9.0
- AppDynamics Node.js Agent version: Latest
- Nexe version: Latest
- OS: Windows Server
- Build tool: Nexe with custom build script

Project Structure
We have a Node.js API service that uses:
- Express.js for REST API
- Native modules (specifically AppDynamics agent)
- Various npm packages for business logic
- Built and distributed as a single executable using Nexe

 

Issue
When running our Nexe-bundled application, the AppDynamics agent fails to initialize with the following error:

 

Appdynamics agent cannot be initialized due to Error: Missing required module. \\?\C:\Path\nodejs_api\node_modules\appdynamics-libagent-napi\appd_libagent.node TypeError: Cannot read properties of undefined (reading 'init') at LibagentConnector.init


What We've Tried
1. Including the native module as a resource in Nexe build:
--resource "./node_modules/appdynamics-libagent-napi/appd_libagent.node"

2. Copying the native module to the correct directory structure in distribution:

dist/

- api_node.exe

- node_modules/

-- appdynamics-libagent-napi/

--- appd_libagent.node

 

According to Nexe's documentation, when dealing with native modules (.node files), the module should be placed in the `node_modules` directory relative to the compiled executable's location. This means that while the application is bundled into a single executable, native modules are expected to be loaded from the filesystem at runtime.


Question
How can we properly bundle and load the AppDynamics native agent with a Nexe-compiled Node.js application? Is there a specific configuration or approach needed for native modules, particularly AppDynamics, to work with Nexe?

Any guidance or working examples would be greatly appreciated.

Labels (1)
Tags (3)
0 Karma

iamryan
Community Manager
Community Manager

Hello @extalt,

Thank you for asking your question on the Community. I'm not a product expert. Let's see if the community can jump in and help. 

If you don't get a reply soon, you can each out to AppDynamics Support. https://community.splunk.com/t5/AppDynamics-Knowledge-Base/How-do-I-open-a-case-with-AppDynamics-Sup...

 

0 Karma

extalt
Observer

@iamryan can you look that sir please.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...