Commit graph

18 commits

Author SHA1 Message Date
Gavin D'souza
ecb4795ed3
feat: Enable Sentry Sampling
Closes https://github.com/frappe/frappe/issues/28245
2024-10-28 11:27:51 +01:00
Ankush Menat
445e1dbd6b
perf: num2words, babel, gettext, sentry imports (#26475)
num2words - 260KB - Used frequently on ERPNext sites.
babel - 1.1MB Gets imported because of dates, localization
sentry - 2.8MB should be loaded only if envvar is set
gettext - required for reading translations
2024-05-18 07:20:41 +00:00
Akhil Narang
edad15ef9c
chore(sentry): exclude PermissionError as well
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-04-22 18:21:43 +05:30
Akhil Narang
38af00f0db
fix(sentry): correctly skip frappe.ValidationError and its children
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-04-08 16:03:13 +05:30
Akhil Narang
bd6eaab00e
feat: drop sentry's RQ integration
It overrides what we set with information that isn't really useful for us.
Set a more readable method name, and add in some additional job metadata.

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-22 18:51:38 +05:30
Akhil Narang
92326d143d
fix(sentry): set scope for background jobs
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-16 16:26:48 +05:30
Akhil Narang
da8e88e66c
feat(sentry): log request json body / form data
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-02 11:39:16 +05:30
Ankush Menat
31d72c33b4
chore: use site as "user" (#24026)
For us, a user is single site. This is because logic like "issue affects
more than 1 user" only makes sense for site. Same client/server script
can affect multiple user on same site but it's not a useful error for
us.


[skip ci]
2023-12-29 11:55:26 +05:30
Akhil Narang
d5d35704d8
feat(sentry): skip validation errors
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-27 18:43:33 +05:30
Akhil Narang
64b63d5969
fix(sentry): don't set context if not enabled
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-27 11:38:01 +05:30
Akhil Narang
067104ca9c
refactor(sentry): sync up with FC implementation
Co-authored-by: Aditya Hase <aditya@adityahase.com>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-26 12:30:10 +05:30
Akhil Narang
39359f9793
fix(sentry): name field is ignored
Only `id`, `username`, `email`, and `ip_address` are accepted here

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-20 12:43:42 +05:30
Akhil Narang
c0de1aa0df
refactor(sentry): don't require passing in an exception (#23689)
`sys.exc_info()` works out for our use case

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-08 21:07:17 +05:30
Akhil Narang
faef64bab4
fix(sentry): set the user's name correctly
https://docs.sentry.io/platforms/python/enriching-events/identify-user/

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-08 16:13:15 +05:30
Ankush Menat
0e8b4de96f fix: tweak sentry config
- disable session tracking - This causes sentry to phone home on every load, we don't need this (yet)
- disable automatic integrtaions (like redis)
- disable all default integration and cherry-pick what's required
2023-11-30 19:01:19 +05:30
Ankush Menat
52686f79cb refactor: code cleanup
- better boot config name
- send sentry after - because frappe namespce doesn't exist if it starts
  first
- remove import in app.py because __init__ is always imported so no
  need.
- leave telemetry JS always present, this is used even when telemetry is
  not enabled.
2023-11-30 17:40:53 +05:30
Akhil Narang
9a0a5468c5 feat: setup sentry integration
Inspired primarily from sentry's generic WSGI integration

Environment variable `FRAPPE_SENTRY_DSN` needs to be enabled as well
as explicit opt-in from the user's side in system sid telemetry
settings

Conditionally include telemetry JS bundles

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-11-30 17:13:41 +05:30
Ankush Menat
a7137bdeaa feat: client side error reporting + sentry
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-11-30 17:13:41 +05:30