HealthEvent.LastWarningTransitionAt Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
If the current HealthState is Warning, returns the time at which the health report was first reported with Warning. For periodic reporting, many reports with the same state may have been generated.
If the current HealthState is Ok or Error, returns the time at which the health state was last in Warning, before transitioning to a different state. If the HealthState has never been Warning, the value will be System.DateTime.FromFileTimeUtc(0).
public DateTime LastWarningTransitionAt { get; }
member this.LastWarningTransitionAt : DateTime
Public ReadOnly Property LastWarningTransitionAt As DateTime
Property Value
Returns DateTime representing the last transition time (UTC) involving Warning.
Remarks
The transition fields, LastOkTransitionAt, LastWarningTransitionAt, LastErrorTransitionAt give the history of the health state transitions for the event. They can be used for smarter alerts or "historical" health event information. They enable scenarios such as:
Alert when a property has been at warning/error for more than X minutes. This avoids alerts on temporary conditions. For example, an alert if the health state has been warning for more than five minutes can be translated into (HealthState == Warning and Now - LastWarningTransitionTime > 5 minutes).
Alert only on conditions that have changed in the last X minutes. If a report was already at error before the specified time, it can be ignored because it was already signaled previously.
If a property is toggling between warning and error, determine how long it has been unhealthy (i.e. not OK). For example, an alert if the property hasn't been healthy for more than five minutes can be translated into (HealthState != Ok and Now - LastOkTransitionTime > 5 minutes).