From 3334b07b9ddaff9c2eadd829bdc2af8394988721 Mon Sep 17 00:00:00 2001 From: "Marco \"Efesto\" Polita" Date: Fri, 1 Oct 2021 18:30:49 +0200 Subject: [PATCH] Adds readme entry on Plug.Telemetry (#20) * adds entry about Plug.Telemetry * Adds reference to phoenix endpoint template --- instrumentation/opentelemetry_phoenix/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/instrumentation/opentelemetry_phoenix/README.md b/instrumentation/opentelemetry_phoenix/README.md index 09d0d13..dd39f0f 100644 --- a/instrumentation/opentelemetry_phoenix/README.md +++ b/instrumentation/opentelemetry_phoenix/README.md @@ -27,3 +27,18 @@ def deps do 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 +