Example #1
0
        public static ITracerBuilder AddMetric(this ITracerBuilder traceBuilder)
        {
            if (traceBuilder == null)
            {
                throw new ArgumentNullException(nameof(traceBuilder));
            }

            //if (actConfig == null)
            //{
            //    throw new ArgumentNullException(nameof(actConfig));
            //}

            //ZipkinCollectorConfig cfg = new ZipkinCollectorConfig();
            //actConfig(cfg);
            //cfg.Validate();
            traceBuilder.AddCollector(new MetricCollector());
            return(traceBuilder);
        }
Example #2
0
        public static ITracerBuilder AddZipkin(this ITracerBuilder traceBuilder, Action <ZipkinCollectorConfig> actConfig)
        {
            if (traceBuilder == null)
            {
                throw new ArgumentNullException(nameof(traceBuilder));
            }

            if (actConfig == null)
            {
                throw new ArgumentNullException(nameof(actConfig));
            }

            ZipkinCollectorConfig cfg = new ZipkinCollectorConfig();

            actConfig(cfg);
            cfg.Validate();
            traceBuilder.AddCollector(new ZipkinCollector(cfg));
            return(traceBuilder);
        }