Skip to content

Commit

Permalink
Refactor compact!
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahramadan committed Aug 20, 2024
1 parent 146bd71 commit f9c244e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def client_attributes(sql = nil)
attributes['db.instance.id'] = @connected_host unless @connected_host.nil?

if sql
attributes['db.collection.name'] = collection_name(sql)
collection_name = collection_name(sql)
attributes['db.collection.name'] = collection_name if collection_name

case config[:db_statement]
when :obfuscate
Expand All @@ -89,7 +90,7 @@ def client_attributes(sql = nil)
attributes[::OpenTelemetry::SemanticConventions::Trace::DB_STATEMENT] = sql
end
end
attributes.compact!

attributes
end

Expand Down

0 comments on commit f9c244e

Please sign in to comment.