Created
May 1, 2019 07:06
-
-
Save nicholasamorim/382fc6957a6a2157e985daaf441764a3 to your computer and use it in GitHub Desktop.
Minimal example on tracing requests library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from jaeger_client import Config | |
from opentracing_instrumentation.client_hooks import install_all_patches | |
def init_tracer(): | |
install_all_patches() | |
config = Config( | |
config={ # usually read from some yaml config | |
"sampler": {"type": "const", "param": 1}, | |
"reporter_batch_size": 1, | |
}, | |
service_name='myservice', | |
validate=True, | |
) | |
tracer = config.initialize_tracer() | |
return tracer | |
init_tracer() | |
resp = requests.get('https://google.com') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment