SkyWalking tracing

Requirements

Sandbox environment

Setup your sandbox environment with Docker and Docker Compose, and clone the Envoy repository with Git.

curl

Used to make HTTP requests.

The SkyWalking tracing sandbox demonstrates Envoy’s request tracing capabilities using SkyWalking as the tracing provider. This sandbox is very similar to the Zipkin sandbox. All containers will be deployed inside a virtual network called envoymesh.

All incoming requests are routed via the front Envoy, which is acting as a reverse proxy sitting on the edge of the envoymesh network. Port 8000 is exposed by docker compose (see docker-compose.yaml).

Notice that all Envoys are configured to collect request traces (e.g., http_connection_manager/config/tracing setup in front-envoy-skywalking.yaml) and setup to propagate the spans generated by the SkyWalking tracer to a SkyWalking cluster (trace driver setup in front-envoy-skywalking.yaml).

When service1 accepts the request forwarded from front envoy, it will make an API call to service2 before returning a response.

Step 1: Build the sandbox

Change to the examples/skywalking-tracing directory.

To build this sandbox example, and start the example apps run the following commands:

  1. $ pwd
  2. envoy/examples/skywalking-tracing
  3. $ docker-compose pull
  4. $ docker-compose up --build -d
  5. $ docker-compose ps
  6. Name Command State Ports
  7. --------------------------------------------------------------------------------------------------------------------------------------------------
  8. skywalking-tracing_elasticsearch_1 /tini -- /usr/local/bin/do ... Up (healthy) 0.0.0.0:9200->9200/tcp, 9300/tcp
  9. skywalking-tracing_front-envoy_1 /docker-entrypoint.sh /bin ... Up 10000/tcp, 0.0.0.0:8000->8000/tcp, 0.0.0.0:8001->8001/tcp
  10. skywalking-tracing_service1_1 /bin/sh /usr/local/bin/sta ... Up 10000/tcp
  11. skywalking-tracing_service2_1 /bin/sh /usr/local/bin/sta ... Up 10000/tcp
  12. skywalking-tracing_skywalking-oap_1 bash docker-entrypoint.sh Up (healthy) 0.0.0.0:11800->11800/tcp, 1234/tcp, 0.0.0.0:12800->12800/tcp
  13. skywalking-tracing_skywalking-ui_1 bash docker-entrypoint.sh Up 0.0.0.0:8080->8080/tcp

Step 2: Generate some load

You can now send a request to service1 via the front-envoy as follows:

  1. $ curl -v localhost:8000/trace/1
  2. * Trying ::1...
  3. * TCP_NODELAY set
  4. * Connected to localhost (::1) port 8000 (#0)
  5. > GET /trace/1 HTTP/1.1
  6. > Host: localhost:8000
  7. > User-Agent: curl/7.58.0
  8. > Accept: */*
  9. >
  10. < HTTP/1.1 200 OK
  11. < content-type: text/html; charset=utf-8
  12. < content-length: 89
  13. < server: envoy
  14. < date: Sat, 10 Oct 2020 01:56:08 GMT
  15. < x-envoy-upstream-service-time: 27
  16. <
  17. Hello from behind Envoy (service 1)! hostname: 1a2ba43d6d84 resolvedhostname: 172.19.0.6
  18. * Connection #0 to host localhost left intact

You can get SkyWalking stats of front-envoy after some requests as follows:

  1. $ curl -s localhost:8001/stats | grep tracing.skywalking
  2. tracing.skywalking.cache_flushed: 0
  3. tracing.skywalking.segments_dropped: 0
  4. tracing.skywalking.segments_flushed: 0
  5. tracing.skywalking.segments_sent: 13

Step 3: View the traces in SkyWalking UI

Point your browser to http://localhost:8080 . You should see the SkyWalking dashboard. Set the service to “front-envoy” and set the start time to a few minutes before the start of the test and hit enter. You should see traces from the front-proxy. Click on a trace to explore the path taken by the request from front-proxy to service1 to service2, as well as the latency incurred at each hop.

See also

Request tracing

Learn more about using Envoy’s request tracing.

Envoy admin quick start guide

Quick start guide to the Envoy admin interface.

Apache SkyWalking

SkyWalking observability analysis platform and application performance management system.