The page has been translated by Gen AI.

Using the ServiceWatch Agent

Users can install the ServiceWatch Agent on Virtual Servers, GPU Servers, Bare Metal Servers, and other environments 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 > Inquiry.
Warning
Metric collection through the ServiceWatch Agent is billed separately from the default metrics collected from each service, as it is categorized as custom metrics. Therefore, be careful not to configure unnecessary metric collection. Configure the system to collect only the metrics that are essential.

ServiceWatch Agent

The agents that must be installed on the server to collect custom metrics and logs for ServiceWatch can be broadly divided into two types. Prometheus Exporter and Open Telemetry Collector.

Notice
After completing the installation of the Prometheus Exporter appropriate for your environment, you must install the ServiceWatch Agent. The ServiceWatch Agent collects metrics provided by the Prometheus Exporter and sends them to ServiceWatch. Therefore, the Exporter must be installed first.
CategoryDetailed Description
Prometheus ExporterProvides metrics for a specific application or service in a format that Prometheus can scrape. The exporter you use depends on the metrics you want to collect and the server’s operating system. For the types of exporters and installation instructions, see Prometheus Exporter Types.
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.
  • This guide explains how to use the Open Telemetry Collector provided by ServiceWatch.
Table. Description of Prometheus Exporter and Open Telemetry Collector
Reference

To link server log files to ServiceWatch using the ServiceWatch Agent, you must first create a log group and a log stream within that log group.

  • For details on creating log groups and log streams, see Logs.

Types of Prometheus Exporters

Use the following Exporters depending on the metrics you want to collect and the server’s OS.

ExporterCollected MetricsTarget serverInstallation Guide
Node ExporterOS Metrics for Linux Servers
  • Virtual Server
  • GPU Server
  • Bare Metal Server
  • Multi-node GPU Cluster > GPU Node
Virtual Server > ServiceWatch Agent
Windows ExporterOS Metrics for Windows Servers
  • Virtual Server
  • Bare Metal Server
Virtual Server > ServiceWatch Agent
DCGM ExporterGPU Metrics
  • DCGM: NVIDIA Data Center GPU Manager
  • GPU Server
  • Multi-node GPU Cluster > GPU Node
GPU Server > ServiceWatch Agent
Table. Types of Prometheus Exporters
Notice
After completing the installation of the Prometheus Exporter appropriate for your environment, you must install the ServiceWatch Agent.
The ServiceWatch Agent collects metrics provided by the Prometheus Exporter and sends them to ServiceWatch. Therefore, the Exporter must be installed first.

Installation and Configuration Order

Install and configure the ServiceWatch Agent in the following order.

StepTaskDetails
Step 0Installing a Prometheus Exporter for Your EnvironmentPrometheus Exporter Types
Step 1Network settings for communication between the ServiceWatch Agent and ServiceWatchPre-configuration for the ServiceWatch Agent
Step 2Download and Define Agent FilesOpen Telemetry Collector configuration for ServiceWatch
Step 3Running and Stopping an AgentRunning the Open Telemetry Collector for ServiceWatch
Table. ServiceWatch Agent installation and configuration sequence

Pre-configuration for the ServiceWatch Agent

Network configuration is required for communication between the ServiceWatch Agent and ServiceWatch. ServiceWatch Agent supports two methods for sending collected data to ServiceWatch: using an Internet Gateway and using PrivateLink. Select and configure the method that best fits your environment.

Communication MethodDetailed DescriptionSupported Offerings/RegionsRequired settings
How to Use an Internet GatewaySend data to the ServiceWatch OpenAPI Endpoint through the Internet Gateway
  • For Enterprise: kr-west1, kr-east1
  • Soverign: kr-south1, kr-south2
Security Group rules, Internet Gateway Firewall rules
How to Use PrivateLinkSend data to the internal network through the PrivateLink Endpoint created in the VPC
  • For Enterprise: kr-west1, kr-east1
  • For Samsung: kr-west1, kr-east1
PrivateLink Endpoint, Security Group rules, hosts file
Table. Data transmission methods of the ServiceWatch Agent
Reference
For information about data transfer methods in the kr-south3 region, refer to Support Center > Inquiry.
Reference
Bare Metal Servers do not support Security Groups.

How to Use an Internet Gateway

When sending data to ServiceWatch through an Internet Gateway, you must add Security Group and Firewall rules.

Notice
When using the ServiceWatch Agent or ServiceWatch OpenAPI through a NAT Gateway or Internet Gateway in the kr-south1 or kr-south2 regions, you must separately request firewall rule changes.
To request firewall rule changes, go to Support Center > Inquiry.
  1. Add Security Group Rule

    • To send data collected by ServiceWatch from the ServiceWatch Agent installed on a Virtual Server or GPU Server, you must add the following rules to the Security Group.
      DirectionTypePortTarget Address
      OutboundCustom TCP443ServiceWatch OpenAPI Endpoint IP Address
      Table. Security Group rules for ServiceWatch Agent communication
  2. Add a firewall rule

    • If you enable the firewall for the Internet Gateway of a VPC, you must add a firewall rule as shown below.
      DirectionTypePortOperationOrigin addressDestination address
      OutboundTCP443AllowThe Private IP address assigned when creating a Virtual Server. You can view the Virtual Server Private IP address in View Virtual Server Details.ServiceWatch OpenAPI Endpoint IP Address
      Table. Internet Gateway Firewall rules for ServiceWatch Agent communication

With PrivateLink, you can send the data collected by the ServiceWatch Agent to the internal network of the Samsung Cloud Platform without going through the internet. Because the data uses only the internal network, it offers high security and does not require a public IP, NAT, or an Internet Gateway. Therefore, no Internet Gateway Firewall rules are added.

Notice
PrivateLink is available in the kr-west1 and kr-east1 regions for For Enterprise and For Samsung. For the kr-south1 and kr-south2 regions of Soverign, use the Internet Gateway approach.
  1. Create a PrivateLink Endpoint
    • Create a PrivateLink endpoint to connect to ServiceWatch in the VPC. * In Service Type, select Samsung Cloud Platform Provided Services, and then select ServiceWatch_GLOBAL1 from the PrivateLink Service list.
    • For details on the creation procedure, see VPC > Create a PrivateLink Endpoint.
Warning
Creating a PrivateLink Endpoint incurs additional costs.
Also, if you do not specify a security group for the PrivateLink endpoint, all connections are blocked. Therefore, be sure to configure the two security group rules below.
  1. Add Security Group Rule

    • To transmit data through a PrivateLink Endpoint from the ServiceWatch Agent, you must add the following rules to the Security Group.
      TargetDirectionTypePortTarget Address
      Security Group for Virtual Server/GPU ServerOutboundCustom TCP443IP address assigned to the PrivateLink Endpoint
      Security Group for PrivateLink EndpointInboundCustom TCP443IP address of the Virtual Server/GPU Server
      Table. Security Group rules for PrivateLink usage
  2. hosts file configuration

    • Because the ServiceWatch Agent sends data to the ServiceWatch OpenAPI Endpoint domain, you must configure the hosts file on the server to resolve that domain to the PrivateLink Endpoint IP address.
    • The location of the hosts file varies by operating system.
      • Linux: /etc/hosts
      • Windows: C:\Windows\System32\drivers\etc\hosts
        Color mode
        # When the PrivateLink Endpoint IP is 192.168.0.3,
        192.168.0.3 servicewatch.kr-west1.e.samsungsdscloud.com
        # When the PrivateLink Endpoint IP is 192.168.0.3,
        192.168.0.3 servicewatch.kr-west1.e.samsungsdscloud.com
        Code block. Example hosts file configuration
Reference
The domain to register in the hosts file varies depending on the region and offering in use. You can find the domain information in ServiceWatch OpenAPI Endpoint IP address. For the IP address, enter the IP address assigned to the created PrivateLink Endpoint.

ServiceWatch OpenAPI Endpoint IP Address

The following are the endpoint IP addresses required for the ServiceWatch Agent to send data collected by ServiceWatch.

