Skip to content

sql.active_record

View Markdown

A SQL query from Rails Active Record. Use request_id to group queries from the same HTTP request.

Source Active Record Category Database Fields 9 honeybadger-ruby

Fields

9
FieldTypeDescription
event_typestringAllowed value: sql.active_record.
querystringThe SQL text with bind parameters obfuscated.
durationnumberWall-clock time the query took, in milliseconds.
cachedbooleanWhether the query result was served from the ActiveRecord query cache.
asyncbooleanWhether the query was executed asynchronously.
request_idstringRails request UUID. Shared by all events from the same HTTP request.
instrumenter_idstringUnique identifier for the ActiveSupport::Notifications instrumentation request, assigned by Rails.
hostnamestringServer hostname. Attached to every event by default (events.attach_hostname).
environmentstringApplication environment, e.g. "production". Attached to every event by default (events.attach_environment).

Example

{
"event_type": "sql.active_record",
"query": "SELECT \"users\".* FROM \"users\" WHERE \"users\".\"id\" = ? LIMIT ?",
"duration": 2.34,
"cached": false,
"async": false,
"request_id": "0f5e4bb2-3c46-4b1c-91d5-2f4e8a6b9c01",
"instrumenter_id": "d6a5b3f4c2e1908a7b6c",
"hostname": "web-1.example.com",
"environment": "production"
}