summaryrefslogtreecommitdiffstats
path: root/controlloop/common/feature-controlloop-trans
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2022-02-09 21:09:30 -0600
committerjhh <jorge.hernandez-herrero@att.com>2022-02-09 21:18:44 -0600
commit1ce041490b2b4aafb700c905b23d17037e42f153 (patch)
tree8c4e333b31933e16efe7b8c7ca7061430a09c52f /controlloop/common/feature-controlloop-trans
parentda7e9bded7185b6713b7c6a19ed17ae953864138 (diff)
transaction records cleanup
Issue-ID: POLICY-3761 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Id842d8ca5773d0c1104ae387519375fb914bdf4f Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Diffstat (limited to 'controlloop/common/feature-controlloop-trans')
-rw-r--r--controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/CacheBasedControlLoopMetricsManager.java25
1 files changed, 19 insertions, 6 deletions
diff --git a/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/CacheBasedControlLoopMetricsManager.java b/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/CacheBasedControlLoopMetricsManager.java
index d0b79125b..66a975024 100644
--- a/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/CacheBasedControlLoopMetricsManager.java
+++ b/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/CacheBasedControlLoopMetricsManager.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2022 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -248,9 +248,22 @@ class CacheBasedControlLoopMetricsManager implements ControlLoopMetrics {
protected void evicted(VirtualControlLoopNotification notification) {
MdcTransaction
.newTransaction(notification.getRequestId().toString(), notification.getFrom())
- .setServiceName(notification.getClosedLoopControlName()).setTargetEntity(notification.getTarget())
- .setStartTime(notification.getNotificationTime().toInstant()).setEndTime(Instant.now())
- .setResponseDescription("EVICTED").setStatusCode(false).metric().resetTransaction();
+ .setServiceName(notification.getClosedLoopControlName())
+ .setServiceInstanceId(notification.getPolicyName() + ":" + notification.getPolicyVersion())
+ .setProcessKey("" + notification.getAai())
+ .setTargetEntity(notification.getTargetType() + "." + notification.getTarget())
+ .setResponseCode(UNKNOWN_RESPONSE_CODE)
+ .setStartTime(notification.getNotificationTime().toInstant())
+ .setEndTime(Instant.now())
+ .setResponseDescription("EVICTED")
+ .setStatusCode(false)
+ .setCustomField1((notification.getNotification() != null)
+ ? notification.getNotification().name() : "")
+ .setCustomField2(notification.getPolicyScope())
+ .setClientIpAddress(notification.getClosedLoopEventClient())
+ .metric()
+ .resetTransaction();
+
}
@Override
@@ -291,8 +304,7 @@ class CacheBasedControlLoopMetricsManager implements ControlLoopMetrics {
return MdcTransaction
.newTransaction(notification.getRequestId().toString(), notification.getFrom())
.setServiceName(notification.getClosedLoopControlName())
- .setServiceInstanceId(notification.getPolicyScope()
- + ":" + notification.getPolicyName() + ":" + notification.getPolicyVersion())
+ .setServiceInstanceId(notification.getPolicyName() + ":" + notification.getPolicyVersion())
.setProcessKey("" + notification.getAai())
.setTargetEntity(notification.getTargetType() + "." + notification.getTarget())
.setResponseCode((notification.getNotification() != null)
@@ -300,6 +312,7 @@ class CacheBasedControlLoopMetricsManager implements ControlLoopMetrics {
: UNKNOWN_RESPONSE_CODE)
.setCustomField1((notification.getNotification() != null)
? notification.getNotification().name() : "")
+ .setCustomField2(notification.getPolicyScope())
.setResponseDescription(notification.getMessage())
.setClientIpAddress(notification.getClosedLoopEventClient());
}