Closed barthez closed 5 years ago
This is tricky since both frameworks are involved in the request - the question is what do you want the transaction named after - the Phoenix based name or the Absinthe based name...
custom_name
is reserved for end users (via the NewRelic.set_transaction_name()
)
I believe that fist framework (deepest in the call stack) should be the one to sign off the transaction (give it its name).
Maybe it is possible to make framework_name
attribute writable only once per transaction?
There's no way to prevent it from being written more than once, but I could store it as a list and grab just the first one.
~I think it might be ideal to simply set the Phoenix name earlier in the stack and leave the behavior as is~
Actually that won't work, we don't know the controller yet in the call
, only in before_send
Upon reflection, it turns out that the first framework to set a name isn't necessarily the "deepest in the call stack", it actually just reflects where the instrumentation was inserted, not something semantic.
Nor can we really assume that the first is the "correct" one to choose - the first will actually be Plug instrumentation here, which wouldn't provide what you want either.
For now, your best be is to set a name yourself with NewRelic.set_transaction_name
Hello @binaryseed,
I noticed that transaction name isn't set properly in the middleware when I use
NewRelic.Phoenix.Transaction
.I noticed that middleware sets
framework_name
transaction attribute, but it is being overwritten inNewRelic.Phoenix.Transtion.Plug.before_send
.I think there are 2 possible solutions:
framework_name
attributecustom_name
in Absinthe middleware (which has bigger precedence overframework_name
intransform_name_attrs
.I can implement it, just tell me which solution you find better.