question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add migration guide for SharpRaven

See original GitHub issue

We currently use the legacy SharpRaven nuget package, and are looking to migrate.

Some things that are not immediately obvious from reading the documentation (my apologies if I’ve missed this information):

  • What is the replacement for SentryUserFactory?
  • Is ASP.NET (Framework) integration supported?
  • What is the replacement for LogScrubber?
  • What is the recommended way to move away from RavenClient? Currently we create a global instance at application startup, and use this throughout. With SentrySdk.Init(), all the examples use a using statement - should we initialise whenever we log an exception, or continue using a global instance and disposing on application shutdown?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bruno-garciacommented, Apr 14, 2021

Lets finally tackle this, it’s been too long.

The task should:

  • Add a sub page to the migration page: https://docs.sentry.io/platforms/dotnet/migration/ titled From SharpRaven
  • To simplify, it can be a single file on the dotnet level and there we note migration for any integration like ASP.NET
  • Add the items listed in this issue like UserFactory
  • Capturing on the background vs async. Even if not awaited, no backpressure so in high error rate it would degrade performance of the app. If you await, latecy to sending events to Sentry would affect your user experience.
  • First entry will be titled: Migrating from SharpRaven to Sentry and it should include:
  • Note the minimum .NET Framework version required: SharpRaven can run on .NET Framework 3.5 or later. Sentry on the other hand only support .NET Framework 4.6.1 and later.
  • How to Init the SDK. How to Init it for ASP.NET (install the package and AddAspNet).
  • Events are sent in the background. The IDisposable returned from Init needs to be invoked before the problem exists. On ASP.NET classic, mention Sentry.AspNet must be installed to get HTTP related information.
  • A series of: Before: await client.CaptureAsync(..) After: SentrySdk.CaptureEvent(..) (the event will be sent on a background thread and so it’ll not block the calling thread. The SharpRaven approach would not block the thread but only continue your code (i.e: return the HTTP request) once the SDK communicated with Sentry which was suboptimal.
  • Before: client.Capture(..) After: SentrySdk.CaptureEvent(..)
  • Before:
ravenClient.BeforeSend = requester =>
{
    // Here you can log data from the requester
    // or replace it entirely if you want.
    return requester;
};

After:

SentrySdk.Init(o => o.BeforeSend = e {
// Mutate the event or return null to drop it altogether
}

This should be a good start ^

List of features used used to announce to raven users: https://github.com/getsentry/raven-csharp/issues/281#issuecomment-565854063

1reaction
mrmondaycommented, Jul 18, 2019

Shall I open another issue for this?

Please feel free. Hasn’t been requested yet.

Done - #244

We have that scrubbing on the server.

This won’t cut it for cardholder data - for PCI-DSS compliance we cannot send Sentry cardholder data. There shouldn’t be any such data in exceptions anyway, but it needs to be filtered on our side just in case.

Again, thanks for your response.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migration Guide for .NET
Migrating from SharpRaven to Sentry SDK. Below are the main differences between SharpRaven and Sentry SDK, including a list of features available in...
Read more >
Using a Separate Migrations Project - EF Core
Using a separate migration project for managing database schemas with Entity Framework Core.
Read more >
Part 4, Razor Pages with EF Core migrations in ASP.NET ...
The EF Core migrations add command generated code to create the database. ... Use SSOX or SQLite tool to inspect the database.
Read more >
SharpRaven 2.4.0
The full contexts interface is accessible via the API so SDK consumers can add more context when available at the application level.
Read more >
Untitled
Here's a link to SharpRaven 's open source repository on GitHub grzybica skóry leczenie mp Add migration guide for SharpRaven #243 - GitHub ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found