diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-04-21 01:26:47 +0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-04-21 01:26:47 +0300 |
commit | 5c10b29700eea58c5b34b6601c2f98e7685b2fa4 (patch) | |
tree | fd51aa9af2947275b68892bf963c6fb61a351f47 /lib | |
parent | c9f11db21914ff5d5bd7799aebdc7948d66d08e3 (diff) | |
parent | 7e6d59067eb614a139cfa438d4c9f9f9f5368a47 (diff) |
Merge remote-tracking branch 'origin/master' into issue_14904
# Conflicts:
# app/views/shared/issuable/_sidebar.html.haml
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/internal.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/gon_helper.rb | 1 | ||||
-rw-r--r-- | lib/gitlab/metrics.rb | 9 |
3 files changed, 11 insertions, 1 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb index 8cfa1f1556b..3ac7b50c4ce 100644 --- a/lib/api/internal.rb +++ b/lib/api/internal.rb @@ -23,7 +23,7 @@ module API end post "/allowed" do - Gitlab::Metrics.tag_transaction('action', 'Grape#/internal/allowed') + Gitlab::Metrics.action = 'Grape#/internal/allowed' status 200 diff --git a/lib/gitlab/gon_helper.rb b/lib/gitlab/gon_helper.rb index ab900b641c4..9d81ffb3e6c 100644 --- a/lib/gitlab/gon_helper.rb +++ b/lib/gitlab/gon_helper.rb @@ -8,6 +8,7 @@ module Gitlab gon.relative_url_root = Gitlab.config.gitlab.relative_url_root gon.shortcuts_path = help_shortcuts_path gon.user_color_scheme = Gitlab::ColorSchemes.for_user(current_user).css_class + gon.sentry_dsn = ApplicationSetting.current.sentry_dsn if Rails.env.production? if current_user gon.current_user_id = current_user.id diff --git a/lib/gitlab/metrics.rb b/lib/gitlab/metrics.rb index f82dce14865..49f702f91f6 100644 --- a/lib/gitlab/metrics.rb +++ b/lib/gitlab/metrics.rb @@ -115,6 +115,15 @@ module Gitlab trans.add_tag(name, value) if trans end + # Sets the action of the current transaction (if any) + # + # action - The name of the action. + def self.action=(action) + trans = current_transaction + + trans.action = action if trans + end + # When enabled this should be set before being used as the usual pattern # "@foo ||= bar" is _not_ thread-safe. if enabled? |