diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 248f0f5..f843e9c 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -15,6 +15,7 @@ <sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> <outputRelativeToContentRoot value="true" /> <module name="prediction-orchestrator" /> + <module name="predictionorchestrator" /> </profile> </annotationProcessing> <bytecodeTargetLevel> @@ -27,6 +28,7 @@ <component name="JavacSettings"> <option name="ADDITIONAL_OPTIONS_OVERRIDE"> <module name="prediction-orchestrator" options="-parameters" /> + <module name="predictionorchestrator" options="-parameters" /> </option> </component> </project> \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml index 38dde96..70f3ca2 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,6 @@ <project version="4"> <component name="ProjectModuleManager"> <modules> - <module fileurl="file://$PROJECT_DIR$/.idea/modules/com.example.prediction-orchestrator.main.iml" filepath="$PROJECT_DIR$/.idea/modules/com.example.prediction-orchestrator.main.iml" /> <module fileurl="file://$PROJECT_DIR$/.idea/prediction-orchestrator.iml" filepath="$PROJECT_DIR$/.idea/prediction-orchestrator.iml" /> </modules> </component> diff --git a/.idea/prediction-orchestrator.iml b/.idea/prediction-orchestrator.iml index efb4d78..d6ebd48 100644 --- a/.idea/prediction-orchestrator.iml +++ b/.idea/prediction-orchestrator.iml @@ -1,13 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <module type="JAVA_MODULE" version="4"> - <component name="AdditionalModuleElements"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> <content url="file://$MODULE_DIR$" /> - </component> - <component name="TemplatesService"> - <option name="TEMPLATE_FOLDERS"> - <list> - <option value="$MODULE_DIR$/charts/nebulous-prediction-orchestrator/templates" /> - </list> - </option> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> </component> </module> \ No newline at end of file diff --git a/prediction-orchestrator/pom.xml b/prediction-orchestrator/pom.xml index b25471b..19333ac 100644 --- a/prediction-orchestrator/pom.xml +++ b/prediction-orchestrator/pom.xml @@ -21,6 +21,11 @@ <artifactId>spring-boot-starter</artifactId> </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-core</artifactId> + <version>2.13.0</version> <!-- Use the latest version available --> + </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> @@ -31,6 +36,11 @@ <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-databind</artifactId> + <version>2.15.2</version> <!-- Update to the latest version --> + </dependency> <dependency> <groupId>eu.nebulouscloud</groupId> diff --git a/prediction-orchestrator/src/main/java/eu/nebulouscloud/predictionorchestrator/ApplicationSpecificPredictionConsumer.java b/prediction-orchestrator/src/main/java/eu/nebulouscloud/predictionorchestrator/ApplicationSpecificPredictionConsumer.java index 76426f5..24ee749 100644 --- a/prediction-orchestrator/src/main/java/eu/nebulouscloud/predictionorchestrator/ApplicationSpecificPredictionConsumer.java +++ b/prediction-orchestrator/src/main/java/eu/nebulouscloud/predictionorchestrator/ApplicationSpecificPredictionConsumer.java @@ -48,9 +48,22 @@ public class ApplicationSpecificPredictionConsumer extends Consumer { String metricName = parts[parts.length - 1]; log.debug("Extracted metric name: {}", metricName); // Log the extracted metric name + // Remove "app_wide_scope_" prefix if present + if (metricName.startsWith("app_wide_scope_")) { + metricName = metricName.substring(16); + log.debug("Removed 'app_wide_scope_' prefix. New metric name: {}", metricName); + } + String publisherKey = "predicted_metrics_" + metricName; PredictedMetricsPublisher predictedMetricsPublisher = (PredictedMetricsPublisher) ctx.getPublisher(publisherKey); + // Remove "app_wide_scope_" prefix if present + if (metricName.startsWith("app_wide_scope_")) { + metricName = metricName.substring(16); + log.debug("Removed 'app_wide_scope_' prefix. New metric name: {}", metricName); + } + + if (predictedMetricsPublisher == null) { log.info("PredictedMetricsPublisher for metric {} not found, creating a new one.", metricName); predictedMetricsPublisher = new PredictedMetricsPublisher(metricName);