ServiceWatch Agent Installation
Users can install the ServiceWatch Agent on a Virtual Server to collect custom metrics and logs.
ServiceWatch Agent
The agents that need to be installed on the Virtual Server for collecting ServiceWatch’s custom metrics and logs can be divided into two main types. It is Prometheus Exporter and Open Telemetry Collector.
| Category | Detailed Description | |
|---|---|---|
| Prometheus Exporter | Provides metrics of a specific application or service in a format that Prometheus can scrape
| |
| Open Telemetry Collector | Collects telemetry data such as metrics and logs from distributed systems, processes (filtering, sampling, etc.) them, and serves as a centralized collector that exports to various backends (e.g., Prometheus, Jaeger, Elasticsearch, etc.)
|
Installation of Prometheus Exporter for Virtual Server (for Linux)
Install the Prometheus Exporter according to the steps below for use on a Linux server.
Node Exporter Installation
Install Node Exporter according to the following steps.
Node Exporter User Creation
Create a dedicated user to safely isolate the Node Exporter process.
sudo useradd --no-create-home --shell /bin/false node_exportersudo useradd --no-create-home --shell /bin/false node_exporterNode Exporter Settings
- Download to install Node Exporter.
This guide provides the version below.
- Download path: /tmp
- Installation version: 1.7.0Color mode
cd /tmp wget https://github.com/prometheus/node_exporter/releases/download/v1.7.0/node_exporter-1.7.0.linux-amd64.tar.gzcd /tmp wget https://github.com/prometheus/node_exporter/releases/download/v1.7.0/node_exporter-1.7.0.linux-amd64.tar.gzCode block. Node Exporter download command
Install the downloaded Node Exporter and grant permission to the executable file.
Color modecd /tmp sudo tar -xvf node_exporter-1.7.0.linux-amd64.tar.gz -C /usr/local/bin --strip-components=1 node_exporter-1.7.0.linux-amd64/node_exportercd /tmp sudo tar -xvf node_exporter-1.7.0.linux-amd64.tar.gz -C /usr/local/bin --strip-components=1 node_exporter-1.7.0.linux-amd64/node_exporterCode block. Node Exporter installation command Color modesudo chown node_exporter:node_exporter /usr/local/bin/node_exportersudo chown node_exporter:node_exporter /usr/local/bin/node_exporterCode block. Node Exporter permission setting command Service file creation Set Node Exporter to collect memory metrics (meminfo) or block storage metrics (filesystem).
Color modesudo vi /etc/systemd/system/node_exporter.servicesudo vi /etc/systemd/system/node_exporter.serviceCode block. Node Exporter service file opening command Color mode[Unit] Description=Prometheus Node Exporter (meminfo only) Wants=network-online.target After=network-online.target [Service] User=node_exporter Group=node_exporter Type=simple ExecStart=/usr/local/bin/node_exporter \ --collector.disable-defaults \ # Disable default metrics --collector.meminfo \ # Enable memory metrics --collector.filesystem # Block Storage Enable filesystem metrics Restart=on-failure [Install] WantedBy=multi-user.target[Unit] Description=Prometheus Node Exporter (meminfo only) Wants=network-online.target After=network-online.target [Service] User=node_exporter Group=node_exporter Type=simple ExecStart=/usr/local/bin/node_exporter \ --collector.disable-defaults \ # Disable default metrics --collector.meminfo \ # Enable memory metrics --collector.filesystem # Block Storage Enable filesystem metrics Restart=on-failure [Install] WantedBy=multi-user.targetCode block. Node Exporter service file open result
collector can be enabled/disabled using flags.
–collector.{name}: Used to enable a specific metric.–no-collector.{name}: You can disable specific metrics.- To disable all default metrics and enable only specific collectors, you can use
–collector.disable-defaults –collector.{name} ….
Below is the description of the main collector.
| Collector | Description | Label |
|---|---|---|
| meminfo | Provides memory statistics | - |
| filesystem | Provides file system statistics such as used disk space |
|
- Node Exporter Metrics you can check the main metrics provided by Node Exporter and how to configure the Node Exporter Collector.
- Detailed information about collectable metrics and how to configure them can be found at Node Exporter > Collector.
- The available metrics may vary depending on the version of Node Exporter you are using. Refer to Node Exporter.
- Service activation and start
Register the Node Exporter service and check the registered service and configured metrics.Color mode
sudo systemctl daemon-reload sudo systemctl enable --now node_exportersudo systemctl daemon-reload sudo systemctl enable --now node_exporterCode block. Node Exporter service activation and start command Color modesudo systemctl status node_exportersudo systemctl status node_exporterCode block. Node Exporter service check command Color modecurl http://localhost:9100/metrics | grep node_memorycurl http://localhost:9100/metrics | grep node_memoryCode block. Node Exporter metric information check command
For more details, see ServiceWatch > Using ServiceWatch Agent.
Installation of Prometheus Exporter for Virtual Server (for Windows)
Install according to the steps below to use Prometheus Exporter on a Windows server.
Windows Exporter Installation
Install the Windows Exporter according to the steps below.
Windows Exporter Settings
- Download the installation file to install Windows Exporter.
- Download path: C:\Temp
- Test version: 0.31.3Color mode
$ mkdir /Temp $ Invoke-WebRequest -Uri "https://github.com/prometheus-community/windows_exporter/releases/download/v0.31.3/windows_exporter-0.31.3-amd64.exe" -OutFile "C:\Temp\windows_exporter-0.31.3-amd64.exe"$ mkdir /Temp $ Invoke-WebRequest -Uri "https://github.com/prometheus-community/windows_exporter/releases/download/v0.31.3/windows_exporter-0.31.3-amd64.exe" -OutFile "C:\Temp\windows_exporter-0.31.3-amd64.exe"Code block. Windows Exporter download
- Windows Exporter execution test
Windows Exporter enables all collectors by default, but to collect only the metrics you want, you need to enable the following collectors. Below is an example of enabling user-specified collectors.- Memory Metric: memory
- Block Storage Metric: local_disk
- Host name: osColor mode
$ cd C:\Temp $ .\windows_exporter-0.31.3-amd64.exe --collectors.enabled memory,logical_disk,os$ cd C:\Temp $ .\windows_exporter-0.31.3-amd64.exe --collectors.enabled memory,logical_disk,osCode block. Windows Exporter execution test
collector can be enabled using a flag.
–collectors.enabled “[defaults]"metrics provided by default–collector.enabled {name},{name},{name}…: Used to enable specific metrics.
Below is the description of the main collector.
| Collector | Description | Label |
|---|---|---|
| memory | Memory Statistics Provided | |
| logical_disk | Collect performance and health metrics of logical disks (e.g., C:, D: drives) on the local system |
|
- Windows Exporter Metrics you can check the main metrics provided by Windows Exporter and how to configure the Windows Exporter Collector.
For detailed information on collectable metrics and how to configure them, see Windows Exporter > Collector.
The metrics that can be provided may differ depending on the version of the Windows Exporter you are using. Please refer to the Windows Exporter.
Service Registration and Confirmation Register the Windows Exporter service and check the configured metrics.
Color mode$ sc.exe create windows_exporter binPath= "C:\Temp\windows_exporter-0.31.3-amd64.exe --collectors.enabled memory,logical_disk,os" DisplayName= "Prometheus Windows Exporter" start= auto $ Start-Service windows_exporter$ sc.exe create windows_exporter binPath= "C:\Temp\windows_exporter-0.31.3-amd64.exe --collectors.enabled memory,logical_disk,os" DisplayName= "Prometheus Windows Exporter" start= auto $ Start-Service windows_exporterCode block. Windows Exporter service registration Color mode# Service Check $ Get-Service windows_exporter # Metric Check $ Invoke-WebRequest -Uri "http://localhost:9182/metrics" | Select-String memory# Service Check $ Get-Service windows_exporter # Metric Check $ Invoke-WebRequest -Uri "http://localhost:9182/metrics" | Select-String memoryCode block. Windows Exporter service check Configuration File Settings
- You can set it to use a YAML configuration file using the
–config.fileoption.Color mode$ .\windows_exporter.exe --config.file=config.yml $ .\windows_exporter.exe --config.file="C:\Program Files\windows_exporter\config.yml" # If you use an absolute path, you must enclose the path in quotes.$ .\windows_exporter.exe --config.file=config.yml $ .\windows_exporter.exe --config.file="C:\Program Files\windows_exporter\config.yml" # If you use an absolute path, you must enclose the path in quotes.Code block. Windows Exporter configuration file settings Color modecollectors: enabled: cpu,net,service collector: service: include: windows_exporter log: level: warncollectors: enabled: cpu,net,service collector: service: include: windows_exporter log: level: warnCode block. Windows Exporter configuration file example snippet
- You can set it to use a YAML configuration file using the
- Windows Exporter > official example configuration file please refer.Color mode
--- # Note this is not an exhaustive list of all configuration values collectors: enabled: cpu,logical_disk,net,os,service,system collector: service: include: "windows_exporter" scheduled_task: include: /Microsoft/.+ log: level: debug scrape: timeout-margin: 0.5 telemetry: path: /metrics web: listen-address: ":9182"--- # Note this is not an exhaustive list of all configuration values collectors: enabled: cpu,logical_disk,net,os,service,system collector: service: include: "windows_exporter" scheduled_task: include: /Microsoft/.+ log: level: debug scrape: timeout-margin: 0.5 telemetry: path: /metrics web: listen-address: ":9182"Code block. Windows Exporter configuration file example - Refer to the below to register a service using a configuration file.Color mode
$ sc.exe create windows_exporter binPath= "C:\Temp\windows_exporter-0.31.3-amd64.exe --config.file=C:\Temp\config.yml" DisplayName= "Prometheus Windows Exporter" start= auto $ Start-Service windows_exporter$ sc.exe create windows_exporter binPath= "C:\Temp\windows_exporter-0.31.3-amd64.exe --config.file=C:\Temp\config.yml" DisplayName= "Prometheus Windows Exporter" start= auto $ Start-Service windows_exporterCode block. Service registration using Windows Exporter configuration file
- Refer to the below to register a service using a configuration file.
For more details, see ServiceWatch > Using ServiceWatch Agent.
Node Exporter metrics
Node Exporter Main Metrics
Below is the collector and metric information that can be checked through Node Exporter. You can set it as a Collector, or you can enable only specific metrics.
| Category | Collector | Metric | Description |
|---|---|---|---|
| Memory | meminfo | node_memory_MemTotal_bytes | Total memory |
| Memory | meminfo | node_memory_MemAvailable_bytes | Available memory (used to determine memory shortage) |
| Memory | meminfo | node_memory_MemFree_bytes | Free memory (empty memory) |
| Memory | meminfo | node_memory_Buffers_bytes | IO buffer |
| Memory | meminfo | node_memory_Cached_bytes | page cache |
| Memory | meminfo | node_memory_SwapTotal_bytes | total swap |
| Memory | meminfo | node_memory_SwapFree_bytes | Remaining swap |
| Filesystem | filesystem | node_filesystem_size_bytes | total filesystem size |
| Filesystem | filesystem | node_filesystem_free_bytes | total free space |
| Filesystem | filesystem | node_filesystem_avail_bytes | Space actually available to the user (available space for unprivileged users) |
Node Exporter Collector and metric collection settings
Node Exporter enables most collectors by default, but you can enable/disable only the collectors you want.
Activate only specific Collector
- When you only want to use the memory and file system collectors:Color mode
./node_exporter --collector.meminfo # Memory Collector activation --collector.filesystem # File system Collector activation./node_exporter --collector.meminfo # Memory Collector activation --collector.filesystem # File system Collector activationCode block. Enable specific Collector of Node Exporter - When you want to disable all Default settings and use only the memory and file system Collectors:Color mode
./node_exporter --collector.disable-defaults # Disable default metrics --collector.meminfo # Memory Collector activation --collector.filesystem # File system Collector activation./node_exporter --collector.disable-defaults # Disable default metrics --collector.meminfo # Memory Collector activation --collector.filesystem # File system Collector activationCode block. Enable specific Collector of Node Exporter - Enable file system Collector for a specific mount pointColor mode
./node_exporter --collector.disable-defaults # disable default metrics --collector.filesystem.mount-points-include="/|/data" # Activate file system Collector for /(Root) and /data mount points./node_exporter --collector.disable-defaults # disable default metrics --collector.filesystem.mount-points-include="/|/data" # Activate file system Collector for /(Root) and /data mount pointsCode block. Enable specific Collector of Node Exporter - Enable file system Collector excluding specific mount pointsColor mode
./node_exporter --collector.disable-defaults # disable default metrics --collector.filesystem.mount-points-exclude="/boot|/var/log" # Enable file system Collector for /boot and /var/log mount points./node_exporter --collector.disable-defaults # disable default metrics --collector.filesystem.mount-points-exclude="/boot|/var/log" # Enable file system Collector for /boot and /var/log mount pointsCode block. Enable specific Collector of Node Exporter
Disable specific Collector (no-collector)
When you don’t want to use the file system collector:
./node_exporter --no-collector.filesystem./node_exporter --no-collector.filesystemConfigure Collector with Systemd service (recommended)
[Unit]
Description=Node Exporter
After=network-online.target
[Service]
User=nodeexp
ExecStart=/usr/local/bin/node_exporter
--collector.disable-defaults # Disable all default metric collectors
--collector.meminfo
--collector.filesystem
[Install]
WantedBy=multi-user.target[Unit]
Description=Node Exporter
After=network-online.target
[Service]
User=nodeexp
ExecStart=/usr/local/bin/node_exporter
--collector.disable-defaults # Disable all default metric collectors
--collector.meminfo
--collector.filesystem
[Install]
WantedBy=multi-user.targetHow to filter only specific metrics
Through the Open Telemetry Collector configuration, you can set it to collect only the necessary metrics gathered from the Node Exporter. When you want to collect only specific metrics among those provided by a particular collector of Node Exporter, you can refer to Preconfiguration of Open Telemetry Collector for ServiceWatch.
Windows Exporter Metrics
Windows Exporter Main Metrics
Below is the collector and metric information that can be checked through Windows Exporter. You can set it as a Collector, or you can enable only specific metrics.
| Category | Collector | Metric Name | Description |
|---|---|---|---|
| Memory | memory | windows_memory_available_bytes | Available Memory |
| Memory | memory | windows_memory_cache_bytes | Cache Memory |
| Memory | memory | windows_memory_committed_bytes | Committed memory |
| Memory | memory | windows_memory_commit_limit | Commit limit |
| Memory | memory | windows_memory_pool_paged_bytes | paged pool |
| Memory | memory | windows_memory_pool_nonpaged_bytes | non-paged pool |
| Disk Information | logical_disk | windows_logical_disk_free_bytes | Remaining Capacity |
| Disk Information | logical_disk | windows_logical_disk_size_bytes | Total Capacity |
| Disk Information | logical_disk | windows_logical_disk_read_bytes_total | Read Bytes |
| Disk Information | logical_disk | windows_logical_disk_write_bytes_total | Write Bytes Count |
| Disk Information | logical_disk | windows_logical_disk_read_seconds_total | Read latency |
| Disk Information | logical_disk | windows_logical_disk_write_seconds_total | Write latency |
| Disk Information | logical_disk | windows_logical_disk_idle_seconds_total | idle time |
Windows Exporter Collector and metric collection settings
Windows Exporter enables most collectors by default, but you can configure only the collectors you want.
Activate only specific Collector
CPU, memory, when you want to use only logical disks:
# --collector.enabled option disables the default and activates only the specified Collector
.\windows_exporter.exe --collectors.enabled="memory,logical_disk"# --collector.enabled option disables the default and activates only the specified Collector
.\windows_exporter.exe --collectors.enabled="memory,logical_disk"–collector.enabled.Configure Collector as a service (recommended)
# Register windows_exporter as a service
sc.exe create windows_exporter binPath= "C:\Temp\windows_exporter-0.31.3-amd64.exe --config.file=C:\Temp\config.yml" DisplayName= "Prometheus Windows Exporter" start= auto
# Service Start
Start-Service windows_exporter# Register windows_exporter as a service
sc.exe create windows_exporter binPath= "C:\Temp\windows_exporter-0.31.3-amd64.exe --config.file=C:\Temp\config.yml" DisplayName= "Prometheus Windows Exporter" start= auto
# Service Start
Start-Service windows_exporter# Note this is not an exhaustive list of all configuration values
collectors:
enabled: logical_disk,memory # collector settings to enable
collector:
service:
include: "windows_exporter"
scheduled_task:
include: /Microsoft/.+
log:
level: debug
scrape:
timeout-margin: 0.5
telemetry:
path: /metrics
web:
listen-address: ":9182"# Note this is not an exhaustive list of all configuration values
collectors:
enabled: logical_disk,memory # collector settings to enable
collector:
service:
include: "windows_exporter"
scheduled_task:
include: /Microsoft/.+
log:
level: debug
scrape:
timeout-margin: 0.5
telemetry:
path: /metrics
web:
listen-address: ":9182"How to filter only specific metrics
Through the Open Telemetry Collector configuration, you can set it to collect only the necessary metrics collected from the Windows Exporter. When you want to collect only specific metrics among those provided by a particular collector of the Windows Exporter, you can refer to the Open Telemetry Collector pre‑configuration for ServiceWatch.