File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
lib/datadog/tracing/contrib/karafka Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,18 @@ def each(&block)
48
48
end
49
49
end
50
50
51
+ module AppPatch
52
+ ONLY_ONCE_PER_APP = Hash . new { |h , key | h [ key ] = Core ::Utils ::OnlyOnce . new }
53
+
54
+ def initialized!
55
+ ONLY_ONCE_PER_APP [ self ] . run do
56
+ # Activate tracing on components related to Karafka (e.g. WaterDrop)
57
+ Contrib ::Karafka ::Framework . setup
58
+ end
59
+ super
60
+ end
61
+ end
62
+
51
63
# Patcher enables patching of 'karafka' module.
52
64
module Patcher
53
65
include Contrib ::Patcher
@@ -60,12 +72,11 @@ def target_version
60
72
61
73
def patch
62
74
require_relative 'monitor'
75
+ require_relative 'framework'
63
76
64
77
::Karafka ::Instrumentation ::Monitor . prepend ( Monitor )
65
78
::Karafka ::Messages ::Messages . prepend ( MessagesPatch )
66
-
67
- # Activate tracing on components related to Karafka (e.g. WaterDrop)
68
- Framework . setup
79
+ ::Karafka ::App . singleton_class . prepend ( AppPatch )
69
80
end
70
81
end
71
82
end
You can’t perform that action at this time.
0 commit comments