Adds readme entry on Plug.Telemetry (#20)

* adds entry about Plug.Telemetry

* Adds reference to phoenix endpoint template
This commit is contained in:
Marco "Efesto" Polita 2021-10-01 18:30:49 +02:00 committed by GitHub
parent 2e45dc6a63
commit 3334b07b9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -27,3 +27,18 @@ def deps do
end end
``` ```
## Note on phoenix integration
`OpentelemetryPhoenix` requires phoenix to use `Plug.Telemetry` in order to correctly trace endpoint calls.
The `endpoint.ex` file should look like:
```Elixir
defmodule MyApp.Endpoint do
use Phoenix.Endpoint, otp_app: :my_app
...
plug Plug.Telemetry, event_prefix: [:phoenix, :endpoint]
...
end
```
The [Phoenix endpoint.ex template](https://github.com/phoenixframework/phoenix/blob/v1.6.0/installer/templates/phx_web/endpoint.ex#L39) can be used as a reference