Capture uncaught JS errors and unhandled promise rejections in the Odoo web client to Sentry, with optional Performance Monitoring (BrowserTracing), Session Replay, Browser CPU Profiling, and Console-log capture tiers behind explicit opt-in toggles.
The Sentry browser SDK ships vendored inside the module — no external CDN call, air-gapped friendly out of the box.
Standalone: works on its own. Reads DSN / release / environment from the sentry_* options in odoo.conf. Captures browser-side errors only.
Better together with sentry: install alongside the server-side sentry module to cluster client and server errors for the same user / release / environment into one Sentry issue. Both modules share the same sentry_* config options by convention — fill them in once and client + server events land in the same Sentry project.
Each tier above Tier 0 is off by default and surfaces an in-form warning about its perf cost when enabled. Sample rates are sliders so admins can dial behaviour without a server restart. Individual users can opt out of session replay via their own preferences page.
auto_awesome What this module does
AI-generated from the code · Odoo 18.0Capture JavaScript errors from the Odoo web client in Sentry, with optional performance tracing, session replay, CPU profiling, console-log capture and a 'Report a bug' button. Configure everything from Settings and let each user opt out of session recording.
This module connects the Odoo web client to Sentry so that browser-side JavaScript errors and unhandled promise rejections are reported automatically. It is configured in Settings under a 'Sentry Browser Monitoring' block, where you enter the Browser DSN, environment and release tags, and switch on the capture tiers.
- Tier 0 (browser error capture) is the base: it loads the Sentry browser SDK on every page and reports uncaught errors. It needs a DSN, either entered in Settings or inherited from the
sentry_*options in odoo.conf. - Tier 1 adds performance monitoring with a traces sample rate.
- Tier 2 adds session replay, with separate sample rates for healthy sessions and sessions that hit an error.
- Tier 3 adds a user feedback widget, browser CPU profiling (which needs Tier 1 tracing), and console-log capture.
When the feedback widget is on, a 'Report a bug' button appears in the top navigation bar and opens Sentry's feedback form. Each user also gets a 'Disable Sentry session replay' option in their preferences, and administrators can set it on the user form, so a person's own sessions are not recorded. The module validates the DSN and SDK source URL formats and refuses a DSN that contains a secret. It touches res.config.settings and res.users.
Depends on
Models and fields (2)
- res.users · extends an existing modelsentry_client_replay_optout (Disable Sentry session replay)
- res.config.settings · extends an existing modelsentry_client_enabled (Enable browser error reporting), sentry_client_release (Release tag), sentry_client_cdn_base (Sentry SDK source URL), sentry_client_browser_dsn (Browser DSN), sentry_client_cdn_version (Sentry SDK version), sentry_client_environment (Environment tag), sentry_client_tier3_logs_enabled (Capture console logs), sentry_client_tier2_replay_enabled (Enable session replay (Tier 2)), sentry_client_tier1_tracing_enabled (Enable performance monitoring (Tier 1)), sentry_client_tier3_feedback_enabled (Enable user feedback widget), sentry_client_tier2_error_sample_rate (On-error session sample rate), sentry_client_tier3_profiling_enabled (Enable browser CPU profiling), sentry_client_tier1_traces_sample_rate (Traces sample rate), sentry_client_tier2_session_sample_rate (Healthy-session sample rate), sentry_client_tier3_profiles_sample_rate (Profiles sample rate)
Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub
Availability by version
Reviewed: 2026-11-03Confirmation status: 1 confirmed, 8 with no information of 9 versions.
Sources · Odoo 18.0
Confirmed on 2026-11-03 in branch 18.0 of OCA/server-tools.
terminal Installation and usage
OCA documentation · Odoo 18.0Configuration
Source · Odoo 18.0- Pick where the DSN comes from
There are two ways to point the browser SDK at a Sentry project. Use one:
(a) Recommended — separate browser DSN via the Settings UI. Sentry's own guidance is one project per platform: a Python project for backend errors and a JavaScript-Browser project for client-side errors. Set the dedicated browser DSN under Settings → General Settings → Sentry Browser Monitoring → Connection:
| Field | Example | Notes | |---|---|---| | Browser DSN | https://<public_key>@sentry.example.com/<project_id> | Public DSN of the JavaScript project. Safe to embed in client code per Sentry's docs. | | Environment | production-web | Tags every browser event. May differ from the backend env tag. | | Release | asset-bundle hash or deploy SHA | Tags every browser event. May differ from the Odoo Python release. |
No Odoo restart required — changes take effect on the next page load.
(b) Fallback — shared DSN via odoo.conf. If the Connection fields above are left blank, the controller reads the same top-level sentry_* options the OCA server-side sentry module uses on the 18.0 series (the dedicated [sentry] section only exists from 19.0):
[options]
sentry_dsn = https://<public_key>@sentry.example.com/<project_id>
sentry_release = 1.3.2
sentry_environment = productionThis path is convenient for single-project deployments that want both backend Python events and browser JavaScript events going to the same Sentry project. Editing odoo.conf requires an Odoo restart. A legacy DSN with a secret (https://key:secret@…) is served to the browser without the secret part.
The UI value always wins when both are set. Whichever source the DSN comes from, the controller strips a legacy :<secret> component before serving it — the browser only ever needs the public key — and the Settings form refuses a Browser DSN that carries one.
- Settings → General Settings → Sentry Browser Monitoring
Each tier is independently toggleable:
Tier 0 — Capture browser errors (recommended default once a DSN is set)
Loads bundle.min.js (~30KB gzipped). Wires window.onerror and window.onunhandledrejection. Sends events with the logged-in user's id + email as Sentry.setUser(...).
Tier 1 — Performance monitoring
Enables BrowserTracing. Auto-instruments fetch / XHR, navigation timing, and long-task observer. Adds roughly 5–10% per-request overhead at sample rate 1.0 plus extra bandwidth per traced request. Recommended in production: 0.05 or below.
Tier 2 — Session replay
Enables @sentry/replay. Adds ~100KB to every page and records DOM mutations + console + network activity. Strongly recommend Healthy-session sample = 0.0 and On-error sample = 1.0 so recording only kicks in for sessions that already hit an error.
Tier 3 — Optional extras
- User feedback widget — adds a feedback button.
- Browser CPU profiling — captures JS Self-Profiling samples for traced transactions. Has its own sample-rate slider. Requires the page to be served with a
Document-Policy: js-profilingHTTP header. See "Browser profiling — extra setup" below. - Console-log capture — uploads
console.log/console.warncalls as Sentry Log entries. Spammy without filtering. - User preferences → Privacy — per-user session-replay opt-out
Each user can disable session replay for their own sessions, regardless of the database-wide Tier 2 setting. The browser SDK still loads (the bundle URL doesn't change), but the Replay integration is never registered for the opted-out user — no DOM observer, no recording.
To enable: open the user's profile (top-right avatar → My Profile → Preferences → Privacy) and check Disable Sentry session replay.
The toggle is self-writeable: users can manage it without administrator help.
What leaves the server per user: events carry the numeric user id plus the app categories of the user's groups (e.g. Sales,Accounting) as the odoo.category tag, cut to Sentry's 200-character tag limit. No group names, email or display name are sent; replay masking covers all text, inputs and media by default.
- Backend errors and OWL component context
In the backend (/odoo/*) Odoo's error service already catches every window error and unhandled rejection, so the module registers one error_handlers entry and turns the SDK's own global handlers and callback wrappers (GlobalHandlers, BrowserApiErrors) off there. Each crash is reported once, and OWL component crashes carry two extra fields:
tags.owl = trueextra.component_tree— the OWL component path of the failing render
Server-side and transport errors (RPCError, including session expiry, ConnectionLostError, ConnectionAbortedError, RequestEntityTooLargeError) are not reported from the browser — the OCA sentry module already reports the server-side ones — they only leave an odoo.rpc breadcrumb on the next browser event. When Tier 2 replay is on, a server error still uploads the buffered replay, so the server-side event has a recording to link to through the trace propagated on the request. Odoo's standard "Oops!" dialog still shows as before. No configuration needed. Portal and website pages have no error service, so the SDK's global handlers stay on there.
Browser profiling — extra setup
The JS Self-Profiling API requires the browser to receive a permission header on the document HTML response:
Document-Policy: js-profilingOdoo's default web responses do not emit this header. You'll need to add it at your reverse proxy. nginx example:
location /odoo {
proxy_pass http://odoo:8069;
add_header Document-Policy "js-profiling";
}Without the header, the Profiling integration registers cleanly and sends profile payloads, but they will be empty — no client-side error, just no useful data in Sentry's Profiling tab.
Vendored Sentry SDK
The browser SDK ships vendored inside the module under sentry_client/static/lib/sentry/<version>/. The default Sentry SDK source URL points at this in-module path, so the browser loads the SDK from the same origin as Odoo — no traffic to browser.sentry-cdn.com, no air-gap workarounds needed.
To bump the vendored version, run the refresh script:
cd sentry_client/
./scripts/refresh-vendor-bundle.sh 10.55.0 # whatever you want
git add static/lib/sentry/10.55.0/
git commit -m "[IMP] sentry_client: bump vendored SDK to 10.55.0"The script downloads each bundle from browser.sentry-cdn.com, verifies it against Sentry's published SHA-384 SRI hash, drops the LICENSE file, and writes a SHA256SUMS for reviewers. After committing, update the Sentry SDK version in Settings → General Settings → Sentry Browser Monitoring to match.
To revert to the public CDN at runtime (e.g. for quick A/B testing), override Sentry SDK source URL to https://browser.sentry-cdn.com in the Settings page.
Sentry server compatibility
The browser SDK talks to whatever Sentry instance you point the DSN at — either sentry.io or a self-hosted instance. Feature support depends on the Sentry server version:
| Feature | Minimum Sentry server | Notes | |---|---|---| | Tier 0 — error capture | v9.0+ | Basic event ingest, supported by every modern Sentry. | | Tier 1 — performance / tracing | v10.0+ | The tracing UI shipped in Sentry 10. | | Tier 2 — session replay | v22.10.0+ (Oct 2022) + feature flag | Replay ingest was introduced in self-hosted 22.10. The feature must also be enabled on the server: set SENTRY_FEATURES["organizations:session-replay"] = True (and …-ui, …-recording-scrubbing) in sentry.conf.py, then restart web + ingest-replay-recordings. Without the flag, browser envelopes arrive at /api/<n>/envelope/ but are silently discarded — no UI surface, no error. | | Tier 3 — feedback widget | v23.6.0+ (Jun 2023) | The modern programmatic feedback API. Older versions still work with the legacy Sentry.showReportDialog path, which this module does not use. | | Tier 3 — browser profiling | v24.0+ (Jan 2024) | Plus the Document-Policy: js-profiling header (see above). | | Tier 3 — console-log capture | v25.0+ (Mar 2025) | Sentry Logs API. Server versions before v25 will ingest the events as a generic log envelope; the dedicated Logs UI requires v25+. |
For sentry.io: all features are always available.
For self-hosted: check your tag at /opt/sentry/install/_version.sh (or docker exec <sentry-web> sentry --version). If a feature you've enabled isn't supported by your Sentry server, the browser SDK still sends the envelope but the server discards it — no client-side error.
Usage
Source · Odoo 18.0Once Tier 0 is enabled and a DSN is configured, the next page load injects the (vendored) Sentry browser SDK and starts capturing errors. No further user action needed.
To verify the integration:
- Open the browser dev tools console on any Odoo page.
- Run
throw new Error("sentry_client smoke test"). - The error appears in your Sentry project within a few seconds, tagged with your Odoo
user.id,release, andenvironment.
Per-user opt-out
Top-right avatar → My Profile → Preferences → Privacy → Disable Sentry session replay. Saves to your own user record. The opt-out only suppresses session replay; basic error capture (Tier 0) still fires.
OWL component context
When the backend OWL stack raises an exception (the usual "Oops!" dialog you see in the Odoo web client), the resulting Sentry event automatically carries:
tags.owl = trueextra.component_tree— the OWL component path
No configuration needed — the OCA sentry_client module registers an entry in @web/core/error_handlers at install time. Standard Odoo error UX is unaffected.
No verified information in OCA: Installation.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.