OfferingLegionURLIP address
For Enterprisekr-west1https://servicewatch.kr-west1.e.samsungsdscloud.com112.107.105.24
For Enterprisekr-east1https://servicewatch.kr-east1.e.samsungsdscloud.com112.107.105.68
Soverignkr-south1https://servicewatch.kr-south1.g.samsungsdscloud.com10.150.58.135
Soverignkr-south2https://servicewatch.kr-south2.g.samsungsdscloud.com10.150.90.135
Soverignkr-west1https://servicewatch.kr-west1.k.samsungsdscloud.com112.107.105.132
Table. ServiceWatch OpenAPI Endpoint information
Notice
For the kr-south3 region, please submit a separate inquiry by referring to Support Center > Contact Us.

Open Telemetry Collector Configuration for ServiceWatch

To use the Open Telemetry Collector on the server for collecting ServiceWatch metrics and logs, install it by following the steps below.

1. ### Download the Agent file

Download the Agent file from the ServiceWatch Agent file download URL.

Notice
You can find the file download link for installing the ServiceWatch agent in Service Home > Start Widget of ServiceWatch. You can also check this using the ShowAgentDownloadLink API of ServiceWatch. For details, see the ServiceWatch API Reference.
Color mode
wget [ServiceWatch Agent file download URL]
wget [ServiceWatch Agent file download URL]
Code block. Command to download the Agent installation file for ServiceWatch

2. ### Check the Agent file structure

You can verify the structure of the downloaded Agent file as follows.

  • Extract the Agent file for ServiceWatch.
    Color mode
    unzip ServiceWatch_Agent.zip
    unzip ServiceWatch_Agent.zip
    Code block. Extract the Agent file for ServiceWatch
    Color mode
    README.md
    otelcontribcol_linux_amd64
    otelcontribcol_windows_amd64.exe
    servicewatch-agent-manager-linux-amd64
    servicewatch-agent-manager-windows-amd64.exe
    os-metrics-min-examples/
     ├─ agent.json
     ├─ metric.json
     └─ log.json
    os-metrics-all-examples/
    gpu-metrics-min-examples/
    gpu-metrics-all-examples/
    only-log-without-timestamp-examples/
    README.md
    otelcontribcol_linux_amd64
    otelcontribcol_windows_amd64.exe
    servicewatch-agent-manager-linux-amd64
    servicewatch-agent-manager-windows-amd64.exe
    os-metrics-min-examples/
     ├─ agent.json
     ├─ metric.json
     └─ log.json
    os-metrics-all-examples/
    gpu-metrics-min-examples/
    gpu-metrics-all-examples/
    only-log-without-timestamp-examples/
    Code block. ServiceWatch Agent extraction result
    CategoryDetailed Description
    README.mdGuide to Using the Agent
    otelcontribcol_linux_amd64Open Telemetry Collector for Linux for ServiceWatch
    otelcontribcol_windows_amd64.exeOpen Telemetry Collector for Windows for ServiceWatch
    servicewatch-agent-manager-linux-amd64ServiceWatch Agent Manager for Linux
    servicewatch-agent-manager-windows-amd64.exeServiceWatch Agent Manager for Windows
    Example configuration file folderEach folder contains an agent.json file and example metric.json, log.json files tailored to their respective purposes.
    • os-metrics-min-examples: Example of minimal metric configuration using Node Exporter
    • os-metrics-all-examples: Example of memory/filesystem Collector metric configuration using Node Exporter
    • gpu-metrics-min-examples: Example of minimal metric configuration using DCGM Exporter
    • gpu-metrics-all-examples: Example of key metric configuration using DCGM Exporter
    • only-log-without-timestamp-examples: Example of configuration that collects logs only, without timestamp parsing
    Table. Agent file structure for ServiceWatch
  • If the environment where the ServiceWatch Agent is used is a Linux OS, you must grant execution permissions as follows.
    Color mode
    chmod +x otelcontribcol_linux_amd64
    chmod +x servicewatch-agent-manager-linux-amd64
    chmod +x otelcontribcol_linux_amd64
    chmod +x servicewatch-agent-manager-linux-amd64
    Code block. Granting execute permissions for the Agent file for ServiceWatch
