diff --git a/instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy/patches/client.rb b/instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy/patches/client.rb index 842a22075..9bceba96c 100644 --- a/instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy/patches/client.rb +++ b/instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy/patches/client.rb @@ -51,11 +51,13 @@ def query(sql) kind: :client ) do |_span, context| if propagator - sql = sql.dup if sql.frozen? + dup = sql.frozen? + sql = sql.dup if dup propagator.inject(sql, context: context) + sql.freeze if dup end - super(sql.freeze) + super(sql) end end