sql.active_record
A SQL query from Rails Active Record. Use request_id to group queries from the same HTTP request.
Fields
9| Field | Type | Description |
|---|---|---|
event_type | string | Allowed value: sql.active_record. |
query | string | The SQL text with bind parameters obfuscated. |
duration | number | Wall-clock time the query took, in milliseconds. |
cached | boolean | Whether the query result was served from the ActiveRecord query cache. |
async | boolean | Whether the query was executed asynchronously. |
request_id | string | Rails request UUID. Shared by all events from the same HTTP request. |
instrumenter_id | string | Unique identifier for the ActiveSupport::Notifications instrumentation request, assigned by Rails. |
hostname | string | Server hostname. Attached to every event by default (events.attach_hostname). |
environment | string | Application 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"}