Set Up the Agent

To enable developers to insert instrumentation on the fly, you need to download and attach the agent to a running application.

Set up the agent
  1. From the server where your application is running, log in to Lightrun from the browser.

  2. Navigate to Getting started=>Install the agent.

    Install the agent -half

  3. From the Install the Agent section, select the tab for the operating system that your application server has installed.

  4. Copy and run the script. The script on this page already includes your server IP and port values, similar to this:

  5. Once you've downloaded the agent, optionally customize the agent configurations.

    Tip

    You can customize agent configurations any time you want. Check out the content of the file agent/agent.config. To apply any changes, restart the agent as described in the next step.

  6. Now, add the application to your application as follows:

    1. From the application server, open the terminal and navigate to the folder where your application resides.

    2. From the browser, copy the command, replace RestofArgumentsHere with the name of your application and any other relevant options, and follow the instructions to run it; similar to this GIF:

      !!! tip Optionally, add the JAVA_OPTS environment variable to the server so that all Java processes launched on that server have an agent attached. Copy the following command from the server and replace the agentpath value with the path to the Lightrun agent where you downloaded it:

      export JAVA_OPTS=-agentpath:/path/to/agent/lightrun_agent.so
      

    3. Install the CLI and validate that the agent registered correctly by running lightrunc list-agents. Assuming the agent is running, something similar to the following should print in the terminal:

      0 : ID 5c84e29871f7a700010ca737UPDATE Sun, 10 Mar 2019 10:10:32 GMT
      

Last update: May 5, 2021