Skip to content

Remove bandit from default excluded domains and recommend PlugCapture only for Cowboy #900

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

Merged
merged 3 commits into from
May 30, 2025

Conversation

martosaur
Copy link
Contributor

Closes #895

See the issue for a write up. The PR here mostly updates the docs. The important change is removing :bandit from the list of excluded domains. Not sure if this counts as a breaking change or not. Users who use default excluded_domains with PlugCapture will see duplicated errors after upgrade 🤔 Let me know what you think!

Copy link
Collaborator

@whatyouhide whatyouhide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My gut feeling is that removing :bandit from the default is not really necessary. It's mostly going to be ignored, right?

@martosaur martosaur force-pushed the am-discourage-plug-capture branch from bd99716 to 803c51d Compare May 28, 2025 15:22
martosaur and others added 2 commits May 28, 2025 08:23
Co-authored-by: Andrea Leopardi <an.leopardi@gmail.com>
Co-authored-by: Andrea Leopardi <an.leopardi@gmail.com>
@martosaur
Copy link
Contributor Author

My gut feeling is that removing :bandit from the default is not really necessary. It's mostly going to be ignored, right?

Currently logger handler ignores them to let PlugCapture log them directly. If Bandit users remove PlugCapture from their apps, logger handler (or backend) has to step in!

Check out this test modification. If we both exclude :bandit and comment out Sentry.PlugCapture in Sentry.ExamplePlugApplication there's no path to log this error:

    @tag handler_config: %{excluded_domains: [:bandit]}
    test "sends two errors when a Plug process crashes if PlugCapture is used and :bandit not excluded",
         %{sender_ref: ref} do
      start_supervised!({Sentry.ExamplePlugApplication, server: :bandit}, restart: :temporary)

      :hackney.get("http://127.0.0.1:8003/error_route", [], "", [])

      assert_receive {^ref, _event}, 1000 # This assertion fails
      # assert_receive {^ref, _event}, 1000
    end

Copy link
Collaborator

@whatyouhide whatyouhide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are totally correct, sorry! 💯

@whatyouhide whatyouhide merged commit d571a6c into getsentry:master May 30, 2025
5 of 6 checks passed
@martosaur
Copy link
Contributor Author

That was fast 😅 I'll make a PR to https://github.com/getsentry/sentry-docs tomorrow morning!

@whatyouhide
Copy link
Collaborator

Thank you @martosaur! Please tag me in there because I don't have notifications on for that.

@martosaur martosaur deleted the am-discourage-plug-capture branch May 30, 2025 06:32
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

Successfully merging this pull request may close these issues.

Limit role of Sentry.PlugCapture?
2 participants