Commit Graph

730 Commits

Author SHA1 Message Date
Ryan Nowak 1afd5b2594 Don't use Map
Fixes aspnet/Diagnostics#511 and aspnet/Diagnostics#514

It's really confusing to people that we use Map. Users expect that the
URL they provide for the health check middleware will only process
exact matches. The way it behaves when using map is not optimal for some
of the common patterns.
2018-10-27 21:01:55 -07:00
Luke Latham b3db95eb2d Change 'create' to 'delete' in message 2018-10-21 13:38:59 -07:00
ASP.NET CI f0994e5972
Update package branding for 2.2 RTM 2018-10-16 12:48:13 -07:00
Gerard Gunnewijk 1ff9a3d80c Fixed broken link (#504)
The link (https://github.com/aspnet/Home/blob/dev/CONTRIBUTING.md) was broken due to merging of repo's.
2018-10-16 05:04:19 -07:00
Ryan Nowak 1f31e0556d
Add IHealthCheckPublisher for push-based checks (#498)
IHealthCheckPublisher allows you to configure and run health checks
regularly inside an application, and push the notifications elsewhere.

All publishers are part of a single queue with a configurable period and
timeout.
2018-10-08 17:58:45 -07:00
Ryan Nowak 9722d89572 Adjust log levels 2018-10-06 16:18:55 -07:00
Ryan Nowak 014e7eb963 Add EFCore DbContext check 2018-10-01 13:33:00 -07:00
ASP.NET CI 6a8494f938 Update dependencies.props
[auto-updated: dependencies]
2018-09-30 12:10:59 -07:00
Nate McMaster 4fc5c7c11b
automated: bulk infrastructure updates. Update bootstrapper scripts and remove unnecessary signing properties 2018-09-28 17:10:32 -07:00
Unai Zorrilla fa961b003f Added execution time duration (HealthReportEntry TotalDuration) (#493)
* Added execution time duration into HealthReportEntry and TotalDuration on HealthReport

* review PR feedback from @rynowak.

* added the same duration into HealthReportEntry and log when the health check throw
2018-09-28 09:14:58 -07:00
Eilon Lipton c29b0e6131
Update LICENSE.txt 2018-09-27 15:30:51 -07:00
Ryan Nowak 204ff0a785 Set cache headers in health check middleware 2018-09-24 10:43:57 -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
ASP.NET CI ea980c55f6 Update dependencies.props
[auto-updated: dependencies]
2018-09-23 19:10:46 +00:00
Ryan Nowak 8fb6c2a50a Allow cancellation to propagate 2018-09-20 11:04:35 -07:00
Ryan Nowak 4259b65c16
Use options for registering health checks (#479)
* Use options for registering health checks

This change pivots to use options for registering health checks. We get
a few pretty nice things out of this, and it unblocks some of our
requirements.

Now all registration methods support the application developer
configuring the name, failure-status, and tags for each health check.
This is a requirment, that we weren't really satisfying - which is what
led to this redesign. In support of this health checks now return pass/fail,
and the service is responsible for assigning the status.

----

Health check authors that need configuration data (connection string as
an example) now have three ways to do this depending on their
requirements.
1. Create an instance and register that (easiest)
2. Use Type Activation and pass parameters (middle)
3. Use named options (richest)

We expect most health checks to need/want some kind of configuration -
which 1) works pretty well to solve. However many other health checks
will need DI + configuration. It was also a gap that we didn't have a
good way to use named options, when it's such a good fit for our
scenarios.

Added new registration methods for type activation that allow you to
pass parameters for 2).

Added a context type that allows the running health check access to its
registration for 3).

----

Redesigned and renamed how status gets reported. Health checks return
pass/fail result, but the overall HealthReport includes entries of a
different type. This seems fine because there isn't really a way to
consume a HealthCheckResult directly - the service is the only consumer.

----

Added support for tags. This was easy to add now that we have a separate
registration type, and it's quite handy for building filters (see
sample).

* HARDER BETTER STRONGER FASTER
2018-09-19 14:48:34 -07:00
ASP.NET CI 3ac6439dcf Update dependencies.props
[auto-updated: dependencies]
2018-09-16 12:09:03 -07:00
ASP.NET CI f94ad0f202 Update dependencies.props
[auto-updated: dependencies]
2018-09-09 12:10:09 -07:00
ASP.NET CI b3e163e44f
Update branding to 2.2.0-preview3 2018-09-05 16:34:00 -07:00
ASP.NET CI dd07e6743c Update dependencies.props
[auto-updated: dependencies]
2018-09-02 12:09:26 -07:00
Ryan Nowak 525fbf495b Fix #468 - all UseHealthChecks without a path 2018-08-30 15:33:49 -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
Zhiliang 6cd4cf1a7a Fix typos in samples 2018-08-29 10:12:10 -07:00
martincostello fc7fa4f0f0 Fix sample typo
Fix typo in sample comment.
2018-08-28 15:41:18 -07:00
ASP.NET CI 5c8b549882 Update package branding for 2.2.0-preview2 2018-08-21 13:33:49 -07:00
ASP.NET CI 983d7836ab Update dependencies.props
[auto-updated: dependencies]
2018-08-12 19:10:01 +00:00
Ryan Nowak 8ec69456ca
Update CustomWriterStartup.cs
Fix a misleading comment in sample
2018-08-06 16:44:54 -07:00
ASP.NET CI 602faf5baa Update dependencies.props
[auto-updated: dependencies]
2018-08-06 20:33:14 +00:00
ASP.NET CI 701fe39170 Update dependencies.props
[auto-updated: dependencies]
2018-08-05 19:10:57 +00: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
Ryan Nowak bf839dadf1 Delete ISSUE_TEMPLATE.md
We're going to be doing some work in this repo. This issue tracker is the place to file Health Checks issues.
2018-07-31 12:51:47 -07:00
ASP.NET CI 1ace256ad0 Update dependencies.props
[auto-updated: dependencies]
2018-07-29 12:09:28 -07:00
Nate McMaster 008e13a4e7
Merge branch 'release/2.1' into release/2.2 2018-07-24 12:06:53 -07:00
ASP.NET CI 4591b4172d Update dependencies.props
[auto-updated: dependencies]
2018-07-22 12:09:40 -07:00
ASP.NET CI d26d6ddfb1 Update dependencies.props
[auto-updated: dependencies]
2018-07-15 12:10:02 -07:00
Nate McMaster 8893337fb0
Pin version variables to the ASP.NET Core 2.1.2 baseline
This reverts our previous policy of cascading versions on all servicing updates.
This moves variables into the 'pinned' section, and points them to the latest
stable release (versions that were used at the time of the 2.1.2 release).
2018-07-12 11:52:12 -07:00
Nate McMaster 286304e2f9
Updating dependencies to 2.1.2 and adding a section for pinned variable versions 2018-07-11 18:48:13 -07:00
Nate McMaster 6a3f878af2
Reverting version from 2.1.2 back to 2.1.1
As a result of changing the way we apply servicing updates to aspnet core, this repo did not need the version bump because there are no planned product changes in this repo.
2018-07-11 15:06:28 -07:00
ASP.NET CI a5ba2590d5 Update dependencies.props
[auto-updated: dependencies]
2018-07-08 12:10:06 -07:00
Nate McMaster 2f8eaa5ea4
Update infrastructure for the 2.2 release 2018-06-28 16:19:26 -07:00
ASP.NET CI 7f463b2793 Update dependencies.props
[auto-updated: dependencies]
2018-06-25 11:11:22 -07:00
Ryan Brandenburg c5eda241ea Adding VSTS file 2018-06-19 11:09:20 -07:00
Ryan Brandenburg 191d2651fc Set 2.1 baselines 2018-06-14 10:02:33 -07:00
Ryan Brandenburg d1b1a8097b Set 2.1 baselines 2018-06-14 10:02:28 -07:00
Nate McMaster ab45862391
Bumping version from 2.1.1 to 2.1.2 2018-06-12 14:01:30 -07:00
ASP.NET CI dedefd7043 Update dependencies.props
[auto-updated: dependencies]
2018-06-12 19:15:53 +00:00