diff options
author | Smokowski, Kevin (ks6305) <kevin.smokowski@att.com> | 2019-10-17 18:22:47 +0000 |
---|---|---|
committer | Kevin Smokowski <kevin.smokowski@att.com> | 2019-10-18 14:22:50 +0000 |
commit | 0eee231b5d1a598e7381be0d733e69357847768f (patch) | |
tree | 826e4107e5b0107667ae26bf8a8cc739ba5ed780 | |
parent | eb00a7cdf2828a3030595e14e142ad1250b45e5b (diff) |
add metric log filter
integrate restapicallnode with MetricLogClientFilter
Issue-ID: CCSDK-1846
Signed-off-by: Smokowski, Kevin (ks6305) <kevin.smokowski@att.com>
Change-Id: I2be5ff327caedfc93cec31d3273c97aa4f924eb7
3 files changed, 14 insertions, 4 deletions
diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml index 1100f223..cd7f0351 100644 --- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml +++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml @@ -27,6 +27,13 @@ <groupId>${project.groupId}</groupId> <artifactId>restapi-call-node-provider</artifactId> <version>${project.version}</version> + <exclusions> + <!-- let the filter module start and manage the common code --> + <exclusion> + <groupId>org.onap.logging-analytics</groupId> + <artifactId>logging-filter-base</artifactId> + </exclusion> + </exclusions> </dependency> </dependencies> </project> diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 0e6babb3..711597d7 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -65,7 +65,11 @@ <groupId>org.glassfish.jersey.media</groupId> <artifactId>jersey-media-multipart</artifactId> </dependency> - + <dependency> + <groupId>org.onap.logging-analytics</groupId> + <artifactId>logging-filter-base</artifactId> + <version>1.5.0</version> + </dependency> <!-- For test --> <dependency> <groupId>junit</groupId> diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index b93887ff..b4d7e1ba 100755 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -72,6 +72,7 @@ import org.glassfish.jersey.media.multipart.file.FileDataBodyPart; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; +import org.onap.logging.filter.base.MetricLogClientFilter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -785,7 +786,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { setClientTimeouts(client); // Needed to support additional HTTP methods such as PATCH client.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); - + client.register(new MetricLogClientFilter()); WebTarget webTarget = addAuthType(client, p).target(p.restapiUrl); long t1 = System.currentTimeMillis(); @@ -819,8 +820,6 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } } - invocationBuilder.header("X-ECOMP-RequestID", org.slf4j.MDC.get("X-ECOMP-RequestID")); - invocationBuilder.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); Response response; |