Example #1
0
        public ValuesController(IHttpContextAccessor accessor)
        {
            //var request = MyHttpContext.Current.Request;
            _accessor = accessor;
            var content = accessor.HttpContext;
            var request = content.Request;

            ZipKinClientHelper.RegisterService();
        }
        public static void AddZipKin(this IApplicationBuilder app, ILoggerFactory loggerFactory, string ServiceName, string ZipKinServer)
        {
            var lifetime = app.ApplicationServices.GetService <IApplicationLifetime>();

            lifetime.ApplicationStarted.Register(() =>
            {
                ZipKinClientHelper.Init(ServiceName, ZipKinServer);
                ZipKinClientHelper.RegisterHandle(loggerFactory);
            });

            lifetime.ApplicationStopped.Register(() => ZipKinClientHelper.UnRegisterHandle());
        }
Example #3
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseStaticHttpContext();
            app.UseMvc();

            var lifetime = app.ApplicationServices.GetService <IApplicationLifetime>();

            lifetime.ApplicationStarted.Register(() =>
            {
                ZipKinClientHelper.Init("ZZH.ZipKinClient.Service.Test.Three", "http://localhost:9411");
                ZipKinClientHelper.RegisterHandle(loggerFactory);
            });

            lifetime.ApplicationStopped.Register(() => ZipKinClientHelper.UnRegisterHandle());
        }
Example #4
0
 public ValuesController()
 {
     ZipKinClientHelper.RegisterService();
 }