Skip to main content

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.

BASH
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.

whatap.conf
license={ACCESS_KEY}
whatap.server.host={COLLECTION_SERVER_IP}

Building the Nuxt application

Build the Nuxt application by executing the following command:

BASH
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.json
    Application information and dependency management document
  • index.mjs
    Server entry point file

Running the application

Use the following command to run the application.

BASH
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:

  1. Go to the .output/server directory.

    BASH
    cd .output/server
  2. Execute the following command to install the WhaTap agent.

    BASH
    npm install whatap
    Note

    After 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.

  3. Create the whatap.conf file and then perform configuration.

  4. Copy the configured .output/server path to WORKDIR.

  5. Use the following command to run the application.

    BASH
    node -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.