public static async Task <IForwarder> Create(IConfiguration configuration, string sectionName = null)
        {
            var options = configuration.GetSection(sectionName ?? DefaultConfigurationSectionName).Get <ServiceAgentOptions>();

            var logger = LoggerBuilder.Initialize(configuration);

            var metricsRegistry = MetricsRegistry.CreateRoot(configuration);

            var forwarders = await BuildServiceForwarders(logger, metricsRegistry, options);

            return(new ServiceForwarderHost(metricsRegistry, forwarders));
        }
Beispiel #2
0
        public static ClientForwarderHost Create(IConfiguration configuration)
        {
            var options = configuration.GetSection("PortBridge").Get <ClientAgentOptions>();

            var logger = LoggerBuilder.Initialize(configuration);

            logger.Information("Building Client Forwarders");

            var metricsRegistry = MetricsRegistry.CreateRoot(configuration);

            var forwarders = BuildPortForwarders(logger, metricsRegistry, options);

            return(new ClientForwarderHost(metricsRegistry, forwarders));
        }