コード例 #1
0
        public HttpHandler(FrontierSetings setings, IMetricScope metricScope, ILog log, IAirlockClient airlockClient)
        {
            this.log           = log;
            this.airlockClient = airlockClient;
            log.Debug("settings: " + setings?.ToPrettyJson());
            var httpScope = metricScope.WithTag(MetricsTagNames.Type, "http");

            resendTo = setings?.ResendTo;
            if (string.IsNullOrWhiteSpace(resendTo))
            {
                resendTo = null;
            }
            else
            {
                resendHttpClient = new HttpClient();
            }

            reportHandlers = new IReportHandler[]
            {
                new StacktraceHandler("stacktracejs", httpScope, log, setings),
                new ReportHandler <CspReport>("csp", httpScope, log),
                new ReportHandler <PkpReport>("pkp", httpScope, log)
            };
            var handlerScope = metricScope.WithTag(MetricsTagNames.Operation, "handler");

            totalCounter = handlerScope.Counter("total");
            errorCounter = handlerScope.Counter("errors");
            environment  = VostokHostingEnvironment.Current.Environment;
        }
コード例 #2
0
 public MetricsAggregatorAirlockEventProcessorProvider(
     IMetricScope rootMetricScope,
     IAirlockClient airlockClient,
     MetricsAggregatorSettings settings)
 {
     this.rootMetricScope = rootMetricScope;
     this.airlockClient   = airlockClient;
     this.settings        = settings;
 }
コード例 #3
0
 public MetricsAggregatorProcessor(
     IAirlockClient airlockClient,
     IMetricScope rootMetricScope,
     MetricsAggregatorSettings settings,
     string eventsRoutingKey)
 {
     this.airlockClient    = airlockClient;
     this.rootMetricScope  = rootMetricScope;
     this.settings         = settings;
     this.eventsRoutingKey = eventsRoutingKey;
 }
コード例 #4
0
        public static LoggerConfiguration Airlock(
            this LoggerSinkConfiguration loggerConfiguration,
            IAirlockClient airlockClient,
            string routingKey,
            LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum)
        {
            if (loggerConfiguration == null)
            {
                throw new ArgumentNullException(nameof(loggerConfiguration));
            }

            var sink = new AirlockSink(airlockClient, routingKey);

            return(loggerConfiguration.Sink(sink, restrictedToMinimumLevel));
        }
コード例 #5
0
 public MetricAggregator(
     IMetricScope metricScope,
     IBucketKeyProvider bucketKeyProvider,
     IAirlockClient airlockClient,
     TimeSpan cooldownPeriod,
     Borders borders,
     string eventsRoutingKey)
 {
     aggregatorMetrics = new AggregatorMetrics(metricScope.WithTags(new Dictionary <string, string>
     {
         { MetricsTagNames.Type, "aggregation" }, { "routingKey", eventsRoutingKey }
     }));
     this.bucketKeyProvider = bucketKeyProvider;
     this.airlockClient     = airlockClient;
     this.cooldownPeriod    = cooldownPeriod;
     this.borders           = borders;
     metricsRoutingKey      = RoutingKey.ReplaceSuffix(eventsRoutingKey, RoutingKey.MetricsSuffix);
     buckets = new ConcurrentDictionary <BucketKey, IBucket>();
 }
コード例 #6
0
 public AirlockSink(IAirlockClient airlockClient, string routingKey)
     : this(() => airlockClient, () => routingKey)
 {
 }
コード例 #7
0
 public AirlockTraceReporter(IAirlockClient airlockClient, string routingKey)
     : this(() => airlockClient, () => routingKey)
 {
 }
コード例 #8
0
 public AirlockMetricReporter(IAirlockClient airlockClient, string routingKeyPrefix)
 {
     this.airlockClient    = airlockClient;
     this.routingKeyPrefix = routingKeyPrefix;
 }
コード例 #9
0
 public AirlockLog(IAirlockClient airlockClient, string routingKey)
 {
     this.airlockClient = airlockClient;
     this.routingKey    = routingKey;
 }