public ClientDiagnosticProcessor(IExitSegmentContextAccessor segmentContextAccessor,
                                  ITracingContext tracingContext, IConfigAccessor configAccessor)
 {
     _tracingContext         = tracingContext;
     _segmentContextAccessor = segmentContextAccessor;
     _tracingConfig          = configAccessor.Get <TracingConfig>();
 }
 public ServerDiagnosticProcessor(IEntrySegmentContextAccessor segmentContextAccessor,
                                  ITracingContext tracingContext, IConfigAccessor configAccessor)
 {
     _tracingContext         = tracingContext;
     _segmentContextAccessor = segmentContextAccessor;
     _tracingConfig          = configAccessor.Get <TracingConfig>();
 }
Esempio n. 3
0
 public SegmentReporter(ConnectionManager connectionManager, IConfigAccessor configAccessor,
                        ILoggerFactory loggerFactory)
 {
     _transportConfig   = configAccessor.Get <TransportConfig>();
     _segmentReporterV5 = new V5.SegmentReporter(connectionManager, configAccessor, loggerFactory);
     _segmentReporterV6 = new V6.SegmentReporter(connectionManager, configAccessor, loggerFactory);
 }
Esempio n. 4
0
        public static ConfigParameter CreateConfigParameter(IConfigAccessor configAccessor, ConfigParameterData configParameterData)
        {
            Verify.Argument.IsNotNull(configAccessor, "configAccessor");
            Verify.Argument.IsNotNull(configParameterData, "configParameterData");

            switch (configParameterData.ConfigFile)
            {
            case ConfigFile.Repository:
                throw new ArgumentException("Config file cannot be 'Repository'.", "configParameterData");

            case ConfigFile.Other:
                return(new ConfigParameter(
                           configAccessor,
                           configParameterData.SpecifiedFile,
                           configParameterData.Name,
                           configParameterData.Value));

            default:
                return(new ConfigParameter(
                           configAccessor,
                           configParameterData.ConfigFile,
                           configParameterData.Name,
                           configParameterData.Value));
            }
        }
Esempio n. 5
0
 public PingCaller(ConnectionManager connectionManager, ILoggerFactory loggerFactory,
                   IConfigAccessor configAccessor)
 {
     _connectionManager = connectionManager;
     _config            = configAccessor.Get <GrpcConfig>();
     _logger            = loggerFactory.CreateLogger(typeof(PingCaller));
 }
 public SamplingRefreshService(IConfigAccessor configAccessor,
                               IRuntimeEnvironment runtimeEnvironment, ILoggerFactory loggerFactory)
     : base(runtimeEnvironment, loggerFactory)
 {
     _config = configAccessor.Get <SamplingConfig>();
     DefaultSampler.Instance.SetSamplePer3Secs(_config.SamplePer3Secs);
 }
Esempio n. 7
0
 public InstrumentRequestCallback(IConfigAccessor configAccessor, ITracingContext tracingContext,
                                  IEntrySegmentContextAccessor contextAccessor)
 {
     _config          = configAccessor.Get <InstrumentConfig>();
     _tracingContext  = tracingContext;
     _contextAccessor = contextAccessor;
 }
Esempio n. 8
0
 public SegmentReporter(ConnectionManager connectionManager, IConfigAccessor configAccessor,
                        ILoggerFactory loggerFactory)
 {
     _connectionManager = connectionManager;
     _config            = configAccessor.Get <GrpcConfig>();
     _logger            = loggerFactory.CreateLogger(typeof(SegmentReporter));
 }
Esempio n. 9
0
 public PhotoRepository(ISessionContainer sessionContainer, IImageGenerator imageGenerator, IConfigAccessor configAccessor, ILogger logger)
 {
     this.sessionContainer = sessionContainer;
     this.imageGenerator   = imageGenerator;
     this.configAccessor   = configAccessor;
     this.logger           = logger;
 }
 /// <summary>Initializes a new instance of the <see cref="PhotosController"/> class.</summary>
 /// <param name="configAccessor">The config accessor.</param>
 /// <param name="photoRepository">The photo repository.</param>
 /// <param name="userRepository">The user repository.</param>
 /// <param name="logger">The logger.</param>
 public PhotosController(IConfigAccessor configAccessor, IPhotoRepository photoRepository, IUserRepository userRepository, ILogger logger)
 {
     this.configAccessor  = configAccessor;
     this.photoRepository = photoRepository;
     this.userRepository  = userRepository;
     this.logger          = logger;
 }
Esempio n. 11
0
 public SkyApmClientV5(ConnectionManager connectionManager, IConfigAccessor configAccessor,
                       ILoggerFactory loggerFactory)
 {
     _connectionManager = connectionManager;
     _config            = configAccessor.Get <GrpcConfig>();
     _logger            = loggerFactory.CreateLogger(typeof(SkyApmClientV5));
 }
Esempio n. 12
0
 public PingCaller(ConnectionManager connectionManager, ILoggerFactory loggerFactory,
                   IConfigAccessor configAccessor)
 {
     _connectionManager = connectionManager;
     _config            = configAccessor.Get <GrpcConfig>();
     _logger            = loggerFactory.CreateLogger(NLog.LogManager.GetCurrentClassLogger());
 }
Esempio n. 13
0
 public SegmentReporter(ConnectionManager connectionManager, IConfigAccessor configAccessor,
                        ILoggerFactory loggerFactory)
 {
     _connectionManager = connectionManager;
     _config            = configAccessor.Get <GrpcConfig>();
     _logger            = loggerFactory.CreateLogger(NLog.LogManager.GetCurrentClassLogger());
 }
Esempio n. 14
0
        public SimpleCountSamplingInterceptor(IConfigAccessor configAccessor, IRuntimeEnvironment runtimeEnvironment, ILoggerFactory loggerFactory) :
            base(runtimeEnvironment, loggerFactory)
        {
            var samplingConfig = configAccessor.Get <SamplingConfig>();

            _samplePer3Secs = samplingConfig.SamplePer3Secs;
            _sample_on      = _samplePer3Secs > -1;
        }
Esempio n. 15
0
 public SegmentReportService(IConfigAccessor configAccessor, ISegmentDispatcher dispatcher,
                             IRuntimeEnvironment runtimeEnvironment, ILoggerFactory loggerFactory)
     : base(runtimeEnvironment, loggerFactory)
 {
     _dispatcher = dispatcher;
     _config     = configAccessor.Get <TransportConfig>();
     Period      = TimeSpan.FromMilliseconds(_config.Interval);
 }
Esempio n. 16
0
 public PingService(IConfigAccessor configAccessor, IPingCaller pingCaller,
                    IRuntimeEnvironment runtimeEnvironment,
                    ILoggerFactory loggerFactory) : base(
         runtimeEnvironment, loggerFactory)
 {
     _pingCaller      = pingCaller;
     _transportConfig = configAccessor.Get <TransportConfig>();
 }
 public ServiceDiscoveryV5Service(IConfigAccessor configAccessor, ISkyApmClientV5 skyApmClient,
                                  IRuntimeEnvironment runtimeEnvironment, ILoggerFactory loggerFactory)
     : base(runtimeEnvironment, loggerFactory)
 {
     _config           = configAccessor.Get <InstrumentConfig>();
     _transportConfig  = configAccessor.Get <TransportConfig>();
     this.skyApmClient = skyApmClient;
 }
Esempio n. 18
0
 public CLRStatsReporter(ConnectionManager connectionManager, ILoggerFactory loggerFactory,
                         IConfigAccessor configAccessor, IRuntimeEnvironment runtimeEnvironment)
 {
     _connectionManager  = connectionManager;
     _logger             = loggerFactory.CreateLogger(NLog.LogManager.GetCurrentClassLogger());
     _config             = configAccessor.Get <GrpcConfig>();
     _runtimeEnvironment = runtimeEnvironment;
 }
Esempio n. 19
0
 public AsyncQueueTraceDispatcher(IConfigAccessor configAccessor, ISkyWalkingClient client, ILoggerFactory loggerFactory)
 {
     _skyWalkingClient = client;
     _logger           = loggerFactory.CreateLogger(typeof(AsyncQueueTraceDispatcher));
     _config           = configAccessor.Get <TransportConfig>();
     _segmentQueue     = new ConcurrentQueue <TraceSegmentRequest>();
     _cancellation     = new CancellationTokenSource();
 }
Esempio n. 20
0
 public RegisterService(IConfigAccessor configAccessor, IServiceRegister serviceRegister,
                        IRuntimeEnvironment runtimeEnvironment, ILoggerFactory loggerFactory) : base(runtimeEnvironment,
                                                                                                     loggerFactory)
 {
     _serviceRegister = serviceRegister;
     _config          = configAccessor.Get <InstrumentConfig>();
     _transportConfig = configAccessor.Get <TransportConfig>();
 }
 public ServiceConfigLocator(ILoggerFactory loggerFactory, IConfigAccessor configAccessor, ServiceClient serviceClient)
 {
     _client   = serviceClient;
     _services = new List <ServiceDto>();
     _logger   = loggerFactory.CreateLogger(typeof(ServiceConfigLocator));
     _config   = configAccessor.Get <DiscoveryServiceConfig>();
     _timer    = new Timer(ScheduleRefresh, null, 0, _config.RefreshInterval);
 }
Esempio n. 22
0
        /// <summary>Create <see cref="ConfigParameter"/>.</summary>
        /// <param name="repository">Related <see cref="Repository"/>.</param>
        /// <param name="name">Paramater name.</param>
        /// <param name="value">Parameter value.</param>
        internal ConfigParameter(IConfigAccessor configAccessor, ConfigFile configFile, string name, string value)
            : base(name)
        {
            Verify.Argument.IsNotNull(configAccessor, "configAccessor");

            _configAccessor = configAccessor;
            _configFile = configFile;
            _value = value;
        }
 public HostingTracingDiagnosticProcessor(IEntrySegmentContextAccessor segmentContextAccessor,
                                          ITracingContext tracingContext, IEnumerable <IHostingDiagnosticHandler> diagnosticHandlers,
                                          IConfigAccessor configAccessor)
 {
     _tracingContext         = tracingContext;
     _diagnosticHandlers     = diagnosticHandlers.Reverse();
     _segmentContextAccessor = segmentContextAccessor;
     _tracingConfig          = configAccessor.Get <TracingConfig>();
 }
Esempio n. 24
0
 public CLRStatsReporter(ConnectionManager connectionManager, ILoggerFactory loggerFactory,
                         IConfigAccessor configAccessor, IRuntimeEnvironment runtimeEnvironment)
 {
     _connectionManager  = connectionManager;
     _logger             = loggerFactory.CreateLogger(typeof(CLRStatsReporter));
     _config             = configAccessor.Get <GrpcConfig>();
     _runtimeEnvironment = runtimeEnvironment;
     _instrumentConfig   = configAccessor.Get <InstrumentConfig>();
 }
Esempio n. 25
0
 public AsyncQueueSegmentDispatcher(IConfigAccessor configAccessor, ISegmentReporter segmentReporter,
                                    ILoggerFactory loggerFactory)
 {
     _segmentReporter = segmentReporter;
     _logger          = loggerFactory.CreateLogger(typeof(AsyncQueueSegmentDispatcher));
     _config          = configAccessor.Get <TransportConfig>();
     _segmentQueue    = new ConcurrentQueue <SegmentRequest>();
     _cancellation    = new CancellationTokenSource();
 }
Esempio n. 26
0
        /// <summary>Create <see cref="ConfigParameter"/>.</summary>
        /// <param name="repository">Related <see cref="Repository"/>.</param>
        /// <param name="name">Paramater name.</param>
        /// <param name="value">Parameter value.</param>
        internal ConfigParameter(IConfigAccessor configAccessor, ConfigFile configFile, string name, string value)
            : base(name)
        {
            Verify.Argument.IsNotNull(configAccessor, nameof(configAccessor));

            _configAccessor = configAccessor;
            _configFile     = configFile;
            _value          = value;
        }
 public TraceSegmentTransportService(IConfigAccessor configAccessor, ITraceDispatcher dispatcher,
                                     ISkyWalkingClient skyWalking, IRuntimeEnvironment runtimeEnvironment, ILoggerFactory loggerFactory)
     : base(skyWalking, runtimeEnvironment, loggerFactory)
 {
     _dispatcher = dispatcher;
     _config     = configAccessor.Get <TransportConfig>();
     Period      = TimeSpan.FromMilliseconds(_config.Interval);
     TracingContext.ListenerManager.Add(this);
 }
Esempio n. 28
0
        /// <summary>Create <see cref="ConfigParameter"/>.</summary>
        /// <param name="repository">Related <see cref="Repository"/>.</param>
        /// <param name="name">Paramater name.</param>
        /// <param name="value">Parameter value.</param>
        internal ConfigParameter(IConfigAccessor configAccessor, string fileName, string name, string value)
            : base(name)
        {
            Verify.Argument.IsNotNull(configAccessor, nameof(configAccessor));

            _configAccessor = configAccessor;
            _configFile     = Git.ConfigFile.Other;
            _fileName       = fileName;
            _value          = value;
        }
        public IgnorePathSamplingInterceptor(IConfigAccessor configAccessor)
        {
            var ignorePaths = configAccessor.Get <SamplingConfig>().IgnorePaths;

            _sample_on = ignorePaths?.Count > 0;
            if (_sample_on)
            {
                _ignorePaths = ignorePaths;
            }
        }
Esempio n. 30
0
        /// <summary>Create <see cref="ConfigParameter"/>.</summary>
        /// <param name="repository">Related <see cref="Repository"/>.</param>
        /// <param name="name">Paramater name.</param>
        /// <param name="value">Parameter value.</param>
        internal ConfigParameter(IConfigAccessor configAccessor, string fileName, string name, string value)
            : base(name)
        {
            Verify.Argument.IsNotNull(configAccessor, "configAccessor");

            _configAccessor = configAccessor;
            _configFile = Git.ConfigFile.Other;
            _fileName = fileName;
            _value = value;
        }
Esempio n. 31
0
 public AsyncQueueSkyApmLogDispatcher(IConfigAccessor configAccessor, ILoggerFactory loggerFactory, ILoggerContextContextMapper loggerContextContextMapper, ILoggerReporter loggerReporter, IRuntimeEnvironment runtimeEnvironment)
 {
     _logger = loggerFactory.CreateLogger(typeof(AsyncQueueSkyApmLogDispatcher));
     _config = configAccessor.Get <TransportConfig>();
     _loggerContextContextMapper = loggerContextContextMapper;
     _runtimeEnvironment         = runtimeEnvironment;
     _segmentQueue   = new ConcurrentQueue <LoggerRequest>();
     _cancellation   = new CancellationTokenSource();
     _loggerReporter = loggerReporter;
 }
Esempio n. 32
0
        public Sw3CarrierFormatter(IUniqueIdParser uniqueIdParser, IConfigAccessor configAccessor)
        {
            _uniqueIdParser = uniqueIdParser;
            var config = configAccessor.Get <InstrumentConfig>();

            Key = string.IsNullOrEmpty(config.Namespace)
                ? HeaderVersions.SW3
                : $"{config.Namespace}-{HeaderVersions.SW3}";
            Enable = config.HeaderVersions != null && config.HeaderVersions.Contains(HeaderVersions.SW3);
        }
Esempio n. 33
0
        public static ConfigParameter CreateConfigParameter(IConfigAccessor configAccessor, ConfigParameterData configParameterData)
        {
            Verify.Argument.IsNotNull(configAccessor, "configAccessor");
            Verify.Argument.IsNotNull(configParameterData, "configParameterData");

            switch(configParameterData.ConfigFile)
            {
                case ConfigFile.Repository:
                    throw new ArgumentException("Config file cannot be 'Repository'.", "configParameterData");
                case ConfigFile.Other:
                    return new ConfigParameter(
                        configAccessor,
                        configParameterData.SpecifiedFile,
                        configParameterData.Name,
                        configParameterData.Value);
                default:
                    return new ConfigParameter(
                        configAccessor,
                        configParameterData.ConfigFile,
                        configParameterData.Name,
                        configParameterData.Value);
            }
        }
Esempio n. 34
0
 /// <summary>Create <see cref="ConfigParameter"/>.</summary>
 /// <param name="repository">Related <see cref="Repository"/>.</param>
 /// <param name="name">Paramater name.</param>
 /// <param name="value">Parameter value.</param>
 internal ConfigParameter(Repository repository, ConfigFile configFile, string name, string value)
     : base(repository, name)
 {
     _configAccessor = repository.Accessor;
     _value = value;
 }