From c341937e0c058304a5a808e4bf416b651d817032 Mon Sep 17 00:00:00 2001 From: Rashmi Pujar Date: Sun, 6 Feb 2022 21:17:28 -0500 Subject: add global constant for policy execution metric Issue-ID: POLICY-3845 Signed-off-by: Rashmi Pujar Change-Id: Ib72691a80aa56249532058dac9c9e59936254fff --- .../common/utils/resources/PrometheusUtils.java | 29 +++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/utils/src/main/java/org/onap/policy/common/utils/resources/PrometheusUtils.java b/utils/src/main/java/org/onap/policy/common/utils/resources/PrometheusUtils.java index 7882d81a..b6dae149 100644 --- a/utils/src/main/java/org/onap/policy/common/utils/resources/PrometheusUtils.java +++ b/utils/src/main/java/org/onap/policy/common/utils/resources/PrometheusUtils.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2022 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2022 Bell Canada. 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. @@ -21,6 +22,7 @@ package org.onap.policy.common.utils.resources; import lombok.AccessLevel; +import lombok.Getter; import lombok.NoArgsConstructor; /** @@ -40,6 +42,16 @@ public class PrometheusUtils { */ public static final String POLICY_DEPLOYMENT_HELP = "The total number of policy deployments."; + /** + * Policy Execution Metric Name. + */ + public static final String POLICY_EXECUTION_METRIC = "policy_executions"; + + /** + * Policy Execution Metric Help Message. + */ + public static final String POLICY_EXECUTION_HELP = "The total number of TOSCA policy executions."; + /** * Metric label for arbitrary operations (eg. deploy, undeploy, execute). */ @@ -65,4 +77,19 @@ public class PrometheusUtils { */ public static final String STATUS_METRIC_LABEL = "status"; -} + /** + * Prometheus namespace values mapping to the supported PDP types. + */ + public enum PdpType { + PDPD("pdpd"), + PDPA("pdpa"), + PDPX("pdpx"); + + @Getter + private final String namespace; + + PdpType(String namespace) { + this.namespace = namespace; + } + } +} \ No newline at end of file -- cgit 1.2.3-korg