honeycomb-rails 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20540b339eef388e9906ce50a0c3b7efbb8cb282189400bf7230d1005f166ea7
|
4
|
+
data.tar.gz: 855af5e90804fdab8f7f2aba2641352673ef5e6ce1abff2953f9926077b2b968
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be8cb30c03e21a4ca871d85817526dc627b5c35b8192f047a5342a86656bf45fde7bcf1ac8270603a1d8daec7ac02e54f356a3d0e7449f0f3fbffb668e7ecefa
|
7
|
+
data.tar.gz: ce2c4b9085ac5e8471619b3747cc99eb07e7a759ebdd5f8a223bd9decc3ad368fc07789fbd46416cd31caf44f6279c624b1a6f972a384f8bb49c1563976d2582
|
@@ -8,6 +8,7 @@ module HoneycombRails
|
|
8
8
|
@db_dataset = 'active_record'
|
9
9
|
@record_flash = true
|
10
10
|
@record_user = :detect
|
11
|
+
@logger = Rails.logger
|
11
12
|
end
|
12
13
|
|
13
14
|
# Whether to record flash messages (default: true).
|
@@ -17,6 +18,10 @@ module HoneycombRails
|
|
17
18
|
!!@record_flash
|
18
19
|
end
|
19
20
|
|
21
|
+
# If set, routes HoneycombRails-specific log output to this logger
|
22
|
+
# (defaults to Rails.logger)
|
23
|
+
attr_accessor :logger
|
24
|
+
|
20
25
|
# If set, determines how to record the current user during request processing (default: :detect). Set to nil or false to disable.
|
21
26
|
#
|
22
27
|
# Valid values:
|
@@ -30,10 +35,14 @@ module HoneycombRails
|
|
30
35
|
# about the current user.
|
31
36
|
attr_accessor :record_user
|
32
37
|
|
33
|
-
#
|
38
|
+
# Send request events to the Honeycomb dataset with this name (default:
|
39
|
+
# 'rails'). Set to nil or an empty string to disable.
|
34
40
|
attr_accessor :dataset
|
35
|
-
|
41
|
+
|
42
|
+
# Send ActiveRecord query events to the Honeycomb dataset with this name
|
43
|
+
# (default: 'active_record'). Set to nil or empty string to disable.
|
36
44
|
attr_accessor :db_dataset
|
45
|
+
|
37
46
|
# The Honeycomb write key for your team (must be specified).
|
38
47
|
attr_accessor :writekey
|
39
48
|
end
|
@@ -18,18 +18,29 @@ module HoneycombRails
|
|
18
18
|
# the app's config/initializers has taken effect.
|
19
19
|
config.after_initialize do
|
20
20
|
writekey = HoneycombRails.config.writekey
|
21
|
-
|
22
|
-
@libhoney = Libhoney::Client.new(writekey: writekey, dataset: dataset)
|
21
|
+
@libhoney = Libhoney::Client.new(writekey: writekey)
|
23
22
|
end
|
24
23
|
|
25
24
|
config.after_initialize do
|
26
|
-
|
27
|
-
db_builder.dataset = HoneycombRails.config.db_dataset
|
25
|
+
subscribers = []
|
28
26
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
27
|
+
if !HoneycombRails.config.dataset.blank?
|
28
|
+
req_builder = @libhoney.builder
|
29
|
+
req_builder.dataset = HoneycombRails.config.dataset
|
30
|
+
subscribers.push(Subscribers::ProcessAction.new(req_builder))
|
31
|
+
end
|
32
|
+
|
33
|
+
if !HoneycombRails.config.db_dataset.blank?
|
34
|
+
db_builder = @libhoney.builder
|
35
|
+
db_builder.dataset = HoneycombRails.config.db_dataset
|
36
|
+
subscribers.push(Subscribers::ActiveRecord.new(db_builder))
|
37
|
+
end
|
38
|
+
|
39
|
+
if subscribers.empty?
|
40
|
+
HoneycombRails.config.logger.warn("No subscribers defined (are both HoneycombRails.config.dataset and HoneycombRails.config.db_dataset both blank?")
|
41
|
+
end
|
42
|
+
|
43
|
+
subscribers.each(&:subscribe!)
|
33
44
|
end
|
34
45
|
end
|
35
46
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: honeycomb-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Stokes
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-12-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: libhoney
|
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
152
|
version: '0'
|
153
153
|
requirements: []
|
154
154
|
rubyforge_project:
|
155
|
-
rubygems_version: 2.7.
|
155
|
+
rubygems_version: 2.7.3
|
156
156
|
signing_key:
|
157
157
|
specification_version: 4
|
158
158
|
summary: Easily instrument your Rails apps with Honeycomb
|