Reference
The ServiceWatch Agent Manager is a tool that helps configure the Open Telemetry Collector to efficiently send custom metrics and logs in conjunction with ServiceWatch. This allows you to send various custom metrics and log data to ServiceWatch.

3. ### agent.json Configuration

Defines the agent configuration file (agent.json) for the ServiceWatch Agent Manager.

CategoryDetailed Description
namespaceCustom namespaces for custom metrics
  • A namespace is a logical division used to distinguish and group metrics. It is designated as a custom metric to distinguish custom metrics.
  • A namespace must be 3 to 128 characters long and can include letters, numbers, spaces, and special characters (_-/). It must begin with a letter.
accessKeyIAM Authentication Key Access Key
accessSecretIAM Authentication Key Secret Key
resourceIdResource ID of the server on Samsung Cloud Platform
  • Example: Resource ID of a Virtual Server
openApiEndpointServiceWatch OpenAPI Endpoint by Legion/Offering
  • Example: https://servicewatch.region.offering.samsungsdscloud.com
  • The region and offering
  • information can be found in the Samsung Cloud Platform Console access URL.
  • Even when using the PrivateLink method, specify the same OpenAPI Endpoint and configure the hosts file so that the domain resolves to the PrivateLink Endpoint IP address.
telemetryPortThe ServiceWatch Agent Telemetry Port is typically set to port 8888. If port 8888 is already in use, you must change it.
Table. agent.json configuration file items
Color mode
{
   "namespace": "swagent-windows",     # Custom namespace for custom metrics
   "accessKey": "testKey",             # IAM authentication key Access Key
   "accessSecret": "testSecret",       # IAM authentication key Secret Key
   "resourceId": "resourceID",         # Resource ID on the server's Samsung Cloud Platform
   "openApiEndpoint": "https://servicewatch.kr-west1.e.samsungsdscloud.com",    # ServiceWatch OpenAPI Endpoint by region/environment
   "telemetryPort": 8889               # Telemetry port for the ServiceWatch Agent (the default is port 8888; the example above specifies port 8889 because port 8888 is already in use)
}
{
   "namespace": "swagent-windows",     # Custom namespace for custom metrics
   "accessKey": "testKey",             # IAM authentication key Access Key
   "accessSecret": "testSecret",       # IAM authentication key Secret Key
   "resourceId": "resourceID",         # Resource ID on the server's Samsung Cloud Platform
   "openApiEndpoint": "https://servicewatch.kr-west1.e.samsungsdscloud.com",    # ServiceWatch OpenAPI Endpoint by region/environment
   "telemetryPort": 8889               # Telemetry port for the ServiceWatch Agent (the default is port 8888; the example above specifies port 8889 because port 8888 is already in use)
}
Code block. Example agent.json configuration

4. ### metric.json Configuration

Defines the metric configuration file (metric.json) for collecting metrics with ServiceWatch.

  • To collect metrics through an agent, configure metric.json.
    CategoryDetailed Description
    prometheus > scrape_configs > targetsFor server endpoints that are targets for metric collection, install the Prometheus Exporter on the same server and configure the endpoint accordingly. Example: localhost:9100
    prometheus > scrape_configs > jobNameSet the Job Name. Typically, set this to the type of Prometheus Exporter used for metric collection.
    • Example: node-exporter
    metricMetas > metricNameSet the name of the metric to collect. The metric name must be 3 to 128 characters long, start with an English letter, and can include letters, numbers, and special characters (_).
    • Example: node_cpu_seconds_total
    metricMetas > dimensionsSet the labels to visualize in the Console from among the labels provided by the Collector to identify the source of the Exporter’s metric data. When visualizing collected metrics in the Console, they are displayed in combinations based on the dimension settings.
    • Configure the setting to match the actual label names collected by the Exporter, including case sensitivity.
    • Example: For metrics from the Memory Collector of the Node Exporter, which do not provide special labels, set the dimension to resource_id.
    • Example: For metrics from the Filesystem Collector of the Node Exporter, you can set the dimension to mountpoint, which indicates the path where the filesystem is mounted on the system.
    metricMetas > unitYou can set the unit for a metric.
    • Example: Bytes, Count, etc.
    metricMetas > aggregationMethodHow to aggregate by the specified dimensions
    • Example: Select from SUM, MAX, MIN, COUNT
    metricMetas > descriptionKoKorean description of the metrics being collected
    metricMetas > descriptionEnEnglish description of the metrics being collected
    Table. metric.json configuration file items
