Installing the ServiceWatch Agent
Users can install the ServiceWatch Agent on a Virtual Server to collect custom metrics and logs.
- Metric collection through the ServiceWatch Agent is billed separately from the default metrics collected from each service because it is categorized as custom metrics. We recommend removing or disabling any unnecessary metric collection settings.
- To analyze the memory usage of a Virtual Server in Resource Optimizer, install the Service Watch Agent on the Virtual Server and then configure the Open Telemetry Collector settings for ServiceWatch as follows.
- Set the
“namespace”in the agent.json configuration file to“Virtual Server Agent” - Set the
“meticMetas>metricName”in the metric.json configuration file to“memory_usage”. - If you do not configure it as described above, Resource Optimizer may not recognize the memory metrics.
- Set the
ServiceWatch Agent
The agents that must be installed on a Virtual Server to collect custom metrics and logs for ServiceWatch can be broadly divided into two types. Prometheus Exporter and Open Telemetry Collector.
| Category | Detailed Description |
|---|---|
| Prometheus Exporter | Provide metrics for specific applications or services in a format that Prometheus can scrape.
|
| Open Telemetry Collector | Acts as a centralized collector that gathers telemetry data such as metrics and logs from distributed systems, processes it (e.g., filtering, sampling), and exports it to multiple backends (e.g., Prometheus, Jaeger, Elasticsearch).
|
Preconfiguration for Using the ServiceWatch Agent
To use the ServiceWatch Agent, prepare the prerequisites by referring to Prerequisites for the ServiceWatch Agent.
Installing the Prometheus Exporter for Virtual Server (for Linux)
Install the Prometheus Exporter on a Linux server by following the steps below.
Node Exporter is configured after creating a dedicated user.
Create a Node Exporter User
Create a dedicated user to securely 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 Configuration
- Download it to install Node Exporter.
This guide covers the following version.
- Download path: /tmp
- Installed 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 permissions 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 configuration command Creates a service file. 3. Configure Node Exporter to collect memory metrics (meminfo) or block storage metrics (filesystem).
–collector.disable-defaults: Disable default metrics–collector.meminfo: Enable memory metrics–collector.filesystem: Enable block storage filesystem metricsColor modesudo vi /etc/systemd/system/node_exporter.servicesudo vi /etc/systemd/system/node_exporter.serviceCode block. Command to open the Node Exporter service file 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 \ --collector.meminfo \ --collector.filesystem 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 \ --collector.meminfo \ --collector.filesystem Restart=on-failure [Install] WantedBy=multi-user.targetCode block. Result of opening the Node Exporter service file
You can enable or disable the collector using flags.
–collector.{name}: Use this to enable a specific metric.–no-collector.{name}: You can disable specific metrics.- To disable all default metrics and enable only specific collectors, use the following:
–collector.disable-defaults –collector.{name} …
The following is a description of the main collectors.
| Collector | Description | Label |
|---|---|---|
| meminfo | Provide memory statistics | - |
| filesystem | Provides file system statistics, such as used disk space |
|
- You can view the key metrics provided by Node Exporter and how to configure Node Exporter collectors in Node Exporter metrics.
- For details on the available metrics and how to configure them, see Node Exporter > Collector.
- The metrics available may vary depending on the version of Node Exporter in use. * See Node Exporter.
- Enable and Start the Service
Register the Node Exporter service and verify 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. Commands to enable and start the Node Exporter service Color modesudo systemctl status node_exportersudo systemctl status node_exporterCode block. Command to check the Node Exporter service Color modecurl http://localhost:9100/metrics | grep node_memorycurl http://localhost:9100/metrics | grep node_memoryCode block. Command to check Node Exporter metric information
For details, refer to ServiceWatch > Using ServiceWatch Agent.
Installing the Prometheus Exporter for Virtual Server (for Windows)
To use the Prometheus Exporter on a Windows server, install it by following the steps below.
Windows Exporter Configuration
- Download the installation file to install the Windows Exporter.
- Download path: C:\Temp
- Test version: 0.31.3Color mode
New-Item -ItemType Directory -Force C:\Temp | Out-Null 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"New-Item -ItemType Directory -Force C:\Temp | Out-Null 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. Download Windows Exporter
- Windows Exporter Execution Test
By default, the Windows Exporter enables all collectors. To collect only the desired metrics, enable the following collectors. The following is an example of enabling the collector specified by the user.
- Memory metrics: memory
- Block storage metrics: logical_disk
- Host name: osColor mode
cd C:\Temp .\windows_exporter-0.31.3-amd64.exe --collectors.enabled memory,logical_disk,oscd C:\Temp .\windows_exporter-0.31.3-amd64.exe --collectors.enabled memory,logical_disk,osCode block. Windows Exporter execution test
You can enable the collector using a flag.
–collectors.enabled “[defaults]"Metrics provided by default–collectors.enabled {name},{name},{name}…: Use this to enable specific metrics.
The following is a description of the main collectors.
| Collector | Description | Label |
|---|---|---|
| memory | Provide memory statistics | |
| logical_disk | Collect performance and status metrics for logical disks (e.g., C: and D: drives) on the local system |
|
- You can view the key metrics provided by the Windows Exporter and how to configure the Windows Exporter Collector in Windows Exporter Metrics.
For details on the available metrics and how to configure them, see Windows Exporter > Collector.
The metrics available may vary depending on the version of the Windows Exporter you are using. * See Windows Exporter.
Service Registration and Verification Register the Windows Exporter service and verify the configured metrics.
Color modesc.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_exportersc.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. Registering the Windows Exporter Service Color mode# Service Verification Get-Service windows_exporter # Check metrics Invoke-WebRequest -Uri "http://localhost:9182/metrics" | Select-String memory# Service Verification Get-Service windows_exporter # Check metrics Invoke-WebRequest -Uri "http://localhost:9182/metrics" | Select-String memoryCode block. Check the Windows Exporter service Configuration File Settings
- You can enable the use of a YAML configuration file by 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 using an absolute path, enclose the path in quotation marks..\windows_exporter.exe --config.file=config.yml .\windows_exporter.exe --config.file="C:\Program Files\windows_exporter\config.yml" # If using an absolute path, enclose the path in quotation marks.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. Example of a partial Windows Exporter configuration file - See Windows Exporter > Configuration file official example file.To register a service using a configuration file, refer to the following.Color mode
--- #Note that 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 that 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: :9182Code block. Example Windows Exporter configuration file Color modesc.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_exportersc.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. Registering a Service Using a Windows Exporter Configuration File
- You can enable the use of a YAML configuration file by using the
For details, see ServiceWatch > Using ServiceWatch Agent.
#Node Exporter metrics {
The following is the collector and metric information available through Node Exporter. You can configure it as a Collector or 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 whether memory is insufficient) |
| 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 | Full Swap |
| Memory | meminfo | node_memory_SwapFree_bytes | Remaining Swap |
| Filesystem | filesystem | node_filesystem_size_bytes | Total file system size |
| Filesystem | filesystem | node_filesystem_free_bytes | Total free space |
| Filesystem | filesystem | node_filesystem_avail_bytes | The space actually available to users (available space for unprivileged users) |
By default, Node Exporter enables most collectors, but you can enable or disable specific collectors as needed.
- 메모리, 파일 시스템 Collector만 사용하고 싶을 때:Color mode
./node_exporter \ --collector.meminfo \ --collector.filesystem./node_exporter \ --collector.meminfo \ --collector.filesystemCode Block. Enabling a Specific Collector in Node Exporter - Default 설정은 모두 해제하고 메모리, 파일 시스템 Collector만 사용하고 싶을 때:Enable the file system Collector for a specific mount pointColor mode
./node_exporter \ --collector.disable-defaults \ --collector.meminfo \ --collector.filesystem./node_exporter \ --collector.disable-defaults \ --collector.meminfo \ --collector.filesystemCode Block. Enabling a Specific Collector in Node Exporter Enable the file system Collector for all mount points except specific onesColor mode./node_exporter \ --collector.disable-defaults \ --collector.filesystem.mount-points-include="/|/data"./node_exporter \ --collector.disable-defaults \ --collector.filesystem.mount-points-include="/|/data"Code Block. Enabling a Specific Collector in Node Exporter Color mode./node_exporter \ --collector.disable-defaults \ --collector.filesystem.mount-points-exclude="/boot|/var/log"./node_exporter \ --collector.disable-defaults \ --collector.filesystem.mount-points-exclude="/boot|/var/log"Code Block. Enabling a Specific Collector in Node Exporter
파일 시스템 collector를 사용하고 싶지 않을때:
./node_exporter --no-collector.filesystem./node_exporter --no-collector.filesystem[Unit]
Description=Node Exporter
After=network-online.target
[Service]
User=nodeexp
ExecStart=/usr/local/bin/node_exporter \
--collector.disable-defaults \
--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 \
--collector.meminfo \
--collector.filesystem
[Install]
WantedBy=multi-user.targetYou can configure the OpenTelemetry Collector to collect only the necessary metrics from the Node Exporter. When you want to collect only specific metrics from the metrics provided by a specific collector in Node Exporter, [Preconfiguration of Open Telemetry Collector for ServiceWatch](/userguide/management/service_watch/how_to_guides/service_watch_agent/
#Windows Exporter metrics {
The following is the Collector and metric information that can be viewed through the Windows Exporter. You can configure it as a Collector or 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 | Bytes read |
| Disk Information | logical_disk | windows_logical_disk_write_bytes_total | Bytes written |
| 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 |
By default, the Windows Exporter enables most collectors, but you can configure only the collectors you need.
CPU, 메모리, 논리 디스크만 사용하고 싶을 때:
#The --collectors.enabled option disables the default and enables only the specified Collectors.
.\windows_exporter.exe --collectors.enabled="memory,logical_disk"#The --collectors.enabled option disables the default and enables only the specified Collectors.
.\windows_exporter.exe --collectors.enabled="memory,logical_disk"–collectors.enabled to collect data only from the collectors specified in the option, without having to disable unused collectors in the 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
#Start Service
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
#Start Service
Start-Service windows_exporter#Note that this is not an exhaustive list of all configuration values
collectors:
enabled: logical_disk,memory
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 that this is not an exhaustive list of all configuration values
collectors:
enabled: logical_disk,memory
collector:
service:
include: "windows_exporter"
scheduled_task:
include: /Microsoft/.+
log:
level: debug
scrape:
timeout-margin: 0.5
telemetry:
path: /metrics
web:
listen-address: :9182You can configure the OpenTelemetry Collector to collect only the necessary metrics from the Windows Exporter. When you want to collect only specific metrics from the metrics provided by a specific collector in the Windows Exporter, refer to [Open Telemetry Collector Presets for ServiceWatch](/userguide/management/service_watch/how_to_guides/service_watch_agent/