Skip to content

Metric plugins - mackerel-plugin-mssql

mackerel-plugin-mssql is a plugin that posts Microsoft SQL Server information as a metric.

SQL Server versions supported by the plugin

  • Microsoft SQL Server 2017 or later
  • Microsoft SQL Express 2017 or later

Monitorable metrics

Post counter values for SQL Server objects.

[https://learn.microsoft.com/en-us/sql/relational-databases/performance-monitor/use-sql-server-objects?view=sql-server-ver16#SQLServerPOs:embed:cite]

MSSQL Buffer

Information about the memory buffers used by SQL Server. Get information on Buffer Manager object.

Metric Display NameMetric NameDiffStackedDescription
Cache Hit Ratiomssql.buffer_cache_hit_ratioPercentage of pages found in the buffer cache without reading from disk
Page Life Expectancymssql.buffer_page_life_expectancyNumber of seconds a page remains in the buffer pool without referenced
Checkpoint Pagesmssql.buffer_checkpoint_pagesNumber of pages flushed to disk per second by a checkpoint or other operation that require all dirty pages to be flushed

MSSQL Stats

Information on SQL Server usage. Get information on SQL Statistics object and General Statistics object.

Metric Display NameMetric NameDiffStackedDescription
Batch Requestsmssql.stats_batch_requestsNumber of Transact-SQL command batches received per second
SQL Compilationsmssql.stats_sql_compilationsSQL compiles per second
SQL Re-Compilationsmssql.stats_sql_recompilationsNumber of statement recompilations per second
Connectionsmssql.stats_connectionsNumber of users currently connected to SQL Server
Lock Waitsmssql.stats_lock_waitsNumber of waits for the File IO Provider lock per second
Procs Blockedmssql.stats_procs_blockedNumber of processes currently blocked

MSSQL Access

Get information on Access Methods object.

Metric Display NameMetric NameDiffStackedDescription
Page Splitsmssql.access_page_splitsNumber of page splits that occurred per second as a result of index page overflow.

Configurable options

OptionShortDescriptionDefault
-metric-key-prefixSpecifies the prefix of the metric namemssql
-instanceSpecify the instance name as either SQLSERVER or SQLEXPRESS. Other names are not supported.SQLSERVER
-tempfileSpecify the destination file path for tempfile

The tempfile is created by default under C:\Windows\Temp in the format mackerel-plugin-mssql-<hash string>.

Example configuration

The following is an example configuration for an instance name of SQLEXPRESS.

toml
[plugin.metrics.mssql]
command = ["mackerel-plugin-mssql", "-instance", "SQLEXPRESS"]

Repository

[https://github.com/mackerelio/mackerel-agent-plugins/tree/master/mackerel-plugin-mssql]