Skip to content
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

Possible duplicate exceptions when using OpenTelemetry #2519

Open
jamescrosswell opened this issue Jul 27, 2023 · 1 comment
Open

Possible duplicate exceptions when using OpenTelemetry #2519

jamescrosswell opened this issue Jul 27, 2023 · 1 comment
Labels
Bug Something isn't working OpenTelemetry

Comments

@jamescrosswell
Copy link
Collaborator

jamescrosswell commented Jul 27, 2023

The following code will result in duplicate exceptions events being reported to Sentry:

        using var activity = Telemetry.ActivitySource.StartActivity("Funny business");
        try
        {
            throw new Exception("test activity.RecordException");
        }
        catch (Exception e)
        {
            SentrySdk.CaptureException(e);
            activity?.RecordException(e);
        }

This is because when our SpanProcessor handles the OpenTelemetry span with the exception recorded in it, we don't have access to the original exception and so we have to recreate a "poor man's" exception instead.

Our deduplication then doesn't, since it matches by reference.

We could come up with a work around this but it makes more sense to address the issue in OpenTelemetry. See open-telemetry/opentelemetry-dotnet#2439 (comment) for details.

@jamescrosswell jamescrosswell changed the title Possible Duplicate events Possible duplicate exceptions when using OpenTelemetry Jul 27, 2023
@jamescrosswell
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working OpenTelemetry
Projects
Status: No status
Development

No branches or pull requests

2 participants