Add filtering of messages

Change-Id: I56fc172a1424bd3f5e0a217aef2fe8914950fbc5
This commit is contained in:
jmarchel7bulls 2024-05-14 10:16:29 +02:00
parent c4fa56635f
commit 82053168f8
5 changed files with 29 additions and 9 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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);