Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add route to the span name to Phoenix socket requests #438

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danschultzer
Copy link

This is WIP as it needs an upstream fix in Phoenix: phoenixframework/phoenix#6019

This will add a route template to the attributes, and use that for the span name. We may want to add code attributes from #432 though I'm not sure as we deal with both the socket module that is the transport (e.g. Phoenix.Transports.WebSocket) and the user socket module that's the actual socket passed into the socket macro.

@@ -145,6 +156,18 @@ defmodule OpentelemetryPhoenix do
|> OpenTelemetry.Ctx.attach()
end

@doc false
def handle_socket_dispatch_start(_event, _measurements, meta, config) do
if config.adapter == :cowboy2, do: cowboy2_start()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was necessary as it didn't update the actual span. I assume the difference from the router event is that the socket handling happens much earlier than router, and there is some handling of cowboy process in phoenix that links it correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant