Transaction Locks Count

Microsoft.SqlServer.Azure.UnitMonitor.DatabaseLocksCount (UnitMonitor)

Monitors the highest number of locks held by any transaction for a database.

Knowledge Base article:

Summary

Monitors the maximum number of locks acquired by any transaction for this database.

Causes

An unhealthy state is caused by the maximum number of locks approaching or exceeding the configured limit for the monitor.

Resolutions

Element properties:

TargetMicrosoft.SqlServer.Azure.Database
Parent MonitorSystem.Health.PerformanceState
CategoryPerformanceHealth
EnabledFalse
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SqlServer.Azure.UnitMonitorType.DatabaseLocksCount
RemotableTrue
AccessibilityPublic
Alert Message
Transaction lock count exceeds configured limit
The number of locks held for a transaction for database "{0}" on server "{1}" exceeds the configured limit with value of {2} locks.
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SqlServer.Azure.UnitMonitor.DatabaseLocksCount" TypeID="Microsoft.SqlServer.Azure.UnitMonitorType.DatabaseLocksCount" Target="Microsoft.SqlServer.Azure.Database" ParentMonitorID="Health!System.Health.PerformanceState" Remotable="true" Priority="Normal" Accessibility="Public" Enabled="false" ConfirmDelivery="true">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SqlServer.Azure.UnitMonitor.DatabaseLocksCount.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="Microsoft.SqlServer.Azure.Database"]/DatabaseName$</AlertParameter1>
<AlertParameter2>$Target/Property[Type="Microsoft.SqlServer.Azure.Database"]/ServerName$</AlertParameter2>
<AlertParameter3>$Data/Context/Property[@Name='LocksCount']$</AlertParameter3>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Healthy" MonitorTypeStateID="Healthy" HealthState="Success"/>
<OperationalState ID="Warning" MonitorTypeStateID="Warning" HealthState="Warning"/>
<OperationalState ID="Critical" MonitorTypeStateID="Critical" HealthState="Error"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>900</IntervalSeconds>
<SyncTime/>
<TimeoutSeconds>300</TimeoutSeconds>
<ServerName>$Target/Property[Type="Microsoft.SqlServer.Azure.Database"]/ServerName$</ServerName>
<DatabaseName>$Target/Property[Type="Microsoft.SqlServer.Azure.Database"]/DatabaseName$</DatabaseName>
<WarningThreshold>100000</WarningThreshold>
<CriticalThreshold>120000</CriticalThreshold>
</Configuration>
</UnitMonitor>