chef / automate

Chef Automate provides a full suite of enterprise capabilities for maintaining continuous visibility into application, infrastructure, and security automation.
https://automate.chef.io/
Apache License 2.0
227 stars 113 forks source link

incorrect check in history status #6785

Open rishichawda opened 2 years ago

rishichawda commented 2 years ago

Thanks @cmailank for reporting this.

Describe the bug

The client run status for the previous day seems to be missing if the run happened within 24 hours from now. As we can see it reports check in for only today while there was a client run yesterday and another one today. So we would expect 2 icons in the time series. Based on the UI, a user would expect that "Today" is 00:00Hrs to now.

MicrosoftTeams-image (1)

Even in the infrastructure dashboard it clearly shows the client runs are from different days.

MicrosoftTeams-image (2)

To Reproduce

Steps to reproduce the behavior:

Expected behavior

A user would expect the status data to be separated based on local time.

Versions (please complete the following information):

Additional context

I took the liberty to look into it further and it seems like the request to node_runs_daily_status_time_series is returning something like this. Which tells us that the most recent status was 24hours back from now rather than 00:00Hrs to now for today.

Screenshot 2022-03-10 at 5 41 23 PM

Which is also confirmed by the function at https://github.com/chef/automate/blob/f4b4aa2db39887dfa66d5666200453e8e9323e40/components/config-mgmt-service/grpcserver/cfg_mgmt.go#L157 which uses the utility function https://github.com/chef/automate/blob/f4b4aa2db39887dfa66d5666200453e8e9323e40/components/config-mgmt-service/grpcserver/cfg_mgmt.go#L565-L573 that is written in such a way that it calculates X*24 hours ago from when the request was made to the server with UTC time.

rishichawda commented 2 years ago

On a side note, the infrastructure tab shows the client run timings in UTC - it should be localised. As a user I would probably be interested in seeing times in my local time zone.

MicrosoftTeams-image (2)