ecto.query
An Ecto repository ran a database query. The event_type comes from the repo telemetry_prefix, so [:my_app, :repo, :query] becomes “my_app.repo.query”. Honeybadger skips transaction bookkeeping, schema migrations, and Oban job table queries by default.
Fields
11| Field | Type | Description |
|---|---|---|
event_type | string | |
query | string | Obfuscated SQL with bind parameters replaced by ?. |
source | string | Table/source name the query targets. |
query_time | number | Time spent executing the query in microseconds. |
decode_time | number | Time spent decoding the result in microseconds. |
queue_time | number | Time spent waiting for a database connection in microseconds. |
total_time | number | Total time including queue, query, and decode in microseconds. |
stacktrace | array<array<string>> | Formatted call stack at query time. Present when include_stacktrace is true and the repo has stacktrace enabled. |
params | array<any> | Query parameters. Present when include_params is true. |
request_id | string | Request ID from the current EventContext. |
idle_time | number | Time the connection spent idle before the query in microseconds. |
Example
{ "event_type": "my_app.repo.query", "query": "SELECT u0.\"id\", u0.\"email\", u0.\"name\" FROM \"users\" AS u0 WHERE (u0.\"id\" = $?)", "source": "users", "query_time": 3200, "decode_time": 180, "queue_time": 45, "total_time": 3425, "stacktrace": [ [ "lib/my_app/accounts.ex:27", "MyApp.Accounts.get_user!/1" ], [ "lib/my_app_web/controllers/user_controller.ex:14", "MyAppWeb.UserController.show/2" ] ], "params": [ 42 ], "request_id": "F8ZBOg1zcBQDqDgAAADx", "idle_time": 120000}