slothis · English

Installing New Relic (APM) on Java Spring Boot

2022-05-08 · Updated: 2026-08-11 · Original (Korean)

This article was translated from the original Korean post with AI assistance. Read the original Korean post →
Logo with a white circle inside a teal circular background containing the text New Relic in black

Goal

Install New Relic on a Java Spring Boot server to monitor transactions and errors through APM.

Deployment Environment

Assuming you have multiple repositories and use a mix of the following two deployment methods:

Installation

After signing up, follow the guide provided by New Relic in order.

Screen for copying the Java Agent command to install New Relic
Screen for entering the Java application name in New Relic and downloading the configuration file
git add <blar>.jar -f

For Docker on EC2

maven:
    build:
      context: ./
      dockerfile: Dockerfile
      args:
        PROCESS: test
    environment:
      - PROCESS=test
    container_name: maven
    expose: [ 8080 ]
    ports:
      - 8080:8080
    entrypoint: java -javaagent:/newrelic/newrelic.jar -Dnewrelic.environment=test -jar -DSpring.profiles.active=test /app/target/test-0.0.1-SNAPSHOT.jar
    depends_on:
    volumes:
      - ./:/app
      - ./newrelic:/newrelic/

For ECS & Code Deploy

"command": [
  "java",
  "-javaagent:/app/newrelic/newrelic.jar",
  "-jar",
  "-DSpring.profiles.active=release",
  "/app/target/test-0.0.1-SNAPSHOT.jar"
],

Result