The page has been translated by Gen AI.

Install ServiceWatch Agent

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

Reference
Collecting custom metrics/logs via the ServiceWatch Agent is currently available only on Samsung Cloud Platform For Enterprise. It will also be available in other offerings in the future.
Caution
Metric collection through the ServiceWatch Agent is classified as custom metrics and, unlike the default metrics collected from each service, incurs charges; therefore, we recommend removing or disabling unnecessary metric collection settings.

ServiceWatch Agent

The agents that must be installed on a Virtual Server to collect ServiceWatch’s custom metrics and logs can be divided into two main types. It is the Prometheus Exporter and OpenTelemetry Collector.

CategoryDetailed description
Prometheus ExporterProvide metrics of a specific application or service in a format that Prometheus can scrape
  • Depending on the OS, you can use the Node Exporter for Linux servers and the Windows Exporter for Windows servers
Open Telemetry CollectorActs as a centralized collector that gathers telemetry data such as metrics and logs from distributed systems, processes (filtering, sampling, etc.), and exports them to various backends (e.g., Prometheus, Jaeger, Elasticsearch, etc.)
  • Exports data via the ServiceWatch Gateway so that ServiceWatch can collect metric and log data.
Table. Explanation of Prometheus Exporter and Open Telemetry Collector

Pre-configuration for Using ServiceWatch Agent

To use the ServiceWatch Agent, please refer to ServiceWatch Agent를 위한 사전 환경 설정 and prepare the prerequisite configuration.

Install Prometheus Exporter for Virtual Server (for Linux)

Install the Prometheus Exporter on a Linux server according to the steps below.

Node Exporter installation

Install Node Exporter according to the steps below.

  1. Node Exporter User Creation
  2. Node Exporter configuration

Create 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 to install Node Exporter. This guide refers to the version below.
    • 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
The latest version of Node Exporter can be found at Node Exporter > Releases > Lastest, and specific versions of Node Exporter can be found at Node Exporter > Releases.
  1. Install the downloaded Node Exporter and grant permission 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 setting command

  2. Create service file Configure Node Exporter to collect memory metrics (meminfo) or block storage metrics (filesystem).

    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 \    # disable default metrics
      --collector.meminfo \             # Enable memory metrics
      --collector.filesystem            # Block Storage filesystem metrics enable
    
    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 filesystem metrics enable
    
    Restart=on-failure
    
    [Install]
    WantedBy=multi-user.target
    code block. Result of opening the Node Exporter service file

Reference
  • The collector can be enabled or disabled using a flag.

    • –collector.{name}: Used to enable a specific metric.
    • –no-collector.{name}: Disables a specific metric.
    • To disable all default metrics and enable only a specific collector, you can use –collector.disable-defaults –collector.{name} ….
  • Below is a description of the main collector.

CollectorExplanationLabel
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. The most intuitive criterion for distinguishing disks
    • Example: /, /var/lib/docker, /mnt/data
Table: Description of major Node Exporter collectors
  • Node Exporter 지표 you can check the main metrics provided by Node Exporter and the Node Exporter Collector configuration method.
Reference
  • Detailed information about the collectable metrics and how to configure them can be found in Node Exporter > Collector.
  • The metrics available may vary depending on the version of the Node Exporter you are using. * Please refer to Node Exporter.
Caution
Since metric collection through the ServiceWatch Agent is classified as custom metrics and incurs charges unlike the default metrics, unnecessary metric collection must be removed or disabled to prevent excessive fees.
  1. Service activation and start 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. Node Exporter service activation and start command
    Color mode
    sudo systemctl status node_exporter
    sudo systemctl status node_exporter
    Code block. Node Exporter service check command
    Color mode
    curl http://localhost:9100/metrics | grep node_memory
    curl http://localhost:9100/metrics | grep node_memory
    Code block. Node Exporter metric information check command
information
If you have completed the Node Exporter configuration, you must install the Open Telemetry Collector provided by ServiceWatch to finish setting up the ServiceWatch Agent.
For more details, see ServiceWatch > ServiceWatch Agent 사용하기.

Install Prometheus Exporter for Virtual Server (for Windows)

Install according to the steps below to use Prometheus Exporter on a Windows server.

Install Windows Exporter

Install the Windows Exporter following the steps below.

  1. Windows Exporter 설정

Windows Exporter configuration

  1. Download the installation file to install the Windows Exporter.
    • Download path: C:\Temp
    • Test version: 0.31.3
      Color 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. Download Windows Exporter
Reference
Windows Exporter version and installation files can be found at Windows Exporter > Releases.
  1. 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. The following is an example that activates a collector specified by the user.
    • Memory metric: memory
    • Block storage metric: local_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
  • The 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 a description of the main collector.

