-
Notifications
You must be signed in to change notification settings - Fork 351
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
filters: deprecate OpenTracing in FilterContext #3044
filters: deprecate OpenTracing in FilterContext #3044
Conversation
Deprecate OpenTracing FilterContext getters and remove their usage from filters. For #2104 Signed-off-by: Alexander Yastrebov <[email protected]>
@@ -599,7 +599,7 @@ func (opa *OpenPolicyAgentInstance) startSpanFromContextWithTracer(tr opentracin | |||
} | |||
|
|||
func (opa *OpenPolicyAgentInstance) StartSpanFromFilterContext(fc filters.FilterContext) (opentracing.Span, context.Context) { | |||
return opa.startSpanFromContextWithTracer(fc.Tracer(), fc.ParentSpan(), fc.Request().Context()) | |||
return opa.StartSpanFromContext(fc.Request().Context()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mjungsbluth BTW I am not sure why OPA needs a whole set of opentracing helpers.
I think it should get tracer from its options and for synchronous filter requests it should get proxy span (and its tracer if needed) via opentracing.SpanFromContext(ctx.Request().Context())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlexanderYastrebov It should be fine the way you outlined. It was probably overly defensive to include the tracer for cases where the context does not already contain a span (which actually don't provide much value for the synchronous cases).
👍 |
1 similar comment
👍 |
// Filter spans should be children of the proxy span, | ||
// use opentracing.SpanFromContext(ctx.Request().Context()) to get the proxy span. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a proxy span but a "filters" span added by #890 if enabled
Lines 111 to 119 in f6bf033
func (t *proxyTracing) startFilterTracing(operation string, ctx *context) *filterTracing { | |
if t.disableFilterSpans { | |
return nil | |
} | |
span := tracing.CreateSpan(operation, ctx.request.Context(), t.tracer) | |
ctx.parentSpan = span | |
return &filterTracing{span, t.logFilterLifecycleEvents} | |
} |
Maybe we can change it to return ingress span.
Anyway it is not used by anything, e.g. tracingTag
uses ingress span (which is opentracing.SpanFromContext(ctx.Request().Context())
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #3052
The ParentSpan is not a proxy span but either ingress span of "filters" span when enabled. Follow up on #3044 Signed-off-by: Alexander Yastrebov <[email protected]>
…#3052) The ParentSpan is not a proxy span but either ingress span of "filters" span when enabled. Follow up on #3044 Signed-off-by: Alexander Yastrebov <[email protected]>
Deprecate OpenTracing FilterContext getters and remove their usage from filters. For zalando#2104 Signed-off-by: Alexander Yastrebov <[email protected]>
…zalando#3052) The ParentSpan is not a proxy span but either ingress span of "filters" span when enabled. Follow up on zalando#3044 Signed-off-by: Alexander Yastrebov <[email protected]>
Deprecate OpenTracing FilterContext getters and remove their usage from filters.
For #2104