This is an automated email from the ASF dual-hosted git repository.
github-actions[bot] pushed a commit to branch asf-site-v2
in repository https://gitbox.apache.org/repos/asf/dubbo-website.git
The following commit(s) were added to refs/heads/asf-site-v2 by this push:
new 4dbecdedbee deploy: 84b35ebdab20a54da2c740aa8428a375ff43b481
4dbecdedbee is described below
commit 4dbecdedbee4a5df181fa79d33554ae4981d02a8
Author: Alanxtl <[email protected]>
AuthorDate: Thu Sep 3 07:55:37 2026 +0000
deploy: 84b35ebdab20a54da2c740aa8428a375ff43b481
---
en/index.xml | 18 ++--
.../golang-sdk/tutorial/observability/index.xml | 18 ++--
.../tutorial/observability/tracing/index.html | 117 +++++++++++++++++----
en/sitemap.xml | 2 +-
sitemap.xml | 2 +-
zh-cn/index.xml | 55 +++++-----
.../golang-sdk/tutorial/observability/index.xml | 55 +++++-----
.../tutorial/observability/tracing/index.html | 117 +++++++++++++++++----
zh-cn/sitemap.xml | 2 +-
9 files changed, 275 insertions(+), 111 deletions(-)
diff --git a/en/index.xml b/en/index.xml
index 369b7cc9945..48d3208d264 100644
--- a/en/index.xml
+++ b/en/index.xml
@@ -3213,18 +3213,16 @@ For
example:</p></description></item><item><title>Dubbo SPI Plugins and De
<h2 id="prerequisites">Prerequisites</h2>
<p>The Dubbo community provides tools and solutions to simplify the
packaging and deployment process in the entire Kubernetes environment.
Therefore, we need to install the relevant tools before we
begin.</p></description></item><item><title>Dubbo
Protocol</title><link>https://dubbo.apache.org/en/overview/mannual/java-sdk/reference-manual/protocol/dubbo/</link><pubDate>Mon,
01 Jan 0001 00:00:00
+0000</pubDate><guid>https://dubbo.apache.org/en/overview/mannual/java-sdk/referen
[...]
-<p>Echo testing is used to detect whether a service is available. The
echo test follows the normal request process, allowing the entire call to be
tested for smooth operation and can be used for monitoring. In an echo test,
the client sends a request containing a specific value (such as a string). The
server should respond with the same value to verify that the request has been
successfully received and processed. If the response does not match the
request, it indicates that the se [...]
+<p>Echo testing is used to detect whether a service is available. The
echo test follows the normal request process, allowing the entire call to be
tested for smooth operation and can be used for monitoring. In an echo test,
the client sends a request containing a specific value (such as a string). The
server should respond with the same value to verify that the request has been
successfully received and processed. If the response does not match the
request, it indicates that the se [...]
+<p>The following exporters are supported:</p>
<ul>
-<li><a
href="https://opentelemetry.io/docs/specs/otel/logs/sdk_exporters/stdout/">Stdout
exporter</a></li>
-<li><a
href="https://opentelemetry.io/docs/languages/js/exporters/#jaeger">Jaeger
exporter</a></li>
-<li><a
href="https://opentelemetry.io/docs/languages/js/exporters/#zipkin">Zipkin
exporter</a></li>
-<li><a
href="https://opentelemetry.io/docs/languages/js/exporters/#use-otlp-exporter-with-httpjson-or-httpprotobuf">OTLP-HTTP
exporter</a></li>
-<li><a
href="https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/">OTLP-gRPC
exporter</a></li>
+<li><code>stdout</code>: Prints spans to the process
standard output as JSON; suitable for local development and
debugging.</li>
+<li><code>jaeger</code>: Exports spans to <a
href="https://www.jaegertracing.io/">Jaeger</a>.</li>
+<li><code>zipkin</code>: Exports spans to <a
href="https://zipkin.io/">Zipkin</a>.</li>
+<li><code>otlp-http</code>: Exports spans to OpenTelemetry
Collector or other backends over OTLP/HTTP.</li>
+<li><code>otlp-grpc</code>: Exports spans to OpenTelemetry
Collector or other backends over OTLP/gRPC.</li>
</ul>
-<h2 id="usage">Usage</h2>
-<p>Please note that tracing functionality is only enabled when creating
the Dubbo application via <code>dubbo.NewInstance</code>, which is
the <code>microservice application mode</code> mentioned in our
quick start. The <code>lightweight RPC API</code> does not
currently support enabling tracing.</p>
-<h2 id="example-explanation">Example Explanation</h2>
-<p>You can view the full example source code <a
href="https://github.com/apache/dubbo-go-samples/tree/main/otel/tracing">here</a>.</p></description></item><item><title>Exception
Type Return
Values</title><link>https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/rpc/error/</link><pubDate>Mon,
01 Jan 0001 00:00:00
+0000</pubDate><guid>https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/rpc/error/</guid><description><h2
id="1-introduction [...]
+<p>Runnable examples for the stdout, jaeger, and otlp-http exporters are
available under <a
href="https://github.com/apache/dubbo-go-samples/tree/main/otel/tracing">dubbo-go-samples/otel/tracing</a>.
The sections below explain how to run each of
them.</p></description></item><item><title>Exception Type Return
Values</title><link>https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/rpc/error/</link><pubDate>Mon,
01 Jan 0001 00:00:00 +0000</pubDate><guid [...]
<p>This document demonstrates how to handle error type responses during
RPC calls. You can view the <a
href="https://github.com/apache/dubbo-go-samples/tree/main/error"
target="_blank">complete example source code here</a>.</p>
<h2 id="2-example-details">2. Example Details</h2>
<h3 id="21-server">2.1 Server</h3>
diff --git a/en/overview/mannual/golang-sdk/tutorial/observability/index.xml
b/en/overview/mannual/golang-sdk/tutorial/observability/index.xml
index 8e141b30a33..a3ba2122981 100644
--- a/en/overview/mannual/golang-sdk/tutorial/observability/index.xml
+++ b/en/overview/mannual/golang-sdk/tutorial/observability/index.xml
@@ -23,18 +23,16 @@
</span></span><span style="display:flex;"><span> |
</span></span><span style="display:flex;"><span> v
</span></span><span
style="display:flex;"><span>Grafana queries Prometheus and renders
dashboards
-</span></span></code></pre></div><p>Pull
mode is the standard Prometheus model and is recommended for long-running
Dubbo-Go providers and consumers. In this
sample:</p></description></item><item><title>Link
Tracing</title><link>https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/observability/tracing/</link><pubDate>Mon,
01 Jan 0001 00:00:00
+0000</pubDate><guid>https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/observa
[...]
+</span></span></code></pre></div><p>Pull
mode is the standard Prometheus model and is recommended for long-running
Dubbo-Go providers and consumers. In this
sample:</p></description></item><item><title>Link
Tracing</title><link>https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/observability/tracing/</link><pubDate>Mon,
01 Jan 0001 00:00:00
+0000</pubDate><guid>https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/observa
[...]
+<p>The following exporters are supported:</p>
<ul>
-<li><a
href="https://opentelemetry.io/docs/specs/otel/logs/sdk_exporters/stdout/">Stdout
exporter</a></li>
-<li><a
href="https://opentelemetry.io/docs/languages/js/exporters/#jaeger">Jaeger
exporter</a></li>
-<li><a
href="https://opentelemetry.io/docs/languages/js/exporters/#zipkin">Zipkin
exporter</a></li>
-<li><a
href="https://opentelemetry.io/docs/languages/js/exporters/#use-otlp-exporter-with-httpjson-or-httpprotobuf">OTLP-HTTP
exporter</a></li>
-<li><a
href="https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/">OTLP-gRPC
exporter</a></li>
+<li><code>stdout</code>: Prints spans to the process
standard output as JSON; suitable for local development and
debugging.</li>
+<li><code>jaeger</code>: Exports spans to <a
href="https://www.jaegertracing.io/">Jaeger</a>.</li>
+<li><code>zipkin</code>: Exports spans to <a
href="https://zipkin.io/">Zipkin</a>.</li>
+<li><code>otlp-http</code>: Exports spans to OpenTelemetry
Collector or other backends over OTLP/HTTP.</li>
+<li><code>otlp-grpc</code>: Exports spans to OpenTelemetry
Collector or other backends over OTLP/gRPC.</li>
</ul>
-<h2 id="usage">Usage</h2>
-<p>Please note that tracing functionality is only enabled when creating
the Dubbo application via <code>dubbo.NewInstance</code>, which is
the <code>microservice application mode</code> mentioned in our
quick start. The <code>lightweight RPC API</code> does not
currently support enabling tracing.</p>
-<h2 id="example-explanation">Example Explanation</h2>
-<p>You can view the full example source code <a
href="https://github.com/apache/dubbo-go-samples/tree/main/otel/tracing">here</a>.</p></description></item><item><title>Kubernetes
Lifecycle
Probe</title><link>https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/observability/probe/</link><pubDate>Mon,
01 Jan 0001 00:00:00
+0000</pubDate><guid>https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/observability/probe/</guid><description><h1
[...]
+<p>Runnable examples for the stdout, jaeger, and otlp-http exporters are
available under <a
href="https://github.com/apache/dubbo-go-samples/tree/main/otel/tracing">dubbo-go-samples/otel/tracing</a>.
The sections below explain how to run each of
them.</p></description></item><item><title>Kubernetes Lifecycle
Probe</title><link>https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/observability/probe/</link><pubDate>Mon,
01 Jan 0001 00:00:00 +0000</pubDa [...]
<p>Dubbo-Go provides a built-in <strong>Kubernetes HTTP Probe
service</strong> that supports:</p>
<ul>
<li>✅ <code>liveness</code></li>
diff --git
a/en/overview/mannual/golang-sdk/tutorial/observability/tracing/index.html
b/en/overview/mannual/golang-sdk/tutorial/observability/tracing/index.html
index 4ecef3c9f17..9b2d416442e 100644
--- a/en/overview/mannual/golang-sdk/tutorial/observability/tracing/index.html
+++ b/en/overview/mannual/golang-sdk/tutorial/observability/tracing/index.html
@@ -1,4 +1,4 @@
-<!doctype html><html lang=en class=no-js><head><meta name=ROBOTS
content="INDEX, FOLLOW"><link rel=alternate hreflang=zh-cn
href=https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/observability/tracing/><link
rel=canonical
href=https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/observability/tracing/><script>var
_paq=window._paq=window._paq||[];_paq.push(["setDocumentTitle",document.domain+"/"+document.title]),_paq.push(["setCookieDomain","*.dubbo.apache.or
[...]
+<!doctype html><html lang=en class=no-js><head><meta name=ROBOTS
content="INDEX, FOLLOW"><link rel=alternate hreflang=zh-cn
href=https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/observability/tracing/><link
rel=canonical
href=https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/observability/tracing/><script>var
_paq=window._paq=window._paq||[];_paq.push(["setDocumentTitle",document.domain+"/"+document.title]),_paq.push(["setCookieDomain","*.dubbo.apache.or
[...]
<a class=dropdown-item href=/en/overview/notices/>Security Notices</a>
<a class=dropdown-item href=/en/contact/>Contributor's Guide</a></div></li><li
class="nav-item nav-item-line px-2 mb-2 mb-lg-0"><a class=nav-link
href=/en/blog/><span>Blog</span></a></li><li class="nav-item nav-item-line px-2
mb-2 mb-lg-0"><a class=nav-link
href=/en/download/><span>DOWNLOAD</span></a></li><li class="nav-item dropdown
d-lg-block"><a class="nav-link dropdown-toggle" href=# id=navbarDropdown
role=button data-toggle=dropdown aria-haspopup=true
aria-expanded=false>ECOSYSTEM</ [...]
<a class=dropdown-item
href=/zh-cn/overview/mannual/control-plane/>Visualizable Console</a>
@@ -693,36 +693,115 @@
<label for=m-enoverviewnoticesprotocol-check><a
href=/en/overview/notices/protocol/ class="align-left pl-0 td-sidebar-link
td-sidebar-link__page" id=m-enoverviewnoticesprotocol><span>RPC Protocol
Security</span></a></label></li><li class="td-sidebar-nav__section-title
td-sidebar-nav__section without-child" id=m-enoverviewnoticesregistry-li><input
type=checkbox id=m-enoverviewnoticesregistry-check>
<label for=m-enoverviewnoticesregistry-check><a
href=/en/overview/notices/registry/ class="align-left pl-0 td-sidebar-link
td-sidebar-link__page" id=m-enoverviewnoticesregistry><span>Registry Center
Security</span></a></label></li><li class="td-sidebar-nav__section-title
td-sidebar-nav__section without-child" id=m-enoverviewnoticesadmin-li><input
type=checkbox id=m-enoverviewnoticesadmin-check>
<label for=m-enoverviewnoticesadmin-check><a href=/en/overview/notices/admin/
class="align-left pl-0 td-sidebar-link td-sidebar-link__page"
id=m-enoverviewnoticesadmin><span>Dubbo Admin
Security</span></a></label></li><li class="td-sidebar-nav__section-title
td-sidebar-nav__section without-child" id=m-enoverviewnoticeslog4j-li><input
type=checkbox id=m-enoverviewnoticeslog4j-check>
-<label for=m-enoverviewnoticeslog4j-check><a href=/en/overview/notices/log4j/
class="align-left pl-0 td-sidebar-link td-sidebar-link__page"
id=m-enoverviewnoticeslog4j><span>Log4j Vulnerability
Impact</span></a></label></li></ul></li></ul></li></ul></nav></div></div><main
class="col-12 col-md-9 col-xl-8 pl-md-5" role=main><nav aria-label=breadcrumb
class=td-breadcrumbs><ol class=breadcrumb><li class=breadcrumb-item><a
href=/en/overview/>Documentation</a></li><li class=breadcrumb-item><a [...]
+<label for=m-enoverviewnoticeslog4j-check><a href=/en/overview/notices/log4j/
class="align-left pl-0 td-sidebar-link td-sidebar-link__page"
id=m-enoverviewnoticeslog4j><span>Log4j Vulnerability
Impact</span></a></label></li></ul></li></ul></li></ul></nav></div></div><main
class="col-12 col-md-9 col-xl-8 pl-md-5" role=main><nav aria-label=breadcrumb
class=td-breadcrumbs><ol class=breadcrumb><li class=breadcrumb-item><a
href=/en/overview/>Documentation</a></li><li class=breadcrumb-item><a [...]
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span><span
style=color:#719e07>import</span> (
-</span></span><span style=display:flex><span> <span
style=color:#2aa198>"dubbo.apache.org/dubbo-go/v3"</span>
-</span></span><span style=display:flex><span> _ <span
style=color:#2aa198>"dubbo.apache.org/dubbo-go/v3/imports"</span>
-</span></span><span style=display:flex><span> <span
style=color:#2aa198>"dubbo.apache.org/dubbo-go/v3/otel/trace"</span>
+</span></span><span style=display:flex><span> <span
style=color:#2aa198>"dubbo.apache.org/dubbo-go/v3"</span>
+</span></span><span style=display:flex><span> _ <span
style=color:#2aa198>"dubbo.apache.org/dubbo-go/v3/imports"</span>
+</span></span><span style=display:flex><span> <span
style=color:#2aa198>"dubbo.apache.org/dubbo-go/v3/otel/trace"</span>
</span></span><span style=display:flex><span>)
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span><span
style=color:#268bd2>func</span> <span style=color:#268bd2>main</span>() {
-</span></span><span style=display:flex><span> instance, err <span
style=color:#719e07>:=</span> dubbo.<span
style=color:#268bd2>NewInstance</span>(
-</span></span><span style=display:flex><span> dubbo.<span
style=color:#268bd2>WithTracing</span>(
-</span></span><span style=display:flex><span> <span
style=color:#586e75>// add tracing options here</span>
-</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithEnabled</span>(), <span style=color:#586e75>// enable
tracing feature</span>
-</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithStdoutExporter</span>(),
-</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithW3cPropagator</span>(),
-</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithAlwaysMode</span>(),
-</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithRatioMode</span>(), <span style=color:#586e75>// use
ratio mode</span>
-</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithRatio</span>(<span style=color:#2aa198>0.5</span>),
<span style=color:#586e75>// sample ratio, only active when using ratio
mode</span>
-</span></span><span style=display:flex><span> ),
-</span></span><span style=display:flex><span> )
+</span></span><span style=display:flex><span> ins, err <span
style=color:#719e07>:=</span> dubbo.<span
style=color:#268bd2>NewInstance</span>(
+</span></span><span style=display:flex><span> dubbo.<span
style=color:#268bd2>WithTracing</span>(
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithEnabled</span>(), <span style=color:#586e75>//
enable tracing</span>
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithStdoutExporter</span>(), <span style=color:#586e75>//
use the stdout exporter</span>
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithW3cPropagator</span>(), <span style=color:#586e75>//
use W3C trace context propagation</span>
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithAlwaysMode</span>(), <span style=color:#586e75>//
sample all requests for local verification</span>
+</span></span><span style=display:flex><span> ),
+</span></span><span style=display:flex><span> )
+</span></span><span style=display:flex><span> <span
style=color:#719e07>if</span> err <span style=color:#719e07>!=</span> <span
style=color:#cb4b16>nil</span> {
+</span></span><span style=display:flex><span> <span
style=color:#b58900>panic</span>(err)
+</span></span><span style=display:flex><span> }
+</span></span><span style=display:flex><span> _ = ins
</span></span><span style=display:flex><span>}
-</span></span></code></pre></div><p>If you do not specify any option
parameters in the <code>dubbo.WithTracing()</code> call, the default behavior
will be used:</p><div class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-yaml data-lang=yaml><span style=display:flex><span><span
style=color:#586e75># default tracing config</span>
+</span></span></code></pre></div><p>If no options are passed to
<code>dubbo.WithTracing()</code>, the default configuration below is
used:</p><div class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-yaml data-lang=yaml><span style=display:flex><span><span
style=color:#586e75># default tracing config</span>
</span></span><span style=display:flex><span><span
style=color:#268bd2>enable</span>: <span style=color:#cb4b16>false</span>
</span></span><span style=display:flex><span><span
style=color:#268bd2>exporter</span>: stdout
</span></span><span style=display:flex><span><span
style=color:#268bd2>endpoint</span>: <span style=color:#2aa198>""</span>
</span></span><span style=display:flex><span><span
style=color:#268bd2>propagator</span>: w3c
</span></span><span style=display:flex><span><span
style=color:#268bd2>sample-mode</span>: ratio
</span></span><span style=display:flex><span><span
style=color:#268bd2>sample-ratio</span>: <span style=color:#2aa198>0.5</span>
-</span></span></code></pre></div><h2
id=tracingoptions-explained>TracingOptions Explained</h2><ul><li>enable: enable
tracing or not<ul><li><code>trace.WithEnabled()</code> means enable
tracing</li></ul></li><li>exporter: tracing exporter backends, support stdout,
jaeger, zipkin, otlp-http,
otlp-grpc<ul><li><code>trace.WithStdoutExporter()</code></li><li><code>trace.WithJaegerExporter()</code></li><li><code>trace.WithZipkinExporter()</code></li><li><code>trace.WithOtlpHttpExporter()</code
[...]
-<button class="btn btn-primary mb-4
feedback--no">No</button></div><script>const
yes=document.querySelector(".feedback--yes"),no=document.querySelector(".feedback--no");document.querySelectorAll(".feedback--link").forEach(e=>{e.href=e.href+window.location.pathname});const
sendFeedback=e=>{gtag||console.log("!gtag"),gtag("event","click",{event_category:"Helpful",event_label:window.location.pathname,value:e})},disableButtons=()=>{yes.disabled=!0,yes.classList.add("feedback--button__disable
[...]
+</span></span><span style=display:flex><span><span
style=color:#268bd2>insecure</span>: <span style=color:#cb4b16>false</span>
+</span></span></code></pre></div><p>Note that <code>enable</code> defaults to
<code>false</code>. You must call <code>trace.WithEnabled()</code> (or set
<code>tracing.enable: true</code> in YAML) to actually turn tracing on.</p><h2
id=common-dubbowithtracing-options>Common dubbo.WithTracing
options</h2><ul><li><code>enable</code>: whether tracing is enabled; defaults
to <code>false</code>.<ul><li><code>trace.WithEnabled()</code> enables
tracing.</li></ul></li><li><code>exporter</code>: t [...]
+</span></span></code></pre></div><p>Example
layout:</p><ul><li><code>go-server/cmd/main.go</code>: the server, which
listens on port 20000 over the Triple
protocol.</li><li><code>go-client/cmd/main.go</code>: the client, which
connects directly to <code>127.0.0.1:20000</code> and calls <code>Greet</code>
once.</li><li>The example uses direct connection, so no registry is
needed.</li></ul><h3 id=configure-the-stdout-exporter>Configure the stdout
exporter</h3><p>Both the server and the cli [...]
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithEnabled</span>(), <span style=color:#586e75>//
enable tracing</span>
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithStdoutExporter</span>(), <span style=color:#586e75>//
use the stdout exporter</span>
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithW3cPropagator</span>(), <span style=color:#586e75>//
W3C trace context propagation</span>
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithAlwaysMode</span>(), <span style=color:#586e75>//
sample all requests</span>
+</span></span><span style=display:flex><span>)
+</span></span></code></pre></div><p><code>WithAlwaysMode</code> samples every
request so a span is produced each time. With the default ratio mode (0.5),
only about half of the requests are sampled.</p><h3 id=run-and-verify>Run and
verify</h3><p>Start the server in the first terminal:</p><div
class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-bash data-lang=bash><span style=display:flex><span>go run .
[...]
+</span></span></code></pre></div><p>Start the client in the second
terminal:</p><div class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-bash data-lang=bash><span style=display:flex><span>go run
./go-client/cmd/main.go
+</span></span></code></pre></div><p>After a successful call, the client prints
a log similar to <code>Greet response: hello world</code>. The server console
then shows the exporter startup logs and the span JSON:</p><div
class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-text data-lang=text><span style=display:flex><span>INFO
tracing/tracing.go:53 tracing enabled, exporter: stdout
+</span></span><span style=display:flex><span>INFO tracing/tracing.go:54
tracing enabled, sampler: always_on
+</span></span></code></pre></div><p>The span is printed as JSON with the
following key fields:</p><div class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-json data-lang=json><span style=display:flex><span>{
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Name"</span>: <span
style=color:#2aa198>"Greet"</span>,
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"SpanContext"</span>: {
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"TraceID"</span>: <span
style=color:#2aa198>"dee1fcd3eafbcb73338aa719a9d4d4ad"</span>,
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"SpanID"</span>: <span
style=color:#2aa198>"23a21f8330154882"</span>
+</span></span><span style=display:flex><span> },
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Parent"</span>: {
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"TraceID"</span>: <span
style=color:#2aa198>"00000000000000000000000000000000"</span>,
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"SpanID"</span>: <span
style=color:#2aa198>"0000000000000000"</span>,
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Remote"</span>: <span
style=color:#cb4b16>true</span>
+</span></span><span style=display:flex><span> },
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"StartTime"</span>: <span
style=color:#2aa198>"2024-01-24T09:31:51.7352636+08:00"</span>,
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"EndTime"</span>: <span
style=color:#2aa198>"2024-01-24T09:31:51.7352636+08:00"</span>,
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Attributes"</span>: [
+</span></span><span style=display:flex><span> {
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Key"</span>: <span
style=color:#2aa198>"rpc.system"</span>,
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Value"</span>: { <span
style=color:#268bd2>"Type"</span>: <span
style=color:#2aa198>"STRING"</span>, <span
style=color:#268bd2>"Value"</span>: <span
style=color:#2aa198>"apache_dubbo"</span> }
+</span></span><span style=display:flex><span> },
+</span></span><span style=display:flex><span> {
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Key"</span>: <span
style=color:#2aa198>"rpc.service"</span>,
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Value"</span>: { <span
style=color:#268bd2>"Type"</span>: <span
style=color:#2aa198>"STRING"</span>, <span
style=color:#268bd2>"Value"</span>: <span
style=color:#2aa198>"greet.GreetService"</span> }
+</span></span><span style=display:flex><span> },
+</span></span><span style=display:flex><span> {
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Key"</span>: <span
style=color:#2aa198>"rpc.method"</span>,
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Value"</span>: { <span
style=color:#268bd2>"Type"</span>: <span
style=color:#2aa198>"STRING"</span>, <span
style=color:#268bd2>"Value"</span>: <span
style=color:#2aa198>"Greet"</span> }
+</span></span><span style=display:flex><span> }
+</span></span><span style=display:flex><span> ],
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Status"</span>: {
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Code"</span>: <span
style=color:#2aa198>"Ok"</span>
+</span></span><span style=display:flex><span> },
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Resource"</span>: [
+</span></span><span style=display:flex><span> {
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Key"</span>: <span
style=color:#2aa198>"service.name"</span>,
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Value"</span>: { <span
style=color:#268bd2>"Type"</span>: <span
style=color:#2aa198>"STRING"</span>, <span
style=color:#268bd2>"Value"</span>: <span
style=color:#2aa198>"dubbo_otel_tracing_server"</span> }
+</span></span><span style=display:flex><span> }
+</span></span><span style=display:flex><span> ]
+</span></span><span style=display:flex><span>}
+</span></span></code></pre></div><p>Every client invocation produces a similar
span on the server. See the <a
href=https://github.com/apache/dubbo-go-samples/blob/main/otel/tracing/stdout/README.md>stdout
example README</a> for the complete output.</p><h2
id=running-the-jaeger-exporter>Running the Jaeger exporter</h2><h3
id=start-jaeger>Start Jaeger</h3><p>The example starts Jaeger all-in-one with
Docker:</p><div class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b3 [...]
+</span></span></span><span style=display:flex><span><span
style=color:#cb4b16></span> -e <span
style=color:#268bd2>COLLECTOR_OTLP_ENABLED</span><span
style=color:#719e07>=</span><span style=color:#b58900>true</span> <span
style=color:#cb4b16>\
+</span></span></span><span style=display:flex><span><span
style=color:#cb4b16></span> -p 16686:16686 <span style=color:#cb4b16>\
+</span></span></span><span style=display:flex><span><span
style=color:#cb4b16></span> -p 14268:14268 <span style=color:#cb4b16>\
+</span></span></span><span style=display:flex><span><span
style=color:#cb4b16></span> -p 4317:4317 <span style=color:#cb4b16>\
+</span></span></span><span style=display:flex><span><span
style=color:#cb4b16></span> -p 4318:4318 <span style=color:#cb4b16>\
+</span></span></span><span style=display:flex><span><span
style=color:#cb4b16></span> jaegertracing/all-in-one:latest
+</span></span></code></pre></div><p><code>16686</code> is the Jaeger UI port
and <code>14268</code> is the Jaeger collector HTTP port used by the example
exporter.</p><h3 id=get-and-run-the-example>Get and run the example</h3><div
class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-bash data-lang=bash><span style=display:flex><span><span
style=color:#b58900>cd</span> dubbo-go-samples/otel/tracing/jaeger
+</span></span></code></pre></div><p>Start the server in the first
terminal:</p><div class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-bash data-lang=bash><span style=display:flex><span>go run
./go-server/cmd/main.go
+</span></span></code></pre></div><p>Start the client in the second
terminal:</p><div class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-bash data-lang=bash><span style=display:flex><span>go run
./go-client/cmd/main.go
+</span></span></code></pre></div><p>The exporter-related configuration in the
example is:</p><div class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-go data-lang=go><span style=display:flex><span>dubbo.<span
style=color:#268bd2>WithTracing</span>(
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithEnabled</span>(),
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithJaegerExporter</span>(),
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithEndpoint</span>(<span
style=color:#2aa198>"http://localhost:14268/api/traces"</span>),
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithW3cPropagator</span>(),
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithAlwaysMode</span>(),
+</span></span><span style=display:flex><span>)
+</span></span></code></pre></div><p>If Jaeger runs on another host or uses a
different port, update the address in <code>WithEndpoint</code>
accordingly.</p><h3 id=view-the-trace-results>View the trace
results</h3><p>Open <code>http://localhost:16686</code> in a
browser:</p><ol><li>Select <code>dubbo_otel_jaeger_server</code> or
<code>dubbo_otel_jaeger_client</code> from the Service dropdown.</li><li>Click
Find Traces.</li><li>Click a trace to inspect the client and server span
timeline. [...]
+</span></span></code></pre></div><p>Start the server in the first
terminal:</p><div class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-bash data-lang=bash><span style=display:flex><span>go run
./go-server/cmd/main.go
+</span></span></code></pre></div><p>Start the client in the second
terminal:</p><div class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-bash data-lang=bash><span style=display:flex><span>go run
./go-client/cmd/main.go
+</span></span></code></pre></div><p>The client calls the server over triple
(port 20000), dubbo (port 20001), and jsonrpc (port 20002). When all six spans
(three client spans plus three server spans) are exported successfully, the
server prints:</p><div class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-text data-lang=text><span style=display:flex><span>server
count: 3, client count: 3
+</span></span></code></pre></div><p>The example panics on timeout or on a
span-count mismatch.</p><p>The exporter-related configuration in the example
is:</p><div class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-go data-lang=go><span style=display:flex><span>dubbo.<span
style=color:#268bd2>WithTracing</span>(
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithEnabled</span>(),
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithOtlpHttpExporter</span>(),
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithEndpoint</span>(<span
style=color:#2aa198>"127.0.0.1:4318"</span>),
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithInsecure</span>(), <span style=color:#586e75>// the
mock receiver uses plain HTTP</span>
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithW3cPropagator</span>(),
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithAlwaysMode</span>(),
+</span></span><span style=display:flex><span>)
+</span></span></code></pre></div><p>In a real environment, point
<code>endpoint</code> at an OpenTelemetry Collector or an OTLP-compatible
backend, for example <code>collector.example.com:4318</code>. Keep
<code>WithInsecure</code> when reporting over plain HTTP, and remove it when
the backend uses TLS.</p><h2 id=how-to-view-trace-results>How to view trace
results</h2><ul><li><strong>stdout exporter</strong>: Spans are printed as JSON
on the application standard output. Inspect <code>Tra [...]
+<button class="btn btn-primary mb-4
feedback--no">No</button></div><script>const
yes=document.querySelector(".feedback--yes"),no=document.querySelector(".feedback--no");document.querySelectorAll(".feedback--link").forEach(e=>{e.href=e.href+window.location.pathname});const
sendFeedback=e=>{gtag||console.log("!gtag"),gtag("event","click",{event_category:"Helpful",event_label:window.location.pathname,value:e})},disableButtons=()=>{yes.disabled=!0,yes.classList.add("feedback--button__disable
[...]
<button class="contact-btn qr-container"
onmouseover='showQRCode("dingding-qr")'
onmouseout='hideQRCode("dingding-qr")'>DINGTALK CHANNEL<div class=qr-code
id=dingding-qr style=display:none><img
src=https://img.alicdn.com/imgextra/i4/O1CN01buuadT274Lj33QZWQ_!!6000000007743-0-tps-1170-1477.jpg
alt="DingTalk QR Code"></div></button>
<button class=contact-btn><a
href=https://github.com/apache/dubbo/>GitHub</a></button></div></div><div
class=footer-container-right><ul><li>DOCUMENTATION</li><li><a
href=/en/overview/>Overview</a></li><li><a href=/en/overview/quickstart/>Quick
Start</a></li><li><a
href=/en/contact/contributor/software-donation-guide_dev/>Developer
guide</a></li></ul><ul><li>RESOURCES</li><li><a
href=/en/contact/>Community</a></li></ul></div></div><div
style="width:85.125rem;height:0;border:1px solid #ddd [...]
project logo are either registered trademarks or trademarks of The Apache
Software Foundation in the United States
diff --git a/en/sitemap.xml b/en/sitemap.xml
index 977ac00acaf..d5d8aa1fc4c 100644
--- a/en/sitemap.xml
+++ b/en/sitemap.xml
@@ -1 +1 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>https://dubbo.apache.org/en/blog/2023/01/16/alibaba-upgrades-dubbo3-to-fully-replace-hsf2/</loc><lastmod>2024-09-30T17:53:33+08:00</lastmod><changefreq>monthly</changefreq><priority>0.5</priority><xhtml:link
rel="alternate" hreflang="zh-cn"
href="https://dubbo.apache.org/zh-cn/blog/2023/01/16/%E9%98%BF%E9%87%8C%E5%B7%B4%E5
[...]
\ No newline at end of file
+<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>https://dubbo.apache.org/en/blog/2023/01/16/alibaba-upgrades-dubbo3-to-fully-replace-hsf2/</loc><lastmod>2024-09-30T17:53:33+08:00</lastmod><changefreq>monthly</changefreq><priority>0.5</priority><xhtml:link
rel="alternate" hreflang="zh-cn"
href="https://dubbo.apache.org/zh-cn/blog/2023/01/16/%E9%98%BF%E9%87%8C%E5%B7%B4%E5
[...]
\ No newline at end of file
diff --git a/sitemap.xml b/sitemap.xml
index 5660e8c4505..053a6782d36 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -1 +1 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?><sitemapindex
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://dubbo.apache.org/zh-cn/sitemap.xml</loc><lastmod>2026-09-02T22:57:37+08:00</lastmod></sitemap><sitemap><loc>https://dubbo.apache.org/en/sitemap.xml</loc><lastmod>2026-08-24T21:00:49+08:00</lastmod></sitemap></sitemapindex>
\ No newline at end of file
+<?xml version="1.0" encoding="utf-8" standalone="yes"?><sitemapindex
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://dubbo.apache.org/zh-cn/sitemap.xml</loc><lastmod>2026-09-03T15:49:14+08:00</lastmod></sitemap><sitemap><loc>https://dubbo.apache.org/en/sitemap.xml</loc><lastmod>2026-09-03T15:49:14+08:00</lastmod></sitemap></sitemapindex>
\ No newline at end of file
diff --git a/zh-cn/index.xml b/zh-cn/index.xml
index 927d572b34f..ca32fcc77dc 100644
--- a/zh-cn/index.xml
+++ b/zh-cn/index.xml
@@ -16318,41 +16318,46 @@ ServiceConfig.export() 或者 ReferenceConfig.get()
先自动启动module,然
</span></span><span style="display:flex;"><span>
<span style="color:#719e07">rpc</span> GreetTimeout(GreetRequest)
<span style="color:#719e07">returns</span> (GreetResponse) {}
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><h4
id="服务端handler文件">服务端handler文件</h4>
-<p><code>Greet</code>方法直接响应,<code>GreetRetry</code>方法用于模拟重试。</p></description></item><item><title>链路追踪</title><link>https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/observability/tracing/</link><pubDate>Mon,
01 Jan 0001 00:00:00
+0000</pubDate><guid>https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/observability/tracing/</guid><description><p>Dubbo-go
支持基于 <a href="https://opentelemetry.io/">OpenTelemetr [...]
+<p><code>Greet</code>方法直接响应,<code>GreetRetry</code>方法用于模拟重试。</p></description></item><item><title>链路追踪</title><link>https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/observability/tracing/</link><pubDate>Mon,
01 Jan 0001 00:00:00
+0000</pubDate><guid>https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/observability/tracing/</guid><description><p>Dubbo-go
基于 <a href="https://opentelemetry.io/">OpenTelemetry& [...]
+<p>当前支持的 exporter 包括:</p>
<ul>
-<li><a
href="https://opentelemetry.io/docs/specs/otel/logs/sdk_exporters/stdout/">Stdout
exporter</a></li>
-<li><a
href="https://opentelemetry.io/docs/languages/js/exporters/#jaeger">Jaeger
exporter</a></li>
-<li><a
href="https://opentelemetry.io/docs/languages/js/exporters/#zipkin">Zipkin
exporter</a></li>
-<li><a
href="https://opentelemetry.io/docs/languages/js/exporters/#use-otlp-exporter-with-httpjson-or-httpprotobuf">OTLP-HTTP
exporter</a></li>
-<li><a
href="https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/">OTLP-gRPC
exporter</a></li>
+<li><code>stdout</code>:以 JSON 形式把 Span
打印到进程标准输出,适合本地开发与调试。</li>
+<li><code>jaeger</code>:上报到 <a
href="https://www.jaegertracing.io/">Jaeger</a>。</li>
+<li><code>zipkin</code>:上报到 <a
href="https://zipkin.io/">Zipkin</a>。</li>
+<li><code>otlp-http</code>:通过 OTLP/HTTP 上报到 OpenTelemetry
Collector 等后端。</li>
+<li><code>otlp-grpc</code>:通过 OTLP/gRPC 上报到 OpenTelemetry
Collector 等后端。</li>
</ul>
+<p>其中 stdout、jaeger、otlp-http 在 <a
href="https://github.com/apache/dubbo-go-samples/tree/main/otel/tracing">dubbo-go-samples/otel/tracing</a>
下有可直接运行的示例,下文分别介绍其运行方式。</p>
<h2 id="使用方式">使用方式</h2>
-<p>请注意,仅支持通过 <code>dubbo.NewInstance</code> 方式创建 dubbo 应用时开启
tracing 功能,也就是我们快速开始中提到的<code>微服务应用模式</code>,对于<code>轻量 RPC
API</code>暂时不支持开启 tracing。</p>
-<h2 id="示例详解">示例详解</h2>
-<p>可在此查看<a
href="https://github.com/apache/dubbo-go-samples/tree/main/otel/tracing">完整示例源码</a>。</p>
-<p>使用 <code>dubbo.WithTracing()</code> 开启 tracing,可以通过多个参数控制
tracing 行为:</p>
+<ul>
+<li>目前仅支持通过 <code>dubbo.NewInstance</code> 创建 dubbo
应用(即快速开始中介绍的微服务应用模式)时开启 tracing;轻量 RPC API 暂不支持。</li>
+<li>使用 tracing 前需要导入
<code>dubbo.apache.org/dubbo-go/v3/imports</code> 空包,用于注册各 exporter
的实现。</li>
+<li>通过 <code>dubbo.WithTracing(...)</code> 配置 tracing,内部使用
<code>trace.WithXXX</code> 子选项控制
exporter、endpoint、传播器和采样策略。</li>
+</ul>
+<p>下面是一段最简配置:</p>
<div class="highlight"><pre tabindex="0"
style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code
class="language-go" data-lang="go"><span
style="display:flex;"><span><span
style="color:#719e07">package</span> main
</span></span><span style="display:flex;"><span>
</span></span><span
style="display:flex;"><span><span
style="color:#719e07">import</span> (
-</span></span><span style="display:flex;"><span>
<span
style="color:#2aa198">&#34;dubbo.apache.org/dubbo-go/v3&#34;</span>
-</span></span><span style="display:flex;"><span> _
<span
style="color:#2aa198">&#34;dubbo.apache.org/dubbo-go/v3/imports&#34;</span>
-</span></span><span style="display:flex;"><span>
<span
style="color:#2aa198">&#34;dubbo.apache.org/dubbo-go/v3/otel/trace&#34;</span>
+</span></span><span style="display:flex;"><span>
<span
style="color:#2aa198">&#34;dubbo.apache.org/dubbo-go/v3&#34;</span>
+</span></span><span style="display:flex;"><span>
_ <span
style="color:#2aa198">&#34;dubbo.apache.org/dubbo-go/v3/imports&#34;</span>
+</span></span><span style="display:flex;"><span>
<span
style="color:#2aa198">&#34;dubbo.apache.org/dubbo-go/v3/otel/trace&#34;</span>
</span></span><span style="display:flex;"><span>)
</span></span><span style="display:flex;"><span>
</span></span><span
style="display:flex;"><span><span
style="color:#268bd2">func</span> <span
style="color:#268bd2">main</span>() {
-</span></span><span style="display:flex;"><span>
instance, err <span style="color:#719e07">:=</span> dubbo.<span
style="color:#268bd2">NewInstance</span>(
-</span></span><span style="display:flex;"><span>
dubbo.<span style="color:#268bd2">WithTracing</span>(
-</span></span><span style="display:flex;"><span>
<span style="color:#586e75">// add tracing options here</span>
-</span></span><span style="display:flex;"><span>
trace.<span style="color:#268bd2">WithEnabled</span>(), <span
style="color:#586e75">// enable tracing feature</span>
-</span></span><span style="display:flex;"><span>
trace.<span style="color:#268bd2">WithStdoutExporter</span>(),
-</span></span><span style="display:flex;"><span>
trace.<span style="color:#268bd2">WithW3cPropagator</span>(),
-</span></span><span style="display:flex;"><span>
trace.<span style="color:#268bd2">WithAlwaysMode</span>(),
-</span></span><span style="display:flex;"><span>
trace.<span style="color:#268bd2">WithRatioMode</span>(), <span
style="color:#586e75">// use ratio mode</span>
-</span></span><span style="display:flex;"><span>
trace.<span style="color:#268bd2">WithRatio</span>(<span
style="color:#2aa198">0.5</span>), <span
style="color:#586e75">// sample ratio, only active when use ratio
mode</span>
-</span></span><span style="display:flex;"><span> ),
-</span></span><span style="display:flex;"><span> )
+</span></span><span style="display:flex;"><span>
ins, err <span style="color:#719e07">:=</span> dubbo.<span
style="color:#268bd2">NewInstance</span>(
+</span></span><span style="display:flex;"><span>
dubbo.<span style="color:#268bd2">WithTracing</span>(
+</span></span><span style="display:flex;"><span>
trace.<span
style="color:#268bd2">WithEnabled</span>(), <span
style="color:#586e75">// 开启 tracing</span>
+</span></span><span style="display:flex;"><span>
trace.<span
style="color:#268bd2">WithStdoutExporter</span>(), <span
style="color:#586e75">// 使用 stdout exporter</span>
+</span></span><span style="display:flex;"><span>
trace.<span
style="color:#268bd2">WithW3cPropagator</span>(), <span
style="color:#586e75">// 使用 W3C trace context 传播</span>
+</span></span><span style="display:flex;"><span>
trace.<span
style="color:#268bd2">WithAlwaysMode</span>(), <span
style="color:#586e75">// 全量采样,便于本地验证</span>
+</span></span><span style="display:flex;"><span>
),
+</span></span><span style="display:flex;"><span>
)
+</span></span><span style="display:flex;"><span>
<span style="color:#719e07">if</span> err <span
style="color:#719e07">!=</span> <span
style="color:#cb4b16">nil</span> {
+</span></span><span style="display:flex;"><span>
<span style="color:#b58900">panic</span>(err)
+</span></span><span style="display:flex;"><span>
}
+</span></span><span style="display:flex;"><span>
_ = ins
</span></span><span style="display:flex;"><span>}
-</span></span></code></pre></div><p>如果你在
<code>dubbo.WithTracing()</code> 调用中不指定任何 option
参数,则会使用默认行为:</p></description></item><item><title>日志管理</title><link>https://dubbo.apache.org/zh-cn/overview/mannual/java-sdk/tasks/observability/logging/</link><pubDate>Mon,
01 Jan 0001 00:00:00
+0000</pubDate><guid>https://dubbo.apache.org/zh-cn/overview/mannual/java-sdk/tasks/observability/logging/</guid><description><h2
id="支持的日志框架">支持的日 [...]
+</span></span></code></pre></div><p><code>dubbo.WithTracing()</code>
不传任何参数时,使用默认配置:</p></description></item><item><title>日志管理</title><link>https://dubbo.apache.org/zh-cn/overview/mannual/java-sdk/tasks/observability/logging/</link><pubDate>Mon,
01 Jan 0001 00:00:00
+0000</pubDate><guid>https://dubbo.apache.org/zh-cn/overview/mannual/java-sdk/tasks/observability/logging/</guid><description><h2
id="支持的日志框架">支持的日志框架</h2>
<p>Dubbo 支持以下日志框架,用户可根据业务应用实际使用的日志框架进行配置。</p>
<table>
<thead>
diff --git a/zh-cn/overview/mannual/golang-sdk/tutorial/observability/index.xml
b/zh-cn/overview/mannual/golang-sdk/tutorial/observability/index.xml
index 8af1820d81c..390429f2f5b 100644
--- a/zh-cn/overview/mannual/golang-sdk/tutorial/observability/index.xml
+++ b/zh-cn/overview/mannual/golang-sdk/tutorial/observability/index.xml
@@ -182,38 +182,43 @@
</table>
<hr>
<h1 id="三配置方式">三、配置方式</h1>
-<p>Dubbo-Go 支持 <strong>New API(推荐)</strong> 与
<strong>配置文件方式(YAML)</strong>
两种配置方式。</p></description></item><item><title>链路追踪</title><link>https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/observability/tracing/</link><pubDate>Mon,
01 Jan 0001 00:00:00
+0000</pubDate><guid>https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/observability/tracing/</guid><description><p>Dubbo-go
支持基于 <a href="https://opentelemet [...]
+<p>Dubbo-Go 支持 <strong>New API(推荐)</strong> 与
<strong>配置文件方式(YAML)</strong>
两种配置方式。</p></description></item><item><title>链路追踪</title><link>https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/observability/tracing/</link><pubDate>Mon,
01 Jan 0001 00:00:00
+0000</pubDate><guid>https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/observability/tracing/</guid><description><p>Dubbo-go
基于 <a href="https://opentelemetry [...]
+<p>当前支持的 exporter 包括:</p>
<ul>
-<li><a
href="https://opentelemetry.io/docs/specs/otel/logs/sdk_exporters/stdout/">Stdout
exporter</a></li>
-<li><a
href="https://opentelemetry.io/docs/languages/js/exporters/#jaeger">Jaeger
exporter</a></li>
-<li><a
href="https://opentelemetry.io/docs/languages/js/exporters/#zipkin">Zipkin
exporter</a></li>
-<li><a
href="https://opentelemetry.io/docs/languages/js/exporters/#use-otlp-exporter-with-httpjson-or-httpprotobuf">OTLP-HTTP
exporter</a></li>
-<li><a
href="https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/">OTLP-gRPC
exporter</a></li>
+<li><code>stdout</code>:以 JSON 形式把 Span
打印到进程标准输出,适合本地开发与调试。</li>
+<li><code>jaeger</code>:上报到 <a
href="https://www.jaegertracing.io/">Jaeger</a>。</li>
+<li><code>zipkin</code>:上报到 <a
href="https://zipkin.io/">Zipkin</a>。</li>
+<li><code>otlp-http</code>:通过 OTLP/HTTP 上报到 OpenTelemetry
Collector 等后端。</li>
+<li><code>otlp-grpc</code>:通过 OTLP/gRPC 上报到 OpenTelemetry
Collector 等后端。</li>
</ul>
+<p>其中 stdout、jaeger、otlp-http 在 <a
href="https://github.com/apache/dubbo-go-samples/tree/main/otel/tracing">dubbo-go-samples/otel/tracing</a>
下有可直接运行的示例,下文分别介绍其运行方式。</p>
<h2 id="使用方式">使用方式</h2>
-<p>请注意,仅支持通过 <code>dubbo.NewInstance</code> 方式创建 dubbo 应用时开启
tracing 功能,也就是我们快速开始中提到的<code>微服务应用模式</code>,对于<code>轻量 RPC
API</code>暂时不支持开启 tracing。</p>
-<h2 id="示例详解">示例详解</h2>
-<p>可在此查看<a
href="https://github.com/apache/dubbo-go-samples/tree/main/otel/tracing">完整示例源码</a>。</p>
-<p>使用 <code>dubbo.WithTracing()</code> 开启 tracing,可以通过多个参数控制
tracing 行为:</p>
+<ul>
+<li>目前仅支持通过 <code>dubbo.NewInstance</code> 创建 dubbo
应用(即快速开始中介绍的微服务应用模式)时开启 tracing;轻量 RPC API 暂不支持。</li>
+<li>使用 tracing 前需要导入
<code>dubbo.apache.org/dubbo-go/v3/imports</code> 空包,用于注册各 exporter
的实现。</li>
+<li>通过 <code>dubbo.WithTracing(...)</code> 配置 tracing,内部使用
<code>trace.WithXXX</code> 子选项控制
exporter、endpoint、传播器和采样策略。</li>
+</ul>
+<p>下面是一段最简配置:</p>
<div class="highlight"><pre tabindex="0"
style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code
class="language-go" data-lang="go"><span
style="display:flex;"><span><span
style="color:#719e07">package</span> main
</span></span><span style="display:flex;"><span>
</span></span><span
style="display:flex;"><span><span
style="color:#719e07">import</span> (
-</span></span><span style="display:flex;"><span>
<span
style="color:#2aa198">&#34;dubbo.apache.org/dubbo-go/v3&#34;</span>
-</span></span><span style="display:flex;"><span> _
<span
style="color:#2aa198">&#34;dubbo.apache.org/dubbo-go/v3/imports&#34;</span>
-</span></span><span style="display:flex;"><span>
<span
style="color:#2aa198">&#34;dubbo.apache.org/dubbo-go/v3/otel/trace&#34;</span>
+</span></span><span style="display:flex;"><span>
<span
style="color:#2aa198">&#34;dubbo.apache.org/dubbo-go/v3&#34;</span>
+</span></span><span style="display:flex;"><span>
_ <span
style="color:#2aa198">&#34;dubbo.apache.org/dubbo-go/v3/imports&#34;</span>
+</span></span><span style="display:flex;"><span>
<span
style="color:#2aa198">&#34;dubbo.apache.org/dubbo-go/v3/otel/trace&#34;</span>
</span></span><span style="display:flex;"><span>)
</span></span><span style="display:flex;"><span>
</span></span><span
style="display:flex;"><span><span
style="color:#268bd2">func</span> <span
style="color:#268bd2">main</span>() {
-</span></span><span style="display:flex;"><span>
instance, err <span style="color:#719e07">:=</span> dubbo.<span
style="color:#268bd2">NewInstance</span>(
-</span></span><span style="display:flex;"><span>
dubbo.<span style="color:#268bd2">WithTracing</span>(
-</span></span><span style="display:flex;"><span>
<span style="color:#586e75">// add tracing options here</span>
-</span></span><span style="display:flex;"><span>
trace.<span style="color:#268bd2">WithEnabled</span>(), <span
style="color:#586e75">// enable tracing feature</span>
-</span></span><span style="display:flex;"><span>
trace.<span style="color:#268bd2">WithStdoutExporter</span>(),
-</span></span><span style="display:flex;"><span>
trace.<span style="color:#268bd2">WithW3cPropagator</span>(),
-</span></span><span style="display:flex;"><span>
trace.<span style="color:#268bd2">WithAlwaysMode</span>(),
-</span></span><span style="display:flex;"><span>
trace.<span style="color:#268bd2">WithRatioMode</span>(), <span
style="color:#586e75">// use ratio mode</span>
-</span></span><span style="display:flex;"><span>
trace.<span style="color:#268bd2">WithRatio</span>(<span
style="color:#2aa198">0.5</span>), <span
style="color:#586e75">// sample ratio, only active when use ratio
mode</span>
-</span></span><span style="display:flex;"><span> ),
-</span></span><span style="display:flex;"><span> )
+</span></span><span style="display:flex;"><span>
ins, err <span style="color:#719e07">:=</span> dubbo.<span
style="color:#268bd2">NewInstance</span>(
+</span></span><span style="display:flex;"><span>
dubbo.<span style="color:#268bd2">WithTracing</span>(
+</span></span><span style="display:flex;"><span>
trace.<span
style="color:#268bd2">WithEnabled</span>(), <span
style="color:#586e75">// 开启 tracing</span>
+</span></span><span style="display:flex;"><span>
trace.<span
style="color:#268bd2">WithStdoutExporter</span>(), <span
style="color:#586e75">// 使用 stdout exporter</span>
+</span></span><span style="display:flex;"><span>
trace.<span
style="color:#268bd2">WithW3cPropagator</span>(), <span
style="color:#586e75">// 使用 W3C trace context 传播</span>
+</span></span><span style="display:flex;"><span>
trace.<span
style="color:#268bd2">WithAlwaysMode</span>(), <span
style="color:#586e75">// 全量采样,便于本地验证</span>
+</span></span><span style="display:flex;"><span>
),
+</span></span><span style="display:flex;"><span>
)
+</span></span><span style="display:flex;"><span>
<span style="color:#719e07">if</span> err <span
style="color:#719e07">!=</span> <span
style="color:#cb4b16">nil</span> {
+</span></span><span style="display:flex;"><span>
<span style="color:#b58900">panic</span>(err)
+</span></span><span style="display:flex;"><span>
}
+</span></span><span style="display:flex;"><span>
_ = ins
</span></span><span style="display:flex;"><span>}
-</span></span></code></pre></div><p>如果你在
<code>dubbo.WithTracing()</code> 调用中不指定任何 option
参数,则会使用默认行为:</p></description></item></channel></rss>
\ No newline at end of file
+</span></span></code></pre></div><p><code>dubbo.WithTracing()</code>
不传任何参数时,使用默认配置:</p></description></item></channel></rss>
\ No newline at end of file
diff --git
a/zh-cn/overview/mannual/golang-sdk/tutorial/observability/tracing/index.html
b/zh-cn/overview/mannual/golang-sdk/tutorial/observability/tracing/index.html
index 2581a9bd620..495310facc3 100644
---
a/zh-cn/overview/mannual/golang-sdk/tutorial/observability/tracing/index.html
+++
b/zh-cn/overview/mannual/golang-sdk/tutorial/observability/tracing/index.html
@@ -1,4 +1,4 @@
-<!doctype html><html lang=zh-cn class=no-js><head><meta name=ROBOTS
content="INDEX, FOLLOW"><link rel=alternate hreflang=en
href=https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/observability/tracing/><link
rel=canonical
href=https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/observability/tracing/><script>var
_paq=window._paq=window._paq||[];_paq.push(["setDocumentTitle",document.domain+"/"+document.title]),_paq.push(["setCookieDomain","*.dubbo.apache.or
[...]
+<!doctype html><html lang=zh-cn class=no-js><head><meta name=ROBOTS
content="INDEX, FOLLOW"><link rel=alternate hreflang=en
href=https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/observability/tracing/><link
rel=canonical
href=https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/observability/tracing/><script>var
_paq=window._paq=window._paq||[];_paq.push(["setDocumentTitle",document.domain+"/"+document.title]),_paq.push(["setCookieDomain","*.dubbo.apache.or
[...]
<a class=dropdown-item href=/zh-cn/overview/notices/>安全公告</a>
<a class=dropdown-item href=/zh-cn/contact/>贡献者指南</a></div></li><li
class="nav-item nav-item-line px-2 mb-2 mb-lg-0"><a class=nav-link
href=/zh-cn/blog/><span>博客</span></a></li><li class="nav-item nav-item-line
px-2 mb-2 mb-lg-0"><a class=nav-link
href=/zh-cn/download/><span>下载</span></a></li><li class="nav-item dropdown
d-lg-block"><a class="nav-link dropdown-toggle" href=# id=navbarDropdown
role=button data-toggle=dropdown aria-haspopup=true
aria-expanded=false>生态</a><div class="dropdo [...]
<a class=dropdown-item href=/zh-cn/overview/mannual/control-plane/>可视化控制台</a>
@@ -688,36 +688,115 @@
<label for=m-zh-cnoverviewnoticesprotocol-check><a
href=/zh-cn/overview/notices/protocol/ class="align-left pl-0 td-sidebar-link
td-sidebar-link__page" id=m-zh-cnoverviewnoticesprotocol><span>RPC
协议安全</span></a></label></li><li class="td-sidebar-nav__section-title
td-sidebar-nav__section without-child"
id=m-zh-cnoverviewnoticesregistry-li><input type=checkbox
id=m-zh-cnoverviewnoticesregistry-check>
<label for=m-zh-cnoverviewnoticesregistry-check><a
href=/zh-cn/overview/notices/registry/ class="align-left pl-0 td-sidebar-link
td-sidebar-link__page"
id=m-zh-cnoverviewnoticesregistry><span>注册中心安全</span></a></label></li><li
class="td-sidebar-nav__section-title td-sidebar-nav__section without-child"
id=m-zh-cnoverviewnoticesadmin-li><input type=checkbox
id=m-zh-cnoverviewnoticesadmin-check>
<label for=m-zh-cnoverviewnoticesadmin-check><a
href=/zh-cn/overview/notices/admin/ class="align-left pl-0 td-sidebar-link
td-sidebar-link__page" id=m-zh-cnoverviewnoticesadmin><span>Dubbo Admin
安全</span></a></label></li><li class="td-sidebar-nav__section-title
td-sidebar-nav__section without-child" id=m-zh-cnoverviewnoticeslog4j-li><input
type=checkbox id=m-zh-cnoverviewnoticeslog4j-check>
-<label for=m-zh-cnoverviewnoticeslog4j-check><a
href=/zh-cn/overview/notices/log4j/ class="align-left pl-0 td-sidebar-link
td-sidebar-link__page" id=m-zh-cnoverviewnoticeslog4j><span>Log4j
漏洞影响</span></a></label></li></ul></li></ul></li></ul></nav></div></div><main
class="col-12 col-md-9 col-xl-8 pl-md-5" role=main><nav aria-label=breadcrumb
class=td-breadcrumbs><ol class=breadcrumb><li class=breadcrumb-item><a
href=/zh-cn/overview/>文档</a></li><li class=breadcrumb-item><a href=/zh-cn/ove
[...]
+<label for=m-zh-cnoverviewnoticeslog4j-check><a
href=/zh-cn/overview/notices/log4j/ class="align-left pl-0 td-sidebar-link
td-sidebar-link__page" id=m-zh-cnoverviewnoticeslog4j><span>Log4j
漏洞影响</span></a></label></li></ul></li></ul></li></ul></nav></div></div><main
class="col-12 col-md-9 col-xl-8 pl-md-5" role=main><nav aria-label=breadcrumb
class=td-breadcrumbs><ol class=breadcrumb><li class=breadcrumb-item><a
href=/zh-cn/overview/>文档</a></li><li class=breadcrumb-item><a href=/zh-cn/ove
[...]
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span><span
style=color:#719e07>import</span> (
-</span></span><span style=display:flex><span> <span
style=color:#2aa198>"dubbo.apache.org/dubbo-go/v3"</span>
-</span></span><span style=display:flex><span> _ <span
style=color:#2aa198>"dubbo.apache.org/dubbo-go/v3/imports"</span>
-</span></span><span style=display:flex><span> <span
style=color:#2aa198>"dubbo.apache.org/dubbo-go/v3/otel/trace"</span>
+</span></span><span style=display:flex><span> <span
style=color:#2aa198>"dubbo.apache.org/dubbo-go/v3"</span>
+</span></span><span style=display:flex><span> _ <span
style=color:#2aa198>"dubbo.apache.org/dubbo-go/v3/imports"</span>
+</span></span><span style=display:flex><span> <span
style=color:#2aa198>"dubbo.apache.org/dubbo-go/v3/otel/trace"</span>
</span></span><span style=display:flex><span>)
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span><span
style=color:#268bd2>func</span> <span style=color:#268bd2>main</span>() {
-</span></span><span style=display:flex><span> instance, err <span
style=color:#719e07>:=</span> dubbo.<span
style=color:#268bd2>NewInstance</span>(
-</span></span><span style=display:flex><span> dubbo.<span
style=color:#268bd2>WithTracing</span>(
-</span></span><span style=display:flex><span> <span
style=color:#586e75>// add tracing options here</span>
-</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithEnabled</span>(), <span style=color:#586e75>// enable
tracing feature</span>
-</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithStdoutExporter</span>(),
-</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithW3cPropagator</span>(),
-</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithAlwaysMode</span>(),
-</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithRatioMode</span>(), <span style=color:#586e75>// use
ratio mode</span>
-</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithRatio</span>(<span style=color:#2aa198>0.5</span>),
<span style=color:#586e75>// sample ratio, only active when use ratio
mode</span>
-</span></span><span style=display:flex><span> ),
-</span></span><span style=display:flex><span> )
+</span></span><span style=display:flex><span> ins, err <span
style=color:#719e07>:=</span> dubbo.<span
style=color:#268bd2>NewInstance</span>(
+</span></span><span style=display:flex><span> dubbo.<span
style=color:#268bd2>WithTracing</span>(
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithEnabled</span>(), <span style=color:#586e75>//
开启 tracing</span>
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithStdoutExporter</span>(), <span style=color:#586e75>//
使用 stdout exporter</span>
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithW3cPropagator</span>(), <span style=color:#586e75>//
使用 W3C trace context 传播</span>
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithAlwaysMode</span>(), <span style=color:#586e75>//
全量采样,便于本地验证</span>
+</span></span><span style=display:flex><span> ),
+</span></span><span style=display:flex><span> )
+</span></span><span style=display:flex><span> <span
style=color:#719e07>if</span> err <span style=color:#719e07>!=</span> <span
style=color:#cb4b16>nil</span> {
+</span></span><span style=display:flex><span> <span
style=color:#b58900>panic</span>(err)
+</span></span><span style=display:flex><span> }
+</span></span><span style=display:flex><span> _ = ins
</span></span><span style=display:flex><span>}
-</span></span></code></pre></div><p>如果你在 <code>dubbo.WithTracing()</code>
调用中不指定任何 option 参数,则会使用默认行为:</p><div class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-yaml data-lang=yaml><span style=display:flex><span><span
style=color:#586e75># default tracing config</span>
+</span></span></code></pre></div><p><code>dubbo.WithTracing()</code>
不传任何参数时,使用默认配置:</p><div class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-yaml data-lang=yaml><span style=display:flex><span><span
style=color:#586e75># default tracing config</span>
</span></span><span style=display:flex><span><span
style=color:#268bd2>enable</span>: <span style=color:#cb4b16>false</span>
</span></span><span style=display:flex><span><span
style=color:#268bd2>exporter</span>: stdout
</span></span><span style=display:flex><span><span
style=color:#268bd2>endpoint</span>: <span style=color:#2aa198>""</span>
</span></span><span style=display:flex><span><span
style=color:#268bd2>propagator</span>: w3c
</span></span><span style=display:flex><span><span
style=color:#268bd2>sample-mode</span>: ratio
</span></span><span style=display:flex><span><span
style=color:#268bd2>sample-ratio</span>: <span style=color:#2aa198>0.5</span>
-</span></span></code></pre></div><h2
id=tracingoptions详解>TracingOptions详解</h2><ul><li>enable: enable tracing or
not<ul><li><code>trace.WithEnabled()</code> means enable
tracing</li></ul></li><li>exporter: tracing exporter backends, support stdout,
jaeger, zipkin, otlp-http,
otlp-grpc<ul><li><code>trace.WithStdoutExporter()</code></li><li><code>trace.WithJaegerExporter()</code></li><li><code>trace.WithZipkinExporter()</code></li><li><code>trace.WithOtlpHttpExporter()</code></li><li><code>
[...]
-<button class="btn btn-primary mb-4
feedback--no">否</button></div><script>const
yes=document.querySelector(".feedback--yes"),no=document.querySelector(".feedback--no");document.querySelectorAll(".feedback--link").forEach(e=>{e.href=e.href+window.location.pathname});const
sendFeedback=e=>{gtag||console.log("!gtag"),gtag("event","click",{event_category:"Helpful",event_label:window.location.pathname,value:e})},disableButtons=()=>{yes.disabled=!0,yes.classList.add("feedback--button__disabled
[...]
+</span></span><span style=display:flex><span><span
style=color:#268bd2>insecure</span>: <span style=color:#cb4b16>false</span>
+</span></span></code></pre></div><p>注意默认 <code>enable: false</code>,必须通过
<code>trace.WithEnabled()</code>(或 YAML 配置 <code>tracing.enable:
true</code>)真正开启功能。</p><h2 id=dubbowithtracing-常用参数>dubbo.WithTracing
常用参数</h2><ul><li><code>enable</code>:是否开启 tracing,默认
<code>false</code>。<ul><li><code>trace.WithEnabled()</code>:开启
tracing。</li></ul></li><li><code>exporter</code>:Span exporter 类型,支持
<code>stdout</code>、<code>jaeger</code>、<code>zipkin</code>、<code>otlp-http</code>、<code>otlp-grpc<
[...]
+</span></span></code></pre></div><p>示例目录说明:</p><ul><li><code>go-server/cmd/main.go</code>:服务端,Triple
协议监听 20000 端口。</li><li><code>go-client/cmd/main.go</code>:客户端,直连
<code>127.0.0.1:20000</code> 并调用一次
<code>Greet</code>。</li><li>示例使用直连方式,运行前不需要启动注册中心。</li></ul><h3
id=配置-stdout-exporter>配置 stdout exporter</h3><p>服务端与客户端均在
<code>dubbo.NewInstance</code> 中配置 stdout exporter:</p><div
class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;ta
[...]
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithEnabled</span>(), <span style=color:#586e75>//
开启 tracing</span>
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithStdoutExporter</span>(), <span style=color:#586e75>//
使用 stdout exporter</span>
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithW3cPropagator</span>(), <span style=color:#586e75>//
W3C trace context 传播</span>
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithAlwaysMode</span>(), <span style=color:#586e75>//
全量采样</span>
+</span></span><span style=display:flex><span>)
+</span></span></code></pre></div><p>这里使用 <code>WithAlwaysMode</code>
全量采样,保证每次调用都能产生 Span;如果使用默认的 ratio 模式(0.5),大约只有一半请求会被采样。</p><h3
id=启动并验证>启动并验证</h3><p>在第一个终端启动服务端:</p><div class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-bash data-lang=bash><span style=display:flex><span>go run
./go-server/cmd/main.go
+</span></span></code></pre></div><p>在第二个终端启动客户端:</p><div class=highlight><pre
tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-bash data-lang=bash><span style=display:flex><span>go run
./go-client/cmd/main.go
+</span></span></code></pre></div><p>客户端调用成功后,终端会输出类似 <code>Greet response:
hello world</code> 的日志。随后在服务端控制台可以看到 exporter 启动日志和本次调用的 Span JSON:</p><div
class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-text data-lang=text><span style=display:flex><span>INFO
tracing/tracing.go:53 tracing enabled, exporter: stdout
+</span></span><span style=display:flex><span>INFO tracing/tracing.go:54
tracing enabled, sampler: always_on
+</span></span></code></pre></div><p>Span 以 JSON 形式打印,关键字段如下:</p><div
class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-json data-lang=json><span style=display:flex><span>{
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Name"</span>: <span
style=color:#2aa198>"Greet"</span>,
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"SpanContext"</span>: {
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"TraceID"</span>: <span
style=color:#2aa198>"dee1fcd3eafbcb73338aa719a9d4d4ad"</span>,
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"SpanID"</span>: <span
style=color:#2aa198>"23a21f8330154882"</span>
+</span></span><span style=display:flex><span> },
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Parent"</span>: {
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"TraceID"</span>: <span
style=color:#2aa198>"00000000000000000000000000000000"</span>,
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"SpanID"</span>: <span
style=color:#2aa198>"0000000000000000"</span>,
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Remote"</span>: <span
style=color:#cb4b16>true</span>
+</span></span><span style=display:flex><span> },
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"StartTime"</span>: <span
style=color:#2aa198>"2024-01-24T09:31:51.7352636+08:00"</span>,
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"EndTime"</span>: <span
style=color:#2aa198>"2024-01-24T09:31:51.7352636+08:00"</span>,
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Attributes"</span>: [
+</span></span><span style=display:flex><span> {
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Key"</span>: <span
style=color:#2aa198>"rpc.system"</span>,
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Value"</span>: { <span
style=color:#268bd2>"Type"</span>: <span
style=color:#2aa198>"STRING"</span>, <span
style=color:#268bd2>"Value"</span>: <span
style=color:#2aa198>"apache_dubbo"</span> }
+</span></span><span style=display:flex><span> },
+</span></span><span style=display:flex><span> {
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Key"</span>: <span
style=color:#2aa198>"rpc.service"</span>,
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Value"</span>: { <span
style=color:#268bd2>"Type"</span>: <span
style=color:#2aa198>"STRING"</span>, <span
style=color:#268bd2>"Value"</span>: <span
style=color:#2aa198>"greet.GreetService"</span> }
+</span></span><span style=display:flex><span> },
+</span></span><span style=display:flex><span> {
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Key"</span>: <span
style=color:#2aa198>"rpc.method"</span>,
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Value"</span>: { <span
style=color:#268bd2>"Type"</span>: <span
style=color:#2aa198>"STRING"</span>, <span
style=color:#268bd2>"Value"</span>: <span
style=color:#2aa198>"Greet"</span> }
+</span></span><span style=display:flex><span> }
+</span></span><span style=display:flex><span> ],
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Status"</span>: {
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Code"</span>: <span
style=color:#2aa198>"Ok"</span>
+</span></span><span style=display:flex><span> },
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Resource"</span>: [
+</span></span><span style=display:flex><span> {
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Key"</span>: <span
style=color:#2aa198>"service.name"</span>,
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>"Value"</span>: { <span
style=color:#268bd2>"Type"</span>: <span
style=color:#2aa198>"STRING"</span>, <span
style=color:#268bd2>"Value"</span>: <span
style=color:#2aa198>"dubbo_otel_tracing_server"</span> }
+</span></span><span style=display:flex><span> }
+</span></span><span style=display:flex><span> ]
+</span></span><span style=display:flex><span>}
+</span></span></code></pre></div><p>每次客户端调用都会在服务端输出一段类似的 Span。完整输出示例可参考 <a
href=https://github.com/apache/dubbo-go-samples/blob/main/otel/tracing/stdout/README_zh.md>stdout
示例 README</a>。</p><h2 id=jaeger-exporter-运行方式>Jaeger exporter 运行方式</h2><h3
id=启动-jaeger>启动 Jaeger</h3><p>示例使用 Docker 启动 Jaeger all-in-one:</p><div
class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-bash data-lang=bash><span style=d [...]
+</span></span></span><span style=display:flex><span><span
style=color:#cb4b16></span> -e <span
style=color:#268bd2>COLLECTOR_OTLP_ENABLED</span><span
style=color:#719e07>=</span><span style=color:#b58900>true</span> <span
style=color:#cb4b16>\
+</span></span></span><span style=display:flex><span><span
style=color:#cb4b16></span> -p 16686:16686 <span style=color:#cb4b16>\
+</span></span></span><span style=display:flex><span><span
style=color:#cb4b16></span> -p 14268:14268 <span style=color:#cb4b16>\
+</span></span></span><span style=display:flex><span><span
style=color:#cb4b16></span> -p 4317:4317 <span style=color:#cb4b16>\
+</span></span></span><span style=display:flex><span><span
style=color:#cb4b16></span> -p 4318:4318 <span style=color:#cb4b16>\
+</span></span></span><span style=display:flex><span><span
style=color:#cb4b16></span> jaegertracing/all-in-one:latest
+</span></span></code></pre></div><p>其中 <code>16686</code> 是 Jaeger UI
端口,<code>14268</code> 是 Jaeger collector HTTP 端口(示例 exporter 使用该端口上报)。</p><h3
id=获取并运行示例>获取并运行示例</h3><div class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-bash data-lang=bash><span style=display:flex><span><span
style=color:#b58900>cd</span> dubbo-go-samples/otel/tracing/jaeger
+</span></span></code></pre></div><p>第一个终端启动服务端:</p><div class=highlight><pre
tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-bash data-lang=bash><span style=display:flex><span>go run
./go-server/cmd/main.go
+</span></span></code></pre></div><p>第二个终端启动客户端:</p><div class=highlight><pre
tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-bash data-lang=bash><span style=display:flex><span>go run
./go-client/cmd/main.go
+</span></span></code></pre></div><p>示例中 exporter 相关配置如下:</p><div
class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-go data-lang=go><span style=display:flex><span>dubbo.<span
style=color:#268bd2>WithTracing</span>(
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithEnabled</span>(),
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithJaegerExporter</span>(),
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithEndpoint</span>(<span
style=color:#2aa198>"http://localhost:14268/api/traces"</span>),
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithW3cPropagator</span>(),
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithAlwaysMode</span>(),
+</span></span><span style=display:flex><span>)
+</span></span></code></pre></div><p>如果 Jaeger 不在本机或修改了端口,需要同步修改
<code>WithEndpoint</code> 中的地址。</p><h3 id=查看-trace-结果>查看 trace
结果</h3><p>打开浏览器访问 <code>http://localhost:16686</code>:</p><ol><li>在 Service
下拉框中选择 <code>dubbo_otel_jaeger_server</code> 或
<code>dubbo_otel_jaeger_client</code>。</li><li>点击 Find Traces。</li><li>点击某条
trace 即可查看客户端、服务端的 Span 时间线。</li></ol><p>客户端示例在调用结束后会调用
<code>TracerProvider.Shutdown</code>,确保 Span 在进程退出前被刷新到 Jaeger。</p><h2
id=otlp-http-exporter-运行方式>OTLP HTTP ex [...]
+</span></span></code></pre></div><p>第一个终端启动服务端:</p><div class=highlight><pre
tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-bash data-lang=bash><span style=display:flex><span>go run
./go-server/cmd/main.go
+</span></span></code></pre></div><p>第二个终端启动客户端:</p><div class=highlight><pre
tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-bash data-lang=bash><span style=display:flex><span>go run
./go-client/cmd/main.go
+</span></span></code></pre></div><p>客户端会分别通过 triple(20000 端口)、dubbo(20001 端口)和
jsonrpc(20002 端口)调用服务端。如果 6 个 Span(3 个客户端 Span + 3 个服务端
Span)都成功上报,服务端终端会输出:</p><div class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-text data-lang=text><span style=display:flex><span>server
count: 3, client count: 3
+</span></span></code></pre></div><p>如果超时或数量不匹配,示例会直接 panic。</p><p>示例中 exporter
相关配置如下:</p><div class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-go data-lang=go><span style=display:flex><span>dubbo.<span
style=color:#268bd2>WithTracing</span>(
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithEnabled</span>(),
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithOtlpHttpExporter</span>(),
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithEndpoint</span>(<span
style=color:#2aa198>"127.0.0.1:4318"</span>),
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithInsecure</span>(), <span style=color:#586e75>// mock
receiver 使用纯 HTTP</span>
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithW3cPropagator</span>(),
+</span></span><span style=display:flex><span> trace.<span
style=color:#268bd2>WithAlwaysMode</span>(),
+</span></span><span style=display:flex><span>)
+</span></span></code></pre></div><p>在真实环境中,把 endpoint 改为 OpenTelemetry
Collector 或兼容 OTLP 的观测后端即可,例如 <code>collector.example.com:4318</code>。纯 HTTP
上报时保留 <code>WithInsecure</code>;如果后端启用了 TLS,则去掉该选项。</p><h2
id=如何查看-trace-结果>如何查看 trace 结果</h2><ul><li><strong>stdout
exporter</strong>:Span 以 JSON 打印在应用标准输出中。关注
<code>TraceID</code>、<code>SpanID</code>、<code>Parent</code> 和
<code>Attributes</code>,其中 <code>Attributes</code> 会携带
<code>rpc.system</code>、<code>rpc.service</code>、<code>rpc.method [...]
+<button class="btn btn-primary mb-4
feedback--no">否</button></div><script>const
yes=document.querySelector(".feedback--yes"),no=document.querySelector(".feedback--no");document.querySelectorAll(".feedback--link").forEach(e=>{e.href=e.href+window.location.pathname});const
sendFeedback=e=>{gtag||console.log("!gtag"),gtag("event","click",{event_category:"Helpful",event_label:window.location.pathname,value:e})},disableButtons=()=>{yes.disabled=!0,yes.classList.add("feedback--button__disabled
[...]
<button class="contact-btn qr-container"
onmouseover='showQRCode("dingding-qr")'
onmouseout='hideQRCode("dingding-qr")'>钉钉<div class=qr-code id=dingding-qr
style=display:none><img
src=https://img.alicdn.com/imgextra/i4/O1CN01buuadT274Lj33QZWQ_!!6000000007743-0-tps-1170-1477.jpg
alt="DingTalk QR Code"></div></button>
<button class=contact-btn><a
href=https://github.com/apache/dubbo/>GitHub</a></button></div></div><div
class=footer-container-right><ul><li>文档</li><li><a
href=/zh-cn/overview/home/>概览</a></li><li><a
href=/zh-cn/overview/quickstart/>快速开始</a></li><li><a
href=/zh-cn/contact/contributor/software-donation-guide_dev/>开发者指南</a></li></ul><ul><li>资源</li><li><a
href=/zh-cn/contact/>社区</a></li></ul></div></div><div
style="width:85.125rem;height:0;border:1px solid
#dddee4;margin-bottom:32px"></div>< [...]
project logo are either registered trademarks or trademarks of The Apache
Software Foundation in the United States
diff --git a/zh-cn/sitemap.xml b/zh-cn/sitemap.xml
index 7db8f214a06..67b372ef274 100644
--- a/zh-cn/sitemap.xml
+++ b/zh-cn/sitemap.xml
@@ -1 +1 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>https://dubbo.apache.org/zh-cn/blog/2023/01/16/%E9%98%BF%E9%87%8C%E5%B7%B4%E5%B7%B4%E5%8D%87%E7%BA%A7-dubbo3-%E5%85%A8%E9%9D%A2%E5%8F%96%E4%BB%A3-hsf2/</loc><lastmod>2023-11-28T15:14:12+08:00</lastmod><changefreq>monthly</changefreq><priority>0.5</priority><xhtml:link
rel="alternate" hreflang="en" href="https://dubbo.apach [...]
\ No newline at end of file
+<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>https://dubbo.apache.org/zh-cn/blog/2023/01/16/%E9%98%BF%E9%87%8C%E5%B7%B4%E5%B7%B4%E5%8D%87%E7%BA%A7-dubbo3-%E5%85%A8%E9%9D%A2%E5%8F%96%E4%BB%A3-hsf2/</loc><lastmod>2023-11-28T15:14:12+08:00</lastmod><changefreq>monthly</changefreq><priority>0.5</priority><xhtml:link
rel="alternate" hreflang="en" href="https://dubbo.apach [...]
\ No newline at end of file