Skip to content

Huawei Cloud ASM Tracing TO TrueWatch

Output tracing data from Huawei Cloud ASM to TrueWatch for viewing and analysis.

Configuration

Preparation

To use ASM, you need to purchase a CCE cluster and deploy the datakit daemonset.

Creation of ASM

Service Mesh => Purchase Mesh => Basic Edition img

Grid name, select istio version, choose cluster version and istio control node, submit directly.

img

After about 1~3 minutes, the installation completed page looks like this:

img

After installation, create the bookinfo application.

img

Before installation, we need to prepare a load balancer, which I have already done. Select it, choose external port as 80, select image repository address as docker.io/istio, then install.

img

Check the created gateway and services.

img

img

Access http://124.70.68.49/productpage to check if the service is normal.

img

Sending Trace Data to TrueWatch

Enable OpenTelemetry Collector

Refer to the OpenTelemetry collector connection documentation

  • Add to ConfigMap
opentelemetry.conf: |
      [[inputs.opentelemetry]]
          [inputs.opentelemetry.http]
            enable = true
            http_status_ok = 200
            trace_api = "/otel/v1/trace"
            metric_api = "/otel/v1/metric"
          [inputs.opentelemetry.grpc]
            trace_enable = true
            metric_enable = true
            addr = "0.0.0.0:4317"
  • Mount opentelemetry.conf
- mountPath: /usr/local/datakit/conf.d/opentelemetry/opentelemetry.conf
    name: datakit-conf
    subPath: opentelemetry.conf

Redeploy datakit

kubectl apply -f datakit.yaml

After deployment, check in monitor whether opentelemetry has been enabled.

# kubectl exec -it -n datakit pods/datakit-lfb95 datakit monitor

img

Modify asm Output Address

For easy testing, first modify the sampling rate of ASM.

# kubectl edit -n istio-system cm istio-1-15-5-r4
...
sampling: 100   # Change this parameter from 1 to 100
...

Modify asm output to TrueWatch

# kubectl edit -n monitoring cm otel-collector-conf
...
exporters:
      apm:
        address: "100.125.0.78:8923"
        project_id: f5f4c067d68b4b3aad86e173b18367bf
        cluster_id: 5f642ce9-4aca-11ee-9dbd-0255ac10024d
      otlp:   # Add otlp output
        endpoint: "http://datakit-service.datakit:4317"
        tls:
          insecure: true
        compression: none # Do not enable gzip
...
traces/apm:
          receivers: [ zipkin ]
          processors: [ memory_limiter, batch ]
          exporters: [ otlp ]   # Change exporter to otlp

img

After configuration modification, access the address http://124.70.68.49/productpage several times, then check the traces in TrueWatch workspace.

img

Click on a trace to view detailed information.

img

Sending Metrics Data to TrueWatch

Metric Collection Configuration

  1. Enable Prometheus Exportter data collection in DataKit. Refer to Prometheus Exportter, ConfigMap as follows:
    prom.conf: |
      [[inputs.prom]]
        urls = ["http://istiod.istio-system:15014/metrics"] ## istiod address
        uds_path = ""
        ignore_req_err = false
        source = "prom"
        measurement_prefix = ""
        measurement_name = "istio_prom"
  1. Mount configuration file
        - mountPath: /usr/local/datakit/conf.d/prom/prom.conf
          name: datakit-conf
          subPath: prom.conf
  1. Redeploy DataKit
Kubectl apply -f datakit.yml