This repository was archived by the owner on Aug 11, 2025. It is now read-only.

Description
I'm trying to get the current span in my content_by_lua_block so that I can create a new span to describe my processing. I can use the opentracing_binary_context to do this unless there is no current context. In this case, an error level message is printed to the log.
If there is no context, then ngx.var.opentracing_context_foo returns nil (with no message logged). However, if there is a context, then it logs a message saying that there is no value foo.
I can't use the presence of the trace-id in the http request headers as there might not be a trace-id, but tracing might still be enabled (and vice versa).
Is there a way to discover if there is a current span without ever generating a log message?