Skip to content

Monitor Internals


Due to factors such as network and system load, monitor evaluation execution has some special internal handling mechanisms.

Evaluation Trigger Time

User-configured evaluation frequencies are converted into crontab expressions internally. A monitor starts strictly on schedule according to this expression rather than simply running once every N minutes after it is created or saved.

For example, if a user configures an evaluation frequency of "5 minutes" for "Monitor A", the corresponding crontab expression is */5 * * * *. The specific trigger timing is as follows:

Action Time
User creates/saves monitor 00:00:30
Monitor triggers evaluation 00:05:00
Monitor triggers evaluation 00:10:00
... ...

Data Waiting Window

The Data Waiting Window is used to intentionally delay monitor evaluation after the scheduled execution time arrives, giving delayed data more time to be ingested into storage.

Suppose a monitor is scheduled to execute at 10:00, the evaluation interval is the last 1 hour, and the data waiting window is 5 minutes:

Stage Time or Range
Scheduled execution time 10:00
Waiting state 10:00 ~ 10:05
Actual execution start Approximately 10:05
Query time range Still 09:00 ~ 10:00

The data waiting window only delays the actual execution time. The query range is still based on the scheduled execution time and does not shift as a whole. During the waiting period, the execution record status is displayed as "Waiting for Data". If the actual execution time is later than "scheduled execution time + waiting duration" due to job queueing, the task still runs, and the execution record retains the scheduled execution time, waiting configuration, and actual start time.

Note the following:

  • By default, no waiting is applied, and existing monitors also run without waiting;
  • The waiting duration must be less than the interval between two adjacent scheduled execution times;
  • If a monitor is disabled or deleted during the waiting period, pending waiting tasks that have not yet executed are canceled.

Evaluation Range Calibration

Because the platform needs to process thousands of monitors configured by all users, evaluation jobs triggered at the same time cannot run concurrently, and most jobs enter a queue and wait.

Therefore, most evaluation jobs encounter the situation where they are scheduled to trigger at time T but actually execute at T + Δt.

If the actual execution time is used directly as the query end time, evaluation time ranges will overlap or have gaps. For example:

Suppose the evaluation time range is 5 minutes:

Action Time Actual queried data range
1. Actual execution 00:05:10 00:00:10 ~ 00:05:10
2. Actual execution 00:10:05 00:05:05 ~ 00:10:05
3. Actual execution 00:15:30 00:10:30 ~ 00:15:30

In this case:

  • The evaluation ranges of "Action 1" and "Action 2" overlap from 00:05:05 to 00:05:10;
  • The evaluation ranges of "Action 2" and "Action 3" have a gap from 00:10:05 to 00:10:30, so data in this period is not covered.

Current Solution

To avoid evaluation range fluctuations caused by job queueing, a monitor's data query range is calibrated based on its scheduled trigger time rather than the actual execution time.

Suppose the evaluation time range is 5 minutes:

Action Time Final queried data range
Monitor triggers evaluation (enqueued) 00:05:00
Monitor actually executes (dequeued) 00:05:10 00:00:00 ~ 00:05:00
Monitor triggers evaluation (enqueued) 00:10:00
Monitor actually executes (dequeued) 00:10:30 00:05:00 ~ 00:10:00

As shown, regardless of how long an evaluation job is queued, its data query range is always based on the scheduled trigger time, ensuring the continuity and stability of the time window.

Note

The above example only illustrates the principle of "Evaluation Range Calibration". Actual ranges are also affected by the "Evaluation Range Drift" mechanism.

Evaluation Range Drift

Due to factors such as network latency and data processing, data usually takes several seconds to tens of seconds to be persisted to disk after being reported (that is, to become queryable through DQL). During this period, monitor evaluation cannot query this "in-flight" data.

This can easily lead to missing data when evaluation is performed over a fixed time range. For example:

Suppose the evaluation time range is 5 minutes:

Action Time Evaluation range
Data A reported (not yet persisted) 00:09:59
Monitor triggers evaluation 00:10:00 00:05:00 ~ 00:10:00
Data A persisted 00:10:05 (data timestamp 00:09:59)
Monitor triggers evaluation 00:15:00 00:10:00 ~ 00:15:00

Although Data A was reported before the second evaluation ran, it was missed in the first evaluation because it had not been persisted. After it was persisted, its timestamp was earlier and already outside subsequent evaluation time ranges, so it remained undetected.

