You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get failed to expand opentracing_context_ for request 000055D4589C9190: get_binary_context failed: could not find request trace when invoking subrequest by ngx lua.
$ curl 127.0.0.1:8080
2020/07/02 10:22:11 [error] 308#308: *22 failed to expand opentracing_context_ for request 000055D4589C9190: get_binary_context failed: could not find request trace, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", subrequest: "/sub", host: "127.0.0.1:8080"
terminate called without an active exception
2020/07/02 10:22:11 [alert] 154#154: worker process 308 exited on signal 6
curl: (52) Empty reply from server
How to trace sub requests?
nginx.conf:
load_module modules/ngx_http_opentracing_module.so;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
opentracing on;
opentracing_load_tracer /usr/local/lib/libjaegertracing_plugin.so jaeger-config.json;
opentracing_propagate_context;
server {
listen 8080;
location / {
default_type text/html;
content_by_lua '
local bridge_tracer = require("opentracing_bridge_tracer")
local tracer = bridge_tracer.new_from_global()
local parent_context = tracer:binary_extract(ngx.var.opentracing_binary_context)
local span = tracer:start_span("lua-hello", {["references"] = {{"child_of", parent_context}}})
local res = ngx.location.capture("/sub")
ngx.say(res.body)
span:finish()
';
}
location /sub {
default_type text/html;
content_by_lua '
local bridge_tracer = require("opentracing_bridge_tracer")
local tracer = bridge_tracer.new_from_global()
local parent_context = tracer:binary_extract(ngx.var.opentracing_binary_context)
local span = tracer:start_span("sub-lua-hello", {["references"] = {{"child_of", parent_context}}})
ngx.say("<p>hello, world</p>")
span:finish()
';
}
}
}
Get
failed to expand opentracing_context_ for request 000055D4589C9190: get_binary_context failed: could not find request trace
when invoking subrequest by ngx lua.How to trace sub requests?
nginx.conf:
jaeger-config.json:
The text was updated successfully, but these errors were encountered: