Installation of the Nuxt.js environment
The following explains how to install the Node.js agent in Nuxt.js 3 that is easy for users to install. This document has been created based on Nuxt.js 3.
Installing the agent
Install the WhaTap agent by executing the following command from the root path of the project.
npm install whatap
Creating the agent configuration file
Create the whatap.conf file in the root path of the project and then add the required settings. For more information about the agent configuration, see the following.
license={ACCESS_KEY}
whatap.server.host={COLLECTION_SERVER_IP}
Building the Nuxt application
Build the Nuxt application by executing the following command:
npm run build
When the build is completed, a .output/server directory is created. For the directory structure, see the following.
- chunks/Chunk files (Code-splitted Java script files)
- node_modules/Dependency modules required to run the server
- package.jsonApplication information and dependency management document
- index.mjsServer entry point file
Running the application
Use the following command to run the application.
node -r whatap .output/server/index.mjs
Running in the Decker environment
To run your Nuxt application in the Docker environment, add the following steps in Dockerfile:
-
Go to the .output/server directory.
BASHcd .output/server
-
Execute the following command to install the WhaTap agent.
BASHnpm install whatap
NoteAfter building the application, install the whatap package with a separate command, because the whatap package does not exist in the .output/server path. It is a tree shaking feature of Nuxt.js, which prevents packages that are not used in the code from being included in the build.
-
Create the whatap.conf file and then perform configuration.
-
Copy the configured .output/server path to
WORKDIR
. -
Use the following command to run the application.
BASHnode -r whatap .output/server/index.mjs
Next steps
-
Checking the installation
If you have applied all for project creation and agent installation, check the checklist in [the following] (install-check).
-
Agent setting
It provides various features for monitoring by applying some options to the agent configuration file (whatap.conf). It includes basic configuration, configuration for server connection and data transfer, how to manage the configuration files for multiple application servers, and transaction tracing, and more. For more information, see the following.
-
Starting the monitoring
After all settings are made, restart the application server. The agent starts collecting data. First, check whether the monitoring data has been collected in Application Dashboard. For more information about Application Dashboard, see the following.