Skip to content

Commit 1f4d746

Browse files
committed
Add annotation @ConditionalOnProperty on MetricAspect
1 parent 1683669 commit 1f4d746

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/kotlin/com/cosmotech/api/metrics/MonitorServiceAspect.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,17 @@ import org.aspectj.lang.annotation.Pointcut
1717
import org.aspectj.lang.reflect.CodeSignature
1818
import org.slf4j.Logger
1919
import org.slf4j.LoggerFactory
20+
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
2021
import org.springframework.stereotype.Component
2122

2223
private const val SERVICE_NAME = "API"
2324

2425
@Aspect
2526
@Component
27+
@ConditionalOnProperty(
28+
name = ["csm.platform.metrics.enabled"],
29+
havingValue = "true",
30+
matchIfMissing = false)
2631
class MonitorServiceAspect(
2732
private var meterRegistry: MeterRegistry,
2833
private val eventPublisher: CsmEventPublisher,

0 commit comments

Comments
 (0)