I just tried switching the opentelemetry processor to stdout instead of sending it to Honeycomb to see if it was even running using this config directly in runtime.exs
above the if config_env() == :prod do
statement.
config :opentelemetry, :processors,
otel_batch_processor: %{
exporter: {:otel_exporter_stdout, []}
}
Here are the logs from the deploy and subsequent call that should have logged telemetry data.
2022-09-10T19:22:06Z runner[ca900611] dfw [info]Starting instance
2022-09-10T19:22:06Z runner[ca900611] dfw [info]Configuring virtual machine
2022-09-10T19:22:06Z runner[ca900611] dfw [info]Pulling container image
2022-09-10T19:22:07Z runner[ca900611] dfw [info]Unpacking image
2022-09-10T19:22:08Z runner[ca900611] dfw [info]Preparing kernel init
2022-09-10T19:22:08Z runner[ca900611] dfw [info]Configuring firecracker
2022-09-10T19:22:08Z runner[ca900611] dfw [info]Starting virtual machine
2022-09-10T19:22:08Z app[ca900611] dfw [info]Starting init (commit: 249766e)...
2022-09-10T19:22:08Z app[ca900611] dfw [info]Setting up swapspace version 1, size = 512 MiB (536866816 bytes)
2022-09-10T19:22:08Z app[ca900611] dfw [info]no label, UUID=c073199d-abba-47a1-80cb-4d0794229080
2022-09-10T19:22:08Z app[ca900611] dfw [info]Preparing to run: `/app/bin/migrate` as nobody
2022-09-10T19:22:08Z app[ca900611] dfw [info]2022/09/10 19:22:08 listening on [fdaa:0:869c:a7b:cf99:ca90:611:2]:22 (DNS: [fdaa::3]:53)
2022-09-10T19:22:10Z app[ca900611] dfw [info]19:22:10.966 [info] Migrations already up
2022-09-10T19:22:11Z app[ca900611] dfw [info]Starting clean up.
2022-09-10T19:22:32Z runner[a05fbf8c] sjc [info]Shutting down virtual machine
2022-09-10T19:22:32Z app[a05fbf8c] sjc [info]Sending signal SIGTERM to main child process w/ PID 515
2022-09-10T19:22:32Z app[a05fbf8c] sjc [info]19:22:32.125 [notice] SIGTERM received - shutting down
2022-09-10T19:22:32Z app[b65b9934] dfw [info]19:22:32.567 [info] [libcluster:fly6pn] disconnected from :"reel-prod@fdaa:0:869c:a7b:b389:a05f:bf8c:2"
2022-09-10T19:22:32Z app[b65b9934] dfw [info]19:22:32.567 [info] Dropping node :"reel-prod@fdaa:0:869c:a7b:b389:a05f:bf8c:2" for region sjc
2022-09-10T19:22:34Z app[a05fbf8c] sjc [info]Starting clean up.
2022-09-10T19:22:35Z runner[b09fb331] sjc [info]Starting instance
2022-09-10T19:22:36Z runner[b09fb331] sjc [info]Configuring virtual machine
2022-09-10T19:22:36Z runner[b09fb331] sjc [info]Pulling container image
2022-09-10T19:22:38Z runner[b09fb331] sjc [info]Unpacking image
2022-09-10T19:22:39Z runner[b09fb331] sjc [info]Preparing kernel init
2022-09-10T19:22:39Z runner[b09fb331] sjc [info]Configuring firecracker
2022-09-10T19:22:39Z runner[b09fb331] sjc [info]Starting virtual machine
2022-09-10T19:22:39Z app[b09fb331] sjc [info]Starting init (commit: 249766e)...
2022-09-10T19:22:39Z app[b09fb331] sjc [info]Preparing to run: `/app/bin/server` as nobody
2022-09-10T19:22:39Z app[b09fb331] sjc [info]2022/09/10 19:22:39 listening on [fdaa:0:869c:a7b:b389:b09f:b331:2]:22 (DNS: [fdaa::3]:53)
2022-09-10T19:22:42Z app[b65b9934] dfw [info]19:22:42.684 [warning] [libcluster:fly6pn] unable to connect to :"reel-prod@fdaa:0:869c:a7b:b389:b09f:b331:2"
2022-09-10T19:22:42Z app[b09fb331] sjc [info]19:22:42.837 [info] Running ReelWeb.Endpoint with cowboy 2.9.0 at :::8080 (http)
2022-09-10T19:22:42Z app[b09fb331] sjc [info]19:22:42.840 [info] Access ReelWeb.Endpoint at https://reel-prod.fly.dev
2022-09-10T19:22:43Z app[b09fb331] sjc [info]19:22:43.231 [info] [libcluster:fly6pn] connected to :"reel-prod@fdaa:0:869c:a7b:cf99:b65b:9934:2"
2022-09-10T19:22:43Z app[b65b9934] dfw [info]19:22:43.303 [info] Discovered node :"reel-prod@fdaa:0:869c:a7b:b389:b09f:b331:2" in region sjc
2022-09-10T19:22:43Z app[b09fb331] sjc [info]19:22:43.328 [info] Discovered node :"reel-prod@fdaa:0:869c:a7b:cf99:b65b:9934:2" in region dfw
2022-09-10T19:22:43Z app[b09fb331] sjc [info]19:22:43.529 [notice] global: Name conflict terminating {Swoosh.Adapters.Local.Storage.Memory, #PID<47718.2251.0>}
2022-09-10T19:23:23Z runner[b65b9934] dfw [info]Shutting down virtual machine
2022-09-10T19:23:23Z app[b65b9934] dfw [info]Sending signal SIGTERM to main child process w/ PID 515
2022-09-10T19:23:23Z app[b65b9934] dfw [info]19:23:23.616 [notice] SIGTERM received - shutting down
2022-09-10T19:23:24Z app[b09fb331] sjc [info]19:23:24.657 [info] Dropping node :"reel-prod@fdaa:0:869c:a7b:cf99:b65b:9934:2" for region dfw
2022-09-10T19:23:25Z app[b65b9934] dfw [info]Starting clean up.
2022-09-10T19:23:28Z runner[0de1a07d] dfw [info]Starting instance
2022-09-10T19:23:28Z runner[0de1a07d] dfw [info]Configuring virtual machine
2022-09-10T19:23:28Z runner[0de1a07d] dfw [info]Pulling container image
2022-09-10T19:23:29Z runner[0de1a07d] dfw [info]Unpacking image
2022-09-10T19:23:29Z runner[0de1a07d] dfw [info]Preparing kernel init
2022-09-10T19:23:29Z runner[0de1a07d] dfw [info]Configuring firecracker
2022-09-10T19:23:29Z runner[0de1a07d] dfw [info]Starting virtual machine
2022-09-10T19:23:29Z app[0de1a07d] dfw [info]Starting init (commit: 249766e)...
2022-09-10T19:23:29Z app[0de1a07d] dfw [info]Preparing to run: `/app/bin/server` as nobody
2022-09-10T19:23:29Z app[0de1a07d] dfw [info]2022/09/10 19:23:29 listening on [fdaa:0:869c:a7b:cf99:de1:a07d:2]:22 (DNS: [fdaa::3]:53)
2022-09-10T19:23:32Z app[0de1a07d] dfw [info]19:23:32.466 [info] Running ReelWeb.Endpoint with cowboy 2.9.0 at :::8080 (http)
2022-09-10T19:23:32Z app[0de1a07d] dfw [info]19:23:32.468 [info] Access ReelWeb.Endpoint at https://reel-prod.fly.dev
2022-09-10T19:23:32Z app[0de1a07d] dfw [info]19:23:32.846 [info] [libcluster:fly6pn] connected to :"reel-prod@fdaa:0:869c:a7b:b389:b09f:b331:2"
2022-09-10T19:23:32Z app[b09fb331] sjc [info]19:23:32.919 [info] Discovered node :"reel-prod@fdaa:0:869c:a7b:cf99:de1:a07d:2" in region dfw
2022-09-10T19:23:32Z app[0de1a07d] dfw [info]19:23:32.942 [info] Discovered node :"reel-prod@fdaa:0:869c:a7b:b389:b09f:b331:2" in region sjc
2022-09-10T19:23:33Z app[b09fb331] sjc [info]19:23:33.175 [notice] global: Name conflict terminating {Swoosh.Adapters.Local.Storage.Memory, #PID<47722.2082.0>}
2022-09-10T19:24:44Z app[0de1a07d] dfw [info]19:24:44.807 request_id=FxOWPwMCzccFs78AAAHh [info] GET /
2022-09-10T19:24:44Z app[0de1a07d] dfw [info]19:24:44.818 request_id=FxOWPwMCzccFs78AAAHh [info] Sent 200 in 10ms
2022-09-10T19:24:49Z app[0de1a07d] dfw [info]19:24:49.437 request_id=FxOWQBbxV8uDvG0AAAIR [info] GET /users/settings
2022-09-10T19:24:49Z app[0de1a07d] dfw [info]19:24:49.443 request_id=FxOWQBbxV8uDvG0AAAIR [info] Sent 200 in 5ms
2022-09-10T19:24:52Z app[0de1a07d] dfw [info]19:24:52.036 request_id=FxOWQLHqO3JUUOoAAAIx [info] POST /users/settings
2022-09-10T19:24:52Z app[0de1a07d] dfw [info]19:24:52.046 request_id=FxOWQLHqO3JUUOoAAAIx [info] Sent 302 in 9ms
2022-09-10T19:24:52Z app[0de1a07d] dfw [info]19:24:52.098 request_id=FxOWQLWRaKLQMx0AAAJR [info] GET /
2022-09-10T19:24:52Z app[0de1a07d] dfw [info]19:24:52.102 request_id=FxOWQLWRaKLQMx0AAAJR [info] Sent 200 in 4ms
Here is what that config generates locally:
➜ reel git:(main) ✗ iex -S mix phx.server
Erlang/OTP 25 [erts-13.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
[info] Exporter :otel_exporter_stdout successfully initialized
[debug] QUERY OK db=0.1ms decode=1.5ms queue=39.1ms idle=0.0ms
select CAST(pg_last_wal_replay_lsn() AS TEXT) []
[info] Running ReelWeb.Endpoint with cowboy 2.9.0 at 127.0.0.1:4000 (http)
[info] Access ReelWeb.Endpoint at http://localhost:4000
Interactive Elixir (1.13.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> [watch] build finished, watching for changes...
Rebuilding...
Done in 115ms.
[info] GET /
[debug] Processing with ReelWeb.PageController.index/2
Parameters: %{}
Pipelines: [:browser]
[debug] QUERY OK source="users_tokens" db=2.7ms queue=0.6ms idle=1118.6ms
SELECT u1."id", u1."email", u1."name", u1."display_name", u1."confirmed_at", u1."inserted_at", u1."updated_at" FROM "users_tokens" AS u0 INNER JOIN "users" AS u1 ON u1."id" = u0."user_id" WHERE ((u0."token" = $1) AND (u0."context" = $2)) AND (u0."inserted_at" > $3::timestamp + (-(129600)::numeric * interval '1 minute')) [<<171, 105, 223, 252, 200, 247, 200, 61, 159, 94, 185, 73, 149, 188, 220, 25, 213, 196, 244, 237, 22, 189, 181, 19, 107, 185, 117, 162, 110, 175, 168, 144>>, "session", ~U[2022-09-10 19:26:16.734217Z]]
↳ ReelWeb.UserAuth.fetch_current_user/2, at: lib/reel_web/controllers/user_auth.ex:92
[info] Sent 200 in 88ms
*SPANS FOR DEBUG*
{span,159932783622264806624766945821061902995,16343692459422432525,[],
undefined,<<"/">>,server,-576460745652062625,-576460745570740208,
{attributes,128,infinity,0,
#{'http.client_ip' => <<"127.0.0.1">>,
'http.flavor' => '1.1','http.host' => <<"localhost">>,
'http.method' => <<"GET">>,'http.route' => <<"/">>,
'http.scheme' => <<"http">>,'http.status_code' => 200,
'http.target' => <<"/">>,
'http.user_agent' =>
<<"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.25.584.290 Safari/537.36">>,
'net.host.ip' => <<"127.0.0.1">>,'net.host.port' => 4000,
'net.peer.ip' => <<"127.0.0.1">>,'net.peer.port' => 61437,
'net.transport' => 'IP.TCP','phoenix.action' => index,
'phoenix.plug' => 'Elixir.ReelWeb.PageController'}},
{events,128,128,infinity,0,[]},
{links,128,128,infinity,0,[]},
undefined,1,false,
{instrumentation_scope,<<"opentelemetry_phoenix">>,<<"1.0.0">>,
undefined}}
I am reasonably sure that telemetry is not running in my released code. I have no idea why. Any insights anyone has would be appreciated.