prometheus-phoenix icon indicating copy to clipboard operation
prometheus-phoenix copied to clipboard

Phoenix 1.4 Phoenix.Socket struct change

Open akoutmos opened this issue 6 years ago • 5 comments
trafficstars

It looks like in Phoenix 1.4 the Phoenix.Socket struct no longer has the :transport_name field which in turns yields the following error:

[error] Instrumenter SampleApp.PhoenixInstrumenter.phoenix_channel_join/3 failed.
** (KeyError) key :transport_name not found in: %Phoenix.Socket{assigns: %{}, channel: Phoenix.LiveReloader.Channel, channel_pid: nil, endpoint: SampleAppWeb.Endpoint, handler:
Phoenix.LiveReloader.Socket, id: nil, join_ref: "1", joined: false, private: %{log_handle_in: :debug, log_join: :info}, pubsub_server: SampleApp.PubSub, ref: nil, serializer: Phoenix.Socket.V2.JSONSerializer, topic: "phoenix:live_reload", transport: :websocket, transport_pid: #PID<0.695.0>}

Any thoughts on getting around this with Phoenix 1.4?

Thanks!

akoutmos avatar Jan 06 '19 07:01 akoutmos

Possible temporary solution would be overriding default list of labels and using :transport, not :transport_name here.

deadtrickster avatar Jan 06 '19 17:01 deadtrickster

For if anyone else comes across this issue, I changed my config as follows:

config :prometheus, SampleApp.PhoenixInstrumenter,
  controller_call_labels: [:controller, :action],
  channel_join_labels: [:channel, :topic, :transport]

akoutmos avatar Jan 07 '19 00:01 akoutmos

Any plan to solve this?

jalberto avatar Feb 07 '19 10:02 jalberto

This should work with phoenix 1.4: #13

paveltyk avatar Jul 18 '19 15:07 paveltyk

Can confirm, it works for me with v1.3.0 .

smaximov avatar Jul 23 '19 07:07 smaximov