Langue

HealthEvent.LastErrorTransitionAt Property

Definition

If the current HealthState is Error, returns the time at which the health report was first reported with Error. For periodic reporting, many reports with the same state may have been generated.

If the current HealthState is Ok or Warning, returns the time at which the health state was last in Error, before transitioning to a different state. If the HealthState has never been Error, the value will be System.DateTime.FromFileTimeUtc(0).

public DateTime LastErrorTransitionAt { get; }
member this.LastErrorTransitionAt : DateTime
Public ReadOnly Property LastErrorTransitionAt As DateTime

Property Value

Returns DateTime representing the last transition time (UTC) involving Error.

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).

Applies to