Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the current parent span in nginx #13

Open
pjsg opened this issue Feb 12, 2021 · 0 comments
Open

How to get the current parent span in nginx #13

pjsg opened this issue Feb 12, 2021 · 0 comments

Comments

@pjsg
Copy link

pjsg commented Feb 12, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant