public AgentComponents(
     AbstractLogger logger = null,
     IConfigurationReader configurationReader = null,
     Service service = null,
     IPayloadSender payloadSender = null
     )
 {
     Logger = logger ?? ConsoleLogger.Instance;
     ConfigurationReader  = configurationReader ?? new EnvironmentConfigurationReader(Logger);
     Service              = service ?? Service.GetDefaultService(ConfigurationReader);
     PayloadSender        = payloadSender ?? new PayloadSender(Logger, ConfigurationReader);
     TracerInternal       = new Tracer(Logger, Service, PayloadSender);
     TransactionContainer = new TransactionContainer();
 }
Ejemplo n.º 2
0
        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);

            PayloadSender        = payloadSender ?? new PayloadSenderV2(Logger, ConfigurationReader, Service);
            TracerInternal       = new Tracer(Logger, Service, PayloadSender, ConfigurationReader);
            TransactionContainer = new TransactionContainer();
        }
        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();
        }