The page has been translated by Gen AI.

Installing the ServiceWatch Agent

Users can install the ServiceWatch Agent on a Virtual Server to collect custom metrics and logs.

Notice
When collecting custom metrics or logs using the ServiceWatch Agent, contact us separately for the kr-south3 region by referring to Support Center > Inquiries.
Warning
  • 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.

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.

CategoryDetailed Description
Prometheus ExporterProvide metrics for specific applications or services in a format that Prometheus can scrape.
  • You can use Node Exporter for Linux servers and Windows Exporter for Windows servers, depending on the operating system.
  • You can use the DCGM (NVIDIA Data Center GPU Manager) Exporter for GPU metrics.
Open Telemetry CollectorActs 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).
  • Exports data to the ServiceWatch Gateway, enabling ServiceWatch to collect metrics and log data.
Table. Description of Prometheus Exporter and Open Telemetry Collector

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.

Color mode
sudo useradd --no-create-home --shell /bin/false node_exporter
sudo useradd --no-create-home --shell /bin/false node_exporter
Code block. Node Exporter user creation command

Node Exporter Configuration

  1. Download it to install Node Exporter. This guide covers the following version.
    • Download path: /tmp
    • Installed version: 1.7.0
      Color mode
      cd /tmp
      wget https://github.com/prometheus/node_exporter/releases/download/v1.7.0/node_exporter-1.7.0.linux-amd64.tar.gz
      cd /tmp
      wget https://github.com/prometheus/node_exporter/releases/download/v1.7.0/node_exporter-1.7.0.linux-amd64.tar.gz
      Code block. Node Exporter download command
Reference
You can find the latest version of Node Exporter at Node Exporter > Releases > Latest, and specific versions of Node Exporter at Node Exporter > Releases.
  1. Install the downloaded Node Exporter and grant permissions to the executable file.

    Color mode
    cd /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_exporter
    cd /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_exporter
    Code block. Node Exporter installation command
    Color mode
    sudo chown node_exporter:node_exporter /usr/local/bin/node_exporter
    sudo chown node_exporter:node_exporter /usr/local/bin/node_exporter
    Code block. Node Exporter permission configuration command

  2. 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 metrics
      Color mode
      sudo vi /etc/systemd/system/node_exporter.service
      sudo vi /etc/systemd/system/node_exporter.service
      Code 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.target
      Code block. Result of opening the Node Exporter service file
Reference
  • 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.

CollectorDescriptionLabel
meminfoProvide memory statistics-
filesystemProvides file system statistics, such as used disk space
  • device: The physical or virtual device path where the filesystem is located
    • Example: /dev/sda1
  • fstype: The type of the filesystem
    • Example: ext4, xfs, nfs, tmpfs
  • mountpoint: The path where the filesystem is mounted on the host OS. This is the most intuitive criterion for distinguishing disks
    • Example: /, /var/lib/docker, /mnt/data
Table. Description of Key Node Exporter Collectors
  • You can view the key metrics provided by Node Exporter and how to configure Node Exporter collectors in Node Exporter metrics.
Reference
  • 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.
Warning
Metric collection through the ServiceWatch Agent is billed separately from default metrics because it is categorized as custom metrics. To avoid excessive charges, remove or disable any unnecessary metric collection.
  1. 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_exporter
    sudo systemctl daemon-reload
    sudo systemctl enable --now node_exporter
    Code block. Commands to enable and start the Node Exporter service
    Color mode
    sudo systemctl status node_exporter
    sudo systemctl status node_exporter
    Code block. Command to check the Node Exporter service
    Color mode
    curl http://localhost:9100/metrics | grep node_memory
    curl http://localhost:9100/metrics | grep node_memory
    Code block. Command to check Node Exporter metric information
Notice
If you have completed the Node Exporter configuration, you must install the Open Telemetry Collector provided by ServiceWatch to complete the ServiceWatch Agent configuration.
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

  1. Download the installation file to install the Windows Exporter.
    • Download path: C:\Temp
    • Test version: 0.31.3
      Color 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
Reference
You can find the Windows Exporter version and installation files at Windows Exporter > Releases.
  1. 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: os
      Color 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,os
      Code block. Windows Exporter execution test
Reference
  • 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.

CollectorDescriptionLabel
memoryProvide memory statistics
logical_diskCollect performance and status metrics for logical disks (e.g., C: and D: drives) on the local system
  • volume: The physical or virtual device path where the file system is located
    • Example: C:D:
Table. Description of the main collectors in the Windows Exporter
  • You can view the key metrics provided by the Windows Exporter and how to configure the Windows Exporter Collector in Windows Exporter Metrics.
