phoenix icon indicating copy to clipboard operation
phoenix copied to clipboard

Channel `handle_in/3` to emit more standardized telemetry events

Open RudolfMan opened this issue 2 years ago • 1 comments

Hi there! I was working on the instrumentation of a project, particularly on the incoming events via channels. And apparently, learned that handle_in only emits [:phoenix, :channel_handeled_in] telemetry event after success.

I'd like to propose standardized set of :telemetry events for channel handle_in/3 callback, similar to those emitted by Phoenix.Router:

  • [:phoenix, :channel_handele_in, :start]
  • [:phoenix, :channel_handele_in, :stop]
  • [:phoenix, :channel_handele_in, :exception]

As if they were emitted by :telemetry.span/3. And, probably, "soft-deprecate" the existing [:phoenix, :channel_handeled_in] in favor of new events.

That would provide with better info for observability.

I put together a code change, in case it's helpful: https://github.com/phoenixframework/phoenix/compare/master...RudolfMan:handle_in_telemetry_events

RudolfMan avatar May 20 '22 08:05 RudolfMan