[18.0][ADD] sentry_client: tiered browser SDK with vendoring, profiling, replay opt-out, OWL boundary#3627
Open
dnplkndll wants to merge 1 commit into
Open
[18.0][ADD] sentry_client: tiered browser SDK with vendoring, profiling, replay opt-out, OWL boundary#3627dnplkndll wants to merge 1 commit into
dnplkndll wants to merge 1 commit into
Conversation
…nfig Backport of the 19.0 module (OCA#3622) to 18.0. Identical feature set; only the API surfaces that changed between series are adapted: - `user.all_group_ids` (19.0) → `user.groups_id` (18.0). 19.0 split the groups field into a stored direct collection plus a computed transitive closure; on 18.0 `groups_id` already returns the full set. - `group.privilege_id.category_id` (19.0) → `group.category_id` (18.0). 19.0 introduced the privilege layer between groups and categories; on 18.0 groups carry the category directly. - Manifest version `18.0.1.0.0`. Everything else — Connection UI block (Browser DSN / Environment / Release) with `odoo.conf [sentry]` fallback, four tier toggles with sample-rate knobs, vendored Sentry SDK under `static/lib`, OWL ErrorBoundary capturing the wrapping error and dedup-marking it, per-tab UUID + `workflow_id` + `surface` tags, per-user replay opt-out, and the public `/sentry_client/config.json` endpoint — ports verbatim. The OWL `error_handlers` registry, settings `<block>`/`<setting>` pattern, and asset bundle keys are identical between 18.0 and 19.0.
91d7713 to
0d828a8
Compare
Contributor
Author
|
I think you guys had some contributions on sentry. how does this look? I was actually going to look into if there might be some way to use the data on an instances use to build roles and skills for agents or just keeping process documentation up to date. I created a drop in seer app that runs the lower cost 3.5-flash to keep costs down on error fixes as well. need more use to verify. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New module: a browser-side companion to the OCA
sentryPython module.Loads the Sentry browser SDK into the Odoo web client and reports
uncaught JS errors, optional performance traces, session replays on
error, and a user-feedback widget — all toggleable per tier under
Settings → General Settings → Sentry Browser Monitoring.
Browser DSN, environment, and release are settable via the UI
(
ir.config_parametersentry_client.{browser_dsn,environment,release}).Empty UI values fall back to the
[sentry]section ofodoo.confso asingle-project deployment shared with the server-side
sentrymodulekeeps working without UI clicks. Matches Sentry's recommended
one-project-per-platform setup when the values are split.
Lead PR for the module; 19.0 port at
#3622 (DRAFT,
[19.0][MIG]— cherry-pick of this commit plus three API adaptations).Non-mechanical adaptations worth flagging
@web/core/error_handlersregistry hook captures the OWL-wrappingerror (
error || originalException) rather than the inner one andmarks it with
__sentry_owl_captured__so the globalonunhandledrejectionhandler'sbeforeSenddrops the duplicate.Result: one Sentry issue per OWL crash, tagged
owl: true, with thecomponent tree in
extra.component_tree. Returnsfalseso Odoo'sown Oops! dialog still renders alongside.
/sentry_client/config.jsonendpoint isauth="public"onpurpose — the loader runs on portal/login pages before auth. Only
behaviour flags and the numeric uid leave the server; email and name
are read client-side from
window.odoo.session_info(already gated bythe session cookie). DSN is a public DSN, safe to expose.
Even with Tier 2 enabled DB-wide, an opted-out user's Replay
integration never registers, so no DOM observer runs for them.
tab_id(sessionStorage-persistedUUID),
workflow_id(<action_id>|<model>|<view_type>), and thesurfacetag ship on every event so downstream harvesting can split auser's parallel windows into distinct streams.
surfacetag classifies the source of every browser event:backend(/odoo,/web),portal(/my), orfrontend(publicwebsite). Lets Sentry queries filter cleanly when both browser and
Python ship to the same project —
environmentdistinguishesPython vs JS,
surfacedistinguishes browser sub-streams.bundle.tracing.feedback.min.js; the controller's_bundle_namehelper falls back to
bundle.tracing.replay.feedback.min.jsfor thatcombination — extra replay code is inert without the integration
registered.
static/lib/sentry/<version>/with a refreshscript that SRI-verifies each bundle against Sentry's published
hashes. Browser loads from the same origin as Odoo — air-gap safe.
Demo on the runboat preview
Installed against the PR preview build
with all four tiers enabled and a test DSN:
Runtime config returned by the public endpoint:
{ "enabled": true, "environment": "demo-18", "integrations": {"tracing": true, "replay": true, "feedback": true, "profiling": false, "logs": false}, "traces_sample_rate": 1.0, "replay_session_sample_rate": 0.0, "replay_error_sample_rate": 1.0 }Reviewers running the runboat preview themselves can reproduce by
configuring a DSN for their own project, then triggering a JS exception
in the browser console — events land within seconds tagged with
environment+surfacefor query separation:environment:demo-18 surface:python-backendenvironment:demo-18 surface:backendenvironment:demo-18 surface:portal/myportal JS errorsenvironment:demo-18 surface:frontend