From: Rashmi Pujar Date: Mon, 7 Feb 2022 02:17:28 +0000 (-0500) Subject: add global constant for policy execution metric X-Git-Tag: 1.10.1~4 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F77%2F126977%2F4;p=policy%2Fcommon.git add global constant for policy execution metric Issue-ID: POLICY-3845 Signed-off-by: Rashmi Pujar Change-Id: Ib72691a80aa56249532058dac9c9e59936254fff --- 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