Exemple #1
0
        public SentryTarget(string dsn)
        {
            _sdk = SentrySdk.Init(o =>
            {
                o.Dsn = dsn;
                o.AttachStacktrace = true;
                o.MaxBreadcrumbs   = 200;
                o.SendDefaultPii   = false;
                o.Debug            = false;
                o.DiagnosticLevel  = SentryLevel.Debug;
                o.Release          = BuildInfo.Release;
                o.BeforeSend       = x => SentryCleanser.CleanseEvent(x);
                o.BeforeBreadcrumb = x => SentryCleanser.CleanseBreadcrumb(x);
                o.Environment      = BuildInfo.Branch;
            });

            InitializeScope();

            _debounce = new SentryDebounce();

            // initialize to true and reconfigure later
            // Otherwise it will default to false and any errors occuring
            // before config file gets read will not be filtered
            FilterEvents  = true;
            SentryEnabled = true;
        }
Exemple #2
0
        public SentryTarget(string dsn)
        {
            _sdk = SentrySdk.Init(o =>
            {
                o.Dsn = new Dsn(dsn);
                o.AttachStacktrace = true;
                o.MaxBreadcrumbs   = 200;
                o.SendDefaultPii   = false;
                o.AttachStacktrace = true;
                o.Debug            = false;
                o.DiagnosticsLevel = SentryLevel.Debug;
                o.Release          = BuildInfo.Release;
                if (PlatformInfo.IsMono)
                {
                    // Mono 6.0 broke GzipStream.WriteAsync
                    // TODO: Check specific version
                    o.RequestBodyCompressionLevel = System.IO.Compression.CompressionLevel.NoCompression;
                }
                o.BeforeSend       = x => SentryCleanser.CleanseEvent(x);
                o.BeforeBreadcrumb = x => SentryCleanser.CleanseBreadcrumb(x);
                o.Environment      = BuildInfo.Branch;
            });

            InitializeScope();

            _debounce = new SentryDebounce();

            // initialize to true and reconfigure later
            // Otherwise it will default to false and any errors occuring
            // before config file gets read will not be filtered
            FilterEvents = true;

            SentryEnabled = true;
        }
Exemple #3
0
        public SentryTarget(string dsn)
        {
            _client = new RavenClient(new Dsn(dsn), new SonarrJsonPacketFactory(), new SentryRequestFactory(), new MachineNameUserFactory())
            {
                Compression    = true,
                Environment    = RuntimeInfo.IsProduction ? "production" : "development",
                Release        = BuildInfo.Release,
                ErrorOnCapture = OnError
            };


            _client.Tags.Add("osfamily", OsInfo.Os.ToString());
            _client.Tags.Add("runtime", PlatformInfo.PlatformName);
            _client.Tags.Add("culture", Thread.CurrentThread.CurrentCulture.Name);
            _client.Tags.Add("branch", BuildInfo.Branch);
            _client.Tags.Add("version", BuildInfo.Version.ToString());

            _debounce = new SentryDebounce();
        }