You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: allow for propagation_style in Sidekiq instrumentation to have dynamic option
This still permits static values (and environment variable to configure
them) but allows users to opt-in to having a callable/dynamic value for
the given option.
Resolves#991
# @param [String] name The name of the configuration option
144
156
# @param default The default value to be used, or to used if validation fails
145
-
# @param [Callable, Symbol] validate Accepts a callable or a symbol that matches
146
-
# a key in the VALIDATORS hash. The supported keys are, :array, :boolean,
147
-
# :callable, :integer, :string.
157
+
# @param [Callable, Symbol] validate Accepts a callable, Enumerable,
158
+
# DynamicValidator, or a symbol that matches a key in the VALIDATORS
159
+
# hash. The supported keys are, :array, :boolean, :callable, :integer,
160
+
# :string.
148
161
defoption(name,default:,validate:)
149
162
validator=VALIDATORS[validate] || validate
150
-
raiseArgumentError,"validate must be #{VALIDATORS.keys.join(', ')}, or a callable"unlessvalidator.respond_to?(:call) || validator.respond_to?(:include?)
163
+
raiseArgumentError,"validate must be #{VALIDATORS.keys.join(', ')}, or a callable"unlessvalidator.respond_to?(:call) || validator.respond_to?(:include?) || validator.is_a?(DynamicValidator)
Copy file name to clipboardExpand all lines: instrumentation/sidekiq/test/opentelemetry/instrumentation/sidekiq/middlewares/server/tracer_middleware_test.rb
+58Lines changed: 58 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -226,6 +226,64 @@
226
226
end
227
227
end
228
228
229
+
describe'when propagation_style is a callable that resolves to `:child`'do
230
+
let(:config)do
231
+
{propagation_style: ->(){:child}}
232
+
end
233
+
234
+
it'continues the enqueuer trace to the job process'do
0 commit comments