Skip to content
Snippets Groups Projects
Commit f2e26bd0 authored by Benedikt Wetzel's avatar Benedikt Wetzel
Browse files

Load paramter via quarkus configuration mechanism

parent 33d7d120
No related branches found
No related tags found
1 merge request!180Make the analysis of experiments more flexible
......@@ -51,7 +51,7 @@ class AnalysisExecutor(
fetcher.fetchMetric(
start = interval.first,
end = interval.second,
query = slo.query
query = SloConfigHandler.getQueryString(sloType = slo.sloType)
)
}
......
package theodolite.evaluation
import theodolite.util.InvalidPatcherConfigurationException
import theodolite.util.TheodoliteConfig
import javax.inject.Inject
class SloConfigHandler {
companion object {
@Inject
lateinit var config: TheodoliteConfig
fun getQueryString(sloType: String): String {
return when (sloType){
"Lag Trend" -> config.PROM_RECORD_LAG_QUERY
"Dropped Records" -> config.PROM_DROPPED_RECORDS_QUERY
else -> throw InvalidPatcherConfigurationException("Could not find Prometheus query string for slo type $sloType")
}
}
}
}
\ No newline at end of file
package theodolite.util
import io.quarkus.arc.config.ConfigProperties
import org.eclipse.microprofile.config.inject.ConfigProperty
import javax.enterprise.context.ApplicationScoped
import javax.inject.Inject
import javax.inject.Singleton
@ApplicationScoped
class TheodoliteConfig{
@ConfigProperty(name = "prom.dropped.records.query")
lateinit var PROM_DROPPED_RECORDS_QUERY: String
@ConfigProperty(name = "prom.record.lag.query")
lateinit var PROM_RECORD_LAG_QUERY: String
}
\ No newline at end of file
......@@ -4,3 +4,6 @@ quarkus.native.additional-build-args=\
--initialize-at-run-time=io.fabric8.kubernetes.client.dsl.internal.core.v1.PodOperationsImpl$1,\
--initialize-at-run-time=io.fabric8.kubernetes.client.dsl.internal.core.v1.PodOperationsImpl$3,\
--report-unsupported-elements-at-runtime
prom.record.lag.query="sum by(group)(kafka_consumergroup_group_lag >= 0)"
prom.dropped.records.query="todo"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment