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
Get Updates on the Splunk Community!

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

This is the third post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...