This page covers the discussion and design documentation of epic POLICY-2025 - This epic covers the work to ensure all the PDP’s report statistics and that both the statistics and health checks are consolidated by the PAP.

POLICY-1628 Create policy model provider for PdpStatistics entity
POLICY-1629 PAP REST API for PDPGroup Statistics
POLICY-1689 Consolidate Policy Health Check into PAP
POLICY-2022 All PDPs should support statistics


Below diagram shows PDPs send heartbeat messages to PolicyAdministration over DMaap, and users get statistics and health checks by PolicyAdministration. 

1 Create policy model provider for PdpStatistics entity

(Leading @Tim Huang)

Add Class PdpStatisticProvider for new table(PdpStatistic).
Methods including:

List<PdpStatistics> PdpStatisticProvider().getPdpStatistics(pfDao,name)

PdpStatisticProvider().updatePdpStatistics(PfDao, pdpInstanceId, pdpStatistics)

PdpStatisticProvider().deletePdpStatistics(pfDao, name)

List<PdpStatistics> getFilteredPdpPdpStatistics(PdpStatisticsGroupFilter filter)

Also need to update the definition in PolicyModelsProvider

[Todo]

  • Question: Consider the table PdpStatistic, is it enough with the columns listed as below?

           

    private String pdpInstanceId;
    private Date timeStamp;
    private long policyDeployCount;
    private long policyDeploySuccessCount;
    private long policyDeployFailCount;
    private long policyExecutedCount;
    private long policyExecutedSuccessCount;
    private long policyExecutedFailCount;
[TODO] Also need to  store PDPGroup and PDPSubGroup info for each Pdp Instance in PdpStatictics table, because PdpGroup table may already changed, but Statictics remains. 
  • Question: Is there any other API need for this new table PdpStatistics?
  • Question: Do we need more seperate tables to store other PDP status history info, like PDP state, Health check etc?
  • Question: How do we embed specific extra information into the statistics?
  • Action: PDP responsibles come back with the stats they want.
  • Question: How is the table cleared down periodically? MariaDB probably has support for this.

2 Rest API for PDP statistics

(Leading @Ning Xi)

PAP Rest Controller part:

We add 3 new Rest path for PDP/PDP group/PDP subgroup staticstics following the definition in page
Policy Design and API Flow)
3.3.5 PDP Group Statistics

@Path("pdps/statistics")
@Path("pdps/groups/{name}/statistics")
@Path("pdps/groups/{name}/subgroups/{type}/statistics")
  • Question: Do we need two REST API, one for returning latest statistics, another for returning all the history data?

Add ArrayList<Object> list in StatisticsReport Class for new return values. 

PAP Provider part:

Since Statistics db table is standalone,
Get Statistics result need three steps

  • query PDP table and get PDPGroup=>PDPSubGroup structure

    databaseProvider.getPdpGroups(null)
    store PDP instance name to List
    List PdpInstances

  • query statistics table for each PDP instance

 PdpInstances.stream().forEach(s -> {
            databaseProvier.getStatictics(s);
            });
  • Summarize statictics result for PDP subgroups,
    also add to StatisticsReport

3  Consolidate Policy Health Check into PAP

(Leading @Yehui Wang)

Currently Policy Health check support to fetch health status of all PDPs registered with PAP and PAP per se. 

Considerring requirement in the ticket "report the health check for ALL the policy components" and Policy Design and API Flow#3.3.6PDPGroupHealthCheck, there are serveral tasks:

  1. Get health check on the individual PDPs.
  2. Get health check on PDPs of specific PDPGroup.
  3. Get health check on PDPs of specific PDPSubGroup.
  4. Detailed requirements of Policy Design and API Flow#3.3.6PDPGroupHealthCheck
    1.  If use PUT operations for ordering health checks, user only get a HTTP status code of 202: Accepted if the health check request has been accepted by the PAP.

                      Question: How to secure to GET the latest heal checks afterwards? Solution is to compare the timestamp of PUT request and return timestamp in GET response?




  • No labels

4 Comments

  1. There is an existing project called Consul (CLI project) for monitoring things, Jorge Hernandez will forward info. This work may be useful to them.

    1. Following up on Consul Liam Fallon - We should add hooks in this file, also this ties up to healtcheck work that Ram Krishna Verma is looking at 

      https://git.onap.org/oom/tree/kubernetes/consul/resources/config/consul-agent-config/policy-health.json


      Probably for statistics, should create new config file under 

      https://git.onap.org/oom/tree/kubernetes/consul/resources/config/consul-agent-config

      This will provide dynamic policy info system wide through the Consul GUI.

  2. The other issue is to deal with bounding the Statistics table since the presence of "timestamp" suggests and indeterminate number of entries.

  3. Just noting here that there are synergies and complimentary work with the logging project that through the logging analytics framewok provides historical transaction information across components.    In theory each policy execution translates into a sequence of logging records that could be compiled and analysed under their framework.    Actually, there may be a tad of overlap as we are keeping "timestamped" records.   The caveat is that we are not yet fully compliant with the new logging spec so right now that info could not be extrapolated.