Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
from flask import Flask
from flask import request
import requests
from jaeger_client import Config
from flask_opentracing import FlaskTracer
app = Flask(__name__)
def pull_requests():
# Fetch a list of pull requests on the opentracing repository
github_url = ""
r = requests.get(github_url)
json = r.json()
pull_request_titles = map(lambda item: item['title'], json)
return 'OpenTracing Pull Requests: ' + ', '.join(pull_request_titles)
def initialize_tracer():
config = Config(
'sampler': {'type': 'const', 'param': 1}
return config.initialize_tracer() # also sets opentracing.tracer
flask_tracer = FlaskTracer(initialize_tracer, True, app)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment