The page has been translated by Gen AI.

ServiceWatch Agent Installation

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 only available on Samsung Cloud Platform For Enterprise. It will be offered in other offerings in the future.
Caution
Metric collection via ServiceWatch Agent is classified as custom metrics and, unlike the metrics collected by default from each service, incurs charges, so it is recommended to remove or disable unnecessary metric collection settings.

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.

CategoryDetailed Description
Prometheus ExporterProvides metrics of a specific application or service in a format that Prometheus can scrape
  • Depending on the OS, you can use Node Exporter for Linux servers and Windows Exporter for Windows servers
Open Telemetry CollectorCollects 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.)
  • Exports data to ServiceWatch Gateway so that ServiceWatch can collect metric and log data.
Table. Explanation of Prometheus Exporter and Open Telemetry Collector

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.

  1. Node Exporter User Creation
  2. Node Exporter Settings

Node Exporter User Creation

Create a dedicated user to safely 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 Settings

  1. Download to install Node Exporter. This guide provides the version below.
    • Download path: /tmp
    • Installation 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 a specific version 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. Service file creation Set 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. 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.target
    Code block. Node Exporter service file open result

Reference
  • 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.

CollectorDescriptionLabel
meminfoProvides memory statistics-
filesystemProvides file system statistics such as used disk space
  • device: Physical or virtual device path where the file system is located
    • Example: /dev/sda1
  • fstype: File system type
    • Example: ext4, xfs, nfs, tmpfs
  • mountpoint: The path where the file system is mounted on the host OS. The most intuitive basis for distinguishing disks
    • Example: /, /var/lib/docker, /mnt/data
Table. Node Exporter Main Collector Description
  • Node Exporter Metrics you can check the main metrics provided by Node Exporter and how to configure the Node Exporter Collector.
Reference
  • 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.
Caution
Since metric collection via ServiceWatch Agent is classified as custom metrics and incurs charges unlike the default collected metrics, unnecessary metric collection must be removed or disabled to avoid excessive charges.
  1. 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_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
Notice
If you have completed the Node Exporter setup, you need to install the Open Telemetry Collector provided by ServiceWatch to complete the ServiceWatch Agent configuration.
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.

  1. Windows Exporter Settings

Windows Exporter Settings

  1. Download the installation file to install 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. Windows Exporter download
Reference
You can check the Windows Exporter version and installation files 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. Below is an example of enabling user-specified collectors.
    • 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
  • 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.

CollectorDescriptionLabel
memoryMemory Statistics Provided
logical_diskCollect performance and health metrics of logical disks (e.g., C:, D: drives) on the local system
  • volume: Physical or virtual device path where the filesystem resides
    • Example: C:D:
Table. Windows Exporter Main Collector Description
  • Windows Exporter Metrics you can check the main metrics provided by Windows Exporter and how to configure the Windows Exporter Collector.
Reference
  • 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.

Caution
Since metric collection via ServiceWatch Agent is classified as custom metrics and incurs charges unlike the default collected metrics, unnecessary metric collection must be removed or disabled to avoid excessive charges.
  1. 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_exporter
    Code 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 memory
    Code block. Windows Exporter service check

  2. Configuration File Settings

    • You can set it to use a YAML configuration file 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. Windows Exporter configuration file example snippet
  • 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_exporter
      Code block. Service registration using Windows Exporter configuration file
Reference
When using configuration files and command-line options together, the values included in the command-line options take precedence. Therefore, command-line options override the configuration file settings.
Notice
If you have completed the Node Exporter setup, you need to install the Open Telemetry Collector provided by ServiceWatch to complete the ServiceWatch Agent configuration.
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.

CategoryCollectorMetricDescription
Memorymeminfonode_memory_MemTotal_bytesTotal memory
Memorymeminfonode_memory_MemAvailable_bytesAvailable memory (used to determine memory shortage)
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 filesystem 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 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 activation
    Code 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 activation
    Code block. Enable specific Collector of Node Exporter
  • Enable file system Collector for a specific mount point
    Color 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 points
    Code block. Enable specific Collector of Node Exporter
  • Enable file system Collector excluding specific mount points
    Color 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 points
    Code block. Enable specific Collector of Node Exporter

Disable specific Collector (no-collector)

When you don’t want to use the file system collector:

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

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

Caution
Metric collection via ServiceWatch Agent is classified as custom metrics, and unlike the metrics collected by default from each service, it incurs charges, so it is recommended to configure only the metrics that are absolutely necessary.

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.

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_totalRead Bytes
Disk Informationlogical_diskwindows_logical_disk_write_bytes_totalWrite Bytes 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 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:

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. Windows Exporter specific Collector activation
Reference
Even without disabling unused collectors, Windows Exporter will collect only the collectors specified in the option when using –collector.enabled.

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 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"
Code block. Service configuration file

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.

Caution
Metric collection via ServiceWatch Agent is classified as custom metrics, and unlike the metrics collected by default from each service, charges apply, so it is recommended to configure only the metrics that are absolutely necessary.
Setting up RHEL Repo and WKMS
Release Note