我使用docker设置zipkin
然后我使用http://localhost:9411/访问它,然后我遵循此tutorial并遵循代码
class Filters @Inject() (
zipkinTraceFilter: ZipkinTraceFilter
) extends HttpFilters {
val filters = Seq(zipkinTraceFilter)
}
我在application.conf
中添加了
play.http.filters=arteciate.filters.Filters
trace {
service-name = "zipkin-api-sample"
zipkin {
base-url = "http://localhost:9411"
sample-rate = 0.1
}
}
zipkin-trace-context {
fork-join-executor {
parallelism-factor = 20.0
parallelism-max = 200
}
}
play.modules.enabled += "jp.co.bizreach.trace.play24.module.ZipkinModule"
在我的控制器中添加
class DirectUserController @Inject() (userRepository: UserRepositoryTrait, val tracer: ZipkinTraceService)
extends Controller with ZipkinTraceImplicits {
// Trace blocking action
def test1 = Action { implicit request =>
tracer.trace("sync"){ implicit traceData =>
log.info("Hello World!")
Ok(Json.obj("result" -> "ok"))
}
}
}
然后我访问了这条路线
http://localhost:9000/direct-user/test1
,然后http://localhost:9411/,然后单击查找跟踪,但显示0个服务 我有什么想念的吗?也是zipkin的新手