Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fajpunk committed Jan 6, 2025
1 parent 2b233d2 commit 428e898
Show file tree
Hide file tree
Showing 21 changed files with 953 additions and 1,759 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
- id: check-toml

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.3
rev: v0.8.4
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
1 change: 1 addition & 0 deletions docs/development/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Here are some guides on developing and testing mobu.

idfdev
github
sentry
19 changes: 19 additions & 0 deletions docs/development/sentry.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
######
Sentry
######

Footguns
========

* `~sentry_sdk.Transaction.set_data` will `silently not do anything <https://github.com/getsentry/sentry-python/issues/930>`_.
All calls to ``set_data`` must be called on `~sentry_sdk.Span` instances.

* Unhandled errors will be reported in the scope in which they are sent to sentry, NOT the scope in which they are thrown.
* This means that if you call `~sentry_sdk.new_scope`, set tags on the scope, and an exception is raised but not explicitly captured in that scope, the `tags will not show up in the Sentry UI <https://github.com/getsentry/sentry-python/issues/2857>`_.
* This also means that the error events will occur in the transaction that is active when they are handled, not the active transaction when they are raised.

* Alerts that are set to fire when an issue is first created, or regressed, will do so once an event that matches that issue occurs in `ANY environment <https://github.com/getsentry/sentry/issues/21612>`_, not every environment.
This means that if an the first event from an issue comes from a development environment, the alert will be triggered, and will not trigger again when the first event comes from a production environment.
To have such an alert trigger per-environment, we need to `change the fingerprint of the event <https://github.com/getsentry/sentry/issues/64354#issuecomment-1927839632>`_ to include the environment, which can be done by using the the ``add_environment_to_fingerprint`` helper method as a `before_send` method in your Sentry initialization.

* Calling `~sentry_sdk.`
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ extend = "ruff-shared.toml"
"tests/data/**/*.ipynb" = [
"T201", # test notebooks are allowed to use print
]
"src/mobu/safir/sentry.py" = [
"N818", # Exception is correct in some cases, others are part of API
]

[tool.ruff.lint.isort]
known-first-party = ["monkeyflocker", "mobu", "tests"]
Expand Down
432 changes: 216 additions & 216 deletions requirements/dev.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions requirements/main.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ safir>=9.0.1
shortuuid
structlog
websockets
sentry-sdk

# Uncomment this, change the branch, comment out safir above, and run make
# update-deps-no-hashes to test against an unreleased version of Safir.
Expand Down
317 changes: 162 additions & 155 deletions requirements/main.txt

Large diffs are not rendered by default.

Loading

0 comments on commit 428e898

Please sign in to comment.