Skip to content

Add bot/crawler filtering to ring middleware - #3

Draft
ashpland wants to merge 1 commit into
masterfrom
claude/slack-session-qPAcx
Draft

Add bot/crawler filtering to ring middleware#3
ashpland wants to merge 1 commit into
masterfrom
claude/slack-session-qPAcx

Conversation

@ashpland

Copy link
Copy Markdown
Member

Summary

  • Add ability to filter out bot/crawler requests from Rollbar reporting to reduce noise from automated traffic
  • The wrap-rollbar middleware now accepts an options map with:
    • :ignore-bots? - when true, skip reporting for detected bot requests
    • :bot-patterns - custom regex patterns for bot detection (defaults to 50+ common bot patterns)
    • :ignore-request? - custom predicate function for filtering any requests
  • Export bot-request? function for use in application code
  • Add comprehensive tests for bot detection and filtering

Usage

;; Enable bot filtering with default patterns
(middleware/wrap-rollbar handler client {:ignore-bots? true})

;; Or use custom patterns
(middleware/wrap-rollbar handler client 
  {:ignore-bots? true
   :bot-patterns [#"(?i)my-custom-bot"]})

;; Or use a custom predicate
(middleware/wrap-rollbar handler client
  {:ignore-request? #(= "/health" (:uri %))})

Test plan

  • Verify unit tests pass in CI
  • Test with real bot user agents (Googlebot, Bingbot, etc.)
  • Test that normal browser requests still report errors

Slack thread: https://opengb.slack.com/archives/C0A6EN75S9K/p1779727697072269?thread_ts=1779718632.861429&cid=C0A6EN75S9K

https://claude.ai/code/session_01BS2FMA4B8bCkPbcY5H3z2h


Generated by Claude Code

Add ability to filter out bot/crawler requests from Rollbar reporting to
reduce noise from automated traffic. The middleware now accepts options:
- :ignore-bots? - skip reporting for detected bot requests
- :bot-patterns - custom regex patterns for bot detection
- :ignore-request? - custom predicate for filtering requests

Also exports bot-request? function for use in application code.

https://claude.ai/code/session_01BS2FMA4B8bCkPbcY5H3z2h
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.

2 participants