diff --git a/build.gradle.kts b/build.gradle.kts index 9eabc4e..68ec74c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -65,11 +65,13 @@ dependencyManagement { // https://javadoc.io/doc/org.mockito/mockito-core/latest/org.mockito/org/mockito/Mockito.html#0.3 val mockitoAgent = configurations.create("mockitoAgent") dependencies { + implementation("org.springframework.boot:spring-boot-starter-actuator") implementation("org.springframework.boot:spring-boot-starter-validation") implementation("org.springframework.boot:spring-boot-starter-webflux") implementation("org.springframework.cloud:spring-cloud-starter-consul-config") compileOnly("org.projectlombok:lombok") annotationProcessor("org.projectlombok:lombok") + runtimeOnly("io.micrometer:micrometer-registry-prometheus") // clevermicro implementation("com.cleverthis.clevermicro:core:0.2.0-SNAPSHOT") @@ -77,6 +79,10 @@ dependencies { // keycloak admin client implementation("org.keycloak:keycloak-admin-client:26.0.6") + // opentelemetry + implementation(platform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:2.11.0")) + implementation("io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter") + testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("io.projectreactor:reactor-test") testRuntimeOnly("org.junit.platform:junit-platform-launcher") diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 3680720..7f7b362 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -54,4 +54,26 @@ logging: # Set log levels as needed. com.clevermicro.authservice: DEBUG org.springframework.web.client.RestTemplate: DEBUG - reactor.netty.http.client: DEBUG \ No newline at end of file + reactor.netty.http.client: DEBUG + +# Enable prometheus endpoint +management: + endpoint: + prometheus: + access: read_only + web: + exposure: + include: health,prometheus +# OpenTelemetry +otel: + logs: + exporter: otlp + exporter: + otlp: + logs: + endpoint: ${OTLP_LOG_ENDPOINT:http://victorialogs.dev.localhost/insert/opentelemetry/v1/logs} + # for now disable the tracing and metrics exporter + traces: + exporter: none + metrics: + exporter: none \ No newline at end of file diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml new file mode 100644 index 0000000..e44914f --- /dev/null +++ b/src/test/resources/application.yml @@ -0,0 +1,12 @@ +spring: + cloud: + consul: + config: + enabled: false +otel: + logs: + exporter: none + traces: + exporter: none + metrics: + exporter: none \ No newline at end of file