added basic tracing
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2021-08-09 15:56:32 +02:00
parent 6dca52ef27
commit dfa848b1d8

View File

@ -13,6 +13,11 @@ from views import ObjectView
from config import Config
# Tracing stuffs
import jaeger_client
import opentracing
from flask_opentracing import FlaskTracing
# Setup sentry
if Config.SENTRY_DSN:
sentry_sdk.init(
@ -38,6 +43,17 @@ health = HealthCheck()
# register error handlers
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
for view in [ObjectView]:
view.register(app, trailing_slash=False)