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>();
 }
Beispiel #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);
 }
Beispiel #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));
            }
        }
Beispiel #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);
 }
Beispiel #7
0
 public InstrumentRequestCallback(IConfigAccessor configAccessor, ITracingContext tracingContext,
                                  IEntrySegmentContextAccessor contextAccessor)
 {
     _config          = configAccessor.Get <InstrumentConfig>();
     _tracingContext  = tracingContext;
     _contextAccessor = contextAccessor;
 }
Beispiel #8
0
 public SegmentReporter(ConnectionManager connectionManager, IConfigAccessor configAccessor,
                        ILoggerFactory loggerFactory)
 {
     _connectionManager = connectionManager;
     _config            = configAccessor.Get <GrpcConfig>();
     _logger            = loggerFactory.CreateLogger(typeof(SegmentReporter));
 }
Beispiel #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;
 }
Beispiel #11
0
 public SkyApmClientV5(ConnectionManager connectionManager, IConfigAccessor configAccessor,
                       ILoggerFactory loggerFactory)
 {
     _connectionManager = connectionManager;
     _config            = configAccessor.Get <GrpcConfig>();
     _logger            = loggerFactory.CreateLogger(typeof(SkyApmClientV5));
 }
Beispiel #12
0
 public PingCaller(ConnectionManager connectionManager, ILoggerFactory loggerFactory,
                   IConfigAccessor configAccessor)
 {
     _connectionManager = connectionManager;
     _config            = configAccessor.Get <GrpcConfig>();
     _logger            = loggerFactory.CreateLogger(NLog.LogManager.GetCurrentClassLogger());
 }
Beispiel #13
0
 public SegmentReporter(ConnectionManager connectionManager, IConfigAccessor configAccessor,
                        ILoggerFactory loggerFactory)
 {
     _connectionManager = connectionManager;
     _config            = configAccessor.Get <GrpcConfig>();
     _logger            = loggerFactory.CreateLogger(NLog.LogManager.GetCurrentClassLogger());
 }
Beispiel #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;
        }
Beispiel #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);
 }
Beispiel #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;
 }
Beispiel #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;
 }
Beispiel #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();
 }
Beispiel #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);
 }
Beispiel #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>();
 }
 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>();
 }
Beispiel #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();
 }
Beispiel #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);
 }
Beispiel #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;
            }
        }
Beispiel #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;
        }
Beispiel #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;
 }
Beispiel #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);
        }
Beispiel #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);
            }
        }
Beispiel #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;
 }