Module: OpenTelemetry::Instrumentation::Mysql2::Patches::Client
- Defined in:
- lib/opentelemetry/instrumentation/mysql2/patches/client.rb
Overview
Module to prepend to Mysql2::Client for instrumentation
Constant Summary collapse
- QUERY_NAMES =
[ 'set names', 'select', 'insert', 'update', 'delete', 'begin', 'commit', 'rollback', 'savepoint', 'release savepoint', 'explain', 'drop database', 'drop table', 'create database', 'create table' ].freeze
- QUERY_NAME_RE =
Regexp.new("^(#{QUERY_NAMES.join('|')})", Regexp::IGNORECASE)
Instance Method Summary collapse
Instance Method Details
#query(sql, options = {}) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/opentelemetry/instrumentation/mysql2/patches/client.rb', line 33 def query(sql, = {}) tracer.in_span( database_span_name(sql), attributes: client_attributes.merge( 'db.statement' => sql ), kind: :client ) do super(sql, ) end end |