lib/opentelemetry/instrumentation/pg/patches/connection.rb in opentelemetry-instrumentation-pg-0.17.1 vs lib/opentelemetry/instrumentation/pg/patches/connection.rb in opentelemetry-instrumentation-pg-0.18.0

- old
+ new

@@ -81,10 +81,11 @@ sql = lru_cache[statement_name] operation = 'EXECUTE' end end - attrs = { 'db.operation' => validated_operation(operation), 'db.statement' => sql, 'db.postgresql.prepared_statement_name' => statement_name } + attrs = { 'db.operation' => validated_operation(operation), 'db.postgresql.prepared_statement_name' => statement_name } + attrs['db.statement'] = sql if config[:enable_statement_attribute] attrs.reject! { |_, v| v.nil? } [span_name(operation), client_attributes.merge(attrs)] end