Grouping exceptions by fingerprint

Question about grouping: if we are using fingerprints for grouping, and at the same time we are sending stacktraces (because exception has stacktrace and we are using custom fingerprints)…who has priority for grouping ? fingerprint or stacktrace ? i guess is fingerprint…

Is because i can not visualize fingerprint from an exception in sentry.io web page at least i send fingerprint as message property of sentry event (i’m using SharpRaven libraryemphasized text), is there a way to visualize fingerprint (not using message property), is because i need to compare what kind of data is sentry using for grouping and who has priority.

Fingerprints always have priority, but if you put {{ default }} in your fingerprint, the stacktrace will become “part of” the fingerprint.

There are two practical examples on https://docs.sentry.io/data-management/rollups/?platform=javascript#custom-grouping, I hope they help.

Thanks…just a question about that link…

Here:
" The following example will just completely overwrite Sentry’s grouping by omitting {{ default }} from the array:"

If i select C# code snippet, i can see this part of the code:

@event.SetFingerprint(
                new []
                {
                    "{{ default }}",
                    ex.Function,
                    ex.Code.ToString(),
                }
            );

Seems like is not ommitting, is adding, is this correct ?

You’re right, the examples are completely swapped for C#. Thanks for bringing this to our attention! Will fix it right away.

thanks

A last question please: this code appears to be created to work in global file, comparing C# and Angular (by example) in angular you can do this using an object called Observable, this basically allows you put some pieces of code in just 1 file but this will be executed before every http call between server and cliente for example. It suppose this piece of code will work in the same way with c# ?

using (SentrySdk.Init(o =>
{
    o.BeforeSend = @event =>
    {
        if (@event.Exception is SqlConnection ex)
        {
            @event.SetFingerprint(new [] { "database-connection-error" });
        }

        return @event;
    };
}

If yes, what is the file ?

Are you asking how often the callback BeforeSend will be called? It’s called everytime your app encounters an error.

I don’t understand the question about the file. I think this is highly application dependent.