public async Task HandleAsync(TEvent @event)
        {
            if (!_trackingSampler.DoWork())
            {
                await _handler.HandleAsync(@event);

                return;
            }

            using var scope = _withTracing ? BuildScope(@event.GetEventName()) : null;

            _qoSViolateChecker.Run();

            try
            {
                await _handler.HandleAsync(@event);
            }
            catch (Exception exception)
            {
                switch (exception)
                {
                case AppException _:
                    _qoSViolateRaiser.Raise(ViolationType.AmongServicesInconsistency);
                    break;
                }
                throw;
            }

            await _qoSViolateChecker.Analyze();
        }
        public async Task <TResult> HandleAsync(TQuery query)
        {
            if (!_trackingSampler.DoWork())
            {
                return(await _handler.HandleAsync(query));
            }

            using var scope = _withTracing ? BuildScope(query.GetQueryName()) : null;

            _qoSViolateChecker.Run();

            var queryResult = await _handler.HandleAsync(query);

            await _qoSViolateChecker.Analyze();

            return(queryResult);
        }