honeycomb-beeline 2.5.0 → 2.6.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 +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/lib/honeycomb/beeline/version.rb +1 -1
- data/lib/honeycomb/integrations/active_support.rb +22 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ae074f65cd2b6319b74e07b06148e9e2cd446bfd3fc7c2c686c9ab4702550a4
|
4
|
+
data.tar.gz: a7c934d59de13e4099636470fb9660520478bbe56c38c5eb42c69839cb6a6f4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12c63d47f117a7fae5771b504ff58191627824618c7127257ca29f9c0e1de9cee3e140184bf3e04935846a2a9cef6768245ce6a89d540a1e48b8ddd1eb923704
|
7
|
+
data.tar.gz: 599d93dc3ca17e34b4828cf557aa98a4b697a26cfffa8957a4b25997c37d7967ab2753bcc01ced943db8e74a52f6dff0f93c0a51ee59d28b0fbc9ad1f144a30b
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -8,12 +8,13 @@ module Honeycomb
|
|
8
8
|
# Included in the configuration object to specify events that should be
|
9
9
|
# subscribed to
|
10
10
|
module Configuration
|
11
|
-
|
11
|
+
attr_writer :notification_events
|
12
12
|
|
13
13
|
def after_initialize(client)
|
14
14
|
super(client) if defined?(super)
|
15
15
|
|
16
|
-
events = notification_events
|
16
|
+
events = notification_events | active_support_handlers.keys
|
17
|
+
|
17
18
|
ActiveSupport::Subscriber.new(client: client).tap do |sub|
|
18
19
|
events.each do |event|
|
19
20
|
sub.subscribe(event, &method(:handle_notification_event))
|
@@ -21,18 +22,30 @@ module Honeycomb
|
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
24
|
-
def on_notification_event(&hook)
|
25
|
-
if
|
26
|
-
|
25
|
+
def on_notification_event(event_name = nil, &hook)
|
26
|
+
if event_name
|
27
|
+
active_support_handlers[event_name] = hook
|
27
28
|
else
|
28
|
-
@
|
29
|
+
@default_handler = hook
|
29
30
|
end
|
30
31
|
end
|
31
32
|
|
32
33
|
def handle_notification_event(name, span, payload)
|
33
|
-
|
34
|
-
|
35
|
-
|
34
|
+
handler = active_support_handlers.fetch(name, default_handler)
|
35
|
+
|
36
|
+
handler.call(name, span, payload)
|
37
|
+
end
|
38
|
+
|
39
|
+
def active_support_handlers
|
40
|
+
@active_support_handlers ||= {}
|
41
|
+
end
|
42
|
+
|
43
|
+
def notification_events
|
44
|
+
@notification_events ||= []
|
45
|
+
end
|
46
|
+
|
47
|
+
def default_handler
|
48
|
+
@default_handler ||= lambda do |name, span, payload|
|
36
49
|
payload.each do |key, value|
|
37
50
|
# Make ActionController::Parameters parseable by libhoney.
|
38
51
|
value = value.to_unsafe_hash if value.respond_to?(:to_unsafe_hash)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: honeycomb-beeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Holman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: libhoney
|