You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using your bundle and used the NameableNewrelicTransactionInterface to customize the transaction names in NewRelic dashboard, for my different message classes. Now, when I'm using the symfony/serializer I have a newrelicTransactionName property that is added to the stringified messag, which is unintended I think.
A quick fix that I found is to add a serialization configuration to my app like this one :
This is a side-effect of altering the entity/message class to implement a "getter" for the transaction name. For all that Symfony Serializer knows, it's a "real" property, since it looks for public properties and methods prefixed with get, is, has when normalizing.
This also creates another side-effect of failing to deserialize the message if there's no public property, or public setter for newrelicTransactionName (e. g. if the getNewrelicTransactionName method is implemented as returning a constant/literal string with no public property backing it or no setNewrelicTransactionName counterpart).
If using the current interface approach is ideal, I guess the "right" solution would be to include a decorator for the Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory service that automatically ignores the getNewrelicTransactionName method (and/or newrelicTransactionName property) for classes that implement NameableNewrelicTransactionInterface, injected through https://github.com/ArxusPublic/messenger-newrelic/blob/master/Resources/config/services.yaml
Otherwise, I'd suggest keeping the metadata completely isolated from the message data by using stamps, as proposed in #9
Hi,
I've been using your bundle and used the
NameableNewrelicTransactionInterface
to customize the transaction names in NewRelic dashboard, for my different message classes. Now, when I'm using thesymfony/serializer
I have anewrelicTransactionName
property that is added to the stringified messag, which is unintended I think.A quick fix that I found is to add a serialization configuration to my app like this one :
But I think it would be better to let the bundle itself handle it, with a configurable option for example.
Let me know what you think.
Cheers !
The text was updated successfully, but these errors were encountered: