The problem of previous gateway option to provide a tracer and a tracer closer is that when creating the tracer, the service name, logger, metric scope are not available.
This PR update the option to be a tracer provider function and takes the gateway as input so that the service name, logger and metric scope all are available similar to NotFoundHandler - func(*Gateway) http.HandlerFunc.
With this change, now we can provide the tracer like below:
var AppOptions = &zanzibar.Options{
...
TracerProvider: func(g *zanzibar.Gateway) (opentracing.Tracer, io.Closer, error) {
// actual logic to instantiate the tracer with the service name, logger, scope available in gateway
}
}
The problem of previous gateway option to provide a tracer and a tracer closer is that when creating the tracer, the service name, logger, metric scope are not available.
This PR update the option to be a tracer provider function and takes the gateway as input so that the service name, logger and metric scope all are available similar to
NotFoundHandler
-func(*Gateway) http.HandlerFunc
.With this change, now we can provide the tracer like below: