Commit Graph

9 Commits

Author SHA1 Message Date
Ryan Nowak 014e7eb963 Add EFCore DbContext check 2018-10-01 13:33:00 -07:00
Ryan Nowak 18145880fa Improved logging for health checks
- Add logging of description/data
- Add logging for aggregate begin/end
2018-09-24 10:29:23 -07:00
Ryan Nowak 3e4a3d0b90
Allow health checks to use any DI lifetime (#466)
* Allow health checks to use any DI lifetime

This change allows registered IHealthCheck implementations to use any DI
lifetime. This is necessary for scenarios like using EF which requires a
scope.

The works by having the health check service create a scope for each
time it queries health checks. This scope does not overlap or share
state with other scopes (the request scope) so there is no crosstalk
between processing going on per-request in ASP.NET Core and the health
check operation.

* PR feedback and some logging cleanup
2018-08-30 10:51:48 -07:00
Ryan Nowak d1cba1f55b Add Database health sample 2018-08-03 15:10:03 -07:00
Ryan Nowak ebafbcdae3 Add filtering by port
This adds UseHealthChecks overloads that configure the health checks
middleware to listen on a preconfigured port.

This is sugar for MapWhen, but it's important because a significant set
of users will want to use Health Checks in this way.
2018-08-03 14:37:27 -07:00
Ryan Nowak 4549b84cb5
Remove JSON output (#457)
* Remove JSON output and convert to sample

GlennC and I made the decisison to turn the JSON output into a sample
rather than something we support out of the box. We wouldn't tell
customers to definitely use it and we don't want to introduce more
coupling to JSON.NET.
2018-08-03 09:40:45 -07:00
Ryan Nowak 64124e9c85 Add filtering to Health Checks middleware
This allows each middleware to be configured with a specific set of
checks (by name). See the comments in the sample for how this is
frequently used.

This is also addresses aspnet/Home#2575 - or at least the part that we
plan to do. We think that any sort of built-in system of metadata or
tags is vast overkill, and doesn't really align with the primary usage
of health checks.

We're providing building blocks, and these can be put together to
build more complicated things like what's described in aspnet/Home#2575.
2018-08-01 19:07:58 -07:00
Ryan Nowak 47f427d5ac Updating Health Checks for 2.2
A bunch of small changes and updates for 2.2 focused at making our main
scenarios more streamlined and focused. Also adds samples for
extensibility we support so far.

A list of changes:

Clearing baselines for these projects. We didn't ship anything in 2.1 so
there should be nothing in the baselines.

--

The middleware now uses Map for path matching. This makes the actual
`HealthCheckMiddleware` more standalone. This will make it easy to use
with Dispatcher/Endpoint Routing in the future.

This also manifests by removing Path from HealthCheckOptions - the path
is an explicit argument to the UseHealthChecks middelware - this
streamlines the design for 3.0.

--

Added extensibility for customizing the status codes (aspnet/Home#2584)

--

Added extensibility for writing the textual output (aspnet/Home#2583)

--

Changed the default output to be `text/plain`. The most common use cases
for health checks don't include a detailed status.

The existing output format is still available as an option.
2018-08-01 18:49:44 -07:00
Andrew Stanton-Nurse a30befae0f Add abstractions for Health Checks and a simple middleware and service to run them (#408) 2017-10-18 13:52:06 -07:00