[FIX] sentry: Patch odoo.service.server wsgi app
Because post_load is called after odoo.service.server start It has already registered the unpatched odoo.service.wsgi_server.application So patch it here too. This enables wsgi performance reporting with sentry_traces_sample_ratepull/2516/head
parent
e546324ee2
commit
d438a30b7d
|
@ -6,6 +6,7 @@ from collections import abc
|
||||||
|
|
||||||
import odoo.http
|
import odoo.http
|
||||||
from odoo.service import wsgi_server
|
from odoo.service import wsgi_server
|
||||||
|
from odoo.service.server import server
|
||||||
from odoo.tools import config as odoo_config
|
from odoo.tools import config as odoo_config
|
||||||
|
|
||||||
from . import const
|
from . import const
|
||||||
|
@ -110,6 +111,11 @@ def initialize_sentry(config):
|
||||||
for item in exclude_loggers:
|
for item in exclude_loggers:
|
||||||
ignore_logger(item)
|
ignore_logger(item)
|
||||||
|
|
||||||
|
# The server app is already registered so patch it here
|
||||||
|
if server:
|
||||||
|
server.app = SentryWsgiMiddleware(server.app)
|
||||||
|
|
||||||
|
# Patch the wsgi server in case of further registration
|
||||||
wsgi_server.application = SentryWsgiMiddleware(wsgi_server.application)
|
wsgi_server.application = SentryWsgiMiddleware(wsgi_server.application)
|
||||||
|
|
||||||
with sentry_sdk.push_scope() as scope:
|
with sentry_sdk.push_scope() as scope:
|
||||||
|
|
Loading…
Reference in New Issue