Skip to content
This repository has been archived by the owner on Dec 8, 2018. It is now read-only.

Multiple health check endpoints #512

Closed
steveoh opened this issue Oct 24, 2018 · 3 comments
Closed

Multiple health check endpoints #512

steveoh opened this issue Oct 24, 2018 · 3 comments

Comments

@steveoh
Copy link

steveoh commented Oct 24, 2018

In preview 2 I was able to use

      app.UseHealthChecks("/health");
      app.UseHealthChecks("/health/detail", new HealthCheckOptions()
            {
                // This custom writer formats the detailed status as JSON.
                ResponseWriter = WriteResponse,
            });

            app.Run(async (context) =>
            {
                await context.Response.WriteAsync("Go to /health to see the health status");
            });

And that would work properly.

In preview 3 both routes return the default data and the response writer is ignored. You can test this in the CustomWriterStartup.cs file by adding the code above.

What is the proper way to expose more than one health check endpoint? Tags?

@rynowak
Copy link
Member

rynowak commented Oct 24, 2018

I think your issue is the same as #511 this is using the .Map middleware primitive, so if these middleware were ordered in the opposite way, it would work as you expect.

I agree that this is surprising and bad, I think we will have change how this is implemented.

@steveoh
Copy link
Author

steveoh commented Oct 24, 2018

Yes I believe this is a duplicate. I will close this and follow that one.

@steveoh steveoh closed this as completed Oct 24, 2018
@rynowak
Copy link
Member

rynowak commented Oct 28, 2018

Fixed for the 2.2.0 release. Thanks for the feedback 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants