summaryrefslogtreecommitdiffstats
path: root/aai-traversal/src/main
diff options
context:
space:
mode:
authorWilliam Reehil <william.reehil@att.com>2021-08-24 15:19:12 +0000
committerGerrit Code Review <gerrit@onap.org>2021-08-24 15:19:12 +0000
commit8fee89a23ace47c64f2a49dfe078d3def93d995c (patch)
treed6169225d7c7d05933e2473a929525b92347c848 /aai-traversal/src/main
parent326f7ec066ed555b6c320e4cbee23fd186887201 (diff)
parent9897b61766f53cf02d92d5debd9ec2457fb2750d (diff)
Merge "[AAI] Integrate Micrometer to identify slow APIs (Making aai_uri tag configurable)"
Diffstat (limited to 'aai-traversal/src/main')
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/web/MicrometerConfiguration.java4
-rw-r--r--aai-traversal/src/main/resources/application.properties8
2 files changed, 9 insertions, 3 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";
diff --git a/aai-traversal/src/main/resources/application.properties b/aai-traversal/src/main/resources/application.properties
index 0cc0473..a416dc8 100644
--- a/aai-traversal/src/main/resources/application.properties
+++ b/aai-traversal/src/main/resources/application.properties
@@ -117,9 +117,11 @@ history.truncate.window.days=365
#To Expose the Prometheus scraping endpoint
management.server.port=8448
#To Enable Actuator Endpoint, you can override this to True in OOM charts
-management.endpoints.enabled-by-default=false
+management.endpoints.enabled-by-default=true
#To Enable Actuator Endpoint, you can override this in OOM Charts
-#management.endpoints.web.exposure.include=info, health, prometheus
+management.endpoints.web.exposure.include=info, health, prometheus
management.metrics.web.server.auto-time-requests=false
management.metrics.tags.group_id=aai
-management.metrics.tags.app_id=${info.build.artifact}
+# management.metrics.tags.app_id=${info.build.artifact}
+#Enable this option only for debug purposes. For more information: https://github.com/micrometer-metrics/micrometer/issues/1584
+scrape.uri.metrics=true