debian-mirror-gitlab/config/initializers/peek.rb

26 lines
899 B
Ruby
Raw Normal View History

2021-03-11 19:13:27 +05:30
# frozen_string_literal: true
2019-10-12 21:52:04 +05:30
require 'peek/adapters/redis'
2018-03-17 18:26:18 +05:30
2019-10-12 21:52:04 +05:30
Peek::Adapters::Redis.prepend ::Gitlab::PerformanceBar::RedisAdapterWhenPeekEnabled
2019-12-04 20:38:33 +05:30
Peek.singleton_class.prepend ::Gitlab::PerformanceBar::WithTopLevelWarnings
2019-07-31 22:56:46 +05:30
2019-10-12 21:52:04 +05:30
Rails.application.config.peek.adapter = :redis, { client: ::Redis.new(Gitlab::Redis::Cache.params) }
2018-03-17 18:26:18 +05:30
2019-10-12 21:52:04 +05:30
Peek.into Peek::Views::Host
Peek.into Peek::Views::ActiveRecord
2018-05-09 12:01:36 +05:30
Peek.into Peek::Views::Gitaly
2019-10-12 21:52:04 +05:30
Peek.into Peek::Views::RedisDetailed
2020-06-23 00:09:42 +05:30
Peek.into Peek::Views::Elasticsearch
2019-10-12 21:52:04 +05:30
Peek.into Peek::Views::Rugged
2021-03-11 19:13:27 +05:30
Peek.into Peek::Views::ExternalHttp
2020-06-23 00:09:42 +05:30
Peek.into Peek::Views::BulletDetailed if defined?(Bullet)
2019-09-30 21:07:59 +05:30
2019-10-12 21:52:04 +05:30
Peek.into Peek::Views::Tracing if Labkit::Tracing.tracing_url_enabled?
2020-10-24 23:57:45 +05:30
ActiveSupport::Notifications.subscribe('endpoint_run.grape') do |_name, _start, _finish, _id, payload|
if request_id = payload[:env]['action_dispatch.request_id']
Peek.adapter.save(request_id)
end
end