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

How to get the current parent span in nginx #13

@pjsg

Description

@pjsg

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions