Skip to content

Performance transactions doesn't contains context set in before_action #1153

@nicolas-brousse

Description

@nicolas-brousse

Describe the bug
Performance transactions doesn't contains context set in a before_action.

To Reproduce
In ApplicationController

class ApplicationController < ActionController::Base
  before_action :set_sentry_contexts

  private

  def set_sentry_contexts
    Sentry.set_user(id: Current&.user&.id, ip_address: request.remote_ip)
    # Sentry.set_extras(params: params.to_unsafe_h, url: request.url)
    Sentry.set_tags(locale: I18n.locale)
  end
end

Expected behavior
Having user and locale information present in Transaction summary in sentry.

Actual behavior
Information are absent.

Environment

  • Ruby Version: 2.7.2
  • SDK Version: sentry-ruby 4.0.1
  • Integration Versions (if any):sentry-rails 4.0.0 and sentry-sidekiq 4.0.0
  • Rails 6.0, Sidekiq 6.1.2

Raven Config

Sentry.init do |config|
  config.traces_sample_rate = 0.5
  config.release = ENV["HEROKU_SLUG_COMMIT"]
  config.async = ->(event) { ErrorsTracker::SendEventJob.perform_later(event) }
  config.breadcrumbs_logger = %i[sentry_logger active_support_logger]
end

Metadata

Metadata

Assignees

Labels

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions