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.

177 lines
9.0 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_release`` Explicitly define a version to be sent as the release version to
  58. Sentry. Useful in conjuntion with Sentry's "Resolve in the next
  59. release"-functionality. Also useful if your production deployment
  60. does not include any Git context from which a commit might be read.
  61. Overrides *sentry_odoo_dir*.
  62. ``sentry_odoo_dir`` Absolute path to your Odoo installation directory. This is optional
  63. and will only be used to extract the Odoo Git commit, which will be
  64. sent to Sentry, to allow to distinguish between Odoo updates.
  65. Overridden by *sentry_release*
  66. ============================= ==================================================================== ==========================================================
  67. Other `client arguments
  68. <https://docs.sentry.io/clients/python/advanced/#client-arguments>`_ can be
  69. configured by prepending the argument name with *sentry_* in your Odoo config
  70. file. Currently supported additional client arguments are: ``install_sys_hook,
  71. include_paths, exclude_paths, machine, auto_log_stacks, capture_locals,
  72. string_max_length, list_max_length, site, include_versions, environment``.
  73. Example Odoo configuration
  74. --------------------------
  75. Below is an example of Odoo configuration file with *Odoo Sentry* options::
  76. [options]
  77. sentry_dsn = https://<public_key>:<secret_key>@sentry.example.com/<project id>
  78. sentry_enabled = true
  79. sentry_logging_level = warn
  80. sentry_exclude_loggers = werkzeug
  81. 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
  82. sentry_processors = raven.processors.SanitizePasswordsProcessor,odoo.addons.sentry.logutils.SanitizeOdooCookiesProcessor
  83. sentry_transport = threaded
  84. sentry_include_context = true
  85. sentry_environment = production
  86. sentry_auto_log_stacks = false
  87. sentry_odoo_dir = /home/odoo/odoo/
  88. sentry_release = 1.3.2
  89. Usage
  90. =====
  91. Once configured and installed, the module will report any logging event at and
  92. above the configured Sentry logging level, no additional actions are necessary.
  93. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  94. :alt: Try me on Runbot
  95. :target: https://runbot.odoo-community.org/runbot/149/10.0
  96. Known issues / Roadmap
  97. ======================
  98. * **No database separation** -- This module functions by intercepting all Odoo
  99. logging records in a running Odoo process. This means that once installed in
  100. one database, it will intercept and report errors for all Odoo databases,
  101. which are used on that Odoo server.
  102. * **Frontend integration** -- In the future, it would be nice to add
  103. Odoo client-side error reporting to this module as well, by integrating
  104. `raven-js <https://github.com/getsentry/raven-js>`_. Additionally, `Sentry user
  105. feedback form <https://docs.sentry.io/learn/user-feedback/>`_ could be
  106. integrated into the Odoo client error dialog window to allow users shortly
  107. describe what they were doing when things went wrong.
  108. Bug Tracker
  109. ===========
  110. Bugs are tracked on `GitHub Issues
  111. <https://github.com/OCA/server-tools/issues>`_. In case of trouble, please
  112. check there if your issue has already been reported. If you spotted it first,
  113. help us smash it by providing detailed and welcomed feedback.
  114. Credits
  115. =======
  116. Images
  117. ------
  118. * `Module Icon <https://sentry.io/branding/>`_
  119. Contributors
  120. ------------
  121. * Mohammed Barsi <barsintod@gmail.com>
  122. * Andrius Preimantas <andrius@versada.eu>
  123. * Naglis Jonaitis <naglis@versada.eu>
  124. * Atte Isopuro <atte.isopuro@avoin.systems>
  125. Maintainer
  126. ----------
  127. .. image:: https://odoo-community.org/logo.png
  128. :alt: Odoo Community Association
  129. :target: https://odoo-community.org
  130. This module is maintained by the OCA.
  131. OCA, or the Odoo Community Association, is a nonprofit organization whose
  132. mission is to support the collaborative development of Odoo features and
  133. promote its widespread use.
  134. To contribute to this module, please visit https://odoo-community.org.
  135. .. _raven: https://github.com/getsentry/raven-python