Add MeterRegistry monitoring

- update and cleanup in README.md
- extract webclient call from registerDevice and add metrics in DeviceRegistryService
- add WebClientCalls.kt
- update kotlin logging dependency
- add MeterRegistry dependency
This commit is contained in:
2024-12-20 17:09:22 +01:00
parent 10f6486e37
commit 93680e50d5
9 changed files with 138 additions and 52 deletions

View File

@@ -1,3 +1,5 @@
import com.bmuschko.gradle.docker.tasks.container.DockerCreateContainer
plugins {
alias(hlaeja.plugins.kotlin.jvm)
alias(hlaeja.plugins.kotlin.spring)
@@ -13,6 +15,7 @@ dependencies {
implementation(hlaeja.kotlin.reflect)
implementation(hlaeja.kotlinx.coroutines)
implementation(hlaeja.library.hlaeja.common.messages)
implementation(hlaeja.micrometer.registry.influx)
implementation(hlaeja.springboot.starter.actuator)
implementation(hlaeja.springboot.starter.webflux)
@@ -27,6 +30,17 @@ dependencies {
group = "ltd.hlaeja"
tasks.named("processResources") {
dependsOn("copyCertificates")
fun influxDbToken(): String = config.findOrDefault("influxdb.token", "INFLUXDB_TOKEN", "")
tasks {
named("containerCreate", DockerCreateContainer::class) {
withEnvVar("MANAGEMENT_INFLUX_METRICS_EXPORT_TOKEN", influxDbToken())
}
withType<ProcessResources> {
filesMatching("**/application.yml") { filter { it.replace("%INFLUXDB_TOKEN%", influxDbToken()) } }
onlyIf { file("src/main/resources/application.yml").exists() }
}
named("processResources") {
dependsOn("copyCertificates")
}
}