CollectorExplanationLabel
memoryProvide memory statistics
logical_diskCollect performance and health metrics of logical disks (e.g., C:, 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 major Windows Exporter collectors
  • Windows Exporter 지표 you can find the main metrics provided by Windows Exporter and the method to configure the Windows Exporter Collector.
Reference
  • Detailed information about the collectable metrics and how to configure them can be found in Windows Exporter > Collector.

  • The metrics that can be provided may vary depending on the version of the Windoes Exporter you are using. * Please refer to Windows Exporter.

Caution
Since metric collection through the ServiceWatch Agent is classified as custom metrics and incurs charges unlike the default metrics, unnecessary metric collection must be removed or disabled to prevent excessive fees.
  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. Windows Exporter service registration
    Color mode
    # Service check
    $ Get-Service windows_exporter
    
    # Check metrics
    $ Invoke-WebRequest -Uri "http://localhost:9182/metrics" | Select-String memory
    # Service check
    $ Get-Service windows_exporter
    
    # Check metrics
    $ Invoke-WebRequest -Uri "http://localhost:9182/metrics" | Select-String memory
    Code block. Check Windows Exporter service

  2. Configuration file settings

    • You can set it to use 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 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 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 part of a Windows Exporter configuration file
    • Please refer to Windows Exporter > Official Example Configuration File.
      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. Example of a Windows Exporter configuration file
      Refer to the following 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_exporter
      code block. Service registration using Windows Exporter configuration file
Reference
When using a configuration file together with command-line options, the values specified in the command-line options take precedence. Consequently, command-line options override the configuration file settings.
notice
If you have completed the Node Exporter configuration, you must install the OpenTelemetry Collector provided by ServiceWatch to finish the ServiceWatch Agent setup.
For detailed information, refer to ServiceWatch > ServiceWatch Agent 사용하기.

#Node Exporter metrics

Below is the collector and metric information that can be viewed through Node Exporter. It can be set as a Collector, or you can enable only specific metrics.

CategoryCollectorMetricDescription
Memorymeminfonode_memory_MemTotal_bytesTotal memory
Memorymeminfonode_memory_MemAvailable_bytesAvailable memory (used to determine if memory is insufficient)
Memorymeminfonode_memory_MemFree_bytesFree memory (empty memory)
Memorymeminfonode_memory_Buffers_bytesIO buffer
Memorymeminfonode_memory_Cached_bytesPage cache
Memorymeminfonode_memory_SwapTotal_bytesTotal swap
Memorymeminfonode_memory_SwapFree_bytesRemaining swap
Filesystemfilesystemnode_filesystem_size_bytesTotal file system size
Filesystemfilesystemnode_filesystem_free_bytestotal free space
Filesystemfilesystemnode_filesystem_avail_bytesSpace actually available to the user (available space for unprivileged users)
Table. Node Exporter key metrics

Node Exporter enables most collectors by default, but you can enable or disable only the collectors you want.

  • 메모리, 파일 시스템 Collector만 사용하고 싶을 때:
    Color mode
    ./node_exporter
      --collector.meminfo
      --collector.filesystem
    ./node_exporter
      --collector.meminfo
      --collector.filesystem
    code block. Enable 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. Enable specific collector of Node Exporter
    Enable 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. Enable specific collector in Node Exporter
    Enable the file system Collector, excluding specific mount points
    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. Enable specific collector in Node Exporter

파일 시스템 collector를 사용하고 싶지 않을때:

Color mode
./node_exporter --no-collector.filesystem
./node_exporter --no-collector.filesystem
code block. Disable 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 Open Telemetry Collector to select and 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, ServiceWatch를 위한 Open Telemetry Collector 사전 설정

Caution
Collecting metrics through the ServiceWatch Agent is classified as custom metrics, and unlike the default metrics collected from each service, it incurs charges; therefore, we recommend configuring only the metrics that are essential.

#Windows Exporter metrics

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

CategoryCollectorIndicator nameExplanation
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_totalNumber of bytes read
Disk informationlogical_diskwindows_logical_disk_write_bytes_totalWrite byte count
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. Windows Exporter Key Metrics

Windows Exporter enables most collectors by default, but you can configure only the collectors you want.

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

Color mode
#--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"
code block. Enable a specific collector for Windows Exporter
Reference
Even without disabling unused collectors, using –collector.enabled will collect only the collectors specified in that option.

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
#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
code block. service registration
Color mode
#Note 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 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

Through the Open Telemetry Collector configuration, you can set it to collect only the required metrics gathered from the Windows Exporter. When you want to collect only specific metrics among those provided by a particular collector of the Windows Exporter, [ServiceWatch를 위한 Open Telemetry Collector 사전 설정](/userguide/management/service_watch/how_to_guides/service_watch_agent/

Caution
Metric collection through the ServiceWatch Agent is classified as custom metrics and incurs charges, unlike the default metrics collected from each service; therefore, we recommend configuring only the metrics that are essential.
Configure RHEL Repo and WKMS
Release Note