OpenTelemetry Support
Service Integration Guides

Monitor MSSQL using OpenTelemetry receivers

8min

This document demonstrate the steps to scrape MSSQL metrics as well as logs to KloudMate using various receivers.

The sqlserver receiver grabs metrics about a Microsoft SQL Server instance. The receiver works by either using the Windows Performance Counters, or by directly connecting to the instance and querying it. Windows Performance Counters are only available when running on Windows.

To get the MSSQL logs the SQL Query Receiver used. It uses custom SQL queries to generate metrics or logs from a database connection.

Here hostmetrics receiver, SQL server receiver, and SQL query receiver are configured.

Prerequisite:

  1. MSSQL server must be installed and running.
  2. Install the OpenTelemetry collector on the server. See Installing and Configuring OpenTelemetry Collector.

Make sure to run the collector as administrator in order to collect all performance counters for metrics.

Step-1: Configure the Microsoft SQL Server Receiver along with the hostmetrics receiver scrape the MSSQL metrics and SQL Query Receiver along with the filelog receiver to pull required logs.

  • Linux Users: Open the file located at /etc/otelcol-contrib/config.yaml using your preferred text editor.
  • Windows Users: Create a new file called config.yaml in the C:\Program Files\OpenTelemetry Collector folder. You can use Notepad or any text editor to do this.
YAML


Step 2: Configure the processor part to detect resource information from the host and append or override the resource value in telemetry data with this information.

  • On-premise, non-cloud, or cloud
YAML

  • AWS EC2:

Optional: To retrieve AWS EC2 instance tags along with logs and metrics, you need to associate an IAM role with the EC2 instance that includes the EC2:DescribeTags policy. The processor below needs to be added:

YAML

  • Azure Virtual Machines:
YAML


Step 3:

Set up the KloudMate Backend on the exporter part with the correct extensions of the OpenTelemetry configuration file and configure the pipeline.

Change the pipeline as per your correct configuration.

YAML


Step 4: Restart the Opentelemetry collector service

Linux:

Text


Windows:

  • Go to the Windows service. You can directly search and open otherwise can go to Run ➝ type services.msc ➝ ok
  • On service search for OpenTelemetry collector service and restart it.