Reference
Warning
Metric collection through the ServiceWatch Agent is billed separately from default metrics because it is categorized as custom metrics. To avoid excessive charges, remove or disable any unnecessary metric collection.
  1. Service Registration and Verification Register the Windows Exporter service and verify 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_exporter
    Code 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 memory
    Code block. Check the Windows Exporter service

  2. Configuration File Settings

    • You can enable the use of a YAML configuration file by using the –config.file option.
      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 mode
      collectors:
        enabled: cpu,net,service
      collector:
        service:
          include: windows_exporter
      log:
        level: warn
      collectors:
        enabled: cpu,net,service
      collector:
        service:
          include: windows_exporter
      log:
        level: warn
      Code block. Example of a partial Windows Exporter configuration file
    • See Windows Exporter > Configuration file official example file.
      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: :9182
      Code block. Example Windows Exporter configuration file
      To register a service using a configuration file, refer to the following.
      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_exporter
      Code Block. Registering a Service Using a Windows Exporter Configuration File
Reference
When configuration files and command-line options are used together, the values specified in the command-line options take precedence. Therefore, command-line options override the settings in the configuration file.
Notice
If you have completed the Windows Exporter configuration, you must install the Open Telemetry Collector provided by ServiceWatch to complete the ServiceWatch Agent configuration.
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.

CategoryCollectorMetricDescription
Memorymeminfonode_memory_MemTotal_bytesTotal Memory
Memorymeminfonode_memory_MemAvailable_bytesAvailable memory (used to determine whether memory is insufficient)
Memorymeminfonode_memory_MemFree_bytesFree memory (empty memory)
Memorymeminfonode_memory_Buffers_bytesIO buffer
Memorymeminfonode_memory_Cached_bytesPage Cache
Memorymeminfonode_memory_SwapTotal_bytesFull Swap
Memorymeminfonode_memory_SwapFree_bytesRemaining Swap
Filesystemfilesystemnode_filesystem_size_bytesTotal file system size
Filesystemfilesystemnode_filesystem_free_bytesTotal free space
Filesystemfilesystemnode_filesystem_avail_bytesThe space actually available to users (available space for unprivileged users)
Table. Key Node Exporter metrics

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.filesystem
    Code Block. Enabling a Specific Collector in Node Exporter
  • Default 설정은 모두 해제하고 메모리, 파일 시스템 Collector만 사용하고 싶을 때:
    Color mode
    ./node_exporter \
      --collector.disable-defaults \
      --collector.meminfo \
      --collector.filesystem
    ./node_exporter \
      --collector.disable-defaults \
      --collector.meminfo \
      --collector.filesystem
    Code Block. Enabling a Specific Collector in Node Exporter
    Enable the file system Collector for a specific mount point
    Color 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
    Enable the file system Collector for all mount points except specific ones
    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를 사용하고 싶지 않을때:

Color mode
./node_exporter --no-collector.filesystem
./node_exporter --no-collector.filesystem
Code Block. Disabling a Specific Collector in Node Exporter

Color mode
[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.target
Code block. Node Exporter > /etc/systemd/system/node_exporter.service configuration

You 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.

CategoryCollectorMetric NameDescription
Memorymemorywindows_memory_available_bytesAvailable memory
Memorymemorywindows_memory_cache_bytesCache Memory
Memorymemorywindows_memory_committed_bytesCommitted Memory
Memorymemorywindows_memory_commit_limitCommit limit
Memorymemorywindows_memory_pool_paged_bytespaged pool
Memorymemorywindows_memory_pool_nonpaged_bytesnon-paged pool
Disk Informationlogical_diskwindows_logical_disk_free_bytesRemaining capacity
Disk Informationlogical_diskwindows_logical_disk_size_bytesTotal capacity
Disk Informationlogical_diskwindows_logical_disk_read_bytes_totalBytes read
Disk Informationlogical_diskwindows_logical_disk_write_bytes_totalBytes written
Disk Informationlogical_diskwindows_logical_disk_read_seconds_totalRead latency
Disk Informationlogical_diskwindows_logical_disk_write_seconds_totalWrite latency
Disk Informationlogical_diskwindows_logical_disk_idle_seconds_totalidle time
Table. Key metrics for the Windows Exporter

By default, the Windows Exporter enables most collectors, but you can configure only the collectors you need.

CPU, 메모리, 논리 디스크만 사용하고 싶을 때:

Color mode
#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"
Code Block. Enabling a Specific Collector in the Windows Exporter
Reference
You can use –collectors.enabled to collect data only from the collectors specified in the option, without having to disable unused collectors in the Windows Exporter.

Color mode
#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
Code block. Service registration
Color mode
#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: :9182
Code block. Service configuration file

You 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/

Configure RHEL Repo and WKMS
Release Note