Need timestamp on each UVE API & UVE Stream response

Registered by Sundaresan Rajangam

Problem:
At present, the response for /analytics/uves requests and /analytics/uve-stream does not contain timestamp.

Solution:
Add a new field "__T" to each UVE structure. The value of this field is UTC Timestamp and it is updated by contrail-alarm-gen when it evaluates and aggregates the UVEs.

Example:

http://<analytics-ip>:<analytics-api-port>/analytics/uves/analytics-node/xyz?flat
{
    "AnalyticsApiInfo": {
        "__T": 1515010981733871,
        "analytics_node_ip": {
        "host_ip": "10.84.30.201",
        "rest_api_ip": "0.0.0.0" }
    },
    "CollectorState": {
       "__T": 1515737608360464,
       "generator_infos": [
          {
               "instance_id": "0",
               "module_id": "contrail-alarm-gen",
               "node_type": "Analytics",
               "sm_defer": false,
               "sm_defer_time_msec": 0,
               "sm_queue_count": 0,
               "source": "xyz",
               "state": "Established"
         }
      ]
  }
...
...
}

http://<analytics-ip>:<analytics-api-port>/analytics/uve-stream

event: update
data: {"type": "PeerStatsData", "value": {"rx_update_stats_ewm": {"config": "0.2", "metric": 0, "state": {"stddev": "0", "mean": "0"}, "algo": "EWM", "samples": 21284, "sigma": 0.0}, "__T": 1515737754157339, "rx_update_stats": {"unreach": 1, "total": 0, "reach": 1, "end_of_rib": 0}, "tx_update_stats": {"unreach": 2, "total": 0, "reach": 2, "end_of_rib": 0}}, "key": "ObjectBgpPeer:default-domain:default-project:ip- fabric:__default__:a7s33:default-domain:default-project:ip- fabric:__default__:a7-qfx5"}

event: update
data: {"type": "PeerFlapData", "value": {"flap_10m": {"value": 0}, "flap_info": {"flap_count": 1, "flap_time": 1514946277697402}, "encoding": "BGP", "__T": 1515737754157339}, "key": "ObjectBgpPeer:default- domain:default-project:ip-fabric:__default__:a7s33:default-domain:default- project:ip-fabric:__default__:a7-qfx5”}

Blueprint information

Status:
Complete
Approver:
Rudra Rugge
Priority:
Medium
Drafter:
Sundaresan Rajangam
Direction:
Needs approval
Assignee:
Sundaresan Rajangam
Definition:
Approved
Series goal:
Accepted for trunk
Implementation:
Implemented
Milestone target:
milestone icon r5.0.0
Started by
Sundaresan Rajangam
Completed by
Sundaresan Rajangam

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.