This commit is contained in:
parent
6dca52ef27
commit
dfa848b1d8
@ -13,6 +13,11 @@ from views import ObjectView
|
|||||||
|
|
||||||
from config import Config
|
from config import Config
|
||||||
|
|
||||||
|
# Tracing stuffs
|
||||||
|
import jaeger_client
|
||||||
|
import opentracing
|
||||||
|
from flask_opentracing import FlaskTracing
|
||||||
|
|
||||||
# Setup sentry
|
# Setup sentry
|
||||||
if Config.SENTRY_DSN:
|
if Config.SENTRY_DSN:
|
||||||
sentry_sdk.init(
|
sentry_sdk.init(
|
||||||
@ -38,6 +43,17 @@ health = HealthCheck()
|
|||||||
# register error handlers
|
# register error handlers
|
||||||
register_all_error_handlers(app)
|
register_all_error_handlers(app)
|
||||||
|
|
||||||
|
|
||||||
|
# Setup tracing
|
||||||
|
def initialize_tracer():
|
||||||
|
app.logger.info("Initializing jaeger...")
|
||||||
|
jaeger_cfg = jaeger_client.Config(config={}, service_name='storage-service', validate=True)
|
||||||
|
tracer = jaeger_cfg.initialize_tracer()
|
||||||
|
return tracer
|
||||||
|
|
||||||
|
|
||||||
|
tracing = FlaskTracing(initialize_tracer, True, app)
|
||||||
|
|
||||||
# register views
|
# register views
|
||||||
for view in [ObjectView]:
|
for view in [ObjectView]:
|
||||||
view.register(app, trailing_slash=False)
|
view.register(app, trailing_slash=False)
|
||||||
|
Loading…
Reference in New Issue
Block a user