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.

168 lines
8.4 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. ``odoo.exceptions.AccessDenied,
  38. You can use a star symbol (*) at the end, to ignore all exceptions odoo.exceptions.AccessError,
  39. from a module, eg.: *odoo.exceptions.**. odoo.exceptions.DeferredException,
  40. odoo.exceptions.MissingError,
  41. odoo.exceptions.RedirectWarning,
  42. odoo.exceptions.UserError,
  43. odoo.exceptions.ValidationError,
  44. odoo.exceptions.Warning,
  45. odoo.exceptions.except_orm``
  46. ``sentry_processors`` A string of comma-separated processor classes which will be applied ``raven.processors.SanitizePasswordsProcessor,
  47. on an event before sending it to Sentry. odoo.addons.sentry.logutils.SanitizeOdooCookiesProcessor``
  48. ``sentry_transport`` Transport class which will be used to send events to Sentry. ``threaded``
  49. Possible values: *threaded*: spawns an async worker for processing
  50. messages, *synchronous*: a synchronous blocking transport;
  51. *requests_threaded*: an asynchronous transport using the *requests*
  52. library; *requests_synchronous* - blocking transport using the
  53. *requests* library.
  54. ``sentry_include_context`` If enabled, additional context data will be extracted from current ``True``
  55. HTTP request and user session (if available). This has no effect
  56. for Cron jobs, as no request/session is available inside a Cron job.
  57. ``sentry_odoo_dir`` Absolute path to your Odoo installation directory. This is optional
  58. and will only be used to extract the Odoo Git commit, which will be
  59. sent to Sentry, to allow to distinguish between Odoo updates.
  60. ============================= ==================================================================== ==========================================================
  61. Other `client arguments
  62. <https://docs.sentry.io/clients/python/advanced/#client-arguments>`_ can be
  63. configured by prepending the argument name with *sentry_* in your Odoo config
  64. file. Currently supported additional client arguments are: ``install_sys_hook,
  65. include_paths, exclude_paths, machine, auto_log_stacks, capture_locals,
  66. string_max_length, list_max_length, site, include_versions, environment``.
  67. Example Odoo configuration
  68. --------------------------
  69. Below is an example of Odoo configuration file with *Odoo Sentry* options::
  70. [options]
  71. sentry_dsn = https://<public_key>:<secret_key>@sentry.example.com/<project id>
  72. sentry_enabled = true
  73. sentry_logging_level = warn
  74. sentry_exclude_loggers = werkzeug
  75. sentry_ignore_exceptions = odoo.exceptions.AccessDenied,odoo.exceptions.AccessError,odoo.exceptions.MissingError,odoo.exceptions.RedirectWarning,odoo.exceptions.UserError,odoo.exceptions.ValidationError,odoo.exceptions.Warning,odoo.exceptions.except_orm
  76. sentry_processors = raven.processors.SanitizePasswordsProcessor,odoo.addons.sentry.logutils.SanitizeOdooCookiesProcessor
  77. sentry_transport = threaded
  78. sentry_include_context = true
  79. sentry_environment = production
  80. sentry_auto_log_stacks = false
  81. sentry_odoo_dir = /home/odoo/odoo/
  82. Usage
  83. =====
  84. Once configured and installed, the module will report any logging event at and
  85. above the configured Sentry logging level, no additional actions are necessary.
  86. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  87. :alt: Try me on Runbot
  88. :target: https://runbot.odoo-community.org/runbot/149/10.0
  89. Known issues / Roadmap
  90. ======================
  91. * **No database separation** -- This module functions by intercepting all Odoo
  92. logging records in a running Odoo process. This means that once installed in
  93. one database, it will intercept and report errors for all Odoo databases,
  94. which are used on that Odoo server.
  95. * **Frontend integration** -- In the future, it would be nice to add
  96. Odoo client-side error reporting to this module as well, by integrating
  97. `raven-js <https://github.com/getsentry/raven-js>`_. Additionally, `Sentry user
  98. feedback form <https://docs.sentry.io/learn/user-feedback/>`_ could be
  99. integrated into the Odoo client error dialog window to allow users shortly
  100. describe what they were doing when things went wrong.
  101. Bug Tracker
  102. ===========
  103. Bugs are tracked on `GitHub Issues
  104. <https://github.com/OCA/server-tools/issues>`_. In case of trouble, please
  105. check there if your issue has already been reported. If you spotted it first,
  106. help us smash it by providing detailed and welcomed feedback.
  107. Credits
  108. =======
  109. Images
  110. ------
  111. * `Module Icon <https://sentry.io/branding/>`_
  112. Contributors
  113. ------------
  114. * Mohammed Barsi <barsintod@gmail.com>
  115. * Andrius Preimantas <andrius@versada.eu>
  116. * Naglis Jonaitis <naglis@versada.eu>
  117. Maintainer
  118. ----------
  119. .. image:: https://odoo-community.org/logo.png
  120. :alt: Odoo Community Association
  121. :target: https://odoo-community.org
  122. This module is maintained by the OCA.
  123. OCA, or the Odoo Community Association, is a nonprofit organization whose
  124. mission is to support the collaborative development of Odoo features and
  125. promote its widespread use.
  126. To contribute to this module, please visit https://odoo-community.org.
  127. .. _raven: https://github.com/getsentry/raven-python