Import SkyWalking Data

Created:2024-11-05 Last Modified:2024-11-05

This document was translated by ChatGPT

#1. Data Flow

#2. Configure OpenTelemetry SkyWalking Receiver

#2.1 Background Knowledge

You can refer to the OpenTelemetry documentation (opens new window) to understand the background knowledge of OpenTelemetry and refer to the previous section OpenTelemetry Installation for quick installation of OpenTelemetry.

You can refer to the SkyWalking documentation (opens new window) to understand the background knowledge of SkyWalking. This demo does not require a full installation of SkyWalking; we will use OpenTelemetry to integrate SkyWalking's trace data.

#2.2 Confirm OpenTelemetry Version

First, you need to enable OpenTelemetry's ability to receive SkyWalking data, process the data through the OpenTelemetry standard protocol, and send it to the DeepFlow Agent.

There is a bug in OpenTelemetry receiving SkyWalking data, which we have recently fixed in these two PRs #11562 (opens new window) and #12651 (opens new window). For the following demo, we need the OpenTelemetry Collector image (opens new window) version >= 0.57.0. Please check the image version of the otel-agent in your environment and ensure it meets the requirements. Refer to the previous section OpenTelemetry Installation to update the otel-agent version in your environment.

#2.3 Configure OpenTelemetry to Receive SkyWalking Data

After installing OpenTelemetry as described in the Background Knowledge section, we can configure OpenTelemetry to receive SkyWalking data using the following steps:

Assuming the namespace where OpenTelemetry is located is open-telemetry and the ConfigMap used by otel-agent is named otel-agent-conf, use the following command to modify the otel-agent configuration:

kubectl -n open-telemetry edit cm otel-agent-conf
1

In the receivers section, add the following content:

receivers:
  # add the following config
  skywalking:
    protocols:
      grpc:
        endpoint: 0.0.0.0:11800
      http:
        endpoint: 0.0.0.0:12800
1
2
3
4
5
6
7
8

In the service.pipelines.traces section, add the following content:

service:
  pipelines:
    traces:
      # add receiver `skywalking`
      receivers: [skywalking]
1
2
3
4
5

At the same time, ensure that the otel-agent-conf has completed the corresponding configuration as described in the section Configure otel-agent.

Next, use the following command to modify the otel-agent Service to open the corresponding ports:

kubectl -n open-telemetry patch service otel-agent -p '{"spec":{"ports":[{"name":"sw-http","port":12800,"protocol":"TCP","targetPort":12800},{"name":"sw-grpc","port":11800,"protocol":"TCP","targetPort":11800}]}}'
1

Then, check the connection address configured in the application for the SkyWalking OAP Server (opens new window) and modify it to the Service address of the Otel Agent: otel-agent.open-telemetry. For example, change the environment variable SW_AGENT_COLLECTOR_BACKEND_SERVICES=oap-server:11800 to SW_AGENT_COLLECTOR_BACKEND_SERVICES=otel-agent.open-telemetry:11800.

Of course, the reporting address configured in the application may take various forms. Please modify it according to the actual startup command of the application. For Java applications, just ensure that the address injected in the startup command can be modified, such as: -Dskywalking.collector.backend_service=otel-agent.open-telemetry:11800.

Finally, restart the otel-agent to complete the update:

kubectl rollout restart -n open-telemetry daemonset/otel-agent
1

#3. Configure DeepFlow

Please refer to the section Configure DeepFlow to complete the configuration of the DeepFlow Agent.

#4. Experience Based on WebShop Demo

#4.1 Deploy Demo

This demo comes from this GitHub repository (opens new window). It is a WebShop application composed of five microservices written in Spring Boot. Its architecture is as follows:

Sping Boot Demo Architecture

Sping Boot Demo Architecture

You can deploy this demo with one click using the following command. This demo has already configured the reporting address, so no additional modifications are needed.

kubectl apply -f https://raw.githubusercontent.com/deepflowio/deepflow-demo/main/DeepFlow-Otel-SkyWalking-Demo/deepflow-otel-skywalking-demo.yaml
1

#4.2 View Tracing Data

Go to Grafana, open the Distributed Tracing Dashboard, select namespace = deepflow-otel-skywalking-demo, and then you can choose a call to trace. DeepFlow can correlate and display the tracing data obtained from SkyWalking, eBPF, and BPF in a single trace flame graph, covering the full-stack call path of a Spring Boot application from business code, system functions, to network interfaces, achieving true full-link distributed tracing, as shown below:

OTel SkyWalking Demo

OTel SkyWalking Demo

You can also visit the DeepFlow Online Demo (opens new window) to see the effect.