openzipkin-contrib / play-zipkin-tracing

Provides distributed tracing for Play Framework and Akka using Zipkin.
Apache License 2.0
48 stars 19 forks source link

could not find implicit value for parameter traceData #38

Closed JaryZhen closed 6 years ago

JaryZhen commented 6 years ago

Here is my controller code

  class MonitorController @Inject() ( monitorService: MonitorService,
    val tracer: ZipkinTraceServiceLike ) extends AbstractController  with ZipkinTraceImplicits {
     import io.growing.monitor.dtos.MonitorUnitResponse._

controllers/MonitorController.scala:: could not find implicit value for parameter traceData: 
jp.co.bizreach.trace.TraceData unitsWithReasons <- monitorService.updateUnits(projectId,form.map(_.toMonitorUnit(projectId)))

I do this follow the sample play25 step by step . Others can work. I don't know what details I miss.

shimamoto commented 6 years ago

Is there an action block that marks the request parameter as implicit like this?

Action.async { implicit req =>
  // call a service method
}

You need to pass through the implicit request from the action because a trace data including a span is implicitly created from request headers.