From ca548f0863947ac8613a6cf7ff9cd8273d3fb95d Mon Sep 17 00:00:00 2001 From: marcsello Date: Tue, 17 Aug 2021 17:16:01 +0200 Subject: [PATCH 1/9] Removed db stuffs --- requirements.txt | 4 -- src/app.py | 6 +-- src/config.py | 8 ---- src/db.py | 13 ------ src/healthchecks.py | 13 ------ src/models.py | 25 ----------- src/resources.py | 106 +------------------------------------------- src/schemas.py | 10 ----- 8 files changed, 3 insertions(+), 182 deletions(-) delete mode 100644 src/db.py delete mode 100644 src/models.py diff --git a/requirements.txt b/requirements.txt index f9cf75d..da2506c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,13 +4,9 @@ Flask~=2.0.1 Flask-RESTful~=0.3.9 requests~=2.26.0 werkzeug -sqlalchemy~=1.4.22 -flask_sqlalchemy~=2.5.1 xeger~=0.3.5 pika~=1.2.0 -psycopg2-binary marshmallow~=3.13.0 -marshmallow-sqlalchemy~=0.26.1 flask-marshmallow py-healthcheck Flask-InfluxDB diff --git a/src/app.py b/src/app.py index b1db571..7399b1b 100644 --- a/src/app.py +++ b/src/app.py @@ -7,11 +7,10 @@ from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration from healthcheck import HealthCheck from config import Config -from db import db from marshm import ma from influxus import influx_db from resources import SampleResource, SampleParameterResource -from healthchecks import health_database_status, amqp_connection_status +from healthchecks import amqp_connection_status import atexit @@ -48,7 +47,6 @@ app.config.from_object(Config) api = Api(app) health = HealthCheck() -db.init_app(app) ma.init_app(app) # ampq magic stuff @@ -68,7 +66,6 @@ if Config.ENABLE_INFLUXDB: def init_db(): if Config.ENABLE_INFLUXDB: influx_db.database.create(Config.INFLUXDB_DATABASE) - db.create_all() # Setup tracing def initialize_tracer(): @@ -83,7 +80,6 @@ tracing = FlaskTracing(initialize_tracer, True, app) api.add_resource(SampleResource, "/input") api.add_resource(SampleParameterResource, '/input/') -health.add_check(health_database_status) health.add_check(amqp_connection_status) register_all_error_handlers(app) diff --git a/src/config.py b/src/config.py index 1d3cc11..5b7362c 100644 --- a/src/config.py +++ b/src/config.py @@ -10,12 +10,6 @@ __copyright__ = "Copyright 2020, Birbnetes Team" __module_name__ = "app" __version__text__ = "1" -_POSTGRES_HOSTNAME = os.getenv("INPUT_POSTGRES_HOSTNAME", "localhost") -_POSTGRES_USERNAME = os.getenv("INPUT_POSTGRES_USERNAME", "input-service") -_POSTGRES_PASSWORD = os.getenv("INPUT_POSTGRES_PASSWORD", "input-service") -_POSTGRES_DB = os.getenv("INPUT_POSTGRES_DB", "input-service") -_POSTGRES_OPTS = os.getenv("INPUT_POSTGRES_OPTS", "") - class Config: PORT = 8080 @@ -36,8 +30,6 @@ class Config: 'virtual_host': '/' } - SQLALCHEMY_DATABASE_URI = f"postgresql://{_POSTGRES_USERNAME}:{_POSTGRES_PASSWORD}@{_POSTGRES_HOSTNAME}:5432/{_POSTGRES_DB}{_POSTGRES_OPTS}" - STORAGE_HOSTNAME = os.getenv("INPUT_STORAGE_HOSTNAME", "localhost:8042") ENABLE_INFLUXDB = os.environ.get("INPUT_ENABLE_INFLUX", "true").lower() in ["true", "yes", "1"] diff --git a/src/db.py b/src/db.py deleted file mode 100644 index 98196e0..0000000 --- a/src/db.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python3 -from flask_sqlalchemy import SQLAlchemy - -""" -Database api -""" - -__author__ = '@tormakris' -__copyright__ = "Copyright 2020, Birbnetes Team" -__module_name__ = "db" -__version__text__ = "1" - -db = SQLAlchemy() diff --git a/src/healthchecks.py b/src/healthchecks.py index d97b19c..1681ed3 100644 --- a/src/healthchecks.py +++ b/src/healthchecks.py @@ -1,6 +1,4 @@ #!/usr/bin/env python3 - -from db import db from magic_amqp import magic_amqp """ @@ -13,17 +11,6 @@ __module_name__ = "healthchecks" __version__text__ = "1" -def health_database_status(): - is_database_working = True - output = 'database is ok' - try: - db.session.execute('SELECT 1') - except Exception as e: - output = str(e) - is_database_working = False - return is_database_working, output - - def amqp_connection_status(): if magic_amqp.is_healthy(): result = True diff --git a/src/models.py b/src/models.py deleted file mode 100644 index 8a3cf36..0000000 --- a/src/models.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python3 -from db import db -from sqlalchemy.sql import func - -""" -Flask Restful endpoints -""" - -__author__ = '@tormakris' -__copyright__ = "Copyright 2020, Birbnetes Team" -__module_name__ = "models" -__version__text__ = "1" - - -class SampleMetadata(db.Model): - """ - SQLAlchemy model of metadata entries - """ - id = db.Column(db.Integer, primary_key=True, auto_increment=True) - timestamp = db.Column(db.TIMESTAMP, nullable=False, server_default=func.now()) - - device_id = db.Column(db.Integer, nullable=False) - device_date = db.Column(db.DateTime, nullable=False) - - tag = db.Column(db.String(32), nullable=False, unique=True) diff --git a/src/resources.py b/src/resources.py index 1fc24d7..52241da 100644 --- a/src/resources.py +++ b/src/resources.py @@ -6,12 +6,9 @@ import tzlocal from xeger import Xeger from flask_restful import Resource from flask import request, current_app, abort -import requests from magic_amqp import magic_amqp -from db import db from influxus import influx_db -from models import SampleMetadata -from schemas import SampleSchema, SampleMetadataSchema +from schemas import SampleSchema from requests_opentracing import SessionTracing import opentracing @@ -32,7 +29,6 @@ class SampleResource(Resource): """ sampleschema = SampleSchema(many=False) - samplemetadataschema = SampleMetadataSchema(many=True) def post(self): """ @@ -84,14 +80,6 @@ class SampleResource(Resource): # It's insane, that you can not set this field in curl - with opentracing.tracer.start_active_span('sqlalchemy.create'): - record = SampleMetadata( - device_id=desc['device_id'], - device_date=desc['date'], - tag=generated_tag - ) - db.session.add(record) - with opentracing.tracer.start_active_span('uploadToStorageService'): files = { 'description': (None, json.dumps({'tag': generated_tag}), 'application/json'), @@ -115,9 +103,6 @@ class SampleResource(Resource): return abort(500, f"Failed to upload sample to storage service. Upstream status: {r.status_code}: {r.text}") - with opentracing.tracer.start_active_span('sqlalchemy.commit'): - db.session.commit() - # Announce only after the data is successfully committed with opentracing.tracer.start_active_span('publishMessage'): try: @@ -144,91 +129,4 @@ class SampleResource(Resource): ] ) - return {"tag": generated_tag}, 200 - - def get(self): - """ - Get all stored items - :return: - """ - with opentracing.tracer.start_active_span('compileQuery'): - query = SampleMetadata.query - - ## Compile filters ## - - filters = [] - try: - first = int(request.args.get('first')) - except (ValueError, TypeError): - first = None - else: - filters.append( - SampleMetadata.id >= first - ) - - try: - after = datetime.fromisoformat(request.args.get('after')) - except (ValueError, TypeError): - after = None - else: - filters.append( - SampleMetadata.timestamp > after - ) - - try: - before = datetime.fromisoformat(request.args.get('before')) - except (ValueError, TypeError): - before = None - else: - filters.append( - SampleMetadata.timestamp < before - ) - - if filters: - query = query.filter(db.and_(*filters)) - - try: - limit = int(request.args.get('limit')) - except (ValueError, TypeError): - limit = None - else: - query = query.limit(limit) - - ## Run query ## - count = "count" in request.args - tags = { - "first": first, - "limit": limit, - "after": after, - "before": before - } - - if count: - with opentracing.tracer.start_active_span('sqlalchemy.count', tags=tags): - rows = query.count() - - return {"count": rows}, 200 - else: - with opentracing.tracer.start_active_span('sqlalchemy.select', tags=tags): - samples = query.all() - - return self.samplemetadataschema.dump(list(samples)), 200 - - -class SampleParameterResource(Resource): - """ - Sample endpoint with parameters - """ - - samplemetadataschema = SampleMetadataSchema(many=False) - - def get(self, tag: str): - """ - Get a specific item - :param tag: - :return: - """ - with opentracing.tracer.start_active_span('sqlalchemy.select', tags={"tag": tag}): - sample = SampleMetadata.query.filter_by(tag=tag).first_or_404() - - return self.samplemetadataschema.dump(sample), 200 + return {"tag": generated_tag}, 200 \ No newline at end of file diff --git a/src/schemas.py b/src/schemas.py index 3413902..abf5967 100644 --- a/src/schemas.py +++ b/src/schemas.py @@ -26,13 +26,3 @@ class SampleSchema(ma.Schema): date = fields.DateTime(required=True) device_id = fields.Integer(required=True) - - -class SampleMetadataSchema(ma.SQLAlchemyAutoSchema): - """ - Marshmallow schema generated - """ - class Meta: - model = SampleMetadata - exclude = ('timestamp', 'id', 'device_date') - date = auto_field("device_date", dump_only=False) -- 2.45.2 From 7f987afa7a5a48d40a36bea7ead21d93240e8f1b Mon Sep 17 00:00:00 2001 From: marcsello Date: Tue, 17 Aug 2021 17:53:16 +0200 Subject: [PATCH 2/9] Added redis stuffs --- requirements.txt | 3 +- src/app.py | 7 ++++- src/redis_client.py | 4 +++ src/resources.py | 69 ++++++++++++++++----------------------------- 4 files changed, 36 insertions(+), 47 deletions(-) create mode 100644 src/redis_client.py diff --git a/requirements.txt b/requirements.txt index da2506c..308fa0f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,7 +14,8 @@ tzdata tzlocal apscheduler~=3.7.0 +flask-redis~=0.4.0 + opentracing~=2.4.0 jaeger-client -requests-opentracing Flask-Opentracing \ No newline at end of file diff --git a/src/app.py b/src/app.py index 7399b1b..4a8e5a5 100644 --- a/src/app.py +++ b/src/app.py @@ -6,10 +6,11 @@ from sentry_sdk.integrations.flask import FlaskIntegration from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration from healthcheck import HealthCheck +from redis_client import redis_client from config import Config from marshm import ma from influxus import influx_db -from resources import SampleResource, SampleParameterResource +from resources import SampleResource from healthchecks import amqp_connection_status import atexit @@ -49,6 +50,8 @@ api = Api(app) health = HealthCheck() ma.init_app(app) +redis_client.init_app(app) + # ampq magic stuff magic_amqp.init_app(app) @@ -67,6 +70,7 @@ def init_db(): if Config.ENABLE_INFLUXDB: influx_db.database.create(Config.INFLUXDB_DATABASE) + # Setup tracing def initialize_tracer(): app.logger.info("Initializing jaeger...") @@ -88,6 +92,7 @@ app.add_url_rule("/healthz", "healthcheck", view_func=lambda: health.run()) if __name__ != '__main__': import logging + gunicorn_logger = logging.getLogger('gunicorn.error') app.logger.handlers = gunicorn_logger.handlers app.logger.setLevel(gunicorn_logger.level) diff --git a/src/redis_client.py b/src/redis_client.py new file mode 100644 index 0000000..3bba60d --- /dev/null +++ b/src/redis_client.py @@ -0,0 +1,4 @@ +#!/usr/bin/env python3 +from flask_redis import FlaskRedis + +redis_client = FlaskRedis() diff --git a/src/resources.py b/src/resources.py index 52241da..035ec91 100644 --- a/src/resources.py +++ b/src/resources.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -import json -import time +import io from datetime import datetime import tzlocal from xeger import Xeger @@ -9,7 +8,7 @@ from flask import request, current_app, abort from magic_amqp import magic_amqp from influxus import influx_db from schemas import SampleSchema -from requests_opentracing import SessionTracing +from redis_client import redis_client import opentracing """ @@ -44,13 +43,13 @@ class SampleResource(Resource): if 'description' not in request.form: return abort(400, "no description found") else: - description = request.form.get("description") + description_raw = request.form.get("description") if soundfile.content_type != 'audio/wave': current_app.logger.info(f"Input file was not WAV.") return abort(415, 'Input file not a wave file.') try: - desc = self.sampleschema.loads(description) + desc = self.sampleschema.loads(description_raw) except Exception as e: current_app.logger.exception(e) return abort(417, 'Input JSON schema invalid') @@ -62,50 +61,30 @@ class SampleResource(Resource): if len(generated_tag) > 2: # Ensure minimum length break - # Handle mega-autismo-cliento - soundfile_content_length = soundfile.content_length - if soundfile_content_length <= 0: # BRUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUH - with opentracing.tracer.start_active_span( - 'calculateContentLength'): # In an ideal scenario this span is missing - current_app.logger.debug( - "The uploader did not provide content-length for the sound file... Calculating manually..." + with opentracing.tracer.start_active_span('publishMetaMessage'): + try: # TODO change exchange + magic_amqp.publish( + { + 'tag': generated_tag, + 'timestamp': datetime.now().isoformat(), + 'device_id': desc['device_id'], + 'device_date': desc['date'].isoformat() + } ) - # So, this is a seekable stream, so we just seek to the end - old_ptr = soundfile.tell() - soundfile.seek(0, 2) - # Check where is the end (= content length) - soundfile_content_length = soundfile.tell() - # Seek back to where the stream was - soundfile.seek(old_ptr, 0) + except Exception as e: + current_app.logger.exception(e) + return abort(500, f"AMQP Publish error: {str(e)}") - # It's insane, that you can not set this field in curl + with opentracing.tracer.start_active_span('readSampleToMemory'): + buf = io.BytesIO() + soundfile.save(buf) - with opentracing.tracer.start_active_span('uploadToStorageService'): - files = { - 'description': (None, json.dumps({'tag': generated_tag}), 'application/json'), - 'soundFile': ( - 'wave.wav', - soundfile, - soundfile.content_type, - {'Content-Length': soundfile_content_length})} - - upload_started = time.time() - r = SessionTracing(propagate=True).post( - f"http://{current_app.config.get('STORAGE_HOSTNAME')}/object", - files=files - ) - upload_time = time.time() - upload_started - - if upload_time > 0.8: - current_app.logger.warning(f"Uploading to storage-service took {upload_time:5} sec") - - if r.status_code not in [200, 201]: - return abort(500, - f"Failed to upload sample to storage service. Upstream status: {r.status_code}: {r.text}") + with opentracing.tracer.start_active_span('putToCache'): + redis_client.set(generated_tag, buf.getbuffer()) # getbuffer is quick as it does not copy like getvalue # Announce only after the data is successfully committed - with opentracing.tracer.start_active_span('publishMessage'): - try: + with opentracing.tracer.start_active_span('publishInCacheMessage'): + try: # TODO change exchange magic_amqp.publish({'tag': generated_tag}) except Exception as e: current_app.logger.exception(e) @@ -129,4 +108,4 @@ class SampleResource(Resource): ] ) - return {"tag": generated_tag}, 200 \ No newline at end of file + return {"tag": generated_tag}, 200 -- 2.45.2 From 2c0e6ec7d75afb10dace6b481b9109e46e70d0d3 Mon Sep 17 00:00:00 2001 From: marcsello Date: Tue, 17 Aug 2021 17:56:52 +0200 Subject: [PATCH 3/9] Removed queue as we do not scrubscribe --- src/config.py | 1 - src/magic_amqp.py | 1 - 2 files changed, 2 deletions(-) diff --git a/src/config.py b/src/config.py index 5b7362c..6c6a8ba 100644 --- a/src/config.py +++ b/src/config.py @@ -20,7 +20,6 @@ class Config: RELEASEMODE = os.environ.get("INPUT_SERVICE_RELEASEMODE", "dev") EXCHANGE_NAME = os.getenv("INPUT_RABBITMQ_EXCHANGE", "dev") - RABBITMQ_QUEUE = os.getenv("INPUT_RABBITMQ_QUEUE", "wave-extract") FLASK_PIKA_PARAMS = { 'host': os.getenv("INPUT_RABBITMQ_HOSTNAME", "localhost"), diff --git a/src/magic_amqp.py b/src/magic_amqp.py index f719183..d550aea 100644 --- a/src/magic_amqp.py +++ b/src/magic_amqp.py @@ -27,7 +27,6 @@ class MagicAMQP: self.app = app self.app.config.setdefault('FLASK_PIKA_PARAMS', {}) self.app.config.setdefault('EXCHANGE_NAME', None) - self.app.config.setdefault('RABBITMQ_QUEUE', None) self._credentials = pika.PlainCredentials( app.config['FLASK_PIKA_PARAMS']['username'], -- 2.45.2 From a118b79512ff64177dc46b2baf6bc29b66ebf490 Mon Sep 17 00:00:00 2001 From: marcsello Date: Tue, 17 Aug 2021 18:05:32 +0200 Subject: [PATCH 4/9] Exchanges are magic --- src/config.py | 3 ++- src/magic_amqp.py | 19 +++++++++++++++---- src/resources.py | 11 +++++++---- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/config.py b/src/config.py index 6c6a8ba..51746bf 100644 --- a/src/config.py +++ b/src/config.py @@ -19,7 +19,8 @@ class Config: RELEASE_ID = os.environ.get("RELEASE_ID", "test") RELEASEMODE = os.environ.get("INPUT_SERVICE_RELEASEMODE", "dev") - EXCHANGE_NAME = os.getenv("INPUT_RABBITMQ_EXCHANGE", "dev") + EXCHANGE_NAME_META = os.getenv("INPUT_RABBITMQ_EXCHANGE_META", "sample-meta") + EXCHANGE_NAME_CACHE = os.getenv("INPUT_RABBITMQ_EXCHANGE_CACHE", "sample-cache") FLASK_PIKA_PARAMS = { 'host': os.getenv("INPUT_RABBITMQ_HOSTNAME", "localhost"), diff --git a/src/magic_amqp.py b/src/magic_amqp.py index d550aea..de91dd6 100644 --- a/src/magic_amqp.py +++ b/src/magic_amqp.py @@ -26,7 +26,8 @@ class MagicAMQP: def init_app(self, app: Flask): self.app = app self.app.config.setdefault('FLASK_PIKA_PARAMS', {}) - self.app.config.setdefault('EXCHANGE_NAME', None) + self.app.config.setdefault('EXCHANGE_NAME_META', None) + self.app.config.setdefault('EXCHANGE_NAME_CACHE', None) self._credentials = pika.PlainCredentials( app.config['FLASK_PIKA_PARAMS']['username'], @@ -45,7 +46,11 @@ class MagicAMQP: ) self._pika_channel = self._pika_connection.channel() self._pika_channel.exchange_declare( - exchange=self.app.config['EXCHANGE_NAME'], + exchange=self.app.config['EXCHANGE_NAME_META'], + exchange_type='direct' + ) + self._pika_channel.exchange_declare( + exchange=self.app.config['EXCHANGE_NAME_CACHE'], exchange_type='direct' ) @@ -70,7 +75,7 @@ class MagicAMQP: if total_time > 1: self.app.logger.warning(f"Loop: Total loop took {total_time:5f} sec") - def publish(self, payload=None): + def _publish(self, exchange: str, payload=None): """ Publish a simple json serialized message to the configured queue. If the connection is broken, then this call will block until the connection is restored @@ -88,7 +93,7 @@ class MagicAMQP: while True: try: self._pika_channel.basic_publish( - exchange=self.app.config['EXCHANGE_NAME'], + exchange=exchange, routing_key='feature', body=json.dumps(payload).encode('UTF-8') ) @@ -119,6 +124,12 @@ class MagicAMQP: if total_time > 0.4: self.app.logger.warning(f"Publish: Total publish took {total_time:5f} sec") + def publish_cache(self, payload=None): + return self._publish(self.app.config['EXCHANGE_NAME_CACHE'], payload) + + def publish_meta(self, payload=None): + return self._publish(self.app.config['EXCHANGE_NAME_META'], payload) + def is_healthy(self) -> bool: with self._lock: if not self._pika_channel: diff --git a/src/resources.py b/src/resources.py index 035ec91..1deaebb 100644 --- a/src/resources.py +++ b/src/resources.py @@ -62,8 +62,8 @@ class SampleResource(Resource): break with opentracing.tracer.start_active_span('publishMetaMessage'): - try: # TODO change exchange - magic_amqp.publish( + try: + magic_amqp.publish_meta( { 'tag': generated_tag, 'timestamp': datetime.now().isoformat(), @@ -84,8 +84,11 @@ class SampleResource(Resource): # Announce only after the data is successfully committed with opentracing.tracer.start_active_span('publishInCacheMessage'): - try: # TODO change exchange - magic_amqp.publish({'tag': generated_tag}) + try: + magic_amqp.publish_cache({ + 'tag': generated_tag, + 'mime_type': soundfile.mimetype + }) except Exception as e: current_app.logger.exception(e) return abort(500, f"AMQP Publish error: {str(e)}") -- 2.45.2 From 738eea1da370986c8031373f1f2e1cd7315a07ef Mon Sep 17 00:00:00 2001 From: marcsello Date: Tue, 17 Aug 2021 18:15:02 +0200 Subject: [PATCH 5/9] removed unused config --- src/config.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/config.py b/src/config.py index 51746bf..f6e6c63 100644 --- a/src/config.py +++ b/src/config.py @@ -30,8 +30,6 @@ class Config: 'virtual_host': '/' } - STORAGE_HOSTNAME = os.getenv("INPUT_STORAGE_HOSTNAME", "localhost:8042") - ENABLE_INFLUXDB = os.environ.get("INPUT_ENABLE_INFLUX", "true").lower() in ["true", "yes", "1"] INFLUXDB_HOST = os.getenv("INFLUX_HOST", "input-influx") INFLUXDB_PORT = os.getenv("INFLUX_PORT", "8086") -- 2.45.2 From 10f57913f387779295af00af34cb622608ce81e4 Mon Sep 17 00:00:00 2001 From: marcsello Date: Tue, 17 Aug 2021 18:18:09 +0200 Subject: [PATCH 6/9] the missing link --- src/config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/config.py b/src/config.py index f6e6c63..565ab4d 100644 --- a/src/config.py +++ b/src/config.py @@ -19,6 +19,8 @@ class Config: RELEASE_ID = os.environ.get("RELEASE_ID", "test") RELEASEMODE = os.environ.get("INPUT_SERVICE_RELEASEMODE", "dev") + REDIS_URL = os.environ['CACHE_REDIS_URL'] + EXCHANGE_NAME_META = os.getenv("INPUT_RABBITMQ_EXCHANGE_META", "sample-meta") EXCHANGE_NAME_CACHE = os.getenv("INPUT_RABBITMQ_EXCHANGE_CACHE", "sample-cache") -- 2.45.2 From 2431812f092b4fd163ba14f56c79ac18cf081c21 Mon Sep 17 00:00:00 2001 From: marcsello Date: Tue, 17 Aug 2021 18:19:30 +0200 Subject: [PATCH 7/9] Removed sentry sqlalchemy integration --- src/app.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app.py b/src/app.py index 4a8e5a5..7546722 100644 --- a/src/app.py +++ b/src/app.py @@ -3,7 +3,6 @@ from flask import Flask from flask_restful import Api import sentry_sdk from sentry_sdk.integrations.flask import FlaskIntegration -from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration from healthcheck import HealthCheck from redis_client import redis_client @@ -35,7 +34,7 @@ __version__text__ = "1" if Config.SENTRY_DSN: sentry_sdk.init( dsn=Config.SENTRY_DSN, - integrations=[FlaskIntegration(), SqlalchemyIntegration()], + integrations=[FlaskIntegration()], traces_sample_rate=0.0, send_default_pii=True, release=Config.RELEASE_ID, -- 2.45.2 From 04bb2722ad60ced63953cbe6eb240e714e0236b1 Mon Sep 17 00:00:00 2001 From: marcsello Date: Tue, 17 Aug 2021 18:20:20 +0200 Subject: [PATCH 8/9] Removed unused resource --- src/app.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app.py b/src/app.py index 7546722..2324c8f 100644 --- a/src/app.py +++ b/src/app.py @@ -81,7 +81,6 @@ def initialize_tracer(): tracing = FlaskTracing(initialize_tracer, True, app) api.add_resource(SampleResource, "/input") -api.add_resource(SampleParameterResource, '/input/') health.add_check(amqp_connection_status) -- 2.45.2 From 3cdacc6720c1d879f4a3e25f949834fd759933a0 Mon Sep 17 00:00:00 2001 From: marcsello Date: Tue, 17 Aug 2021 18:26:08 +0200 Subject: [PATCH 9/9] Fixed bad import --- src/schemas.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/schemas.py b/src/schemas.py index abf5967..f9b1cce 100644 --- a/src/schemas.py +++ b/src/schemas.py @@ -1,7 +1,4 @@ #!/usr/bin/env python3 -from flask_marshmallow.sqla import auto_field - -from models import SampleMetadata from marshm import ma from marshmallow import fields -- 2.45.2