Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Java/hapi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Then set the HAPI_FHIR_CUSTOMBEANPACKAGES environment variable to com.lantanagroup.link.hapi
# See the upgrade notes in the POM as well

FROM maven:3-eclipse-temurin-11 AS build
FROM maven:3-eclipse-temurin-21 AS build
WORKDIR /app
COPY pom.xml ./
COPY hapi/pom.xml hapi/
Expand All @@ -20,14 +20,21 @@ COPY hapi/ hapi/
RUN mvn -pl hapi -am -B -DskipTests -e -ntp package
RUN mvn -pl hapi dependency:copy-dependencies -DoutputDirectory=target/dependencies

FROM hapiproject/hapi:v5.6.0-distroless AS run
FROM hapiproject/hapi:v7.6.1 AS run
WORKDIR /app
COPY --from=build /app/hapi/target/hapi-*.jar extra-classes/link.jar
COPY --from=build /app/hapi/target/dependencies/*.jar extra-classes/
# In newer HAPI versions, the ENTRYPOINT is usually already set, but we might want to customize it if needed.
# For now, let's keep the customization to ensure the extra-classes are picked up correctly.
# But check if HAPI 7.6.1 uses a different mechanism.
# Usually, we can use HAPI_FHIR_CUSTOMBEANPACKAGES.
ENV HAPI_FHIR_CUSTOMBEANPACKAGES=com.lantanagroup.link.hapi
# New HAPI versions might not need the custom ENTRYPOINT if we use the default and put jars in right place.
# However, to be safe and consistent with previous version's intent:
ENTRYPOINT [ \
"java", \
"--class-path", \
"/app/main.war", \
"-Dloader.path=main.war!/WEB-INF/classes/,main.war!/WEB-INF/,/app/extra-classes", \
"org.springframework.boot.loader.PropertiesLauncher" \
"org.springframework.boot.loader.launch.PropertiesLauncher" \
]
10 changes: 6 additions & 4 deletions Java/hapi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>5.6.0</version>
<version>7.6.1</version>
<relativePath/>
</parent>

Expand All @@ -26,7 +26,7 @@
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-bom</artifactId>
<version>${project.parent.version}</version>
<version>7.6.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -35,8 +35,10 @@

<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>6.0.0</version>
<scope>provided</scope>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package ca.uhn.fhir.jpa.starter.link.filters;

import com.lantanagroup.link.hapi.utils.HttpServletRequestUtils;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import io.github.bucket4j.Bandwidth;
import io.github.bucket4j.Bucket;
import io.github.bucket4j.ConsumptionProbe;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
Expand All @@ -14,10 +18,6 @@
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.time.Duration;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.lantanagroup.link.hapi.utils;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;

public class HttpServletRequestUtils {
public static String getClientIpAddress(HttpServletRequest request) {
Expand Down
11 changes: 8 additions & 3 deletions Java/measureeval/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM maven:3-eclipse-temurin-17 AS build
FROM maven:3-eclipse-temurin-21 AS build

WORKDIR /app

Expand All @@ -13,13 +13,18 @@ COPY --chown=mvn:mvn ./ ./
#RUN chmod +x ./mvn
RUN mvn -pl measureeval -am -Dmaven.test.skip=true package

FROM eclipse-temurin:17-alpine AS run
FROM eclipse-temurin:21-alpine AS run
RUN apk add --no-cache curl
WORKDIR /app
COPY --from=build /app/measureeval/target/measureeval-*.jar measureeval.jar

# Extract using tools jarmode (replacement for layertools and cds in SB 3.4)
RUN java -Djarmode=tools -jar measureeval.jar extract --launcher --destination . --force
Comment on lines +21 to +22

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

Spring Boot 3.4 jarmode tools extract CDS archive generation

💡 Result:

To generate a CDS (AppCDS) archive for a Spring Boot 3.4 executable JAR, you use the tools jarmode to extract the JAR into a CDS-friendly layout, then do a “training run” that writes the archive on exit, and finally launch using that archive.

1) Extract the executable JAR (CDS-friendly layout)

java -Djarmode=tools -jar my-app.jar extract --destination application

This tools jarmode extract command is the modern replacement for -Djarmode=layertools extract. [1]

2) Training run: generate the CDS archive (application.jsa)

Run from the extracted directory (so the classpath/layout is stable for CDS):

cd application
java -XX:ArchiveClassesAtExit=application.jsa \
     -Dspring.context.exit=onRefresh \
     -jar my-app.jar

This produces application.jsa. [2][3]

3) Production run: use the archive

java -XX:SharedArchiveFile=application.jsa -jar my-app.jar

(Again, run using the same extracted layout.) [2][3]

Buildpacks (optional, container images)

If you build an image with Paketo buildpacks via Spring Boot, you can enable automatic CDS training + packaging by setting:

  • BP_JVM_CDS_ENABLED=true [4][5]

And if the training run needs different JVM/app options (e.g., to prevent early DB connections), you can use:

  • CDS_TRAINING_JAVA_TOOL_OPTIONS [5]

Sources: Spring Boot 3.3+ tools jarmode (still applies to 3.4) [1], Spring Boot CDS reference/how-to docs [2][4], Spring blog (CDS + self-extracting JAR workflow) [5].


Add missing CDS archive training run.

The extract --launcher command only creates the application structure; it does not generate the application.jsa CDS archive. A separate training run is required between extraction and production:

Required Docker step
RUN java -Djarmode=tools -jar measureeval.jar extract --launcher --destination . --force && \
    java -XX:ArchiveClassesAtExit=application.jsa \
         -Dspring.context.exit=onRefresh \
         org.springframework.boot.loader.launch.JarLauncher

Without this step, the ENTRYPOINT will fail when attempting to load the non-existent application.jsa archive.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Java/measureeval/Dockerfile` around lines 21 - 22, The Dockerfile currently
runs the jarmode extraction (java -Djarmode=tools -jar measureeval.jar extract
--launcher ...) which only creates the app layout but does not produce the CDS
archive; add a training run immediately after the extract to generate
application.jsa by invoking the JVM with
-XX:ArchiveClassesAtExit=application.jsa and launching the Spring Boot launcher
(org.springframework.boot.loader.launch.JarLauncher) so the CDS archive is
created before the ENTRYPOINT attempts to load application.jsa.


RUN chmod -R 755 /app \
&& chown -R 1001 /app

USER 1001
EXPOSE 5135
CMD ["java", "--add-opens", "java.base/java.util=ALL-UNNAMED", "-jar", "measureeval.jar"]
# Run from extracted classes with CDS (using current folder for classpath)
ENTRYPOINT ["java", "-XX:SharedArchiveFile=application.jsa", "--add-opens", "java.base/java.util=ALL-UNNAMED", "org.springframework.boot.loader.launch.JarLauncher"]
4 changes: 1 addition & 3 deletions Java/measureeval/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-extension-autoconfigure</artifactId>
<version>1.38.0</version>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
Expand All @@ -139,8 +138,8 @@
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-kafka-clients-2.6</artifactId>
<version>2.4.0-alpha</version>
</dependency>

<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-runtime-telemetry-java17</artifactId>
Expand Down Expand Up @@ -174,7 +173,6 @@
<execution>
<goals>
<goal>build-info</goal>
<goal>repackage</goal>
</goals>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.lantanagroup.link.shared.config.TelemetryConfig;
import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.api.common.AttributeKey;
import io.opentelemetry.api.trace.propagation.W3CTraceContextPropagator;
import io.opentelemetry.context.propagation.ContextPropagators;
import io.opentelemetry.context.propagation.TextMapPropagator;
Expand All @@ -14,7 +15,6 @@
import io.opentelemetry.sdk.resources.Resource;
import io.opentelemetry.sdk.trace.SdkTracerProvider;
import io.opentelemetry.sdk.trace.export.BatchSpanProcessor;
import io.opentelemetry.semconv.ResourceAttributes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
Expand All @@ -36,7 +36,7 @@ public OpenTelemetryConfig (TelemetryConfig telemetryConfig) {

@Bean
public OpenTelemetry openTelemetry () {
Resource resource = Resource.getDefault().toBuilder().put(ResourceAttributes.SERVICE_NAME, serviceName).build();
Resource resource = Resource.getDefault().toBuilder().put(AttributeKey.stringKey("service.name"), serviceName).build();

if (this.telemetryConfig == null || this.telemetryConfig.getExporterEndpoint() == null) {
logger.warn("Telemetry configuration is not set. OpenTelemetry will not be initialized.");
Expand Down
3 changes: 3 additions & 0 deletions Java/measureeval/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ springdoc:
enabled: false

spring:
threads:
virtual:
enabled: true

cloud:
discovery:
Expand Down
59 changes: 44 additions & 15 deletions Java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<version>3.4.3</version>
<relativePath/>
</parent>

Expand All @@ -20,10 +20,13 @@
<description>Project/folder of Java modules/services for Link</description>

<properties>
<java.version>21</java.version>
<cqf-fhir.version>3.12.0</cqf-fhir.version>
<hapi-fhir.version>7.6.1</hapi-fhir.version>
<janino.version>2.7.8</janino.version>
<jacoco.version>0.8.12</jacoco.version>
<spring-cloud.version>2024.0.0</spring-cloud.version>
<spring-cloud-azure.version>5.19.0</spring-cloud-azure.version>
</properties>

<modules>
Expand Down Expand Up @@ -59,25 +62,61 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>6.2.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations-jakarta</artifactId>
<version>2.2.28</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-models-jakarta</artifactId>
<version>2.2.28</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-core-jakarta</artifactId>
<version>2.2.28</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-dependencies</artifactId>
<version>${spring-cloud-azure.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-bom</artifactId>
<version>1.38.0</version>
<version>1.47.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-instrumentation-bom-alpha</artifactId>
<version>2.4.0-alpha</version>
<version>2.13.0-alpha</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-runtime-telemetry-java17</artifactId>
<version>2.4.0-alpha</version>
<version>2.13.0-alpha</version>
</dependency>
Comment on lines 101 to 120

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify OpenTelemetry API changes that might affect code in the repository
# Search for OpenTelemetry usage patterns that may have changed between versions

echo "=== Searching for ResourceAttributes usage (deprecated in newer versions) ==="
rg -n "ResourceAttributes" --type java

echo "=== Searching for OpenTelemetry SDK configuration patterns ==="
rg -n "SdkTracerProvider|SdkMeterProvider|AutoConfiguredOpenTelemetrySdk" --type java

Repository: lantanagroup/link-cloud

Length of output: 1503


🏁 Script executed:

cat -n Java/validation/src/main/java/com/lantanagroup/link/validation/configs/OpenTelemetryConfig.java

Repository: lantanagroup/link-cloud

Length of output: 4410


🏁 Script executed:

cat -n Java/measureeval/src/main/java/com/lantanagroup/link/measureeval/configs/OpenTelemetryConfig.java

Repository: lantanagroup/link-cloud

Length of output: 4028


🏁 Script executed:

# Check if there are any other OpenTelemetry related files
fd -e java -t f | xargs grep -l "opentelemetry" | head -20

Repository: lantanagroup/link-cloud

Length of output: 1550


🏁 Script executed:

grep -n "opentelemetry" Java/measureeval/src/main/java/com/lantanagroup/link/measureeval/services/MeasureEvalMetrics.java

Repository: lantanagroup/link-cloud

Length of output: 309


🏁 Script executed:

grep -n "opentelemetry" Java/validation/src/main/java/com/lantanagroup/link/validation/services/MetricService.java

Repository: lantanagroup/link-cloud

Length of output: 219


🏁 Script executed:

grep -n "opentelemetry" Java/measureeval/src/main/java/com/lantanagroup/link/measureeval/filters/TracingFilter.java

Repository: lantanagroup/link-cloud

Length of output: 108


🌐 Web query:

OpenTelemetry Java 1.38.0 to 1.47.0 breaking changes migration guide

💡 Result:

OpenTelemetry Java (opentelemetry-java) migration: 1.38.0 → 1.47.0 (breaking changes you must handle)

Use the BOM and upgrade all io.opentelemetry:* artifacts in lockstep to avoid runtime linkage issues (recommended for this repo).

1) 1.39.0 (2024-06-07) — Incubator + Prometheus exporter breaking changes

  • Incubator: ExtendedTracer / ExtendedSpanBuilder refactor (expect compilation fixes if you use the incubator APIs; update imports/usages to the new shapes). [1]
  • Prometheus exporter: Prometheus metrics are served only on /metrics by default (update your scrape config / reverse-proxy routing accordingly). [1]

2) 1.42.0 (2024-09-06) — Logs AnyValue body stabilization (type + package rename)

  • Breaking: Log body “AnyValue” stabilization:
    • AnyValue renamed to Value
    • moved from opentelemetry-api-incubator to opentelemetry-api
    • package changed from io.opentelemetry.api.incubator.logs to io.opentelemetry.api.common [2]
      Migration: update dependencies (stop relying on incubator for this) and fix imports/types to io.opentelemetry.api.common.Value.

3) 1.46.0 (2025-01-10) — Autoconfigure: deprecated property removed

  • Breaking: autoconfigure dropped support for deprecated otel.experimental.resource.disabled.keys.
    Migration: use otel.resource.disabled.keys instead. [3]

4) 1.47.0 (2025-02-07) — Event API/SDK removed

  • Breaking: Event API / SDK dropped. [4]
    Migration: replace Event API usage with the Logs API (and/or incubator helpers added around log “event name”, e.g. ExtendedLogRecordBuilder#setEventName, depending on what you were doing). [4]

Quick “what to do” checklist

  1. Update your BOM: io.opentelemetry:opentelemetry-bom:1.47.0 (and keep all OTel module versions aligned).
  2. If you use Prometheus exporter: ensure your Prometheus job scrapes /metrics. [1]
  3. If you emit structured log bodies: migrate AnyValueValue and fix imports/packages. [2]
  4. If you relied on Event API: migrate to Logs (Event API is gone in 1.47.0). [4]
  5. If you use autoconfigure resource-key disabling: replace otel.experimental.resource.disabled.keys with otel.resource.disabled.keys. [3]

Sources: OpenTelemetry Java CHANGELOG.md for 1.39.0, 1.42.0, 1.46.0, 1.47.0. [1][2][3][4]


🌐 Web query:

OpenTelemetry Instrumentation 2.4.0-alpha to 2.13.0-alpha breaking changes

💡 Result:

Breaking / migration-impacting changes called out in upstream opentelemetry-java-instrumentation release notes between v2.4.0 and v2.13.0 (these affect the 2.x.y-alpha artifacts shipped with each release):

  • v2.13.0 (2025-02-17)

    • io.opentelemetry.instrumentation.api.incubator.semconv.util.SpanNames deprecated → use stable io.opentelemetry.instrumentation.api.semconv.util.SpanNames.
    • Previously-deprecated HTTP library instrumentation classes/methods removed (from prior two releases).
    • Deprecated Dubbo instrumentation method removed. [1]
  • v2.12.0 (2025-01-17)

    • Some Java agent instrumentation suppression keys renamed to match module names (e.g., elasticsearch-rest-6.0elasticsearch-rest-6.4, internal-application-logginginternal-application-logger, etc.).
    • *TelemetryBuilder API parameter types changed: setCaptured*Headers(List)setCaptured*Headers(Collection); setKnownMethods(Set)setKnownMethods(Collection). [2]
  • v2.11.0 (2024-12-23) (prep for HTTP instrumentation stabilization)

    • addAttributeExtractor deprecated/renamedaddAttributesExtractor.
    • setEmitExperimental* deprecated and moved to internal/experimental classes.
    • ApacheHttpClient5* deprecated/renamedApacheHttpClient*.
    • RatpackTelemetry*, SpringWebfluxTelemetry*, ArmeriaTelemetry* deprecated/split into *ClientTelemetry* and *ServerTelemetry*.
    • *Ktor*Tracing* deprecated/renamed*Ktor*Telemetry*.
    • Experimental attribute spring-webflux.handler.type removed (use code.* attributes). [3]
  • v2.10.0 (2024-11-13)

    • Spring Boot Starter scheduling instrumentation scope name changed: io.opentelemetry.spring-scheduling-3.1io.opentelemetry.spring-boot-autoconfigure.
    • AWS Lambda javaagent default flush timeout changed 1s → 10s. [4]
  • v2.9.0 (2024-10-17)

    • Opt-in attribute renamed aws.requestIdaws.request_id, and it is now emitted by default. [5]
  • v2.8.0 (2024-09-13)

    • Java 17 JFR-based runtime metrics unit changed milliseconds → seconds (only if opted-in via otel.instrumentation.runtime-telemetry-java17.enable-all=true). [6]
  • v2.6.0 (2024-07-17)

    • Spring Boot autoconfigure artifacts merged: opentelemetry-spring-boot + opentelemetry-spring-boot-3opentelemetry-spring-boot-autoconfigure (supports both Boot 2 & 3).
    • Experimental HTTP metrics renamed: http.server.request.sizehttp.server.request.body.size; http.server.response.sizehttp.server.response.body.size. [7]
  • v2.4.0 (2024-05-17)

    • Removed incubating semconv dependency from library instrumentation (can affect dependency graphs). [8]

Sources: GitHub release notes for v2.13.0 [1], v2.12.0 [2], v2.11.0 [3], v2.10.0 [4], v2.9.0 [5], v2.8.0 [6], v2.6.0 [7], v2.4.0 [8].


Verify RuntimeMetrics metric unit compatibility with downstream systems.

The OpenTelemetry BOM update (1.38.0 → 1.47.0) and instrumentation update (2.4.0-alpha → 2.13.0-alpha) introduce significant changes. Most breaking changes in these ranges do not affect the code here (e.g., Event API removal, AnyValue renaming, Prometheus exporter config). However, v2.8.0 introduced a breaking change directly affecting this codebase: Java 17 runtime metrics now emit in seconds instead of milliseconds when using RuntimeMetrics.builder().enableAllFeatures().build() (lines 71 in both OpenTelemetryConfig files).

Confirm that downstream systems consuming these metrics expect second-based units, or update the metric unit configuration accordingly.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Java/pom.xml` around lines 101 - 120, The RuntimeMetrics behavior changed in
the updated OpenTelemetry/instrumentation BOMs:
RuntimeMetrics.builder().enableAllFeatures().build() in your OpenTelemetryConfig
files now emits JVM runtime metrics in seconds (v2.8.0+); confirm downstream
consumers expect seconds and, if they expect milliseconds, either change the
consumers to interpret the unit as seconds or modify the metrics pipeline in
your OpenTelemetryConfig to convert values back to milliseconds and set the
metric unit to "ms" (or explicitly set the unit via the runtime metric
configuration API if available) so
RuntimeMetrics.builder().enableAllFeatures().build() produces values and unit
compatible with downstream systems.


<dependency>
Expand All @@ -92,11 +131,6 @@
<version>${janino.version}</version>
</dependency>

<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-appconfiguration-config-web</artifactId>
<version>5.11.0</version>
</dependency>

<dependency>
<groupId>io.jsonwebtoken</groupId>
Expand Down Expand Up @@ -126,7 +160,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi</artifactId>
<version>2.5.0</version>
<version>2.8.5</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -171,11 +205,6 @@
<scope>import</scope>
</dependency>

<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-blob</artifactId>
<version>12.32.0</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
11 changes: 8 additions & 3 deletions Java/validation/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM maven:3-eclipse-temurin-17 AS build
FROM maven:3-eclipse-temurin-21 AS build

WORKDIR /app

Expand All @@ -13,13 +13,18 @@ COPY --chown=mvn:mvn ./ ./
#RUN chmod +x ./mvn
RUN mvn -pl validation -am -Dmaven.test.skip=true package

FROM eclipse-temurin:17-alpine AS run
FROM eclipse-temurin:21-alpine AS run
RUN apk add --no-cache curl
WORKDIR /app
COPY --from=build /app/validation/target/validation-*.jar validation.jar

# Extract using tools jarmode (replacement for layertools and cds in SB 3.4)
RUN java -Djarmode=tools -jar validation.jar extract --launcher --destination . --force

RUN chmod -R 755 /app \
&& chown -R 1001 /app

USER 1001
EXPOSE 5135
CMD ["java", "--add-opens", "java.base/java.util=ALL-UNNAMED", "-jar", "validation.jar"]
# Run from extracted classes with CDS (using current folder for classpath)
ENTRYPOINT ["java", "-XX:SharedArchiveFile=application.jsa", "--add-opens", "java.base/java.util=ALL-UNNAMED", "org.springframework.boot.loader.launch.JarLauncher"]
3 changes: 1 addition & 2 deletions Java/validation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-extension-autoconfigure</artifactId>
<version>1.57.0</version>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
Expand All @@ -157,8 +156,8 @@
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-kafka-clients-2.6</artifactId>
<version>2.4.0-alpha</version>
</dependency>

<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-runtime-telemetry-java17</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.lantanagroup.link.shared.config.TelemetryConfig;
import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.api.common.AttributeKey;
import io.opentelemetry.api.metrics.Meter;
import io.opentelemetry.api.trace.propagation.W3CTraceContextPropagator;
import io.opentelemetry.context.propagation.ContextPropagators;
Expand All @@ -15,7 +16,6 @@
import io.opentelemetry.sdk.resources.Resource;
import io.opentelemetry.sdk.trace.SdkTracerProvider;
import io.opentelemetry.sdk.trace.export.BatchSpanProcessor;
import io.opentelemetry.semconv.ResourceAttributes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
Expand All @@ -37,7 +37,7 @@ public OpenTelemetryConfig (TelemetryConfig telemetryConfig) {

@Bean
public OpenTelemetry openTelemetry () {
Resource resource = Resource.getDefault().toBuilder().put(ResourceAttributes.SERVICE_NAME, serviceName).build();
Resource resource = Resource.getDefault().toBuilder().put(AttributeKey.stringKey("service.name"), serviceName).build();

if (this.telemetryConfig == null || this.telemetryConfig.getExporterEndpoint() == null || this.telemetryConfig.getExporterEndpoint().isEmpty()) {
logger.warn("Telemetry configuration is not set. OpenTelemetry will not be initialized.");
Expand Down
Loading
Loading