public SentryEvent Process(SentryEvent @event)
        {
            _options.DiagnosticLogger?.LogDebug("Running main event processor on: Event {0}", @event.EventId);

            if ([email protected](Runtime.Type) && Runtime != null)
            {
                @event.Contexts[Runtime.Type] = Runtime;
            }

            if ([email protected](OperatingSystem.Type))
            {
                // RuntimeInformation.OSDescription is throwing on Mono 5.12
                if (!PlatformAbstractions.Runtime.Current.IsMono())
                {
                    @event.Contexts.OperatingSystem.RawDescription = RuntimeInformation.OSDescription;
                }
            }

            if (TimeZoneInfo.Local is { } timeZoneInfo)
            {
                @event.Contexts.Device.Timezone = timeZoneInfo;
            }

            const string currentUiCultureKey = "CurrentUICulture";

            if ([email protected](currentUiCultureKey) &&
                CultureInfoToDictionary(CultureInfo.CurrentUICulture) is { } currentUiCultureMap)
            {
                @event.Contexts[currentUiCultureKey] = currentUiCultureMap;
            }

            const string cultureInfoKey = "CurrentCulture";

            if ([email protected](cultureInfoKey) &&
                CultureInfoToDictionary(CultureInfo.CurrentCulture) is { } currentCultureMap)
            {
                @event.Contexts[cultureInfoKey] = currentCultureMap;
            }

            @event.Platform = Protocol.Constants.Platform;

            if (@event.Sdk != null)
            {
                // SDK Name/Version might have be already set by an outer package
                // e.g: ASP.NET Core can set itself as the SDK
                if (@event.Sdk.Version == null && @event.Sdk.Name == null)
                {
                    @event.Sdk.Name    = Constants.SdkName;
                    @event.Sdk.Version = NameAndVersion.Version;
                }

                if (NameAndVersion.Version != null)
                {
                    @event.Sdk.AddPackage(ProtocolPackageName, NameAndVersion.Version);
                }
            }

            // Report local user if opt-in PII, no user was already set to event and feature not opted-out:
            if (_options.SendDefaultPii)
            {
                if (_options.IsEnvironmentUser && [email protected]())
                {
                    @event.User.Username = Environment.UserName;
                }
                @event.User.IpAddress ??= UserIpServerInferred;
            }

            if (@event.ServerName == null)
            {
                // Value set on the options take precedence over device name.
                if (!string.IsNullOrEmpty(_options.ServerName))
                {
                    @event.ServerName = _options.ServerName;
                }
                else if (_options.SendDefaultPii)
                {
                    @event.ServerName = Environment.MachineName;
                }
            }

            if (@event.Level == null)
            {
                @event.Level = SentryLevel.Error;
            }

            if (@event.Release == null)
            {
                @event.Release = _options.Release ?? Release;
            }

            // Recommendation: The 'Environment' setting should always be set
            //                 with a default fallback.
            if (string.IsNullOrWhiteSpace(@event.Environment))
            {
                var foundEnvironment = EnvironmentLocator.Locate();
                @event.Environment = string.IsNullOrWhiteSpace(foundEnvironment)
                    ? string.IsNullOrWhiteSpace(_options.Environment)
                        ? Constants.ProductionEnvironmentSetting
                        : _options.Environment
                    : foundEnvironment;
            }

            if (@event.Exception == null)
            {
                var stackTrace = SentryStackTraceFactoryAccessor().Create(@event.Exception);
                if (stackTrace != null)
                {
                    var thread = new SentryThread
                    {
                        Crashed    = false,
                        Current    = true,
                        Name       = Thread.CurrentThread.Name,
                        Id         = Thread.CurrentThread.ManagedThreadId,
                        Stacktrace = stackTrace
                    };

                    @event.SentryThreads = @event.SentryThreads?.Any() == true
                        ? new List <SentryThread>(@event.SentryThreads)
                    {
                        thread
                    }
                        : new[] { thread }.AsEnumerable();
                }
            }

            if (_options.ReportAssemblies)
            {
                foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
                {
                    if (assembly.IsDynamic)
                    {
                        continue;
                    }

                    var asmName = assembly.GetName();
                    if (asmName.Name is not null && asmName.Version is not null)
                    {
                        @event.Modules[asmName.Name] = asmName.Version.ToString();
                    }
                }
            }

            _options.ApplyDefaultTags(@event);

            return(@event);
        }