This is an automated email from the ASF dual-hosted git repository.

xiaoyu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu-website.git


The following commit(s) were added to refs/heads/main by this push:
     new b8776af  add doc for tracing otel plugin (#434)
b8776af is described below

commit b8776af6244b9212c1f4ab74af38a3c196a814d2
Author: Kunshuai Zhu <[email protected]>
AuthorDate: Mon Jan 10 16:36:02 2022 +0800

    add doc for tracing otel plugin (#434)
---
 docs/user-guide/observability/tracing.md           | 40 +++++++++++++++++++++
 .../current/user-guide/observability/tracing.md    | 42 +++++++++++++++++++++-
 2 files changed, 81 insertions(+), 1 deletion(-)

diff --git a/docs/user-guide/observability/tracing.md 
b/docs/user-guide/observability/tracing.md
index 7e82486..c607bd6 100644
--- a/docs/user-guide/observability/tracing.md
+++ b/docs/user-guide/observability/tracing.md
@@ -165,3 +165,43 @@ please see 
[zipkin-quickstart](https://zipkin.io/pages/quickstart) to start `zip
     - After a successful request, you can see that the link log has been 
reported to zipkin:
       ![](/img/shenyu/agent/shenyu-agent-plugin-tracing-zipkin.png)
     
+
+## Agent Plugin Tracing OpenTelemetry
+
+- modify yaml file
+
+Specify the use of the `opentelemetry` plugin via `supports.tracing` in the 
`shenyu-agent.yaml` file, and fill in the `opentelemetry` configuration 
information via `plugins.tracing`.
+
+```yaml
+appName: shenyu-agent
+supports:
+  tracing:
+    - opentelemetry
+
+plugins:
+  tracing:
+    opentelemetry:
+      props:
+        otel.traces.exporter: jaeger #zipkin #otlp
+        otel.resource.attributes: "service.name=shenyu-agent"
+        otel.exporter.jaeger.endpoint: "http://localhost:14250/api/traces";
+```
+
+- Start jaeger or zipkin or opentelemetry-collector according to exporter 
configuration
+
+To start jaeger, please refer to 
[jaeger-quickstart](https://www.jaegertracing.io/docs/1.28/getting-started/)
+
+To start zipkin, please refer to 
[zipkin-quickstart](https://zipkin.io/pages/quickstart)
+
+To start otel-collector, please refer to 
[opentelemetry-collector-quickstart](https://opentelemetry.io/docs/collector/getting-started/)
+
+- tracing test
+  - Reference [Deployment](../../deployment/deployment-local.md) to start 
`shenyu-admin`.
+  - Start the gateway by referring to the above procedure.
+  - Refer to [Quick start with Http](../../quick-start/quick-start-http.md) to 
start `shenyu-examples-http`.
+  - Launch a request to the gateway.
+  > GET http://localhost:9195/http/order/findById?id=999
+  >
+  > Accept: application/json
+
+  - After the request is successful, you can see the link log in the 
corresponding backend, the effect is the same as the above `jaeger` plugin and 
`zipkin` plugin.
diff --git 
a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/observability/tracing.md
 
b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/observability/tracing.md
index 394279a..cf11ac4 100644
--- 
a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/observability/tracing.md
+++ 
b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/observability/tracing.md
@@ -168,4 +168,44 @@ plugins:
 
    - 请求成功后,可以看到链路日志已经上报到zipkin中:
    ![](/img/shenyu/agent/shenyu-agent-plugin-tracing-zipkin.png)
-    
\ No newline at end of file
+    
+
+## 使用 opentelemetry 插件
+
+- 修改配置文件
+
+在 `shenyu-agent.yaml` 文件中通过`supports.tracing`指定使用 `opentelemetry` 插件,通过 
`plugins.tracing` 填写 `opentelemetry` 的配置信息。
+
+```yaml
+appName: shenyu-agent
+supports:
+  tracing:
+    - opentelemetry
+
+plugins:
+  tracing:
+    opentelemetry:
+      props:
+        otel.traces.exporter: jaeger #zipkin #otlp
+        otel.resource.attributes: "service.name=shenyu-agent"
+        otel.exporter.jaeger.endpoint: "http://localhost:14250/api/traces";
+```
+
+- 根据导出器配置启动 jaeger 或 zipkin 或 opentelemetry-collector
+
+启动 jaeger 可参考 
[jaeger-quickstart](https://www.jaegertracing.io/docs/1.28/getting-started/)
+
+启动 zipkin 可参考 [zipkin-quickstart](https://zipkin.io/pages/quickstart)
+
+启动 otel-collector 可参考 
[opentelemetry-collector-quickstart](https://opentelemetry.io/docs/collector/getting-started/)
+
+- 测试
+  - 参考 [运维部署](../../deployment/deployment-local.md) 的相关文章,启动 `shenyu-admin`;
+  - 参考上述操作步骤,启动网关;
+  - 参考 [Http快速开始](../../quick-start/quick-start-http.md) ,启动 
`shenyu-examples-http`。
+  - 向网关发起请求:
+  > GET http://localhost:9195/http/order/findById?id=1
+  >
+  > Accept: application/json
+
+  - 请求成功后,可在相应后端看到链路日志,效果与上面的jaeger插件和zipkin插件相同。

Reply via email to