summaryrefslogtreecommitdiffstats
path: root/aai-resources/src/main/java
diff options
context:
space:
mode:
authorDimple Soni <dimple.soni@yoppworks.com>2021-08-12 18:49:18 -0400
committerDimple Soni <dimple.soni@yoppworks.com>2021-08-18 10:30:56 -0400
commit0960d01721345589c6d52254f3889f59313ff614 (patch)
tree9eccb4dde71562582ad9984665a2b7696466a80e /aai-resources/src/main/java
parent364dbfd6f51650718d803c7249fe854370eb901e (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: I7879c7e6a5ae9b3a3943f4accceede0c7ba2ade0
Diffstat (limited to 'aai-resources/src/main/java')
-rw-r--r--aai-resources/src/main/java/org/onap/aai/web/MicrometerConfiguration.java4
1 files changed, 4 insertions, 0 deletions
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";