Alibaba Cloud Service Mesh (ASM) allows you to export tracing data to Managed Service for OpenTelemetry or a self-managed system. This topic shows you how to configure this export in the ASM console.
Prerequisites
-
An ACK cluster has been added to the ASM instance. For more information, see Add a cluster to an ASM instance.
-
You have activated Managed Service for OpenTelemetry on your Alibaba Cloud account. For more information about billing, see Billing.
-
An ingress gateway has been deployed in the ASM instance. For more information, see Create an ingress gateway.
Export tracing data to Managed Service for OpenTelemetry
Select the tab that corresponds to your ASM instance version. To upgrade your instance, see Upgrade an ASM instance.
Versions earlier than 1.17.2.35
-
Log on to the ASM console. In the left-side navigation pane, choose .
-
On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose .
-
On the Base Information page, click Settings. In the Settings Update panel, select Enable Tracing Analysis, set the Sampling Percentage, set Sampling Method to Managed Service for OpenTelemetry, and then click OK.
-
In the left-side navigation pane, choose . You are redirected to the Managed Service for OpenTelemetry console. After completing the configuration, you can log on to the Managed Service for OpenTelemetry console and view monitoring metrics such as the number of requests, response times, and number of spans for your applications on the Overview Analysis page.
For more information about tracing, see What is Managed Service for OpenTelemetry?
To disable this feature, deselect Enable Tracing Analysis in the Settings Update panel and then click OK.
Versions 1.17.2.35 to earlier than 1.18.0.124
-
Log on to the ASM console. In the left-side navigation pane, choose .
-
On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose .
-
On the Tracing Analysis page, click Collect ASM Tracing Data to Managed Service for OpenTelemetry, and then in the Confirm dialog box, click OK.
-
Click Open the Managed Service for OpenTelemetry Console to view the tracing data.
For more information about tracing, see What is Managed Service for OpenTelemetry? After the configuration is complete, you can log on to the Managed Service for OpenTelemetry console and view monitoring metrics such as the number of requests, response times, and number of spans for your applications on the Overview Analysis page.
If you no longer need this feature, on the Tracing Analysis page, click Disable Collection, and then in the Confirm dialog box, click OK.
Versions 1.18.0.124 to earlier than 1.22.6.89
For these instance versions, you cannot configure the export to Managed Service for OpenTelemetry directly in the console. Instead, you must manually deploy and configure an OpenTelemetry Collector.
Step 1: Deploy the OpenTelemetry Operator
-
In the kubeconfig environment for your ACK cluster, run the following command to create the
opentelemetry-operator-systemnamespace:kubectl create namespace opentelemetry-operator-system -
Run the following command to install the OpenTelemetry Operator in the opentelemetry-operator-system namespace by using Helm:
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts helm install --namespace=opentelemetry-operator-system opentelemetry-operator open-telemetry/opentelemetry-operator \ --set "manager.collectorImage.repository=otel/opentelemetry-collector-k8s" \ --set admissionWebhooks.certManager.enabled=false \ --set admissionWebhooks.autoGenerateCert.enabled=true -
Run the following command to check if the OpenTelemetry Operator is running properly:
kubectl get pod -n opentelemetry-operator-systemExpected output:
NAME READY STATUS RESTARTS AGE opentelemetry-operator-854fb558b5-pvllj 2/2 Running 0 1mA
STATUSofRunningindicates that the OpenTelemetry Operator is running.
Step 2: Create the OpenTelemetry Collector
-
Create a file named collector.yaml with the following content.
In the YAML file, replace
${ENDPOINT}with the gRPC VPC access point and${TOKEN}with the authentication token. To obtain the access point and authentication token for Managed Service for OpenTelemetry, see Access and authentication. -
In the kubeconfig environment for your ACK cluster, run the following command to deploy the collector to the cluster:
kubectl apply -f collector.yaml -
Run the following command to check if the collector started properly:
kubectl get pod -n opentelemetry-operator-systemExpected output:
NAME READY STATUS RESTARTS AGE opentelemetry-operator-854fb558b5-pvllj 2/2 Running 0 3m default-collector-5cbb4497f4-2hjqv 1/1 Running 0 30sThis output indicates that the collector started successfully.
-
Run the following command to check if the service was created:
kubectl get svc -n opentelemetry-operator-systemExpected output:
opentelemetry-operator ClusterIP 172.16.138.165 <none> 8443/TCP,8080/TCP 3m opentelemetry-operator-webhook ClusterIP 172.16.127.0 <none> 443/TCP 3m default-collector ClusterIP 172.16.145.93 <none> 4317/TCP 30s default-collector-headless ClusterIP None <none> 4317/TCP 30s default-collector-monitoring ClusterIP 172.16.136.5 <none> 8888/TCP 30sThe output indicates that the service was created successfully.
Step 3: Enable tracing in the ASM console
-
Log on to the ASM console. In the left-side navigation pane, choose .
-
On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose .
-
On the Observability Settings page, in the Tracing Analysis Settings section, set Sampling Percentage to 100 and click Submit.
-
In the left-side navigation pane, choose . Set OpenTelemetry Service Address/Domain to default-collector.opentelemetry-operator-system.svc.cluster.local and OpenTelemetry Service Port to 4317. Then, click Collect ASM Tracing Data to Custom Managed Service for OpenTelemetry.
Versions 1.22.6.89 and later
-
Log on to the ASM console. In the left-side navigation pane, choose .
-
On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose .
-
On the Tracing Analysis page, in the Export to Alibaba Cloud Observable Link section, select an Export Method, such as Zipkin. In the Fill in the configuration section, enter the required information and click Submit.
-
Click Go to Managed Service for OpenTelemetry console to view the tracing data. For more information about tracing, see What is Managed Service for OpenTelemetry?
NoteIf you no longer need this feature, on the Tracing Analysis page, click Export, and then in the Confirm dialog box, click OK.
Export tracing data to a self-managed system
The export method for a self-managed system depends on your ASM instance version. Select the tab that corresponds to your instance version.
Versions earlier than 1.18.0.124
-
For ASM instances earlier than 1.17.2.28: Log on to the ASM console. On the Base Information page of the target instance, click Settings, select Enable Tracing Analysis, configure the parameters as needed, and then click OK.
-
For ASM instances of version 1.17.2.28 or later but earlier than 1.18.0.124: For information about how to enable tracing, see Tracing settings.
Versions 1.18.0.124 to earlier than 1.22.6.89
For this version range, configure the export to a self-managed system on the page of the target instance in the ASM console.
Parameters
|
Parameter |
Description |
|
OpenTelemetry Domain Name (FQDN) |
The fully qualified domain name (FQDN) of your self-managed system service. Example: |
|
OpenTelemetry Service Port |
The service port of the self-managed system. Example: |
Versions 1.22.6.89 and later
On the page of your instance in the ASM console, select and configure your self-managed tracing system.
When exporting tracing data to a self-managed system, ensure it is a service within the mesh. If the system is outside the service mesh, you can register it with the mesh by creating a ServiceEntry. For more information, see ServiceEntry.
Parameters
Export to OpenTelemetry
|
Parameter |
Description |
|
|
Service domain name (full FQDN) |
The FQDN of the self-managed system service. Example: |
|
|
Service Port |
The service port of the self-managed system. Example: |
|
|
Export over gRPC |
Timeout |
Optional. The request timeout in seconds for exporting tracing data. Example: |
|
Request Header |
Optional. Request headers to include when exporting tracing data. Example: |
|
|
Export over HTTP |
Request path |
The request path for exporting tracing data. Example: |
|
Timeout |
Optional. The request timeout in seconds for exporting tracing data. Example: |
|
|
Request Header |
Optional. Request headers to include when exporting tracing data. Example: |
|
Export to Zipkin
|
Parameter |
Description |
|
Domain name of Zipkin |
The FQDN of the self-managed system service. Example: |
|
Request Port |
The service port of the self-managed system. Example: |
|
Request Path |
The request path for exporting tracing data. The default value is |
Export to SkyWalking
|
Parameter |
Description |
|
Skywalking service domain name |
The FQDN of the self-managed system service. Example: |
|
Request Port |
The service port of the self-managed system. Example: |
Verify the data export
Deploy applications
-
Deploy the sample Bookinfo application.
-
Create bookinfo.yaml with the following contentbookinfo.yaml。
-
Deploy the Bookinfo application to the data plane cluster.
kubectl --kubeconfig=${DATA_PLANE_KUBECONFIG} apply -f bookinfo.yaml
-
-
Deploy the sleep application.
-
Create a file named sleep.yaml with the following content.
-
Deploy the sleep application.
kubectl --kubeconfig=${DATA_PLANE_KUBECONFIG} apply -f sleep.yaml
-
Send test requests
Run the following command to send test requests:
kubectl exec -it deploy/sleep -- sh -c 'for i in $(seq 1 100); do curl -s productpage:9080/productpage > /dev/null; done'
View the exported data
The following steps show the result of exporting data to Managed Service for OpenTelemetry.
-
Log on to the Managed Service for OpenTelemetry console.
-
In the left-side navigation pane, click Application List. You can see the exported data.
The Application List page displays monitoring data for each service, including its Name (such as
sleep.default,details.default,productpage.default,reviews.default, andratings.default), Health, Today's Requests, Today's Errors, Response Time, and the Response Time (Last 30 Min) trend.