-
Notifications
You must be signed in to change notification settings - Fork 5
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
trace()
fails to execute block when zipkin disabled or not initialized.
#35
Comments
Hey @ParensAllTheWayDown ! Thanks for the suggestion! It sounds reasonable to me, so I prepared #36 that might help with this. Just to make sure about the use cases - am I correctly assuming this happens when you do not add the middleware (that is skip |
Short answer 'Yes'. Longer answer follows: We are using 'Settings' subclass to define all settings for the application. If the zipkin subsection is not included, then ZipkinMiddleware is not included in our middleware stack.
and Settings subclass:
Our middleware include/exclude logic includes this:
|
Alright, thanks for clarifying, will make a new version with this later today 🙌 |
@ParensAllTheWayDown Just merged and released 0.2.4. Let me now if this helps your usecase! |
Thank you for taking this into consideration. I'll give it a try tomorrow. |
I'm trying to ensure that our fastapi application continues to execute instrumented block if zipkin is/isnot configured. In the 'isnot' scenario, zipkin
trace()
scope function fails to execute the scope becauseget_tracer()
returns a None and subsequent call totracer.new_child
fails.Would it be reasonable to fall back to an empty
__enter__
&__exit__
if there is no tracer available? That would allow the instrumented code to run. Perhaps a warning message that indicates that things are not proceeding as expected.I can work around this, but I have to duplicate the instrumented scope in a try-except in order to ensure that the instrumented code is executed in the case that zipkin configuration has been intentionally skipped. For example:
The text was updated successfully, but these errors were encountered: