Xabaril / AspNetCore.Diagnostics.HealthChecks

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

HealthChecks UI - TypeError: e.filter is not a function #281

Closed rscooper closed 5 years ago

rscooper commented 5 years ago

Hi,

I'm encountering a JavaScript error in the latest AspNetCore.HealthChecks.UI v3.0.0 release.

The API request returns successfully but the console (Chrome & FF) shows an error:

TypeError: e.filter is not a function
    at t.LivenessPage.<anonymous> (healthchecks-bundle.js:12)
    at Generator.next (<anonymous>)
    at r (healthchecks-bundle.js:12)

The page displays: image

Is it just me?

Thanks.

CarlosLanderas commented 5 years ago

That error means you have a wrong configuration. Be sure the UI is pointing to and endpoint that is serving the health JSON result serialized using the UIResponseWriter present in the UI.Client package.

Could you paste your current configuration?.

You can also check the samples section to find different ways of configuring the UI.

rscooper commented 5 years ago

Sure, I'm using:

                endpoints.MapHealthChecksUI(x =>
                {
                    x.ApiPath = "/health";
                    x.UIPath = "/health-ui";
                });

and

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

The response from '/health' endpoint returns:

{"status":"Degraded","totalDuration":"00:00:00.0533524","entries":{"self":{"data":{},"duration":"00:00:00.0000701","status":"Healthy"},"Database":{"data":{},"duration":"00:00:00.0425908","status":"Healthy"},"RabbitMq":{"data":{},"description":"None of the specified endpoints were reachable","duration":"00:00:00.0512502","exception":"None of the specified endpoints were reachable","status":"Degraded"}}}
unaizorrilla commented 5 years ago

Your configuration is not valid rscooper, you are using the same path for healtz ( the healthchecks json result information ) and for the UI api. Please checkout the samples to see how ApiAndUI can be in the sample project.

https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/blob/master/samples/HealthChecks.UIAndApi/Startup.cs

I close this issue, please reopen if you have any other problem!

josejavierpaez commented 4 years ago

hi, Please could you be more explicit when you say that you have the same path, I have the same error ".filter is not a function".

I would appreciate it if you could write an example here below

CarlosLanderas commented 4 years ago

@josejavierpaez , you have different ways to configure the UI (standalone, in the same host than the healthchecks, etc) in this samples folder, take a look to them and if you still have doubts tell us!:

https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/tree/master/samples