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

Perform customization with client Patchers for injecting tags #116

Open
t3chboy opened this issue Jun 15, 2021 · 0 comments
Open

Perform customization with client Patchers for injecting tags #116

t3chboy opened this issue Jun 15, 2021 · 0 comments

Comments

@t3chboy
Copy link

t3chboy commented Jun 15, 2021

Using opentracing-instrumentation==3.3.1, opentracing==2.4.0, jaeger-client==4.3.0.

What we want to achieve

Based on HTTP status code we want to add warning & other tags to our HTTP get span, tried to follow the readme help.

from opentracing_instrumentation.client_hooks.requests import patcher
def hook(response, span):
    if not response.ok:
        span.set_tag('error', 'true')
patcher.set_response_handler_hook(hook)

But here we cannot find the patcher within requests class,
Also we want to assign hook when application boots, so should we assign before install_all_patches() or later on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant