Skip to content

Commit

Permalink
Small doc improcements in telemetry section (#3038)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanl authored and josevalim committed Jun 26, 2019
1 parent b6eec78 commit 9f3707f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/ecto/repo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 104,14 @@ defmodule Ecto.Repo do
end
end
and then attach this module to each event on your Application start callback:
Then, in the `Application.start/2` callback, attach the handler to this event using
a unique handler id:
:telemetry.attach("my-app-handler", [:my_app, :repo, :query], &MyApp.Telemetry.handle_event/4, %{})
:ok = :telemetry.attach("my-app-handler-id", [:my_app, :repo, :query], &MyApp.Telemetry.handle_event/4, %{})
Below we list all events developers should expect. All examples below consider
For details, see [the telemetry documentation](https://hexdocs.pm/telemetry/).
Below we list all events developers should expect from Ecto. All examples below consider
a repository named `MyApp.Repo`:
#### `[:my_app, :repo, :query]`
Expand Down

0 comments on commit 9f3707f

Please sign in to comment.