-
Notifications
You must be signed in to change notification settings - Fork 15
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
use router dispatch start events to update name of span #4
Conversation
garthk
commented
May 23, 2020
•
edited
Loading
edited
- fix compile
- fix plug dependency
- fix tests
The test is failing because your |
Ok, I'm going to need to loop around and submit a PR for |
I can make the test pass by calling
We can compensate for that, having |
Reckon I'll apply José's hint from elixir-plug/plug#945 and take a test-only dependency on |
If one of our user's tests don't call through a `Plug.Conn.Adapter` that calls `:telemetry.execute/4` with a `[:plug_adapter, :call, :start]` event as expected, our handler will crash out loudly when their router calls `:telemetry.execute/4` with `[:plug, :router_dispatch, :start]` or `[:phoenix, :router_dispatch, :start]` if we don't take care to avoid calling `OpenTelemetry.Span.set_attribute/2` when the span context is `:undefined`.
Incorporates #1 for one-click merge convenience. |
Make requests through `Plug.Cowboy` to ensure the necessary `[:plug_adapter, :call, :start]` event, taking necessary dependencies on `hackney`, `plug`, and `plug_cowboy`. Smells more of an integration test, but gets the job done.
# for some reason Elixir removed Enum.filter_map in 1.5 | ||
# so just using Erlang's list module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use Enum.flat_map/2
. Is the concern efficiency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kinda doubt it; 𝑛=2. Just another tell that the author comes more from the Erlang side of things? I'd flat map with empty lists instead of false, yeah: this part of the diff is just mix format
doing its thing while I edit elsewhere.