Warning
The label name configured in dimensions must exactly match, including case, the label name that the Exporter actually collects. For example, Hostname and hostname are treated as different labels, preventing metrics from being collected properly.
Additionally, even for the same Exporter, the label names may vary depending on the installed version. Therefore, before creating metric.json, verify the label names actually collected by the Exporter and then configure them in dimensions.

You can check the label names collected by the Exporter by querying the Exporter’s metrics endpoint.

Color mode
curl http://localhost:9100/metrics | grep node_filesystem_size_bytes
curl http://localhost:9100/metrics | grep node_filesystem_size_bytes
Code block. Check the Exporter label name
Color mode
{
   "prometheus": {
      "scrape_configs": {
         "targets": [
            "localhost:9100" # Endpoint of the Prometheus Exporter installed on the server
         ],
         "jobName": "node-exporter" # Typically set to the name of the installed Exporter
      }
   },
   "metricMetas": [
      {
         "metricName": "node_memory_MemTotal_bytes",    # Set the metric name to be linked with ServiceWatch among the metrics collected from the Prometheus Exporter
         "dimensions": [
            [
               "resource_id"        # Sets the label to be visualized in the Console among the Collector labels provided to identify the source of the metric data from Node Exporter
                                    # If no specific label is provided for the relevant Memory-related metrics, set it to resource_id.
            ]
         ],
         "unit": "Bytes",           # Unit of the collected metric data
         "aggregationMethod": "SUM",    # Aggregation method
         "Total physical memory size of the server",    # Korean description of the metric
         "node memory total bytes"
      },
      {
         "metricName": "node_filesystem_size_bytes",    # Set the metric name to be linked with ServiceWatch among the metrics collected from the Prometheus Exporter
         "dimensions": [
            [
               "mountpoint"        # Sets the label to visualize in the Console among the Collector labels provided to identify the source of the Node Exporter metric data
                                   # Set the dimension to the mount point, which indicates the path where the filesystem for the relevant Filesystem metrics is mounted on the system.
            ]
         ],
         "unit": "Bytes",
         "aggregationMethod": "SUM",
         "node filesystem size bytes"
         "node filesystem size bytes"
      },
      {
         "metricName": "node_memory_MemAvailable_bytes",
         "dimensions": [
            [
               "resource_id"
            ]
         ],
         "unit": "Bytes",
         "aggregationMethod": "SUM",
         "node memory available bytes"
         "node memory available bytes"
      },
      {
         "metricName": "node_filesystem_avail_bytes",
         "dimensions": [
            [
               "mountpoint"
            ]
         ],
         "unit": "Bytes",
         "aggregationMethod": "SUM",
         "node filesystem available bytes",
         "node filesystem available bytes"
      }
   ]
}
{
   "prometheus": {
      "scrape_configs": {
         "targets": [
            "localhost:9100" # Endpoint of the Prometheus Exporter installed on the server
         ],
         "jobName": "node-exporter" # Typically set to the name of the installed Exporter
      }
   },
   "metricMetas": [
      {
         "metricName": "node_memory_MemTotal_bytes",    # Set the metric name to be linked with ServiceWatch among the metrics collected from the Prometheus Exporter
         "dimensions": [
            [
               "resource_id"        # Sets the label to be visualized in the Console among the Collector labels provided to identify the source of the metric data from Node Exporter
                                    # If no specific label is provided for the relevant Memory-related metrics, set it to resource_id.
            ]
         ],
         "unit": "Bytes",           # Unit of the collected metric data
         "aggregationMethod": "SUM",    # Aggregation method
         "Total physical memory size of the server",    # Korean description of the metric
         "node memory total bytes"
      },
      {
         "metricName": "node_filesystem_size_bytes",    # Set the metric name to be linked with ServiceWatch among the metrics collected from the Prometheus Exporter
         "dimensions": [
            [
               "mountpoint"        # Sets the label to visualize in the Console among the Collector labels provided to identify the source of the Node Exporter metric data
                                   # Set the dimension to the mount point, which indicates the path where the filesystem for the relevant Filesystem metrics is mounted on the system.
            ]
         ],
         "unit": "Bytes",
         "aggregationMethod": "SUM",
         "node filesystem size bytes"
         "node filesystem size bytes"
      },
      {
         "metricName": "node_memory_MemAvailable_bytes",
         "dimensions": [
            [
               "resource_id"
            ]
         ],
         "unit": "Bytes",
         "aggregationMethod": "SUM",
         "node memory available bytes"
         "node memory available bytes"
      },
      {
         "metricName": "node_filesystem_avail_bytes",
         "dimensions": [
            [
               "mountpoint"
            ]
         ],
         "unit": "Bytes",
         "aggregationMethod": "SUM",
         "node filesystem available bytes",
         "node filesystem available bytes"
      }
   ]
}
Code block. Example metric.json configuration
  • To display resource names, set resource_name in commonLabels and metricMetas.dimensions as shown below. This allows you to view resource names alongside metrics when querying metrics in ServiceWatch.
    Color mode
    ...
       "commonLabels": {
          "resource_name": "ResourceName" # Resource name that can be verified in the User Console
       },
       "metricMetas": [
          {
             "metricName": "metric_name",
             "dimensions": [
                [
                   "resource_id",
                   "resource_name"        # Adds the resource_name configured in commonLabels to the dimensions of each metric
    
                ]
             ],
             "unit": "Bytes",
             "aggregationMethod": "SUM",
             "descriptionKo": "metric_name description",
             "metric_name description"
          },
       ...
       ]
    ...
    ...
       "commonLabels": {
          "resource_name": "ResourceName" # Resource name that can be verified in the User Console
       },
       "metricMetas": [
          {
             "metricName": "metric_name",
             "dimensions": [
                [
                   "resource_id",
                   "resource_name"        # Adds the resource_name configured in commonLabels to the dimensions of each metric
    
                ]
             ],
             "unit": "Bytes",
             "aggregationMethod": "SUM",
             "descriptionKo": "metric_name description",
             "metric_name description"
          },
       ...
       ]
    ...
    Code block. metric.json - Resource name configuration

