All Products
Search
Document Center

:Collect performance data reported by the Pyroscope SDK from Go programs

Last Updated:Sep 03, 2024

Simple Log Service allows you to use Logtail to collect performance data that is reported by the Pyroscope SDK from Go programs to the Full-stack Observability application for visualized performance monitoring and analysis.

Prerequisites

A Full-stack Observability instance is created. For more information, see Create an instance.

Limits

Only Linux Logtail V1.7 or later is supported.

Step 1: Create a Logtail configuration

  1. Log on to the Simple Log Service console.

  2. In the Log Application section, click the Intelligent O&M tab. Then, click Full-stack Observability.

  3. On the Simple Log Service Full-stack Observability page, click the instance that you want to manage.

  4. In the left-side navigation pane, click Performance Monitoring.

  5. Click Enable if this is your first time to use Performance Monitoring in the instance.

  6. In the left-side navigation tree, click Data Import. On the Data Access Configurations page, find Common Push Import.

    If this is your first time to create a Logtail configuration for this type of performance data, turn on the switch to go to the configuration page. If you already created a Logtail configuration, click the 创建 icon to go to the configuration page.

  7. Create a machine group.

    • If a machine group is available, click Use Existing Machine Groups.

    • If no machine groups are available, perform the following steps:

      1. Check your server type.

        • If you use an Elastic Compute Service (ECS) instance that belongs to the same Alibaba Cloud account as Simple Log Service, click the ECS Instances tab, select Manually Select Instances and your ECS instance, and then click Create.

          For more information, see Install Logtail on ECS instances.

        • If you use an ECS instance that belongs to a different Alibaba Cloud account from Simple Log Service, a server from a third-party cloud service provider, or a server in a data center, manually install Linux Logtail V1.7 or later on the server. For more information, see Install Logtail on a Linux server.

          Important

          After you manually install Logtail, you must configure a user identifier for the server. For more information, see Configure a user identifier.

        • If you use a Kubernetes cluster, perform the following steps:

          1. Click the Kubernetes Monitoring tab. Then, configure the parameters, including the Cluster Name and Access Method parameters.

          2. Download the installation script to your Kubernetes cluster.

            wget https://logtail-release-cn-beijing.oss-cn-beijing.aliyuncs.com/kubernetes/sls-monitoring.sh -O sls-monitoring.sh
          3. Copy the installation command on the Kubernetes Monitoring tab and run the command in your Kubernetes cluster. Logtail安装命令

      2. After Logtail is installed, click Complete Installation.

      3. In the Create Machine Group step, configure the Name parameter and click Next.

        Simple Log Service allows you to create IP address-based machine groups and custom identifier-based machine groups. For more information, see Create an IP address-based machine group and Create a custom identifier-based machine group.

        Important

        If you install Logtail in a Kubernetes cluster, a machine group named in the {instanceId}-{clusterId}-k8s-cluster format is automatically generated. You can skip this step.

  8. In the Machine Group Settings step, select the machine group that you create in the Source Server Groups section and move the machine group to the Applied Server Groups section. Then, click Next.

    Important

    If you enable a machine group immediately after you create the machine group, the heartbeat status of the machine group may be FAIL. This issue occurs because the machine group is not connected to Simple Log Service. To resolve this issue, you can click Automatic Retry. If the issue persists, see What do I do if a Logtail machine group has no heartbeats?

  9. In the Specify Data Source step, configure the following parameters and click Complete.

    Parameter

    Description

    Config Name

    The name of the Logtail configuration. You can enter a custom name.

    Cluster

    The name of the cluster. You can enter a custom name.

    After you configure this parameter, Simple Log Service adds a cluster=Cluster name tag to the performance data that is collected by using the Logtail configuration.

    Important

    Make sure that the cluster name is unique. Otherwise, data conflicts may occur.

    Address

    The address for data collection. The default value is http://:4040, where 4040 is the default port of Pyroscope. If you retain the default value, the HTTP server uses the local address.

    • If you use an ECS instance, specify the value in the following format: IP address of the ECS instance:4040.

    • If you use a server that resides in a Kubernetes cluster, set the value to logtail-kubernetes-metrics.sls-monitoring:4040.

    • If you use a server that is from a third-party cloud service provider or a data center, specify the value in the following format: IP address of the server:4040.

    Endpoint

    The default endpoint of Pyroscope. Default value: /ingest.

    Read Timeout Period

    The timeout period for data read operations. Default value: 10. Unit: seconds.

    Maximum Body Size

    The maximum size of data that can be collected.

    After you complete the configuration, Simple Log Service automatically creates assets such as Metricstores. For more information, see Assets.

Step 2: Integrate the Pyroscope SDK to collect performance data

Configure the Pyroscope SDK to send performance data to Simple Log Service based on the sample code that is provided at Golang Example. Configure the address of the data source based on the following description:

  • If you use an ECS instance, specify the value in the following format: IP address of the ECS instance:4040.

  • If you use a server that resides in a Kubernetes cluster, set the value to logtail-kubernetes-metrics.sls-monitoring:4040.

  • If you use a server that is from a third-party cloud service provider or a data center, specify the value in the following format: IP address of the server:4040.

What to do next

After you collect the performance data to Full-stack Observability, you can query and compare the data. For more information, see Data query and Data comparison.