lib/opentelemetry/instrumentation/mysql2/patches/client.rb in opentelemetry-instrumentation-mysql2-0.17.0 vs lib/opentelemetry/instrumentation/mysql2/patches/client.rb in opentelemetry-instrumentation-mysql2-0.18.0
- old
+ new
@@ -117,13 +117,13 @@
host = (query_options[:host] || query_options[:hostname]).to_s
port = query_options[:port].to_s
attributes = {
'db.system' => 'mysql',
- 'db.name' => database_name,
'net.peer.name' => host,
'net.peer.port' => port
}
+ attributes['db.name'] = database_name if database_name
attributes['peer.service'] = config[:peer_service] if config[:peer_service]
attributes
end
def tracer