5. ### log.json Configuration

Defines the log configuration file (log.json) for collecting logs with ServiceWatch.

  • To collect logs, you must configure log.json.
    CategoryDetailed Description
    fileLog > includeLocation of the log files to collect
    fileLog > operatorsDefined to parse the log messages to be collected
    fileLog > operators > regexExpress the log message format as a regular expression
    fileLog > operators > timestampThe format of the Time Stamp for log messages sent to ServiceWatch
    logMetas > log_group_valueThe log group name created for log transmission using ServiceWatch
    logMetas > log_stream_valueLog stream name within the ServiceWatch log group
    Table. log.json configuration file entries
    Color mode
    {
       "fileLog": {
          "include": [
             "/var/log/syslog",        # Log file to be collected by ServiceWatch
             "/var/log/auth.log"
          ],
          "operators": {
             "regex": "^(?P<timestamp>\\S+)\\s+(?P<hostname>\\S+)\\s+(?P<process>[^:]+):\\s+(?P<message>.*)$",    # Expresses the log file format using a regular expression
             "timestamp": {            # Set the Time Stamp format for log messages
                "layout_type": "gotime",
                "layout": "2006-01-02T15:04:05.000000Z07:00"
             }
          }
       },
       "logMetas": {
          "log_group_value": "custom-log-group",    # The log group name of the ServiceWatch created in advance
          "log_stream_value": "custom-log-stream"   # The name of the log stream within the pre-created ServiceWatch log group
       }
    }
    {
       "fileLog": {
          "include": [
             "/var/log/syslog",        # Log file to be collected by ServiceWatch
             "/var/log/auth.log"
          ],
          "operators": {
             "regex": "^(?P<timestamp>\\S+)\\s+(?P<hostname>\\S+)\\s+(?P<process>[^:]+):\\s+(?P<message>.*)$",    # Expresses the log file format using a regular expression
             "timestamp": {            # Set the Time Stamp format for log messages
                "layout_type": "gotime",
                "layout": "2006-01-02T15:04:05.000000Z07:00"
             }
          }
       },
       "logMetas": {
          "log_group_value": "custom-log-group",    # The log group name of the ServiceWatch created in advance
          "log_stream_value": "custom-log-stream"   # The name of the log stream within the pre-created ServiceWatch log group
       }
    }
    Code block. log.json configuration example
