You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

167 lines
8.3 KiB

  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
  3. :alt: License: AGPL-3
  4. ======
  5. Sentry
  6. ======
  7. This module allows painless `Sentry <https://sentry.io/>`__ integration with
  8. Odoo.
  9. Installation
  10. ============
  11. The module can be installed just like any other Odoo module, by adding the
  12. module's directory to Odoo *addons_path*. In order for the module to correctly
  13. wrap the Odoo WSGI application, it also needs to be loaded as a server-wide
  14. module. This can be done with the ``server_wide_modules`` parameter in your
  15. Odoo config file or with the ``--load`` command-line parameter.
  16. This module additionally requires the raven_ Python package to be available on
  17. the system. It can be installed using pip::
  18. pip install raven
  19. Configuration
  20. =============
  21. The following additional configuration options can be added to your Odoo
  22. configuration file:
  23. ============================= ==================================================================== ==========================================================
  24. Option Description Default
  25. ============================= ==================================================================== ==========================================================
  26. ``sentry_dsn`` Sentry *Data Source Name*. You can find this value in your Sentry ``''``
  27. project configuration. Typically it looks something like this:
  28. *https://<public_key>:<secret_key>@sentry.example.com/<project id>*
  29. This is the only required option in order to use the module.
  30. ``sentry_enabled`` Whether or not Sentry logging is enabled. ``False``
  31. ``sentry_logging_level`` The minimal logging level for which to send reports to Sentry. ``warn``
  32. Possible values: *notset*, *debug*, *info*, *warn*, *error*,
  33. *critical*. It is recommended to have this set to at least *warn*,
  34. to avoid spamming yourself with Sentry events.
  35. ``sentry_exclude_loggers`` A string of comma-separated logger names which should be excluded ``werkzeug``
  36. from Sentry.
  37. ``sentry_ignored_exceptions`` A string of comma-separated exceptions which should be ignored. ``openerp.exceptions.AccessDenied,
  38. You can use a star symbol (*) at the end, to ignore all exceptions openerp.exceptions.AccessError,
  39. from a module, eg.: *openerp.exceptions.**. openerp.exceptions.DeferredException,
  40. openerp.exceptions.MissingError,
  41. openerp.exceptions.RedirectWarning,
  42. openerp.exceptions.ValidationError,
  43. openerp.exceptions.Warning,
  44. openerp.exceptions.except_orm``
  45. ``sentry_processors`` A string of comma-separated processor classes which will be applied ``raven.processors.SanitizePasswordsProcessor,
  46. on an event before sending it to Sentry. openerp.addons.sentry.logutils.SanitizeOdooCookiesProcessor``
  47. ``sentry_transport`` Transport class which will be used to send events to Sentry. ``threaded``
  48. Possible values: *threaded*: spawns an async worker for processing
  49. messages, *synchronous*: a synchronous blocking transport;
  50. *requests_threaded*: an asynchronous transport using the *requests*
  51. library; *requests_synchronous* - blocking transport using the
  52. *requests* library.
  53. ``sentry_include_context`` If enabled, additional context data will be extracted from current ``True``
  54. HTTP request and user session (if available). This has no effect
  55. for Cron jobs, as no request/session is available inside a Cron job.
  56. ``sentry_odoo_dir`` Absolute path to your Odoo installation directory. This is optional
  57. and will only be used to extract the Odoo Git commit, which will be
  58. sent to Sentry, to allow to distinguish between Odoo updates.
  59. ============================= ==================================================================== ==========================================================
  60. Other `client arguments
  61. <https://docs.sentry.io/clients/python/advanced/#client-arguments>`_ can be
  62. configured by prepending the argument name with *sentry_* in your Odoo config
  63. file. Currently supported additional client arguments are: ``install_sys_hook,
  64. include_paths, exclude_paths, machine, auto_log_stacks, capture_locals,
  65. string_max_length, list_max_length, site, include_versions, environment``.
  66. Example Odoo configuration
  67. --------------------------
  68. Below is an example of Odoo configuration file with *Odoo Sentry* options::
  69. [options]
  70. sentry_dsn = https://<public_key>:<secret_key>@sentry.example.com/<project id>
  71. sentry_enabled = true
  72. sentry_logging_level = warn
  73. sentry_exclude_loggers = werkzeug
  74. sentry_ignore_exceptions = openerp.exceptions.AccessDenied,openerp.exceptions.AccessError,openerp.exceptions.MissingError,openerp.exceptions.RedirectWarning,openerp.exceptions.ValidationError,openerp.exceptions.Warning,openerp.exceptions.except_orm
  75. sentry_processors = raven.processors.SanitizePasswordsProcessor,openerp.addons.sentry.logutils.SanitizeOdooCookiesProcessor
  76. sentry_transport = threaded
  77. sentry_include_context = true
  78. sentry_environment = production
  79. sentry_auto_log_stacks = false
  80. sentry_odoo_dir = /home/odoo/odoo/
  81. Usage
  82. =====
  83. Once configured and installed, the module will report any logging event at and
  84. above the configured Sentry logging level, no additional actions are necessary.
  85. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  86. :alt: Try me on Runbot
  87. :target: https://runbot.odoo-community.org/runbot/149/8.0
  88. Known issues / Roadmap
  89. ======================
  90. * **No database separation** -- This module functions by intercepting all Odoo
  91. logging records in a running Odoo process. This means that once installed in
  92. one database, it will intercept and report errors for all Odoo databases,
  93. which are used on that Odoo server.
  94. * **Frontend integration** -- In the future, it would be nice to add
  95. Odoo client-side error reporting to this module as well, by integrating
  96. `raven-js <https://github.com/getsentry/raven-js>`_. Additionally, `Sentry user
  97. feedback form <https://docs.sentry.io/learn/user-feedback/>`_ could be
  98. integrated into the Odoo client error dialog window to allow users shortly
  99. describe what they were doing when things went wrong.
  100. Bug Tracker
  101. ===========
  102. Bugs are tracked on `GitHub Issues
  103. <https://github.com/OCA/server-tools/issues>`_. In case of trouble, please
  104. check there if your issue has already been reported. If you spotted it first,
  105. help us smash it by providing detailed and welcomed feedback.
  106. Credits
  107. =======
  108. Images
  109. ------
  110. * `Module Icon <https://sentry.io/branding/>`_
  111. Contributors
  112. ------------
  113. * Mohammed Barsi <barsintod@gmail.com>
  114. * Andrius Preimantas <andrius@versada.eu>
  115. * Naglis Jonaitis <naglis@versada.eu>
  116. Maintainer
  117. ----------
  118. .. image:: https://odoo-community.org/logo.png
  119. :alt: Odoo Community Association
  120. :target: https://odoo-community.org
  121. This module is maintained by the OCA.
  122. OCA, or the Odoo Community Association, is a nonprofit organization whose
  123. mission is to support the collaborative development of Odoo features and
  124. promote its widespread use.
  125. To contribute to this module, please visit https://odoo-community.org.
  126. .. _raven: https://github.com/getsentry/raven-python