Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django related improvements / feedback #543

Open
BYK opened this issue Oct 31, 2024 · 0 comments
Open

Django related improvements / feedback #543

BYK opened this issue Oct 31, 2024 · 0 comments
Assignees

Comments

@BYK
Copy link
Member

BYK commented Oct 31, 2024

This is a braindump of feedback I got from a friend who tried to use Spotlight with Django:

  • It's not clear what Spotlight is or how it works
  • There's no clear or easy to find guide for Django
  • Clearly announce the guiding principle for Spotlight & OSS: it will not require Sentry Cloud ever and it will stay OSI Open Source
  • Capturing the error page is nice, want the widget too now (like Django Debug Toolbar) (Make the entrypoint JS usable by other pages #552) (feat(spotlight): Inject Spotlight button on Django sentry-python#3751)
  • Click-to-copy for filenames (Add click to copy for file names #548)
  • Main use cases:
    • Number of requests
    • Cache usage check / which cache key matched etc - We just need to enable cache_spans in Django integration on SDK side for this
    • Which view & template was used to render this page -- I think this is captured in trace view so will not action unless I hear otherwise)
    • DB queries (With Sentry SDK v8, not able to get the queries in Spotlight #422)
    • Are there N+1 queries around (Sentry & Django Debug Toolbar does this already)
  • Improvements complaints:
    • It's impossible to tell if Spotlight mode is active and working properly. Add something to log output (either tie this to DEBUG setting or SENTRY_DEBUG in the SDK) (feat(spotlight): Add info logs when Sentry is enabled sentry-python#3735)
    • GET/POST/FILES/COOKIES information is not displayed (this is already mostly captured by the SDK) - (feat: Add request and module details to context #544 mostly)
    • User info is missing (the logged in user in Django)
      • Cookies and User info is stripped by default with [send_default_pii](https://docs.sentry.io/platforms/python/configuration/options/#send-default-pii). We can enable this when Spotlight is enabled but then we risk sending this upstream to Sentry if there's a DSN set too. For now, we can limit this to DEBUG mode or lack of DSN for automatic turn-on behavior but looks like we need larger architectural changes for this such as post-scrubbing instead of limiting at the time of collection.
    • Error to trace connection is not clear or easy to follow (Error to trace connection is not clear or easy to follow #551)
    • Transactions under /admin doesn't seem to be captured (intentional by the SDK?) -- We capture these
    • We don't seem to be utilizing profiling info in the UI which may help with the view, template, cache key etc related use cases above

Will be filing individual issues from these as I go.

@BYK BYK self-assigned this Oct 31, 2024
BYK added a commit to getsentry/sentry-python that referenced this issue Nov 5, 2024
This came as user feedback (getsentry/spotlight#543). Intentionally not making this part of Sentry logging as I think if one is enabling Spotlight, they should be seeing this in their logs, regardless of their SENTRY_DEBUG setting, which tends to be noisy.
BYK added a commit to getsentry/sentry-python that referenced this issue Nov 5, 2024
This came as user feedback (getsentry/spotlight#543). Intentionally not making this part of Sentry logging as I think if one is enabling Spotlight, they should be seeing this in their logs, regardless of their SENTRY_DEBUG setting, which tends to be noisy.
BYK added a commit to getsentry/sentry-python that referenced this issue Nov 12, 2024
This patch expands the `SpotlightMiddleware` for Django and injects the Spotlight button to all HTML responses when Spotlight is enabled and running. It requires Spotlight 2.6.0 to work this way.

Ref: getsentry/spotlight#543
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant