Splunk AppDynamics

Next.js support?

PsychicMushroom
Explorer

Hi,

Has anyone tried using the node.js agent to see if it will work with detecting the Next.js framework?

Next.js is an open-source web development framework built on top of Node.js, so don't know if it will at least partially work.🐵

Labels (1)
Tags (1)
0 Karma

iamryan
Community Manager
Community Manager

Hi @Michael.Lee,

I see you created a support ticket for this question. Can you share your learnings with @Kiryl.Kaliada

0 Karma

Kiryl_Kaliada
Explorer

Hi. Any update on that?

0 Karma

iamryan
Community Manager
Community Manager

Hi @Kiryl.Kaliada,

Here is what was shared via Support

Yes, Next.js application can be instrumented with Node.js Agent, but only if the runtime is Node.js, meaning application having node.js backend. Single page applications or frontend applications not running on Node.js cannot be instrumented with Node.js agent. 
 
Next steps:
 
Steps to instrument:
Using below steps appdynamics will be installed outside application folder.

  • Create appd directory outside application mkdir /opt/appdynamics
  • Create package.json in /opt/appdynamics npm init -y
  • Install appd in /opt/appdynamics npm install appdynamics@latest
  • Create shim.js in /opt with the code below
require("appdynamics").profile({
debug: true,
controllerHostName: '<controller-host-name>',
controllerPort: 443,
controllerSslEnabled: true, // Set to true if controllerPort is SSL
accountName: 'xyz',
accountAccessKey: 'xyz', //required
applicationName: '323460-axios-nextjs',
tierName: 't1',
nodeName: 'n1',
logging: {
'logfiles': [
{
'root_directory': '/tmp/appd',
'filename': 'echo_%N.log',
'level': 'TRACE',
'max_size': 5242880,
'max_files': 10
}
]
}
});
 
  • Create appd specific ENV variable which includes app, tier, node, controller host, etc. or can hardcode mandatory parameters in shim.js file itself
  • Create NODE_OPTIONS env variable. export NODE_OPTIONS '--require "/opt/appdynamics/shim.js"'

Start the server and the agent will be pre-loaded with the help of env var NODE_OPTIONS


Hope that helps
 

0 Karma

iamryan
Community Manager
Community Manager

Hi @Michael.Lee,

I didn't see any mention of this within the Community. I did some find Support tickets on this topic. I would recommend reaching out to your AppD rep to see what they can find out. 

0 Karma
Get Updates on the Splunk Community!

Get Schooled with Splunk Education: Explore Our Latest Courses

At Splunk Education, we’re dedicated to providing incredible learning experiences that cater to every skill ...

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL  The Splunk AI Assistant for SPL ...

Buttercup Games: Further Dashboarding Techniques (Part 5)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...