Current Solution

To solve this problem, all monitors automatically drift the data query range 1 minute into the past during evaluation to avoid the gap period while data is being persisted.

After applying this solution, the above example becomes:

Suppose the evaluation time range is 5 minutes:

Action Time Evaluation range
Data A reported (not yet persisted) 00:09:59
Monitor triggers evaluation 00:10:00 00:04:00 ~ 00:09:00 (1-minute drift)
Data A persisted 00:10:05 (data timestamp 00:09:59)
Monitor triggers evaluation 00:15:00 00:09:00 ~ 00:14:00 (1-minute drift)

Although Data A was missed in the evaluation at 00:10:00, its timestamp 00:09:59 falls within the range of the evaluation at 00:15:00 (00:09:00 ~ 00:14:00), so it can be successfully captured in the second evaluation.

Note

If data persistence latency exceeds 1 minute, this solution becomes ineffective, and evaluation may not achieve the expected result.

No Data Determination Logic

As a time series data platform, Guance does not have the concept of an "asset inventory" found in traditional asset management software. The system can determine what "exists" only based on queried data and cannot know about objects that "should exist but currently do not".

For example:

A box is known to contain a pencil and an eraser. We can state for certain that "the box contains a pencil and an eraser," but we cannot assert that "the box does not contain a pen," because we do not know what the box "should" contain.

No-data detection is based on objects identified in historical queries and makes determinations by combining the current query result with the configured no-data duration. The following comparison of two rounds illustrates changes in data status.

If object X was found in the previous evaluation but disappears in the current evaluation, the system enters no-data determination; after the configured no-data duration is met, X is determined to have No Data.

Suppose the evaluation time range is 5 minutes:

00:00:00 ~ 00:05:00 Result 00:05:00 ~ 00:10:00 Result Determination Result
Data detected No data detected No Data
Data detected Data detected Continuously normal
No data detected Data detected Data Reported Again
No data detected No data detected The identified object continues to have no data; when no-data conditions are met, processing continues according to configuration
Note

The above example only illustrates the core logic. Actual determination is also affected by configurations such as "Evaluation Range Drift", "Evaluation Time Range", and "Alert only after N consecutive minutes of no data".

No Data / Data Recovery Events

When the monitor determines that "No Data" or "Data Reported Again" has occurred, it decides whether to generate a "No Data Event" or a "No Data Recovery Event" based on user configuration.

When Trigger No Data Event is selected, before generating an event, the system makes a decision by referencing the existing event status:

Existing Event Status Determination Result of This Evaluation System Action
No event / No Data Recovery Event No Data Generate a No Data Event
No event / No Data Event Data Reported Again Generate a No Data Recovery Event

For the same object, only one No Data Event is generated per no-data round; if No Data occurs again after recovery, a new event can be generated.

When Continuously Trigger No Data Events is selected, a No Data Event is generated each time the same object still meets no-data conditions in an evaluation, until data recovers. The no-data duration controls when triggering starts, and the evaluation frequency controls the cadence at which continuous events are generated; recovery handling follows the original logic.

Both methods are configured in No Data. After an event is generated, notification delivery follows the Alert Policy and Mute Rules.

FAQ

The time indicated by an event does not match the event generation time

The time seen in event details or alert notifications (for example, 00:15:00) is the monitor's scheduled trigger time (that is, the aligned time based on the crontab expression), not the time when the event was actually generated in the system.

Exception: If you manually click "Execute" in the monitor list, the event time will be the actual time you clicked Execute.

The time indicated by an event does not match the actual failure time

The time indicated by an event is the monitor's scheduled trigger time. Because of the "Evaluation Range Drift" mechanism, the actual evaluated data range is from scheduled trigger time - evaluation range - drift time to scheduled trigger time - drift time.

Therefore, the timestamp of the data point where the failure actually occurred is likely not within the intuitive interval from scheduled trigger time - evaluation range to scheduled trigger time. This is expected.

Suspected failure data is found when querying directly in the platform, but the monitor does not generate an alert

This issue is usually caused by the following:

  1. High data persistence latency: During evaluation, the failure data is not yet queryable due to latency;
  2. DQL query execution failure: The evaluation process is interrupted because the query fails.

Such cases usually originate from issues in the data pipeline or query engine and are outside the monitor's own control.

Feedback

Is this page helpful?