Skip to content

Perform customization with client Patchers for injecting tags #116

@t3chboy

Description

@t3chboy

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions