lib/opentelemetry/instrumentation/que/middlewares/server_middleware.rb in opentelemetry-instrumentation-que-0.5.0 vs lib/opentelemetry/instrumentation/que/middlewares/server_middleware.rb in opentelemetry-instrumentation-que-0.5.1
- old
+ new
@@ -72,12 +72,10 @@
end
# tags is an array looking something like ["tag1", "traceparent:..."]
def self.extract_context_from_tags(tags)
# Convert tags into Hash (ignoring elements that cannot be converted)
- tags_hash = Hash[
- tags.map { |value| value.split(':', 2) }.select { |value| value.size == 2 }
- ]
+ tags_hash = tags.map { |value| value.split(':', 2) }.select { |value| value.size == 2 }.to_h
OpenTelemetry.propagation.extract(tags_hash)
end
def self.job_class(job)
job.que_attrs[:job_class] || job.class.name