add monitoring of Spring Boot Camel routes
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
This commit is contained in:
@@ -28,16 +28,11 @@ plugins {
|
|||||||
alias(libs.plugins.spring.dependencies)
|
alias(libs.plugins.spring.dependencies)
|
||||||
alias(libs.plugins.vaadin)
|
alias(libs.plugins.vaadin)
|
||||||
alias(libs.plugins.lombok)
|
alias(libs.plugins.lombok)
|
||||||
//alias(libs.plugins.asciidoctorPdf)
|
|
||||||
//alias(libs.plugins.asciidoctorConvert)
|
|
||||||
//alias(libs.plugins.asciidoctorGems)
|
|
||||||
//id "de.infolektuell.typst" version "0.8.0"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven { setUrl("https://nexus.thpeetz.de/repository/maven-central") }
|
maven { setUrl("https://nexus.thpeetz.de/repository/maven-central") }
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
//ruby.gems()
|
|
||||||
maven { setUrl("https://maven.vaadin.com/vaadin-prereleases") }
|
maven { setUrl("https://maven.vaadin.com/vaadin-prereleases") }
|
||||||
maven { setUrl("https://repo.spring.io/milestone") }
|
maven { setUrl("https://repo.spring.io/milestone") }
|
||||||
maven { setUrl("https://maven.vaadin.com/vaadin-addons") }
|
maven { setUrl("https://maven.vaadin.com/vaadin-addons") }
|
||||||
@@ -63,11 +58,15 @@ dependencies {
|
|||||||
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
||||||
implementation 'org.apache.camel.springboot:camel-spring-boot-starter'
|
implementation 'org.apache.camel.springboot:camel-spring-boot-starter'
|
||||||
implementation 'org.apache.camel.springboot:camel-jms-starter'
|
implementation 'org.apache.camel.springboot:camel-jms-starter'
|
||||||
|
implementation 'org.apache.camel.springboot:camel-metrics-starter'
|
||||||
|
implementation 'org.apache.camel.springboot:camel-micrometer-starter'
|
||||||
implementation 'org.apache.activemq:artemis-jakarta-client'
|
implementation 'org.apache.activemq:artemis-jakarta-client'
|
||||||
//implementation libs.artemis
|
//implementation libs.artemis
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-actuator'
|
implementation 'org.springframework.boot:spring-boot-starter-actuator'
|
||||||
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
||||||
implementation 'io.micrometer:micrometer-registry-prometheus'
|
implementation 'io.micrometer:micrometer-registry-prometheus'
|
||||||
|
implementation libs.jolokia.core
|
||||||
|
implementation libs.prometheus.collector
|
||||||
implementation 'org.springframework.security:spring-security-oauth2-jose'
|
implementation 'org.springframework.security:spring-security-oauth2-jose'
|
||||||
implementation 'org.springframework.security:spring-security-oauth2-resource-server'
|
implementation 'org.springframework.security:spring-security-oauth2-resource-server'
|
||||||
implementation 'com.h2database:h2'
|
implementation 'com.h2database:h2'
|
||||||
@@ -90,8 +89,6 @@ dependencies {
|
|||||||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
||||||
compileOnly 'org.projectlombok:lombok'
|
compileOnly 'org.projectlombok:lombok'
|
||||||
annotationProcessor 'org.projectlombok:lombok'
|
annotationProcessor 'org.projectlombok:lombok'
|
||||||
//asciidoctorGems libs.rouge
|
|
||||||
//asciidoctorGems libs.diagram
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencyManagement {
|
dependencyManagement {
|
||||||
@@ -117,11 +114,6 @@ publishing {
|
|||||||
password = project.findProperty('nexusPassword')
|
password = project.findProperty('nexusPassword')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// maven {
|
|
||||||
// name = "gitlabPackageRegistry"
|
|
||||||
// url = uri("https://gitlab.com/api/v4/projects/64726715/packages/maven")
|
|
||||||
// credentials(PasswordCredentials)
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,19 +3,14 @@ gradle = "8.6"
|
|||||||
args4j = "2.33"
|
args4j = "2.33"
|
||||||
commonscli = "1.5.0"
|
commonscli = "1.5.0"
|
||||||
junit = "5.8.2"
|
junit = "5.8.2"
|
||||||
logback = "1.1.2"
|
logback = "1.6.3"
|
||||||
mockito = "1.9.5"
|
mockito = "1.9.5"
|
||||||
picoli = "4.7.0"
|
picoli = "4.7.0"
|
||||||
slf4j = "1.7.22"
|
slf4j = "2.0.18"
|
||||||
hsqldb = "2.7.1"
|
hsqldb = "2.7.1"
|
||||||
sqlite = "3.25.2"
|
sqlite = "3.25.2"
|
||||||
spotbugs = "6.0.7"
|
spotbugs = "6.0.7"
|
||||||
#asciidoctor = "4.0.2"
|
|
||||||
#rouge = "3.15.0"
|
|
||||||
#diagram = "2.2.2"
|
|
||||||
#diagram = "2.3.1"
|
|
||||||
sonarqube = "3.3"
|
sonarqube = "3.3"
|
||||||
cimtConventions = "1.0.0-SNAPSHOT"
|
|
||||||
springboot = "3.2.5"
|
springboot = "3.2.5"
|
||||||
springdependencies = "1.1.4"
|
springdependencies = "1.1.4"
|
||||||
vaadin = "24.4.23"
|
vaadin = "24.4.23"
|
||||||
@@ -27,6 +22,8 @@ jackson = "2.16.1"
|
|||||||
json_simple = "1.1.1"
|
json_simple = "1.1.1"
|
||||||
mail = "1.6.2"
|
mail = "1.6.2"
|
||||||
hypersistence = "3.9.10"
|
hypersistence = "3.9.10"
|
||||||
|
jolokia = "2.6.1"
|
||||||
|
prometheus = "1.6.0"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
args4j = { module = "args4j:args4j", version.ref = "args4j" }
|
args4j = { module = "args4j:args4j", version.ref = "args4j" }
|
||||||
@@ -47,11 +44,8 @@ hypersistence = { module = "io.hypersistence:hypersistence-utils-hibernate-63",
|
|||||||
vaadin-bom = { module = "com.vaadin:vaadin-bom", version.ref = "vaadin" }
|
vaadin-bom = { module = "com.vaadin:vaadin-bom", version.ref = "vaadin" }
|
||||||
camel-bom = { module = "org.apache.camel.springboot:camel-spring-boot-bom", version.ref = "camel"}
|
camel-bom = { module = "org.apache.camel.springboot:camel-spring-boot-bom", version.ref = "camel"}
|
||||||
artemis = { module = "org.apache.activemq:artemis-jms-server", version.ref = "artemis" }
|
artemis = { module = "org.apache.activemq:artemis-jms-server", version.ref = "artemis" }
|
||||||
#asciidoctorGradleJvmGems = { module = "org.asciidoctor:asciidoctor-gradle-jvm-gems", version.ref= "asciidoctor" }
|
jolokia-core = { module = "org.jolokia:jolokia-core", version.ref = "jolokia" }
|
||||||
#asciidoctorGradleJvm = { module = "org.asciidoctor:asciidoctor-gradle-jvm", version.ref= "asciidoctor" }
|
prometheus-collector = { module = "io.prometheus.jmx:collector", version.ref = "prometheus" }
|
||||||
#asciidoctorGradleJvmPdf = { module = "org.asciidoctor:asciidoctor-gradle-jvm-pdf", version.ref= "asciidoctor" }
|
|
||||||
#rouge = { module = "rubygems:rouge", version.ref = "rouge" }
|
|
||||||
#diagram = { module = "rubygems:asciidoctor-diagram", version.ref = "diagram" }
|
|
||||||
|
|
||||||
[bundles]
|
[bundles]
|
||||||
logback = ["logbackCore", "logbackClassic"]
|
logback = ["logbackCore", "logbackClassic"]
|
||||||
@@ -59,13 +53,6 @@ logback = ["logbackCore", "logbackClassic"]
|
|||||||
[plugins]
|
[plugins]
|
||||||
spotbugs = { id = "com.github.spotbugs", version.ref = "spotbugs" }
|
spotbugs = { id = "com.github.spotbugs", version.ref = "spotbugs" }
|
||||||
sonarqube = { id = "org.sonarqube", version.ref = "sonarqube" }
|
sonarqube = { id = "org.sonarqube", version.ref = "sonarqube" }
|
||||||
#asciidoctorPdf = { id = "org.asciidoctor.jvm.pdf", version.ref = "asciidoctor" }
|
|
||||||
#asciidoctorConvert = { id = "org.asciidoctor.jvm.convert", version.ref = "asciidoctor" }
|
|
||||||
#asciidoctorGems = { id = "org.asciidoctor.jvm.gems", version.ref = "asciidoctor" }
|
|
||||||
javaConvention = { id = "de.cimt.java-conventions", version.ref = "cimtConventions" }
|
|
||||||
applicationConvention = { id = "de.cimt.application-conventions", version.ref = "cimtConventions" }
|
|
||||||
libraryConvention = { id = "de.cimt.library-conventions", version.ref = "cimtConventions" }
|
|
||||||
#asciidoctorConvention = { id = "de.cimt.asciidoctor-conventions", version.ref = "cimtConventions" }
|
|
||||||
spring-boot = { id = "org.springframework.boot", version.ref = "springboot"}
|
spring-boot = { id = "org.springframework.boot", version.ref = "springboot"}
|
||||||
spring-dependencies = { id = "io.spring.dependency-management", version.ref = "springdependencies" }
|
spring-dependencies = { id = "io.spring.dependency-management", version.ref = "springdependencies" }
|
||||||
vaadin = { id = "com.vaadin", version.ref = "vaadin" }
|
vaadin = { id = "com.vaadin", version.ref = "vaadin" }
|
||||||
|
|||||||
@@ -1,15 +1,28 @@
|
|||||||
package de.thpeetz.kontor;
|
package de.thpeetz.kontor;
|
||||||
|
|
||||||
|
import org.apache.camel.CamelContext;
|
||||||
|
import org.apache.camel.component.micrometer.MicrometerConstants;
|
||||||
|
import org.apache.camel.component.micrometer.messagehistory.MicrometerMessageHistoryFactory;
|
||||||
|
import org.apache.camel.component.micrometer.routepolicy.MicrometerRoutePolicyFactory;
|
||||||
|
import org.apache.camel.spring.boot.CamelContextConfiguration;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
|
||||||
import com.vaadin.flow.component.page.AppShellConfigurator;
|
import com.vaadin.flow.component.page.AppShellConfigurator;
|
||||||
import com.vaadin.flow.server.PWA;
|
import com.vaadin.flow.server.PWA;
|
||||||
import com.vaadin.flow.theme.Theme;
|
import com.vaadin.flow.theme.Theme;
|
||||||
|
|
||||||
|
import io.micrometer.core.instrument.Clock;
|
||||||
|
import io.micrometer.prometheus.PrometheusConfig;
|
||||||
|
import io.micrometer.prometheus.PrometheusMeterRegistry;
|
||||||
|
import io.prometheus.client.CollectorRegistry;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
|
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@EnableJpaAuditing
|
@EnableJpaAuditing
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@@ -17,6 +30,27 @@ import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
|
|||||||
@PWA(name = "Vaadin Kontor", shortName = "Kontor", offlinePath = "offline.html", offlineResources = { "images/offline.png" })
|
@PWA(name = "Vaadin Kontor", shortName = "Kontor", offlinePath = "offline.html", offlineResources = { "images/offline.png" })
|
||||||
public class Application implements AppShellConfigurator {
|
public class Application implements AppShellConfigurator {
|
||||||
|
|
||||||
|
@Bean(name = { MicrometerConstants.METRICS_REGISTRY_NAME, "prometheusMeterRegistry" })
|
||||||
|
public PrometheusMeterRegistry prometheusMeterRegistry(
|
||||||
|
PrometheusConfig prometheusConfig, CollectorRegistry collectorRegistry, Clock clock) {
|
||||||
|
return new PrometheusMeterRegistry(prometheusConfig, collectorRegistry, clock);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public CamelContextConfiguration camelContextConfiguration(@Autowired PrometheusMeterRegistry registry) {
|
||||||
|
return new CamelContextConfiguration() {
|
||||||
|
@Override
|
||||||
|
public void beforeApplicationStart(CamelContext camelContext) {
|
||||||
|
camelContext.addRoutePolicyFactory(new MicrometerRoutePolicyFactory());
|
||||||
|
camelContext.setMessageHistoryFactory(new MicrometerMessageHistoryFactory());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterApplicationStart(CamelContext camelContext) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
log.info("Starting Kontor application");
|
log.info("Starting Kontor application");
|
||||||
SpringApplication.run(Application.class);
|
SpringApplication.run(Application.class);
|
||||||
|
|||||||
@@ -25,6 +25,9 @@ spring:
|
|||||||
max-file-size: 10MB
|
max-file-size: 10MB
|
||||||
max-request-size: 10MB
|
max-request-size: 10MB
|
||||||
camel:
|
camel:
|
||||||
|
component:
|
||||||
|
metrics:
|
||||||
|
metric-registry: prometheusMeterRegistry
|
||||||
cloud:
|
cloud:
|
||||||
enabled: true
|
enabled: true
|
||||||
springboot:
|
springboot:
|
||||||
|
|||||||
Reference in New Issue
Block a user