internal AgentComponents(
            IApmLogger logger,
            IConfigurationReader configurationReader,
            IPayloadSender payloadSender,
            IMetricsCollector metricsCollector,
            ICurrentExecutionSegmentsContainer currentExecutionSegmentsContainer
            )
        {
            var tempLogger = logger ?? ConsoleLogger.LoggerOrDefault(configurationReader?.LogLevel);

            ConfigurationReader = configurationReader ?? new EnvironmentConfigurationReader(tempLogger);
            Logger  = logger ?? ConsoleLogger.LoggerOrDefault(ConfigurationReader.LogLevel);
            Service = Service.GetDefaultService(ConfigurationReader, Logger);

            var systemInfoHelper = new SystemInfoHelper(Logger);
            var system           = systemInfoHelper.ReadContainerId(Logger);

            PayloadSender = payloadSender ?? new PayloadSenderV2(Logger, ConfigurationReader, Service, system);

            MetricsCollector = metricsCollector ?? new MetricsCollector(Logger, PayloadSender, ConfigurationReader);
            MetricsCollector.StartCollecting();

            TracerInternal = new Tracer(Logger, Service, PayloadSender, ConfigurationReader,
                                        currentExecutionSegmentsContainer ?? new CurrentExecutionSegmentsContainer(Logger));
        }
        public AgentComponents(
            IApmLogger logger = null,
            IConfigurationReader configurationReader = null,
            IPayloadSender payloadSender             = null
            )
        {
            Logger = logger ?? ConsoleLogger.LoggerOrDefault(configurationReader?.LogLevel);
            ConfigurationReader = configurationReader ?? new EnvironmentConfigurationReader(Logger);
            Service             = Service.GetDefaultService(ConfigurationReader, Logger);

            var systemInfoHelper = new SystemInfoHelper(Logger);
            var system           = systemInfoHelper.ReadContainerId(Logger);

            PayloadSender = payloadSender ?? new PayloadSenderV2(Logger, ConfigurationReader, Service, system);

            MetricsCollector = new MetricsCollector(Logger, PayloadSender, ConfigurationReader);
            MetricsCollector.StartCollecting();

            TracerInternal       = new Tracer(Logger, Service, PayloadSender, ConfigurationReader);
            TransactionContainer = new TransactionContainer();
        }