aboutsummaryrefslogtreecommitdiffstats
path: root/aai-traversal/src/main/java
diff options
context:
space:
mode:
authorDimple Soni <dimple.soni@yoppworks.com>2021-08-12 18:50:29 -0400
committerDimple Soni <dimple.soni@yoppworks.com>2021-08-18 10:28:14 -0400
commit9897b61766f53cf02d92d5debd9ec2457fb2750d (patch)
treee1eb570646a1b7c82ef7a985ad213029e35cec64 /aai-traversal/src/main/java
parentfd3ec07e00ff409d92fea0a3ae11260669a9197a (diff)
[AAI] Integrate Micrometer to identify slow APIs (Making aai_uri tag configurable)
Issue-ID: AAI-3367 Signed-off-by: Dimple Soni <dimple.soni@yoppworks.com>" Change-Id: If8a5734c702242a292eeb6c9c26a844242e1f849
Diffstat (limited to 'aai-traversal/src/main/java')
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/web/MicrometerConfiguration.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/aai-traversal/src/main/java/org/onap/aai/web/MicrometerConfiguration.java b/aai-traversal/src/main/java/org/onap/aai/web/MicrometerConfiguration.java
index 9b48dae..7c93e7d 100644
--- a/aai-traversal/src/main/java/org/onap/aai/web/MicrometerConfiguration.java
+++ b/aai-traversal/src/main/java/org/onap/aai/web/MicrometerConfiguration.java
@@ -22,6 +22,7 @@ import io.micrometer.core.instrument.Tag;
import io.micrometer.core.instrument.Tags;
import io.micrometer.jersey2.server.JerseyTags;
import io.micrometer.jersey2.server.JerseyTagsProvider;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.glassfish.jersey.server.ContainerResponse;
import org.glassfish.jersey.server.monitoring.RequestEvent;
import org.springframework.context.annotation.Bean;
@@ -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";