Uplift prometheus dependencies 83/140283/1
authorwaynedunican <wayne.dunican@est.tech>
Wed, 12 Feb 2025 15:08:01 +0000 (15:08 +0000)
committerwaynedunican <wayne.dunican@est.tech>
Tue, 18 Feb 2025 15:14:58 +0000 (15:14 +0000)
Issue-ID: POLICY-5190
Change-Id: I1a6c91cbcaf4e71bee768b74ee34ba914443a03e
Signed-off-by: waynedunican <wayne.dunican@est.tech>
reception/pom.xml
reception/src/main/java/org/onap/policy/distribution/reception/statistics/DistributionStatisticsManager.java

index f9eafec..67d6a94 100644 (file)
@@ -2,7 +2,7 @@
   ============LICENSE_START=======================================================
    Copyright (C) 2018 Ericsson. All rights reserved.
    Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
-   Modifications Copyright (C) 2024 Nordix Foundation.
+   Modifications Copyright (C) 2024-2025 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
         </dependency>
         <dependency>
             <groupId>io.prometheus</groupId>
-            <artifactId>simpleclient</artifactId>
+            <artifactId>prometheus-metrics-core</artifactId>
         </dependency>
         <dependency>
             <groupId>io.prometheus</groupId>
-            <artifactId>simpleclient_servlet_jakarta</artifactId>
+            <artifactId>prometheus-metrics-exporter-servlet-jakarta</artifactId>
             <scope>runtime</scope>
         </dependency>
         <dependency>
             <groupId>io.prometheus</groupId>
-            <artifactId>simpleclient_hotspot</artifactId>
+            <artifactId>prometheus-metrics-instrumentation-jvm</artifactId>
             <scope>runtime</scope>
         </dependency>
     </dependencies>
index 5a6b76a..8957cd0 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
+ *  Modifications Copyright (C) 2025 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,7 +22,7 @@
 
 package org.onap.policy.distribution.reception.statistics;
 
-import io.prometheus.client.Counter;
+import io.prometheus.metrics.core.metrics.Counter;
 
 /**
  * Class to hold statistical data for distribution component.
@@ -30,26 +31,26 @@ import io.prometheus.client.Counter;
  */
 public class DistributionStatisticsManager {
 
-    private static final Counter TOTAL_DISTRIBUTION_RECEIVED_COUNT = Counter.build()
+    private static final Counter TOTAL_DISTRIBUTION_RECEIVED_COUNT = Counter.builder()
                     .name("total_distribution_received_count")
                     .help("Total number of distribution received.").register();
-    private static final Counter DISTRIBUTION_SUCCESS_COUNT = Counter.build()
+    private static final Counter DISTRIBUTION_SUCCESS_COUNT = Counter.builder()
                     .name("distribution_success_count")
                     .help("Total number of distribution successfully processed.").register();
 
-    private static final Counter DISTRIBUTION_FAILURE_COUNT = Counter.build()
+    private static final Counter DISTRIBUTION_FAILURE_COUNT = Counter.builder()
                     .name("distribution_failure_count")
                     .help("Total number of distribution failures.").register();
 
-    private static final Counter TOTAL_DOWNLOAD_RECEIVED_COUNT = Counter.build()
+    private static final Counter TOTAL_DOWNLOAD_RECEIVED_COUNT = Counter.builder()
                     .name("total_download_received_count")
                     .help("Total number of download received.").register();
 
-    private static final Counter DOWNLOAD_SUCCESS_COUNT = Counter.build()
+    private static final Counter DOWNLOAD_SUCCESS_COUNT = Counter.builder()
                     .name("download_success_count")
                     .help("Total number of download successfully processed.").register();
 
-    private static final Counter DOWNLOAD_FAILURE_COUNT = Counter.build()
+    private static final Counter DOWNLOAD_FAILURE_COUNT = Counter.builder()
                     .name("download_failure_count")
                     .help("Total number of download failures.").register();