vmware-samples / validated-solutions-for-cloud-foundation

A companion repository for the VMware Validated Solutions for VMware Cloud Foundation.
https://vmware.com/go/vvs
BSD 2-Clause "Simplified" License
23 stars 5 forks source link

[HRM] Date on Backups and Snapshot dashboard shown incorrectly #50

Closed bhumitra closed 1 year ago

bhumitra commented 1 year ago

Code of Conduct

VMware Cloud Foundation

v4.5

Environment Details

No response

Description

I am sending a custom metrics to vrops called HRM Snapshot status - I am seeing that when this data goes into vrops, the it gets automatically converted to a number. The data for "statKey":"HRM Snapshot Status|latest",is "Feb 16 15:46:08 2023 GMT" but it is shown as a number on the UI. I dont understand why this value is getting converted.

{
   "stat-content":[
      {
         "statKey":"HRM Snapshot Status|component",
         "timestamps":[
            1683585928000
         ],
         "values":[
            "SDDC Manager"
         ]
      },
      {
         "statKey":"HRM Snapshot Status|resource",
         "timestamps":[
            1683585928000
         ],
         "values":[
            "SDDC Manager Snapshot"
         ]
      },
      {
         "statKey":"HRM Snapshot Status|element",
         "timestamps":[
            1683586608000
         ],
         "values":[
            "sfo-vcf01.sfo.rainpole.io"
         ]
      },
      {
         "statKey":"HRM Snapshot Status|domain",
         "timestamps":[
            1683585385000
         ],
         "values":[
            "sfo-m01,sfo-w01"
         ]
      },
      {
         "statKey":"HRM Snapshot Status|snapshots",
         "timestamps":[
            1683585517000
         ],
         "values":[
            1
         ]
      },
      {
         "statKey":"HRM Snapshot Status|latest",
         "timestamps":[
            1683585928000
         ],
         "values":[
            "Feb 16 15:46:08 2023 GMT"
         ]
      },
      {
         "statKey":"HRM Snapshot Status|consolidation required",
         "timestamps":[
            1683585928000
         ],
         "values":[
            false
         ]
      },
      {
         "statKey":"HRM Snapshot Status|alert",
         "timestamps":[
            1683585928000
         ],
         "values":[
            "RED"
         ]
      },
      {
         "statKey":"HRM Snapshot Status|alert_code",
         "timestamps":[
            1683585928000
         ],
         "data":[
            2
         ]
      },
      {
         "statKey":"HRM Snapshot Status|message",
         "timestamps":[
            1683585928000
         ],
         "values":[
            "Latest snapshot is greater than 3 days old. A single snapshot exists. "
         ]
      }
   ]
}

Similar issue is seen with Backup dashboard in a customer environment.

Expected Behavior

Date should be shown in correct format.

Note - this issue is not seen in all the environments and all dashboards. Sometimes, the dashboards work as expected with same data. Something on vROps is causing the date field to be changed to a different format. Need to check with vROps team.

Actual Behavior

NA

Steps to Reproduce

No response

Screenshots

image

References

No response

bhumitra commented 1 year ago

I have a potential fix for this issue and I am testing it. Reason this has happened is due to a vROps limitation. It assigns datatype for an object automatically when a metric is created for the first time. If it is assigned an integer, like in this case, it cannot be changed later. Fix is to make sure null values are not sent to vROps. Instead empty string should be sent.

bhumitra commented 1 year ago

Fix for this issue will be a part of May release of HRM.