From 0960d01721345589c6d52254f3889f59313ff614 Mon Sep 17 00:00:00 2001 From: Dimple Soni Date: Thu, 12 Aug 2021 18:49:18 -0400 Subject: [AAI] Integrate Micrometer to identify slow APIs (Making aai_uri tag configurable) Issue-ID: AAI-3367 Signed-off-by: Dimple Soni " Change-Id: I7879c7e6a5ae9b3a3943f4accceede0c7ba2ade0 --- .../src/main/java/org/onap/aai/web/MicrometerConfiguration.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'aai-resources/src/main/java') diff --git a/aai-resources/src/main/java/org/onap/aai/web/MicrometerConfiguration.java b/aai-resources/src/main/java/org/onap/aai/web/MicrometerConfiguration.java index 0be4e0b..bbe94fc 100644 --- a/aai-resources/src/main/java/org/onap/aai/web/MicrometerConfiguration.java +++ b/aai-resources/src/main/java/org/onap/aai/web/MicrometerConfiguration.java @@ -21,6 +21,7 @@ package org.onap.aai.web; import io.micrometer.core.instrument.Tag; import io.micrometer.core.instrument.Tags; import io.micrometer.jersey2.server.JerseyTags; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import io.micrometer.jersey2.server.JerseyTagsProvider; import org.glassfish.jersey.server.ContainerResponse; import org.glassfish.jersey.server.monitoring.RequestEvent; @@ -31,6 +32,9 @@ import org.springframework.context.annotation.Configuration; * Configuration Class to add customized tags to http metrics scraped in /actuator/prometheus endpoint */ @Configuration +@ConditionalOnProperty( + value="scrape.uri.metrics", + havingValue = "true") public class MicrometerConfiguration { private static final String TAG_AAI_URI = "aai_uri"; private static final String NOT_AVAILABLE = "NOT AVAILABLE"; -- cgit 1.2.3-korg