Fix default fingerprinting when using synthetic traces #1246
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think I've found a bug w/ fingerprinting and synthetic traces.
When using synthetic traces via the globalOption
stracktrace: true
, there is an attempt to maintain the legacy grouping behavior andfingerprint on msg, not stack trace
.Looks like when this was implemented, there was a few oversights. Here is the breaking code
fingerprint
is dropped and never gets to sentryfingerprint
value is of the wrong typeFirst, there is an attempt to create a default
fingerprint
from themsg
param passed tocaptureMessage
. Thefingerprint
property is added to theoptions
variable but the values fromoptions
are not merged back todata
after thefingerprint
property is set. The end-result is thatfingerprint
ends up getting dropped and it never makes it to sentry.The other issue w/ the existing code is that
fingerprint
is set to a string value. Sentry does not like raw strings and it will ignore thefingerprint
unless its an array of strings. I've modified thefingerprint
value to be an array of strings.Here is my setup and some of the JSON payloads to make things a little clearer.
Sentry 8.22.0
Raven 3.23.1
Config:
{stacktrace: true}
before the fixes: (notice the
["{{ default }}"]
fingerprint)after including the
fingerprint
as a string: (note thefingerprint
and theerrors
)after including the
fingerprint
as an array: