Giter Site home page Giter Site logo

getsentry / raven-csharp Goto Github PK

View Code? Open in Web Editor NEW
231.0 69.0 122.0 2.38 MB

Superseded by: https://github.com/getsentry/sentry-dotnet

License: BSD 3-Clause "New" or "Revised" License

C# 98.58% HTML 0.11% PowerShell 0.90% Shell 0.41%
c-sharp crash-reporting crash-reports error-monitoring tag-archived

raven-csharp's Issues

Modules property is not serialized as well

Hello, it's seems Modules property on JsonPacket is not serialized like sentry specification require. Instead of

{
    "modules": {
        "my.module.name": "1.0"
    }
}

Modules is serialized as

{
    "modules": [
        { "Name": "my.module.name", "Version": "1.0" }
    ]
}

Here xpicio@60dd480 can you find my fix. Is it my bad or a bug ?

Bye Bye

NuGet package doesn't contain libs ?

Hi,

I've tried to install raven-csharp through NuGet. In theory it went well, but in the end packages folder
doesn't contain any dll's.
All I got was:
raven-csharp.1.0.1.nupkg
SharpRaven.xml

Dependency do Newtonsoft.Json was alright.

Thanks in advance!
Marcin

User is not populated properly in some cases

We noticed that in some cases the user passed to GetSentry is not populated correctly in GetSentry

Looking at
https://github.com/getsentry/raven-csharp/blob/develop/src/app/SharpRaven/RavenClient.cs#L288

 packet.User = packet.User ?? this.sentryUserFactory.Create();
 packet.Request = packet.Request ?? this.sentryRequestFactory.Create();

This tweak is fixing the issue

packet.Request = packet.Request ?? this.sentryRequestFactory.Create();
packet.User = packet.User ?? this.sentryUserFactory.Create();

As SentryUser Create() method rely on SentryRequestFactory

  public SentryUser Create()
        {
            SentryUser user;
            if (!SentryRequestFactory.HasHttpContext)
                user = new SentryUser(Environment.UserName);
            else
            {
                user = new SentryUser(GetPrincipal())
                {
                    IpAddress = GetIpAddress()
                };
            }

            return OnCreate(user);
        }

Enable symbol and source for the NuGet package

I've had to disable the Include sources and symbols checkbox in TeamCity due to a bug in NuGet that causes the build to blow up with the following exception:

[04:31:23][push] Failed to process request. 'Package submission failed: Source file d:\BuildAgent-01\work\b2f932b5a0190733\SharpRaven\Data\JsonPacket.cs not found in package. Source file is declared in SharpRaven.pdb. . See http://www.symbolsource.org/Public/Home/Help for possible reasons. Fiddler may help diagnosing this error if your client discards attached detailed information.'. 
[04:31:23][push] The remote server returned an error: (506) Package submission failed: Source file d:\BuildAgent-01\work\b2f932b5a0190733\SharpRaven\Data\JsonPacket.cs not found in package. Source file is declared in SharpRaven.pdb. . See http://www.symbolsource.org/Public/Home/Help for possible reasons. Fiddler may help diagnosing this error if your client discards attached detailed information...
[04:31:23][push] Process exited with code 1

It would be neat if we could circumvent this bug so we could publish SharpRaven's symbols and source code to SymbolSource.

NuGet Pack SharpRaven.Nancy.csproj fails

This command:

NuGet pack app\SharpRaven.Nancy\SharpRaven.Nancy.csproj -Properties ReleaseNotes='Test' -Verbosity detailed

fails with the following error message:

NuGet.CommandLineException: Unable to find 'SharpRaven.Nancy.dll'. Make sure the project has been built.
   at NuGet.Commands.ProjectFactory.BuildProject()
   at NuGet.Commands.ProjectFactory.CreateBuilder(String basePath)
   at NuGet.Commands.PackCommand.BuildFromProjectFile(String path)
   at NuGet.Commands.PackCommand.BuildPackage(String path)
   at NuGet.Commands.PackCommand.ExecuteCommand()
   at NuGet.Commands.Command.Execute()
   at NuGet.Program.Main(String[] args)

Before this is fixed, we can't release version 2 or a new prerelease version of SharpRaven.

Error level and extra on messages with new Capture API.

Hi, is there any way to set level to Info and to add extra objects to messages when you use new Capture API (CaptureMessage is marked as obsolete)? I have tried:

Capture(new SentryEvent(new SentryMessage(message)) { Extra = myObj });

but it didn't work for me. Setting level this way didn't work either. I have always log level Error.

Thanks

Can't report exceptions

Hi,

I can successfully see a CaptureMessage on Sentry, but when I do CaptureException everything goes fine, but I don't see the exception on Sentry (even after waiting a while).
I am testing with the divide by zero example.
What could cause that?

Thank you!

Unable to set tags in 2.0

Just downloaded the new 2.0 version and it looks like i am no longer able to set the tags in the new Capture method. The old CaptureEvent does support a dictionary with tags as parameter but seems to be tagged as obsolete. How are we supposed to set tags in the new version?

Can we change the target framework to 4.5?

Hi,
Can we change the target framework to 4.5?
I made some async methods using the HttpClient, inside the System.Net.Http.dll assembly.

public async Task CaptureExceptionAsync(Exception e, IDictionary<string, string> tags = null, object extra = null)

public async Task CaptureMessageAsync(string message, ErrorLevel level = ErrorLevel.info, IDictionary<string, string> tags = null, object extra = null)

private async Task SendAsync(JsonPacket packet, DSN dsn)

[]'s
Bruno

No timeout

Today, the Getsentry's website is down (302 after 30 seconds) and we have just detected that there is no timeout in the Raven client. We reviewed the code in github

Thread Safety

Hello,

Is Raven C# client thread safe?

Can I have a single instance per application? or instance per request?

What is the best practice?

Thanks.

GetFilename returns null

If you are running with a release build, then you can't get the filename for the stack trace as it returns null. When this json is sent to sentry 5.3.3 it raises an exception in sentry as its expecting the filename(see below). For now we have put a hack that sets the filename to http://unknown.com/unknown.exe. I know this is not the correct approach and haven't raised a pull request but it may be something you guys want to look into.
Error rendering interface <class 'sentry.interfaces.Stacktrace'>

Thanks for the dll, aside from that it is working well.

Stacktrace (most recent call last):

File "sentry/templatetags/sentry_helpers.py", line 344, in get_rendered_interfaces
html = interface.to_html(event)
File "sentry/interfaces.py", line 392, in to_html
format=True,
File "sentry/interfaces.py", line 60, in get_context
if filename.startswith(('http:', 'https:')) and '.' not in filename.rsplit('/', 1)[-1]:

Enable easier event building for context supports

Right now it seems fairly complex to utilize User/Http contexts. It might make sense to do something similar to the following pattern for APIs:

event = Raven.GetEventFromError(...)
event.User = UserInterface(...)
Raven.Send(event)

(Pardon my entire lack of familiarity with C# :)

Logger Seems Like It Should Be A Property of the Message, Not the Client

There is currently no way to set an out-going Sentry message's Logger without setting it through the client. Unfortunately, I'm not sure it makes sense to tie the logger name to the client since client to loggers to clients may have a one to many relationship. I might suggest to have the logger be a optional parameter on the CaptureMessage or CaptureException methods and remove the Logger property from the client.

HttpWebResponse's aren't closed or disposed breaking the client.

This behaviour has been around for a while. I'd say that under normal circumstances these responses would be cleaned up by GC, however when using the client to dump large amounts of data into Sentry it would reliably break on the third log call, something like:

var sentry = new RavenClient...

for(int i = 0; i < 200; i++) {
    sentry.CaptureMessage("Hello " + i);
}

Move towards an Event Builder

The current way that events are generated makes it tough to handle a lot of arbitrary attribute (due to C#'s lack of something like kwargs).

For example, every time a new arg is added, it gets added to CaptureException, and thus to JSONPacketFactory.Create.

It'd make sense to take the unique bits (exception) and split them into their own generative items, possibly something akin to:

event = BuildEvent()
event.tags = ...
client.Capture(event)

SharpRaven messages not getting to GetSentry for some requests

I'm using Log4net / SharpRaven / SentryAppender in a Web.API project with a custom IExceptionLogger set up to send exceptions to Sentry.

Locally, when testing with Postman, exceptions are thrown and they appear in Sentry a few seconds later. On production, when testing exceptions from a browser window the same happens.

However when a different internal server uses the API exceptions just disappear:

  • log4net has no configuration issues and nothing in the trace log.
  • Exceptions are being caught and e-mailed to me, so I know the IExceptionLogger is working.
  • To rule out log4net or SentryAppender bug I have temporarily added direct exception reporting with the RavenClient and the behaviour is the same. Local OK, production OK when serving a local request, nothing from production when serving a remote request.

I'm using v1.5

I'm going to continue to investigate (for e.g. updating Newtonsoft.JSON, trying a SharpRaven pre-release package, logging something that's not an exception) but I thought I'd open this bug in case there was something else I could do to investigate.

PCL Support for MonoTouch

I'd love to see PCL support for MonoTouch so I can use this in my iOS applications. I'd be happy to put the PR in if you're in agreement and don't already have that work underway.

Exception.Data in RavenSharp 1.5.1 ?

Is Exception.Data included in RavenSharp 1.5.1?
I'm trying out stuff like:

ex.Data.Add("Hello world", "Hello");
ravenClient.CaptureException(ex);

But I'm not seeing the "Hello world" in Sentry. I also can't find it in the actual submission to Sentry (as seen with Fiddler), so I suspect it's never sent. Is #87 not in 1.5.1 ?

Value does not fall within the expected range in SharpRaven.Data.SentryRequest.GetUser()

Have found that I am occasionally receiving this exception from within the Sentry Request class. It looks like the source is the HttpContext.Request.UserHostAddress property (source-below). Are you able to offer any insights as to why this may be happening?

return new SentryUser(HttpContext.User as IPrincipal)
{
IpAddress = HttpContext.Request.UserHostAddress
};

Automatically pass Client Application Assembly Version

A little bit like some other raven implemntation that forward information that come with the runtime to Sentry.

Should Raven C# forward Assembly.GetExecutingAssembly().GetName().Version.ToString() automatically?

This is usually always available to any apps, right? (I don't know C#/.NET).

Make SharpRaven less System.Web hosting oriented

We are using Sentry for both server side and client side logging, but currently it is very much designed around System.Web from a hosting perspective.

It would be desirable to be able to specify username, device name and general request info both as client and specific request data rather than it always being automatically fetched.

Our use case is that we have servers servicing requests, which doesn't necessarily use System.Web but is instead a native code Mongoose web server. The .NET code is invoked as services running on that server, but there is no HttpContext available.

We also have client devices written using Xamarin, and they have a user id (which is the users authentication name), a device id (reported by the operating system) and a device name (given by the user in order to easily identify the device and where it belongs).

Currently we post this data as additional data, but this currently limits sentry's usefulness to us.

Nuget package

Publishing as nuget package would make use in .NET projects significantly simpler.

@dcramer mentioned in #8 he has a local branch with nuget working. I was also doing this internally but can wait if @dcramer is farther.

The hard part is answering these questions:

  • What is the versioning strategy? Currently 0.7.8.0 and hasn't changed: https://github.com/getsentry/raven-csharp/blob/master/SharpRaven/Properties/AssemblyInfo.cs
    • Typically I'd default to 0.7.8.%build.number% or 0.7.%build.number% but that means this library may not sync with other Sentry client's version numbers. Is that ok?
  • How is a "release" build determined? Nuget has support for pre-release versions which can be done every check-in, but it's also nice to have an official "release" as opposed to "what happens to be in source control repository today".

As I said, I had started this already. Here's the nuspec file I created:

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
    <metadata>
        <id>SharpRaven</id>
        <version>$version$</version>
        <title>.NET client for Sentry (getsentry.com)</title>
        <authors>David Cramer,GetSentry.com</authors>
        <owners>gmaclellan</owners>
        <licenseUrl>https://github.com/getsentry/sentry/blob/master/LICENSE</licenseUrl>
        <projectUrl>https://github.com/getsentry/raven-csharp</projectUrl>
        <iconUrl>https://www.getsentry.com/_static/getsentry/images/favicon.png</iconUrl>
        <requireLicenseAcceptance>false</requireLicenseAcceptance>
        <description>Raven is a C# client for Sentry (getsentry.com and github.com/getsentry/sentry)</description>
        <dependencies>
            <dependency id="Newtonsoft.Json" version="4.5.11" />
        </dependencies>
    </metadata>
</package>

I have a Teamcity CI server that I'm willing to publish to nuget.org from, if there are no objections and I can get some guidance on how to version things.

That said, I'm happier (and it make more sense) if someone on the actual Sentry team can maintain the C# client and nuget packages. Presumably you guys have CI -- I have lots of experience with this sort of stuff so let me know if I can help.

NRE in ExceptionFrame.cs (or maybe a mono bug)

Hi,

I have an issue where the following stack trace is emitted:

[ERROR] System.NullReferenceException: Object reference not set to an instance of an object
  at SharpRaven.Data.ExceptionFrame..ctor (System.Diagnostics.StackFrame frame) [0x00034] in /Users/bob/src/raven-csharp/src/app/SharpRaven/Data/ExceptionFrame.cs:64 
  at SharpRaven.Data.SentryStacktrace..ctor (System.Exception exception) [0x00043] in /Users/bob/src/raven-csharp/src/app/SharpRaven/Data/SentryStacktrace.cs:66 
  at SharpRaven.Data.SentryException..ctor (System.Exception exception) [0x00042] in /Users/bob/src/raven-csharp/src/app/SharpRaven/Data/SentryException.cs:60 
  at SharpRaven.Data.JsonPacket..ctor (System.String project, System.Exception exception) [0x00092] in /Users/bob/src/raven-csharp/src/app/SharpRaven/Data/JsonPacket.cs:77 
  at SharpRaven.Data.JsonPacketFactory.Create (System.String project, System.Exception exception, SharpRaven.Data.SentryMessage message, ErrorLevel level, IDictionary`2 tags, System.Object extra) [0x00000] in /Users/bob/src/raven-csharp/src/app/SharpRaven/Data/JsonPacketFactory.cs:101 
  at SharpRaven.RavenClient.CaptureException (System.Exception exception, SharpRaven.Data.SentryMessage message, ErrorLevel level, IDictionary`2 tags, System.Object extra) [0x00000] in /Users/bob/src/raven-csharp/src/app/SharpRaven/RavenClient.cs:153 

The problem is that code on line 64

62            var method = frame.GetMethod();
63            Filename = frame.GetFileName();
64            Module = (method.DeclaringType != null) ? method.DeclaringType.FullName : null;

is expecting for the method variable to be non-null as it is dereferencing method.DeclaringType immediately. In my case, however, this assumption fails for some reason and then I get a NRE.

The platform is mono 4.2.1 x86, raven-csharp @ master (commit 74a7710).

I think it might be a mono bug, but not so sure. MS documentation on StackFrame.GetMethod does not apparently say anything on the possibility for the object returned to be null. Thus I assume this is a mono bug?

Should there be a workaround in the meantime for this? What is the policy for commits agains bugs in the underlying platform?

Error Level not working (SharpRaven.2.1.0-unstable0020)

Hey,

I'm testing the realease 2.1.0-unstable0020 and I can't set the Error Level status, always return "Error" status.

(...) @event.Level = ErrorLevel.Debug; raven.Capture(@event);

Even with the old api!

raven.CaptureMessage(msg, ErrorLevel.Debug);

Thanks

RateLimit

Hi, is there any Plan to support rate limiting?

Easy integration with ASP.NET MVC

Once issue #17 is resolved, it would be nice if there was a nuget package to easily integrate exception handling with ASP.NET MVC apps, similar to https://github.com/alexanderbeletsky/elmah.mvc for Elmah.

I figure it should be a different project from raven-csharp (maybe raven-aspnet-mvc?), although I know the raven-python has Django/Flask/etc. If it is a separate project, should it be part of the getsentry organization, or should I start it under my personal projects?

Make integration tests self hosted

As mentioned in #53, the current integration tests are based on posting JSON documents to the live Sentry backend, which is sub-optimal. At least until getsentry/sentry#1018 is implemented, but perhaps even after that, it could be useful if the integration tests instead fired up a self-hosted version of the Python backend and posted JSON to it instead.

Send to analysis a text long (log) to Sentry (Initial version with send for Microsoft Storage)

Hi guys!

We have decided to use to getsentry to capture errors and information. So, in specials situations, i had that capture a long text to analyse sent from desktop applications.

The better solution was to send the file to Microsoft Storage and in the extra message of the Sentry put the link to access the file.

Maybe someone has a similar situation. Then I put in NuGet and Github.

Source: https://github.com/samukce/raven-csharp-extra-cloudstorage
https://www.nuget.org/packages/SharpRaven.ToStorage/

Strong Naming

Hello,

Are there any plans to add a strong name to the assembly? Unfortunately without a strong name, it means you can't reference the library by assemblies that are strong named. For the time being I've forked the repro to add my own strong name, but then I loose out on NuGet and source updates.

Regards;
Richard Moss

'exception' and/or 'timestamp' values are randomly being discarded in Sentry

We've been using Raven and Sentry for a while now, and have always had an issue with exception data sometimes being unavailable in Sentry for no apparent reason. Testing it we've so far been able to reproduce it, and it seems to happen randomly or possibly only for certain users - but a huge lot of them.

Recentry, Sentry added a notification when it happens, so now when exception data is missing for an event I see:

There were 2 errors encountered while processing this event.
Discarded invalid value for parameter 'timestamp'
Discarded invalid value for parameter 'exception'

Sometimes just for the 'exception' value, other times for both. Never for 'timestamp' alone I believe - but I would need to go through a lot of the events to check.

I've spoken with the Sentry team and they believe it's related to unicode characters somehow - but have so far been unable to spend more time looking into it.

Is there anything you guys can think of that could be causing this? My theory is it might be related to the obfuscation we're doing for the release version - which would explain why I can't reproduce it since my dev version isn't obfuscated.

Unable to resolve dependencies 'SharpRaven 2.0.0-unstable0211'

Hello, installing the develop package SharpRaven.Nancy i get the following error message:

Attempting to gather dependencies information for package 'SharpRaven.Nancy.2.0.0-unstable0211' with respect to project 'Service.API', targeting '.NETFramework,Version=v4.5.2'
Attempting to resolve dependencies for package 'SharpRaven.Nancy.2.0.0-unstable0211' with DependencyBehavior 'Lowest'
Unable to resolve dependencies. 'SharpRaven 2.0.0-unstable0211' is not compatible with 'SharpRaven.Nancy 2.0.0-unstable0211 constraint: SharpRaven (≥ 2.0.0)'.

Url tag value is maintained throughout exceptions

Currently testing some exceptions and noticed that the Url tag keeps the same value as the first exception when viewed in sentry dashboard. Any consecutive exceptions will always have the same url tag value as the initial one.
Have tried overriding it when creating an sentry event but that did not work.
I can get it to work by initialising a new ravenclient on every exception but that seems a bit too much i think.

Ability to set the SentryUser via the SentryEvent interface?

I don't see a clean way to access the properties of the SentryUser via the new SentryEvent Capture interface.

Currently, I'm setting some tags to be able to filter the user, but would like to access the SentryUser to be able to set the fields programmatically.

PCL support?

Do you have plans to ship assemblies for .net portable too?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.