Skip to content

.NET SDK redesign #1

Closed
Closed

Description

@bruno-garcia

This issue can be used to discuss the kickoff of a new API for .NET applications.

Some goals to start with are:

  • Targeting .NET Standard 2.0
    • Multi-targeting is hard. The further back you go, the harder it gets. We already have support for .NET 3.5 on the current SDK so there's no reason to attempt to support it on something we're building for the future.
    • There hasn't been any user request to .NET Standard 1.x. There are many essential APIs missing and we'd surely spend quite sometime working around that of simply leaving features off for those targets.
    • This could obviously change and if there is demand, we can simple add the other targets later. Building it on the API offered by .NET Standard 2.0 will speed up the feature rich version though.

Proposed API for sending event:

public class SentryEvent
{
    // Contains fields of the Sentry protocol 
    // This type gets serialized
}

public interface ISentryClient 
{
    Guid CaptureEvent(SentryEvent @event);
}

The client API queues the event for processing/submission via a in-memory queue. In the background there's a task which asynchronously does the event submission. For that reason the API has a IDisposable handle be invoked on app shutdown, which when invoked could block up to N seconds to ensure all events are sent to sentry or persisted to disk if that option is enabled (useful for mobile).

Convenience methods added as extensions, i.e:

public static class SentryClientExtensions
{
    SentryResponse CaptureException(
        this ISentryClient client, 
        Exception exception)
}

The client manages a background worker which invokes a transport. Different transports can be used. For example an HTTP transport should be default but one that will store the event to disk to be sent at a later time could be another one.

Milestones:

  1. The first preview release will include a subset of the interfaces and attributes spec, the HttpTransport and an Microsoft.Extensions.Logging and ASP.NET Core integrations. The extenal API should be close to the final one which is part of the Sentry SDK's unification workload.
  2. Second release will aim finishing support to the Sentry doc's spec
  3. More integrations

If you can support us by testing the previews, that'd be highly appreciated.

Activity

  1. self-assigned this
    on May 15, 2018
  2. changed the title [-]A fresh start[/-] [+].NET SDK redesign[/+] on May 15, 2018
  3. added
    Feature
    on May 15, 2018
  4. bruno-garcia commented on Aug 2, 2018

    @bruno-garcia
    MemberAuthor
  5. n55p33 commented on May 25, 2019

    @n55p33
  6. n55p33 commented on May 25, 2019

    @n55p33

    @shsh.65.65

  7. added a commit that references this issue on Dec 17, 2019
  8. added a commit that references this issue on Feb 24, 2020
  9. added a commit that references this issue on Jun 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Feature

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions