Difference between Top Hit of Metric Visualization and Top Hit in Metric Visual Builder

Hello All,

I have an issue in understanding how exactly Metric in Visual Builder settings work. The easiest way would be to explain it on an example. Here's my data set:

{
    "manufacure_date": "2019-07-01T08:00:00.000Z",
	"modifieddate": "2019-07-01T08:58:56.000Z",
    "name": "Car1",
	"manufactured": 22
	"target": 30
	"gap": 8
  }    {
    "manufacure_date": "2019-07-01T09:00:00.000Z",
	"modifieddate": "2019-07-01T09:56:02.000Z",
    "name": "Car1",
	"manufactured": 16
	"target": 30
	"gap": 14
  }    {
    "manufacure_date": "2019-07-01T10:00:00.000Z",
	"modifieddate": "2019-07-01T10:27:06.000Z",
    "name": "Car1",
	"manufactured": 12
	"target": 30
	"gap": 18
  }

Data at source is updated every 3-5 minutes. I run my pipeline every 2 minutes, visualization is refreshed every 60 seconds.
The way we gather data is simple. We take modifieddate and based on a key, that contains two fields: name and manufacure_date we update the following fields: modifieddate, manufactured and gap which is calculated on a query level.
There are three metrics on my visualization: manufactured, target and gap. They are visualized using Metric and Top Hit aggregation method sorted on modifieddate with size of 1.
Just like that:
gap_metric

Date filter is set to Last 1 hour. It works just fine, but recently for Gap I decided to use Visual Builder Metric, as it provides nice possibilities of conditional coloring with custom color pallet. I used the same Top Hit Aggregation, same fields and settings. Details:
gap_vsb_1
gap_vsb_2

Everything works fine during most of the hour, but once full hour passes, Visual Builder Gap changes to 0, while Metric Gap sits with correct value based on Last Hit. Once the new record comes into index (with modifieddate from same hour as we currently have), VSB Gap shows correct value. I am not sure what might cause that, so if anyone could point me where'd the mistake, I'd appreciate it. I'm quite fresh to VSB so my understanding might be wrong.
Here's a breakdown that might put some light on what happens:
gap_breakdown

Thanks!

Note: I just changed VSB interval to 1y. If my understanding is correct, it should work properly except for new eyars eve, 00:00:00 :slight_smile:

Hey @saif3r would you mind seeing if the system clocks for the server running Kibana and the computer running the browser and accessing Kibana are in sync?

Hello @Brandon_Kobel,

There was a 20s desync, which I fixed immediately.

Did adjusting the system clocks to be in sync remedy the issue that you're seeing?

Hi @Brandon_Kobel,

After i realized what Interval means in VSB, I changed it to 1y (from 1h), and after that it seems like Top Hit works properly.
Thank you.