AlexStocks commented on a change in pull request #119:
URL: https://github.com/apache/dubbo-go-samples/pull/119#discussion_r637556605
##########
File path: openzipkin/README.md
##########
@@ -0,0 +1,174 @@
+# Zipkin in Dubbo-go Example
+
+## Backend
+
+Zipkin is a distributed tracing system. It helps gather timing data needed to
troubleshoot latency problems in service architectures. Features include both
the collection and lookup of this data.
+
+## Introduction
+
+```markdown
+.
+├── README.md
+├── README_zh.md
+├── docker-compose.yml
+├── go-client
+├── go-server-a
+├── go-server-b
+└── prometheus
+```
+
+- go-client :The Service Consumer
+- go-server-a :The Service Provider A
+- go-server-b :The Service Provider B
+
+Client calls ProviderA , and then calls ProviderB,
+ProviderA also makes a request to ProviderB!
+
+依赖关系:
+
+
+## Code
+
+register Zipkin. Reporter,Endpoint,Tracer,default sample `AlwaysSample`
+
+```go
+func registerZipkin() {
+ // set up a span reporter
+ reporter := zipkinhttp.NewReporter("http://localhost:9411/api/v2/spans")
+
+ // create our local service endpoint
+ endpoint, err := zipkin.NewEndpoint("go-server-a", "localhost:80")
+ if err != nil {
+ gxlog.CError("unable to create local endpoint: %+v\n", err)
+ }
+
+ // set sampler , default AlwaysSample
+ // sampler := zipkin.NewModuloSampler(1)
+
+ // initialize our tracer
+ // nativeTracer, err := zipkin.NewTracer(reporter,
zipkin.WithLocalEndpoint(endpoint), zipkin.WithSampler(sampler))
+ nativeTracer, err := zipkin.NewTracer(reporter,
zipkin.WithLocalEndpoint(endpoint))
+ if err != nil {
+ gxlog.CError("unable to create tracer: %+v\n", err)
+ }
+
+ // use zipkin-go-opentracing to wrap our tracer
+ tracer := zipkinot.Wrap(nativeTracer)
+
+ // optionally set as Global OpenTracing tracer instance
+ opentracing.SetGlobalTracer(tracer)
+}
+```
+
+## Config
+
+Provider config filter:
+
+```yaml
+
+services:
+ ...
+filter: "tracing"
+
+```
+
+## Filter
+
+Dubbo-go support `opentrace filter` 实现,基于简单配置即可
Review comment:
Dubbo-go supports `opentrace filter`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]