Skip to content

Conversation

@CagriYonca
Copy link
Contributor

get_tracer_tuple function is widely used in almost every instrumentation and basically it returns the active_tracer and the parent_span if a root exit span is not expected, otherwise it returns only the active span. If neither the current_span is recording nor a root exit span is expected, it returns None. Before the code change, get_current_span function was called twice, the active_tracer was reached via singletons.tracer instead of the tracer getter (get_tracer).

tracing_is_off function is also widely used in almost every instrumentation and it only returns whether the tracer is ready to record a new span or not. As I already explained above, we already have this information in the tracer, so that by combining these two functions into get_tracer_tuple function, we're getting rid of 1 get_current_span call and functionality of tracing_is_off function since we can directly check if the tracer in the instrumentation is False or not.

  • get_active_tracer and tracing_is_off functions has been removed
  • adapted instrumentations to the new get_tracer_tuple function
  • observed that rpc-client spans started being created when the root exit span is enabled for the following instrumentations:
    • google cloud pubsub
    • grpcio

@CagriYonca CagriYonca self-assigned this Nov 5, 2025
@CagriYonca CagriYonca requested a review from a team as a code owner November 5, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants