opentracing-lua icon indicating copy to clipboard operation
opentracing-lua copied to clipboard

format and injectors

Open kakireddyp opened this issue 4 years ago • 0 comments

@james-callahan

Can you please provide sample code for injector. I'm trying to call inject as it needs format and it needs to be registered not sure about injector how to define that. any help here please

`local tracer = require("opentracing.tracer") local t = tracer:new() local span = t:start_span("hello-opentracing") local context = span:context() local carrier = ngx.req.get_headers() span:set_tag("http.method", "GET") span:set_tag("http.url", "/hello-opentracing")

		t.register_injector("my_type","opentracing.tracer.injectors")
		t:inject(context,"my_type",carrier)
		--ngx.say(cjson.encode(context))`

kakireddyp avatar Jul 21 '21 20:07 kakireddyp