Connectors directory[1]   Full listing of connectors[2]

Microsoft SQL Server

Description

Monitors performance and operational metrics for a Microsoft SQL Server database server, version 2012 or higher.

database[3] enterprise[4] linux[5] windows[6]

Target

Typical platform: Microsoft SQL Server[7]

Operating systems: Microsoft Windows, Linux

Prerequisites

Leverages: Microsoft SQL Server

Technology and protocols: SQL/JDBC

Examples

CLI

metricshub HOSTNAME -t win -c +MSSQL --jdbc -u USER --jdbc-url URL

metricshub.yaml

resourceGroups:
  <RESOURCE_GROUP>:
    resources:
      <HOSTNAME-ID>:
        attributes:
          host.name: <HOSTNAME> # Change with actual host name
          host.type: win
        connectors: [ +MSSQL ] # Optional, to load only this connector
        protocols:
          jdbc:
            port: <PORT>
            database: <DB_NAME>
            type: <type>
            url: <URL>
            username: <USERNAME> # Change with actual credentials
            password: <PASSWORD> # Encrypted using metricshub-encrypt

Connector Activation Criteria

The Microsoft SQL Server connector will be automatically activated, and its status will be reported as OK if all the below criteria are met:

  • The SQL query below succeeds on the monitored database:
      • SQL Query: SELECT CASE WHEN SERVERPROPERTY('ProductVersion') IS NOT NULL THEN 1 ELSE 0 END AS is_mssql;
      • Expected Result: 1

Metrics

Type Collected Metrics Specific Attributes
error
  • db.server.errors
  • db.server.name
  • db.system
  • error.type
io
  • db.server.storage.files{db.file.state="open"}
  • db.server.storage.io_time{db.io.direction="read", db.operation.state="wait"}
  • db.server.storage.io_time{db.io.direction="write", db.operation.state="wait"}
  • db.server.storage.io{db.io.direction="read"}
  • db.server.storage.io{db.io.direction="write"}
  • db.server.storage.operations{db.io.direction="read"}
  • db.server.storage.operations{db.io.direction="write"}
  • db.server.storage.size
  • db.name
  • db.server.name
  • db.system
mssql
  • db.server.cache.operations{db.io.direction="read", db.cache.state="hit"}
  • db.server.cache.operations{db.io.direction="read", db.cache.state="miss"}
  • db.server.connections
  • db.server.current_connections{db.connection.state="active"}
  • db.server.current_connections{db.connection.state="idle"}
  • db.server.current_connections{db.connection.state="running"}
  • db.server.mssql.memory_clerk{db.memory_clerk.type="other"}
  • db.server.mssql.memory_clerk{db.memory_clerk.type="sql_buffer_pool"}
  • db.server.mssql.memory_clerk{db.memory_clerk.type="sql_connection"}
  • db.server.mssql.memory_clerk{db.memory_clerk.type="sql_general"}
  • db.server.mssql.memory_clerk{db.memory_clerk.type="sql_optimizer"}
  • db.server.queries{db.mssql.query.state="compiled"}
  • db.server.queries{db.mssql.query.state="executed"}
  • db.server.queries{db.mssql.query.state="recompiled"}
  • db.server.row_lock.current_waits
  • db.server.row_lock.waits
  • db.server.tables
  • db.server.uptime
  • db.threads{db.thread.state="active"}
  • db.threads{db.thread.state="waiting"}
  • db.server.name
  • db.system
  • db.version
No results.