Reference

To link server log files to ServiceWatch using the ServiceWatch Agent, you must first create a log group and a log stream within that log group.

  • For details on creating log groups and log streams, see Logs.

Running the Open Telemetry Collector for ServiceWatch

How to Run the ServiceWatch Agent
[ServiceWatch Agent executable] -action [run|stop] -dir [configuration file location] -collector [Open Telemetry Collector executable location]
Execution OptionsDetailed Description
-actionAction settings (run or stop)
-dirThe location of ServiceWatch Agent configuration files such as agent.json, metric.json, and log.json
-collectorLocation of the Open Telemetry Collector executable
Table. ServiceWatch Agent execution options

Run the ServiceWatch Agent (for Linux)

Reference
Assuming that the agent.json, metric.json, and log.json files are located in current_directory/os-metrics-min-examples, and the otelcontribcol_linux_amd64 file is in current_directory, run the following command.
  1. Run the ServiceWatch Agent.

    • Check the file locations of agent.json, metric.json, and log.json, as well as the locations of the servicewatch-agent-manager-linux-amd64 and otelcontribcol_linux_amd64 files, to start the ServiceWatch Agent.
    • The execution command is the same regardless of the collection target. The collection target is determined by the configuration file structure in the directory specified by -dir.
      Collection TargetsConfiguring the settings file directory
      Collect both metrics and logsagent.json, metric.json, log.json
      Collect metrics onlyagent.json, metric.json
      • log.json to a different filename or move them to a different directory
      Collect logs onlyagent.json, log.json
      • metric.json to a different filename or move them to a different directory
      Table. Collection targets based on configuration file structure
      Color mode
      ./servicewatch-agent-manager-linux-amd64 -action run -dir ./os-metrics-min-examples -collector ./otelcontribcol_linux_amd64
      ./servicewatch-agent-manager-linux-amd64 -action run -dir ./os-metrics-min-examples -collector ./otelcontribcol_linux_amd64
      Code block. Start the ServiceWatch Agent
  2. Stops the ServiceWatch Agent.

    Color mode
    ./servicewatch-agent-manager-linux-amd64 -action stop -dir ./os-metrics-min-examples
    ./servicewatch-agent-manager-linux-amd64 -action stop -dir ./os-metrics-min-examples
    Code block. Stop the ServiceWatch Agent

Run the ServiceWatch Agent (for Windows)

  1. Run the ServiceWatch Agent.

    • The collection target is determined by the configuration file structure of the directory specified in -dir. * For details, see Collection Targets Based on Configuration File Structure.
      Color mode
      servicewatch-agent-manager-windows-amd64.exe -action run -dir ./os-metrics-min-examples -collector otelcontribcol_windows_amd64.exe
      servicewatch-agent-manager-windows-amd64.exe -action run -dir ./os-metrics-min-examples -collector otelcontribcol_windows_amd64.exe
      Code block. Start the ServiceWatch Agent
  2. Stop the ServiceWatch Agent.

    Color mode
    servicewatch-agent-manager-windows-amd64.exe -action stop -dir ./os-metrics-min-examples
    servicewatch-agent-manager-windows-amd64.exe -action stop -dir ./os-metrics-min-examples
    Code block. Stop the ServiceWatch Agent

event
ServiceWatch Event Reference