Skip to content

Commit d2b7c8d

Browse files
authored
feat: newrelic integration (#15)
integrated newrelic for monitoring metrics, logs and overall observability. --------- Signed-off-by: Rajdeep Roy Chowdhury <[email protected]>
1 parent 0b80d0d commit d2b7c8d

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ WORKDIR /src
66
COPY . .
77
RUN chmod +x gradlew && ./gradlew clean build
88

9+
RUN mkdir /newrelic
10+
WORKDIR /newrelic
11+
RUN wget -nv -O newrelic.zip https://download.newrelic.com/newrelic/java-agent/newrelic-agent/current/newrelic-java.zip \
12+
&& unzip newrelic.zip \
13+
&& rm newrelic.zip
14+
915
# ----------------------------------------------
1016

1117
FROM eclipse-temurin:17-jre-alpine as pod
@@ -20,5 +26,6 @@ USER nonroot
2026
WORKDIR /home/nonroot/app
2127

2228
COPY --from=builder /src/build/libs/konsign-api-0.0.1-SNAPSHOT.jar /home/nonroot/app
29+
COPY --from=builder /newrelic/newrelic/newrelic.jar /home/nonroot/app
2330

24-
CMD ["java", "-Dspring.profiles.actives=dev", "-jar", "konsign-api-0.0.1-SNAPSHOT.jar"]
31+
CMD ["java", "-javaagent:newrelic.jar", "-Dspring.profiles.actives=dev", "-jar", "konsign-api-0.0.1-SNAPSHOT.jar"]

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,17 @@ docker-compose up
2121

2222
### Environment variables
2323

24-
| Name | Value |
25-
|-------------------|-----------|
26-
| REDIS_HOST | localhost |
27-
| REDIS_PORT | 6379 |
28-
| REDIS_USERNAME | redis |
29-
| REDIS_PASSWORD | konsign |
30-
| POSTGRES_HOST | localhost |
31-
| POSTGRES_PORT | 5432 |
32-
| POSTGRES_DBNAME | konsign |
33-
| POSTGRES_USERNAME | konsign |
34-
| POSTGRES_PASSWORD | konsign |
35-
24+
| Name | Value |
25+
|-----------------------|-------------|
26+
| REDIS_HOST | localhost |
27+
| REDIS_PORT | 6379 |
28+
| REDIS_USERNAME | redis |
29+
| REDIS_PASSWORD | konsign |
30+
| POSTGRES_HOST | localhost |
31+
| POSTGRES_PORT | 5432 |
32+
| POSTGRES_DBNAME | konsign |
33+
| POSTGRES_USERNAME | konsign |
34+
| POSTGRES_PASSWORD | konsign |
35+
| NEW_RELIC_LICENSE_KEY | LICENSEKEY |
36+
| NEW_RELIC_APP_NAME | konsign-api |
37+
| NEW_RELIC_ENVIRONMENT | dev |

0 commit comments

Comments
 (0)