Skip to content

Commit

Permalink
Opentelemetry i dev (#1218)
Browse files Browse the repository at this point in the history
  • Loading branch information
tendestad authored Aug 18, 2024
1 parent c2fc263 commit 9f260ab
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
FROM ghcr.io/navikt/baseimages/temurin:21-appdynamics

ENV APPD_ENABLED=true
LABEL org.opencontainers.image.source=https://github.com/navikt/k9-punsj

RUN curl -L -O https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v2.6.0/opentelemetry-javaagent.jar

COPY docker-init-scripts/import-serviceuser-credentials.sh /init-scripts/21-import-serviceuser-credentials.sh
COPY docker-init-scripts/import-appdynamics-settings.sh /init-scripts/22-import-appdynamics-settings.sh

COPY docker-init-scripts/setup-opentelemetry.sh /init-scripts/23-setup-opentelemetry.sh

COPY target/*.jar app.jar
8 changes: 8 additions & 0 deletions docker-init-scripts/setup-opentelemetry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

#start opentelemetry-agenten dersom konfigurert
set +u
if [ ! -z "${OTEL_EXPORTER_OTLP_ENDPOINT}" ]; then
echo "Configuring attatchment of opentelemetry-agent"
JAVA_OPTS="${JAVA_OPTS} -javaagent:/app/opentelemetry-javaagent.jar"
fi
12 changes: 12 additions & 0 deletions nais/dev-fss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,18 @@ spec:
- name: AUDITLOGGER_PRODUCT
value: "k9-punsj"

# Tracing : opentelemetry
- name: "OTEL_EXPORTER_OTLP_ENDPOINT"
value: "https://elastic-apm.adeo.no"
- name: "OTEL_METRICS_EXPORTER"
value: "otlp"
- name: "OTEL_LOGS_EXPORTER"
value: "none"
- name: "OTEL_RESOURCE_ATTRIBUTES"
value: "service.name=k9-punsj,service.version=k9-punsj,deployment.environment=q"
- name: "OTEL_TRACES_EXPORTER"
value: "otlp"

# Integrasjoner (Rest)
- name: K9SAK_BASE_URL
value: https://k9-sak.nais.preprod.local/k9/sak/api
Expand Down
4 changes: 4 additions & 0 deletions nais/prod-fss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ spec:
- name: AUDITLOGGER_PRODUCT
value: "k9-punsj"

# tracing (appdynamics/opentelemetry)
- name: APPD_ENABLED
value: "true"

# Integrasjoner (Rest)
- name: K9SAK_BASE_URL
value: https://k9-sak.nais.adeo.no/k9/sak/api
Expand Down

0 comments on commit 9f260ab

Please sign in to comment.