From 7eb1c59ddf1c84d7698369b1232f43e4f71f89aa Mon Sep 17 00:00:00 2001 From: waynedunican Date: Wed, 12 Feb 2025 15:08:01 +0000 Subject: [PATCH] Uplift prometheus dependencies Issue-ID: POLICY-5190 Change-Id: I1a6c91cbcaf4e71bee768b74ee34ba914443a03e Signed-off-by: waynedunican --- reception/pom.xml | 8 ++++---- .../statistics/DistributionStatisticsManager.java | 15 ++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/reception/pom.xml b/reception/pom.xml index f9eafecb..67d6a94c 100644 --- a/reception/pom.xml +++ b/reception/pom.xml @@ -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. @@ -55,16 +55,16 @@ io.prometheus - simpleclient + prometheus-metrics-core io.prometheus - simpleclient_servlet_jakarta + prometheus-metrics-exporter-servlet-jakarta runtime io.prometheus - simpleclient_hotspot + prometheus-metrics-instrumentation-jvm runtime diff --git a/reception/src/main/java/org/onap/policy/distribution/reception/statistics/DistributionStatisticsManager.java b/reception/src/main/java/org/onap/policy/distribution/reception/statistics/DistributionStatisticsManager.java index 5a6b76a8..8957cd05 100644 --- a/reception/src/main/java/org/onap/policy/distribution/reception/statistics/DistributionStatisticsManager.java +++ b/reception/src/main/java/org/onap/policy/distribution/reception/statistics/DistributionStatisticsManager.java @@ -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(); -- 2.16.6