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

filters: deprecate OpenTracing in FilterContext #3044

Merged

Conversation

AlexanderYastrebov
Copy link
Member

Deprecate OpenTracing FilterContext getters and remove their usage from filters.

For #2104

Deprecate OpenTracing FilterContext getters and remove their usage from filters.

For #2104

Signed-off-by: Alexander Yastrebov <[email protected]>
@AlexanderYastrebov AlexanderYastrebov added the minor no risk changes, for example new filters label Apr 26, 2024
@@ -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())
Copy link
Member Author

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())

Copy link
Collaborator

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).

@szuecs
Copy link
Member

szuecs commented Apr 26, 2024

👍

1 similar comment
@AlexanderYastrebov
Copy link
Member Author

👍

@AlexanderYastrebov AlexanderYastrebov merged commit 6ee45b1 into master Apr 26, 2024
14 checks passed
@AlexanderYastrebov AlexanderYastrebov deleted the filters/deprecate-filter-context-opentracing branch April 26, 2024 13:54
Comment on lines +119 to +120
// Filter spans should be children of the proxy span,
// use opentracing.SpanFromContext(ctx.Request().Context()) to get the proxy span.
Copy link
Member Author

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

skipper/proxy/tracing.go

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()))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #3052

AlexanderYastrebov added a commit that referenced this pull request Apr 29, 2024
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]>
AlexanderYastrebov added a commit that referenced this pull request Apr 29, 2024
…#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]>
JanardhanSharma pushed a commit to JanardhanSharma/skipper that referenced this pull request Jul 19, 2024
Deprecate OpenTracing FilterContext getters and remove their usage from filters.

For zalando#2104

Signed-off-by: Alexander Yastrebov <[email protected]>
JanardhanSharma pushed a commit to JanardhanSharma/skipper that referenced this pull request Jul 19, 2024
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor no risk changes, for example new filters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants