Skip to content

Commit

Permalink
zh-translation: /docs/root/start/sandboxes/jaeger_tracing.rst (envoyp…
Browse files Browse the repository at this point in the history
…roxy#432)

* jaeger-tracing.rst revise

* jaeger-tracing.rst revise1

* jaeger_tracing_revised20201215

Co-authored-by: Mars Zhang <mars-zhangcong@users.noreply.github.com>
  • Loading branch information
mars-zhangcong and mars-zhangcong authored Dec 15, 2020
1 parent 0797b7b commit 9cd0740
Showing 1 changed file with 20 additions and 41 deletions.
61 changes: 20 additions & 41 deletions docs/root/start/sandboxes/jaeger_tracing.rst
Original file line number Diff line number Diff line change
@@ -1,44 +1,26 @@
.. _install_sandboxes_jaeger_tracing:

Jaeger Tracing
Jaeger 追踪
==============

The Jaeger tracing sandbox demonstrates Envoy's :ref:`request tracing <arch_overview_tracing>`
capabilities using `Jaeger <https://jaegertracing.io/>`_ as the tracing provider. This sandbox
is very similar to the front proxy architecture described above, with one difference:
service1 makes an API call to service2 before returning a response.
The three 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 :repo:`/examples/jaeger-tracing/docker-compose.yaml`). Notice that
all Envoys are configured to collect request traces (e.g., http_connection_manager/config/tracing setup in
:repo:`/examples/jaeger-tracing/front-envoy-jaeger.yaml`) and setup to propagate the spans generated
by the Jaeger tracer to a Jaeger cluster (trace driver setup
in :repo:`/examples/jaeger-tracing/front-envoy-jaeger.yaml`).

Before routing a request to the appropriate service Envoy or the application, Envoy will take
care of generating the appropriate spans for tracing (parent/child context spans).
At a high-level, each span records the latency of upstream API calls as well as information
needed to correlate the span with other related spans (e.g., the trace ID).

One of the most important benefits of tracing from Envoy is that it will take care of
propagating the traces to the Jaeger service cluster. However, in order to fully take advantage
of tracing, the application has to propagate trace headers that Envoy generates, while making
calls to other services. In the sandbox we have provided, the simple flask app
(see trace function in :repo:`/examples/front-proxy/service.py`) acting as service1 propagates
the trace headers while making an outbound call to service2.


Running the Sandbox
Jaeger 追踪沙盒(Sandbox) 使用 `Jaeger <https://jaegertracing.io/>`_ 作为追踪提供程序来演示 Envoy 的 :ref:`请求追踪 <arch_overview_tracing>` 功能。 该沙盒与上述前端代理体系结构非常相似,但有一个区别:service1 在返回响应之前要对 service2 进行 API 调用。 这三个容器将部署在称为 ``envoymesh`` 的虚拟网络中。

所有的传入请求都通过前端 Envoy 路由,该前端 Envoy 是作为位于 ``envoymesh`` 网络边缘的反向代理。``8000`` 端口由 docker compose 暴露(请参阅 :repo:`/examples/jaeger-tracing/docker-compose.yaml`)。请注意,所有 Envoy 都进行了配置,用来收集请求的追踪(例如 :repo:`/examples/jaeger-tracing/front-envoy-jaeger.yaml` 中的 http_connection_manager/config/tracing 设置),并将 Jaeger 追踪器生成的 span 传播到 Jaeger 集群中(追踪驱动在 :repo:`/examples/jaeger-tracing/front-envoy-jaeger.yaml` 中设置)。

在将请求路由到适当的服务 Envoy 或应用程序之前,Envoy 将负责生成用于追踪的适当跨度(父/子上下文跨度)。在较高层级上,每个跨度都记录上游 API 调用的延迟以及将跨度与其他相跨度相关联的所需信息(例如,追踪 ID)。

从 Envoy 进行追踪的最重要好处之一是,它将负责将追踪信息传播到 Jaeger 服务集群。但是,为了充分利用追踪的优势,应用程序必须传播 Envoy 生成的追踪头部信息,同时调用其他服务。在我们提供的沙盒当中,有个简单 flask 应用程序(请参阅 :repo:`/examples/front-proxy/service.py` 中的追踪功能 )充当 service1 的传播追踪标头,同时对 service2 进行出站调用。


运行沙盒
~~~~~~~~~~~~~~~~~~~

.. include:: _include/docker-env-setup.rst

Step 3: Build the sandbox
*************************
步骤 3: 构建沙盒
*****************

To build this sandbox example, and start the example apps run the following commands:
要构建这个沙盒示例,并启动示例应用程序,请运行以下命令:

.. code-block:: console
Expand All @@ -55,10 +37,10 @@ To build this sandbox example, and start the example apps run the following comm
jaeger-tracing_service1_1 /bin/sh -c /usr/local/bin/ ... Up 10000/tcp, 8000/tcp
jaeger-tracing_service2_1 /bin/sh -c /usr/local/bin/ ... Up 10000/tcp, 8000/tcp
Step 4: Generate some load
**************************
步骤 4: 生成一些负载
**********************

You can now send a request to service1 via the front-envoy as follows:
你现在可以通过 front-envoy 向 service1 发送以下请求:

.. code-block:: console
Expand All @@ -80,10 +62,7 @@ You can now send a request to service1 via the front-envoy as follows:
Hello from behind Envoy (service 1)! hostname: f26027f1ce28 resolvedhostname: 172.19.0.6
* Connection #0 to host 192.168.99.100 left intact
Step 5: View the traces in Jaeger UI
************************************
步骤 5: Jaeger UI 中查看追踪
*********************************

Point your browser to http://localhost:16686 . You should see the Jaeger dashboard.
Set the service to "front-proxy" and hit 'Find Traces'. 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.
用浏览器打开 http://localhost:16686。你应该可以看到 Jaeger 仪表盘。将服务设置为 “front-proxy” 并点击 “Find Traces”。你应该看到从 front-proxy 发起的追踪信息。单击追踪,以查看从 front-proxy 到 service1 再到 service2 的请求路径,以及每一跳产生的延迟。

0 comments on commit 9cd0740

Please sign in to comment.