generated from pricelees/issue-pr-template
[#54] 애플리케이션 배포 #55
@ -1,28 +1,20 @@
|
||||
package com.sangdol.roomescape.common.config
|
||||
|
||||
import io.micrometer.observation.ObservationPredicate
|
||||
import jakarta.servlet.http.HttpServletRequest
|
||||
import org.springframework.beans.factory.annotation.Value
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import org.springframework.http.server.observation.ServerRequestObservationContext
|
||||
|
||||
@Configuration
|
||||
class TraceConfig(
|
||||
@Value("\${management.endpoints.web.base-path}") private val actuatorPath: String
|
||||
) {
|
||||
class TraceConfig {
|
||||
|
||||
companion object {
|
||||
val scheduleTaskName = "tasks.scheduled.execution"
|
||||
}
|
||||
|
||||
@Bean
|
||||
fun excludeActuatorPredicate(): ObservationPredicate {
|
||||
return ObservationPredicate { _, context ->
|
||||
if (context !is ServerRequestObservationContext) {
|
||||
return@ObservationPredicate true
|
||||
}
|
||||
|
||||
val servletRequest: HttpServletRequest = context.carrier
|
||||
val requestUri = servletRequest.requestURI
|
||||
|
||||
!requestUri.contains(actuatorPath)
|
||||
fun excludeSchedulerPredicate(): ObservationPredicate {
|
||||
return ObservationPredicate { name, context ->
|
||||
!name.equals(scheduleTaskName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user