Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
squash: use address suffix
  • Loading branch information
arielvalentin authored Jun 1, 2023
commit baef1f08a5b53e8184e3333ecf40c6d8bba511fd
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def client_attributes(sql)

attributes[::OpenTelemetry::SemanticConventions::Trace::DB_NAME] = database_name if database_name
attributes[::OpenTelemetry::SemanticConventions::Trace::PEER_SERVICE] = config[:peer_service] unless config[:peer_service].nil?
attributes['db.mysql.instance.host.name'] = @connected_host if defined?(@connected_host)
attributes['db.mysql.instance.address'] = @connected_host if defined?(@connected_host)

case config[:db_statement]
when :obfuscate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,25 +73,24 @@
describe '#compatible?' do
describe 'when an unsupported version is installed' do
it 'is incompatible' do
stub_const('Trilogy::VERSION', '2.0.0.beta') do
_(instrumentation.compatible?).must_equal false
end
stub_const('Trilogy::VERSION', '2.2.0')
_(instrumentation.compatible?).must_equal false

stub_const('Trilogy::VERSION', '3.0.0') do
_(instrumentation.compatible?).must_equal false
end
stub_const('Trilogy::VERSION', '2.3.0.beta')
_(instrumentation.compatible?).must_equal false

stub_const('Trilogy::VERSION', '3.0.0')
_(instrumentation.compatible?).must_equal false
end
end

describe 'when supported version is installed' do
it 'is compatible' do
stub_const('Trilogy::VERSION', '2.0.0') do
_(instrumentation.compatible?).must_equal true
end
stub_const('Trilogy::VERSION', '2.3.0')
_(instrumentation.compatible?).must_equal true

stub_const('Trilogy::VERSION', '3.0.0.rc1') do
_(instrumentation.compatible?).must_equal true
end
stub_const('Trilogy::VERSION', '3.0.0.rc1')
_(instrumentation.compatible?).must_equal true
end
end
end
Expand Down Expand Up @@ -184,7 +183,7 @@
_(last_span.attributes[OpenTelemetry::SemanticConventions::Trace::DB_SYSTEM]).must_equal 'mysql'
_(last_span.attributes[OpenTelemetry::SemanticConventions::Trace::DB_STATEMENT]).must_equal 'SELECT ?'
_(last_span.attributes[OpenTelemetry::SemanticConventions::Trace::NET_PEER_NAME]).must_equal(host)
_(last_span.attributes['db.mysql.instance.host.name']).must_equal client.connected_host
_(last_span.attributes['db.mysql.instance.address']).must_equal client.connected_host
end
end

Expand Down