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

Introduce request_tags to capture tags from the current request #1

Merged
merged 1 commit into from
Sep 14, 2021

Conversation

packagethief
Copy link
Member

Rackstash.request_tags= accepts an Array of callable objects or strings. Callable objects will be called with the current request.

Usage:

  config.rackstash.request_tags = [
    lambda { |request| request.subdomains.first || "no-account" },
    lambda { |request|
      case
      when request.subdomains.first == "37smonitoring"
        "monitoring"
      when request.path.starts_with?("/queenbee")
        "queenbee"
      else
        "web"
      end
    }
  ]

lib/rackstash.rb Outdated Show resolved Hide resolved
`Rackstash.request_tags=` accepts an Array of callable objects or strings.
Callable objects will be called with the current request.

Usage:

  config.rackstash.request_tags = [
    lambda { |request| request.subdomains.first || "no-account" },
    lambda { |request|
      case
      when request.subdomains.first == "37smonitoring"
        "monitoring"
      when request.path.starts_with?("/queenbee")
        "queenbee"
      else
        "web"
      end
    }
  ]
@packagethief packagethief merged commit e536727 into master Sep 14, 2021
@packagethief packagethief deleted the request-tags branch September 14, 2021 20:11
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.

1 participant