zipkin tracing: support to make the envoy as the independent hop for tracing
Commit Message: zipkin tracing: support to make the envoy as the independent hop for tracing
Additional Description:
In the previous implementation of zipkin tracer, the inbound envoy will generates server span and the outbound envoy will generates client span. By this way, in the sidecar mode, envoy is treated as part of the app. But in the gateway mode, the zipkin couldn't work correctly.
This PR added a new option to make the envoy worked as independent hop for zipkin tracing. In this new implementation, envoy can work correctly in both sidecar mode and gateway mode.
And this PR will close #22944.
Risk Level: Low, zipkin only updates. Testing: Unit tests. Docs Changes: n/a. Release Notes: Added Platform Specific Features: n/a.
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @adisuissa
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).
cc @mattklein123 @kyessenov
/retest
Retrying Azure Pipelines: Retried failed jobs in: envoy-presubmit
/retest
Retrying Azure Pipelines: Retried failed jobs in: envoy-presubmit
friendly ping @adisuissa
High-level question: is it correct to think that this flag should be true by default? (i.e., if we were to have a runtime guard around it, will it make sense to have it set to true eventually)
IMO, it should be true. But I am afraid there will be many users will be affected. I'm not sure if many people have gotten used to the original model.
It is still somewhat not clear to me and could be due to my misunderstanding of zipkin and tracing. Is this field separating server and client spans?
In the privious implementation, the zinkin tracer create only one span (server span for inbound, client span for outbound) for a request. The inbound proxy and outbond proxy constitute a complete span pair.
This implementation couldn't work properly in gateway mode. And if inbound traffic routing or outbound traffic routing is disabled, the trace chain couldn't be generated correctly.
And in the new implementaion, if the independent_proxy is set to true (and start child span should be set to true also), the inbound proxy will create a complete span pair for a request independently. The outbound proxy will create a complete span pair indepentdently also.
Inbound proxy and outbound proxy will no longer be bound.
friendly ping @adisuissa
the previous assign is failed 🤣
the previous assign is failed 🤣
In the privious implementation, the zinkin tracer create only one span (server span for inbound, client span for outbound) for a request. The inbound proxy and outbond proxy constitute a complete span pair.
This implementation couldn't work properly in gateway mode. And if inbound traffic routing or outbound traffic routing is disabled, the trace chain couldn't be generated correctly.
And in the new implementaion, if the
independent_proxyis set to true (and start child span should be set to true also), the inbound proxy will create a complete span pair for a request independently. The outbound proxy will create a complete span pair indepentdently also. Inbound proxy and outbound proxy will no longer be bound.
Thanks for the explanation. In this case, the name of the field could probably be improved to explain this behavior.
Something in the lines of split_in_out_spans or something that explains what this function does would improve the usability of this feature.
I would suggest adding when the value should be set (i.e., when the proxy is used as a gateway) in the comments.
In the privious implementation, the zinkin tracer create only one span (server span for inbound, client span for outbound) for a request. The inbound proxy and outbond proxy constitute a complete span pair. This implementation couldn't work properly in gateway mode. And if inbound traffic routing or outbound traffic routing is disabled, the trace chain couldn't be generated correctly. And in the new implementaion, if the
independent_proxyis set to true (and start child span should be set to true also), the inbound proxy will create a complete span pair for a request independently. The outbound proxy will create a complete span pair indepentdently also. Inbound proxy and outbound proxy will no longer be bound.Thanks for the explanation. In this case, the name of the field could probably be improved to explain this behavior. Something in the lines of
split_in_out_spansor something that explains what this function does would improve the usability of this feature. I would suggest adding when the value should be set (i.e., when the proxy is used as a gateway) in the comments.
Got it. I will update it tomorrow.
@envoyproxy/envoy-maintainers assignee is @adisuissa