Xabaril / AspNetCore.Diagnostics.HealthChecks

Enterprise HealthChecks for ASP.NET Core Diagnostics Package
Apache License 2.0
4.07k stars 795 forks source link

Cant see any health checks in ui #608

Closed wireless90 closed 4 years ago

wireless90 commented 4 years ago

.net core 2.2

`csharp public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);

        //services.AddInMemoryStorage();

        services.AddHealthChecksUI()
            .AddHealthChecks()
            .AddCheck<DummyCheck>("Dummy Checku");

    }

    // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
    public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    {
        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }
        else
        {
            // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
            app.UseHsts();
        }

        app.UseHttpsRedirection();
        app.UseMvc();

        app.UseHealthChecks("/healthz", new HealthCheckOptions()
        {
            Predicate = _ => true,
            ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
        });

        app.UseHealthChecksUI(s =>
        {
            s.UIPath = "/show-health-ui"; // this is ui path in your browser
            s.ApiPath = "/health-ui-api"; // the UI ( spa app )  use this path to get information from the store ( this is NOT the healthz path, is internal ui api )
        });
    }`
wireless90 commented 4 years ago

Solved, did not specify configuration