Class: Labkit::Tracing::Rails::ActiveRecord::SqlInstrumenter
Overview
Constant Summary
collapse
- OPERATION_NAME_PREFIX =
"active_record:"
- DEFAULT_OPERATION_NAME =
"sqlquery"
Instance Method Summary
collapse
#finish, #scope_stack, #start
Instance Method Details
#span_name(payload) ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/labkit/tracing/rails/active_record/sql_instrumenter.rb', line 16
def tags(payload)
if Labkit::Tracing.sampled? && payload[:sql]
sql = Labkit::Logging::Sanitizer.sanitize_sql(payload[:sql])
fingerprint = Labkit::Logging::Sanitizer.sql_fingerprint(sql)
end
{
"component" => COMPONENT_TAG,
"span.kind" => "client",
"db.type" => "sql",
"db.connection_id" => payload[:connection_id],
"db.cached" => payload[:cached] || false,
"db.statement" => sql,
"db.statement_fingerprint" => fingerprint,
}
end
|