Added basic tracking
This commit is contained in:
parent
edbd17f79d
commit
d8b62f20a2
@ -14,6 +14,11 @@ from views import SVMView, CNNView, RootView
|
||||
|
||||
from config import Config
|
||||
|
||||
# Tracing stuffs
|
||||
import jaeger_client
|
||||
import opentracing
|
||||
from flask_opentracing import FlaskTracing
|
||||
|
||||
if Config.SENTRY_DSN:
|
||||
sentry_sdk.init(
|
||||
dsn=Config.SENTRY_DSN,
|
||||
@ -43,6 +48,16 @@ def create_db():
|
||||
# register error handlers
|
||||
register_all_error_handlers(app)
|
||||
|
||||
|
||||
# Setup tracing
|
||||
def initialize_tracer():
|
||||
jaeger_cfg = jaeger_client.Config(config={}, service_name='cnn-classification-service', validate=True)
|
||||
tracer = jaeger_cfg.initialize_tracer()
|
||||
return tracer
|
||||
|
||||
|
||||
tracing = FlaskTracing(initialize_tracer, True, app)
|
||||
|
||||
# register views
|
||||
for view in [SVMView, CNNView, RootView]:
|
||||
view.register(app, trailing_slash=False, route_prefix='/model')
|
||||
|
@ -31,3 +31,6 @@ scikit-learn==0.21.3
|
||||
scipy==1.4.1
|
||||
simplejson==3.17.0
|
||||
six==1.14.0
|
||||
|
||||
jaeger-client
|
||||
Flask-Opentracing
|
Loading…
Reference in New Issue
Block a user