From c245e5be5ed35c1887c5b129b8cee5d0afcd40a7 Mon Sep 17 00:00:00 2001 From: Mateusz Date: Thu, 6 Jul 2023 13:25:22 +0200 Subject: [PATCH 01/48] Extend DynamoDB to not require neither Credentials nor Region (#1870) --- .../DynamoDbHealthCheckBuilderExtensions.cs | 2 +- .../DynamoDbHealthCheck.cs | 21 ++- .../DependencyInjection/RegistrationTests.cs | 126 +++++++++++------- .../HealthChecks.DynamoDb.approved.txt | 2 +- 4 files changed, 99 insertions(+), 52 deletions(-) diff --git a/src/HealthChecks.DynamoDb/DependencyInjection/DynamoDbHealthCheckBuilderExtensions.cs b/src/HealthChecks.DynamoDb/DependencyInjection/DynamoDbHealthCheckBuilderExtensions.cs index 3d5de86bb2..e49c4d5dfa 100644 --- a/src/HealthChecks.DynamoDb/DependencyInjection/DynamoDbHealthCheckBuilderExtensions.cs +++ b/src/HealthChecks.DynamoDb/DependencyInjection/DynamoDbHealthCheckBuilderExtensions.cs @@ -25,7 +25,7 @@ public static class DynamoDbHealthCheckBuilderExtensions /// The specified . public static IHealthChecksBuilder AddDynamoDb( this IHealthChecksBuilder builder, - Action? setup, + Action? setup = null, string? name = default, HealthStatus? failureStatus = default, IEnumerable? tags = default, diff --git a/src/HealthChecks.DynamoDb/DynamoDbHealthCheck.cs b/src/HealthChecks.DynamoDb/DynamoDbHealthCheck.cs index 1cb8d474fb..c710369eec 100644 --- a/src/HealthChecks.DynamoDb/DynamoDbHealthCheck.cs +++ b/src/HealthChecks.DynamoDb/DynamoDbHealthCheck.cs @@ -11,8 +11,6 @@ public class DynamoDbHealthCheck : IHealthCheck public DynamoDbHealthCheck(DynamoDBOptions options) { _options = Guard.ThrowIfNull(options); - - Guard.ThrowIfNull(options.RegionEndpoint); } /// @@ -35,8 +33,8 @@ public async Task CheckHealthAsync(HealthCheckContext context } using var client = credentials != null - ? new AmazonDynamoDBClient(credentials, _options.RegionEndpoint) - : new AmazonDynamoDBClient(_options.RegionEndpoint); + ? CreateClientWithCredentials(credentials) + : CreateClientWithoutCredentials(); _ = await client.ListTablesAsync(cancellationToken).ConfigureAwait(false); @@ -47,4 +45,19 @@ public async Task CheckHealthAsync(HealthCheckContext context return new HealthCheckResult(context.Registration.FailureStatus, exception: ex); } } + + private AmazonDynamoDBClient CreateClientWithCredentials(AWSCredentials credentials) + { + return _options.RegionEndpoint is null + ? new(credentials) + : new(credentials, _options.RegionEndpoint); + } + + private AmazonDynamoDBClient CreateClientWithoutCredentials() + { + return _options.RegionEndpoint is null + ? new() + : new(_options.RegionEndpoint); + + } } diff --git a/test/HealthChecks.DynamoDb.Tests/DependencyInjection/RegistrationTests.cs b/test/HealthChecks.DynamoDb.Tests/DependencyInjection/RegistrationTests.cs index c1de6c9bcb..648691bada 100644 --- a/test/HealthChecks.DynamoDb.Tests/DependencyInjection/RegistrationTests.cs +++ b/test/HealthChecks.DynamoDb.Tests/DependencyInjection/RegistrationTests.cs @@ -1,46 +1,80 @@ -using Amazon; - -namespace HealthChecks.DynamoDb.Tests.DependencyInjection; - -public class dynamoDb_registration_should -{ - [Fact] - public void add_health_check_when_properly_configured() - { - var services = new ServiceCollection(); - -#pragma warning disable CS0618 // Type or member is obsolete - services.AddHealthChecks() - .AddDynamoDb(_ => { _.AccessKey = "key"; _.SecretKey = "key"; _.RegionEndpoint = RegionEndpoint.CNNorth1; }); -#pragma warning restore CS0618 // Type or member is obsolete - - using var serviceProvider = services.BuildServiceProvider(); - var options = serviceProvider.GetRequiredService>(); - - var registration = options.Value.Registrations.First(); - var check = registration.Factory(serviceProvider); - - registration.Name.ShouldBe("dynamodb"); - check.ShouldBeOfType(); - } - - [Fact] - public void add_named_health_check_when_properly_configured() - { - var services = new ServiceCollection(); - -#pragma warning disable CS0618 // Type or member is obsolete - services.AddHealthChecks() - .AddDynamoDb(_ => { _.AccessKey = "key"; _.SecretKey = "key"; _.RegionEndpoint = RegionEndpoint.CNNorth1; }, name: "my-dynamodb-group"); -#pragma warning restore CS0618 // Type or member is obsolete - - using var serviceProvider = services.BuildServiceProvider(); - var options = serviceProvider.GetRequiredService>(); - - var registration = options.Value.Registrations.First(); - var check = registration.Factory(serviceProvider); - - registration.Name.ShouldBe("my-dynamodb-group"); - check.ShouldBeOfType(); - } -} +using Amazon; + +namespace HealthChecks.DynamoDb.Tests.DependencyInjection; + +public class dynamoDb_registration_should +{ + [Fact] + public void add_health_check_when_properly_configured() + { + var services = new ServiceCollection(); + +#pragma warning disable CS0618 // Type or member is obsolete + services.AddHealthChecks() + .AddDynamoDb(_ => { _.AccessKey = "key"; _.SecretKey = "key"; _.RegionEndpoint = RegionEndpoint.CNNorth1; }); +#pragma warning restore CS0618 // Type or member is obsolete + + using var serviceProvider = services.BuildServiceProvider(); + var options = serviceProvider.GetRequiredService>(); + + var registration = options.Value.Registrations.First(); + var check = registration.Factory(serviceProvider); + + registration.Name.ShouldBe("dynamodb"); + check.ShouldBeOfType(); + } + + [Fact] + public void add_named_health_check_when_properly_configured() + { + var services = new ServiceCollection(); + +#pragma warning disable CS0618 // Type or member is obsolete + services.AddHealthChecks() + .AddDynamoDb(_ => { _.AccessKey = "key"; _.SecretKey = "key"; _.RegionEndpoint = RegionEndpoint.CNNorth1; }, name: "my-dynamodb-group"); +#pragma warning restore CS0618 // Type or member is obsolete + + using var serviceProvider = services.BuildServiceProvider(); + var options = serviceProvider.GetRequiredService>(); + + var registration = options.Value.Registrations.First(); + var check = registration.Factory(serviceProvider); + + registration.Name.ShouldBe("my-dynamodb-group"); + check.ShouldBeOfType(); + } + + [Fact] + public void add_health_check_when_no_credentials_provided() + { + var services = new ServiceCollection(); + services.AddHealthChecks() + .AddDynamoDb(_ => _.RegionEndpoint = RegionEndpoint.CNNorth1); + + using var serviceProvider = services.BuildServiceProvider(); + var options = serviceProvider.GetRequiredService>(); + + var registration = options.Value.Registrations.First(); + var check = registration.Factory(serviceProvider); + + registration.Name.ShouldBe("dynamodb"); + check.ShouldBeOfType(); + } + + [Fact] + public void add_health_check_when_no_option_provided() + { + var services = new ServiceCollection(); + services.AddHealthChecks() + .AddDynamoDb(); + + using var serviceProvider = services.BuildServiceProvider(); + var options = serviceProvider.GetRequiredService>(); + + var registration = options.Value.Registrations.First(); + var check = registration.Factory(serviceProvider); + + registration.Name.ShouldBe("dynamodb"); + check.ShouldBeOfType(); + } +} diff --git a/test/HealthChecks.DynamoDb.Tests/HealthChecks.DynamoDb.approved.txt b/test/HealthChecks.DynamoDb.Tests/HealthChecks.DynamoDb.approved.txt index 5329065857..0cc0758fab 100644 --- a/test/HealthChecks.DynamoDb.Tests/HealthChecks.DynamoDb.approved.txt +++ b/test/HealthChecks.DynamoDb.Tests/HealthChecks.DynamoDb.approved.txt @@ -22,6 +22,6 @@ namespace Microsoft.Extensions.DependencyInjection { public static class DynamoDbHealthCheckBuilderExtensions { - public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddDynamoDb(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, System.Action? setup, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } + public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddDynamoDb(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, System.Action? setup = null, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } } } \ No newline at end of file From c8bae24179c1a142926a72cccb7b4a5ae8d8d646 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Jul 2023 10:39:21 +0300 Subject: [PATCH 02/48] Bump Azure.Storage.Blobs from 12.15.1 to 12.16.0 (#1873) Bumps [Azure.Storage.Blobs](https://github.com/Azure/azure-sdk-for-net) from 12.15.1 to 12.16.0. - [Release notes](https://github.com/Azure/azure-sdk-for-net/releases) - [Commits](https://github.com/Azure/azure-sdk-for-net/compare/Azure.Storage.Blobs_12.15.1...Azure.Storage.Blobs_12.16.0) --- updated-dependencies: - dependency-name: Azure.Storage.Blobs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/HealthChecks.AzureStorage/HealthChecks.AzureStorage.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.AzureStorage/HealthChecks.AzureStorage.csproj b/src/HealthChecks.AzureStorage/HealthChecks.AzureStorage.csproj index 45a5ecee1a..27e719b9c1 100644 --- a/src/HealthChecks.AzureStorage/HealthChecks.AzureStorage.csproj +++ b/src/HealthChecks.AzureStorage/HealthChecks.AzureStorage.csproj @@ -8,7 +8,7 @@ - + From 15d7b2b521b145810e09a1ce54fef7841d5b3518 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Jul 2023 10:40:15 +0300 Subject: [PATCH 03/48] Bump Microsoft.AspNetCore.SignalR.Client from 7.0.4 to 7.0.8 (#1874) Bumps [Microsoft.AspNetCore.SignalR.Client](https://github.com/dotnet/aspnetcore) from 7.0.4 to 7.0.8. - [Release notes](https://github.com/dotnet/aspnetcore/releases) - [Changelog](https://github.com/dotnet/aspnetcore/blob/main/docs/ReleasePlanning.md) - [Commits](https://github.com/dotnet/aspnetcore/compare/v7.0.4...v7.0.8) --- updated-dependencies: - dependency-name: Microsoft.AspNetCore.SignalR.Client dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/HealthChecks.SignalR/HealthChecks.SignalR.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.SignalR/HealthChecks.SignalR.csproj b/src/HealthChecks.SignalR/HealthChecks.SignalR.csproj index f890689de4..6efdd40fe8 100644 --- a/src/HealthChecks.SignalR/HealthChecks.SignalR.csproj +++ b/src/HealthChecks.SignalR/HealthChecks.SignalR.csproj @@ -8,7 +8,7 @@ - + From e66e6319718b37bbbce252c5ae4436866856a72f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Jul 2023 10:40:39 +0300 Subject: [PATCH 04/48] Bump RavenDB.Client from 5.4.103 to 5.4.107 (#1875) Bumps [RavenDB.Client](https://github.com/ravendb/ravendb) from 5.4.103 to 5.4.107. - [Commits](https://github.com/ravendb/ravendb/commits) --- updated-dependencies: - dependency-name: RavenDB.Client dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/HealthChecks.RavenDB/HealthChecks.RavenDB.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.RavenDB/HealthChecks.RavenDB.csproj b/src/HealthChecks.RavenDB/HealthChecks.RavenDB.csproj index 1b8872411a..75a7844176 100644 --- a/src/HealthChecks.RavenDB/HealthChecks.RavenDB.csproj +++ b/src/HealthChecks.RavenDB/HealthChecks.RavenDB.csproj @@ -9,7 +9,7 @@ - + From 0991c4fb8710bdecb4561f041a961f2dccce5172 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Jul 2023 10:41:03 +0300 Subject: [PATCH 05/48] Bump Google.Cloud.Firestore from 3.2.0 to 3.3.0 (#1876) Bumps [Google.Cloud.Firestore](https://github.com/googleapis/google-cloud-dotnet) from 3.2.0 to 3.3.0. - [Release notes](https://github.com/googleapis/google-cloud-dotnet/releases) - [Commits](https://github.com/googleapis/google-cloud-dotnet/compare/Google.Cloud.Firestore-3.2.0...Google.Cloud.Firestore-3.3.0) --- updated-dependencies: - dependency-name: Google.Cloud.Firestore dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../HealthChecks.Gcp.CloudFirestore.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.Gcp.CloudFirestore/HealthChecks.Gcp.CloudFirestore.csproj b/src/HealthChecks.Gcp.CloudFirestore/HealthChecks.Gcp.CloudFirestore.csproj index 81331c4c72..d7e87d31ad 100644 --- a/src/HealthChecks.Gcp.CloudFirestore/HealthChecks.Gcp.CloudFirestore.csproj +++ b/src/HealthChecks.Gcp.CloudFirestore/HealthChecks.Gcp.CloudFirestore.csproj @@ -9,7 +9,7 @@ - + From f874da0d3bd78c9c72bd818bb6771e923f085914 Mon Sep 17 00:00:00 2001 From: MysticBoy Date: Fri, 7 Jul 2023 15:45:49 +0800 Subject: [PATCH 06/48] Fix InfluxDB CI workflow (#1878) * Update healthchecks_influxdb_ci.yml --- .github/workflows/healthchecks_influxdb_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/healthchecks_influxdb_ci.yml b/.github/workflows/healthchecks_influxdb_ci.yml index 9bedf2ee1d..c76f72b6bb 100644 --- a/.github/workflows/healthchecks_influxdb_ci.yml +++ b/.github/workflows/healthchecks_influxdb_ci.yml @@ -49,7 +49,7 @@ jobs: dotnet build --no-restore ./src/HealthChecks.InfluxDB/HealthChecks.InfluxDB.csproj && dotnet build --no-restore ./test/HealthChecks.InfluxDB.Tests/HealthChecks.InfluxDB.Tests.csproj - name: Setup InfluxDB - uses: maikebing/influxdb-action@v4 + uses: maikebing/influxdb-action@v5 with: influxdb_version: latest influxdb_org: influxdata From 50dc5a8879eee781a3acad14cf791ca0f3beafed Mon Sep 17 00:00:00 2001 From: Mateusz Date: Fri, 7 Jul 2023 09:50:49 +0200 Subject: [PATCH 07/48] Extend Service Bus with Active and Deadletter-Queue thresholds (#1861) --- ...usQueueMessageCountThresholdHealthCheck.cs | 81 + ...reServiceBusQueueMessagesCountThreshold.cs | 23 + ...essagesCountThresholdHealthCheckOptions.cs | 22 + ...eServiceBusHealthCheckBuilderExtensions.cs | 1536 +++++++++-------- ...eBusQueueMessageThresholdCountUnitTests.cs | 55 + ...ageThresholdCountUnitWithTokenUnitTests.cs | 63 + .../HealthChecks.AzureServiceBus.approved.txt | 20 + 7 files changed, 1078 insertions(+), 722 deletions(-) create mode 100644 src/HealthChecks.AzureServiceBus/AzureServiceBusQueueMessageCountThresholdHealthCheck.cs create mode 100644 src/HealthChecks.AzureServiceBus/Configuration/AzureServiceBusQueueMessagesCountThreshold.cs create mode 100644 src/HealthChecks.AzureServiceBus/Configuration/AzureServiceBusQueueMessagesCountThresholdHealthCheckOptions.cs create mode 100644 test/HealthChecks.AzureServiceBus.Tests/DependencyInjection/AzureServiceBusQueueMessageThresholdCountUnitTests.cs create mode 100644 test/HealthChecks.AzureServiceBus.Tests/DependencyInjection/AzureServiceBusQueueMessageThresholdCountUnitWithTokenUnitTests.cs diff --git a/src/HealthChecks.AzureServiceBus/AzureServiceBusQueueMessageCountThresholdHealthCheck.cs b/src/HealthChecks.AzureServiceBus/AzureServiceBusQueueMessageCountThresholdHealthCheck.cs new file mode 100644 index 0000000000..21a12dbeac --- /dev/null +++ b/src/HealthChecks.AzureServiceBus/AzureServiceBusQueueMessageCountThresholdHealthCheck.cs @@ -0,0 +1,81 @@ +using HealthChecks.AzureServiceBus.Configuration; +using Microsoft.Extensions.Diagnostics.HealthChecks; + +namespace HealthChecks.AzureServiceBus; + +public class AzureServiceBusQueueMessageCountThresholdHealthCheck : AzureServiceBusHealthCheck, IHealthCheck +{ + private readonly string _queueName; + private readonly AzureServiceBusQueueMessagesCountThreshold? _activeMessagesThreshold; + private readonly AzureServiceBusQueueMessagesCountThreshold? _deadLetterMessagesThreshold; + + public AzureServiceBusQueueMessageCountThresholdHealthCheck(AzureServiceBusQueueMessagesCountThresholdHealthCheckOptions options) + : base(options) + { + _queueName = Guard.ThrowIfNull(options.QueueName); + _activeMessagesThreshold = options.ActiveMessages; + _deadLetterMessagesThreshold = options.DeadLetterMessages; + } + + protected override string ConnectionKey => $"{Prefix}_{_queueName}"; + + /// + public async Task CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default) + { + try + { + var managementClient = ManagementClientConnections.GetOrAdd(ConnectionKey, CreateManagementClient()); + + var properties = await managementClient.GetQueueRuntimePropertiesAsync(_queueName, cancellationToken).ConfigureAwait(false); + + var activeQueueHealthStatus = CheckHealthStatus( + properties.Value.ActiveMessageCount, + _activeMessagesThreshold, + "queue"); + + if (activeQueueHealthStatus.Status != HealthStatus.Healthy) + { + return activeQueueHealthStatus; + } + + var deadLetterQueueHealthStatus = CheckHealthStatus( + properties.Value.DeadLetterMessageCount, + _deadLetterMessagesThreshold, + "dead letter queue"); + + if (deadLetterQueueHealthStatus.Status != HealthStatus.Healthy) + { + return deadLetterQueueHealthStatus; + } + + return HealthCheckResult.Healthy(); + } + catch (Exception ex) + { + return new HealthCheckResult(context.Registration.FailureStatus, exception: ex); + } + } + + private HealthCheckResult CheckHealthStatus( + long messagesCount, + AzureServiceBusQueueMessagesCountThreshold? threshold, + string queueType) + { + if (threshold is null) + { + return HealthCheckResult.Healthy(); + } + + if (messagesCount >= threshold.Value.UnhealthyThreshold) + { + return HealthCheckResult.Unhealthy($"Message in {queueType} {_queueName} exceeded the amount of messages allowed for the unhealthy threshold {threshold.Value.UnhealthyThreshold}/{messagesCount}"); + } + + if (messagesCount >= threshold.Value.DegradedThreshold) + { + return HealthCheckResult.Degraded($"Message in {queueType} {_queueName} exceeded the amount of messages allowed for the degraded threshold {threshold.Value.DegradedThreshold}/{messagesCount}"); + } + + return HealthCheckResult.Healthy(); + } +} diff --git a/src/HealthChecks.AzureServiceBus/Configuration/AzureServiceBusQueueMessagesCountThreshold.cs b/src/HealthChecks.AzureServiceBus/Configuration/AzureServiceBusQueueMessagesCountThreshold.cs new file mode 100644 index 0000000000..7943bfbf11 --- /dev/null +++ b/src/HealthChecks.AzureServiceBus/Configuration/AzureServiceBusQueueMessagesCountThreshold.cs @@ -0,0 +1,23 @@ +using Microsoft.Extensions.Diagnostics.HealthChecks; + +namespace HealthChecks.AzureServiceBus.Configuration; + +/// +/// Threshold configuration options for . +/// +public struct AzureServiceBusQueueMessagesCountThreshold +{ + /// + /// Number of active/dead letter Service Bus messages in the queue before message health check returned . + /// + public int DegradedThreshold { get; set; } = 5; + + /// + /// Number of active/dead letter Service Bus messages in the queue before message health check returned . + /// + public int UnhealthyThreshold { get; set; } = 10; + + public AzureServiceBusQueueMessagesCountThreshold() + { + } +} diff --git a/src/HealthChecks.AzureServiceBus/Configuration/AzureServiceBusQueueMessagesCountThresholdHealthCheckOptions.cs b/src/HealthChecks.AzureServiceBus/Configuration/AzureServiceBusQueueMessagesCountThresholdHealthCheckOptions.cs new file mode 100644 index 0000000000..f31432f2cb --- /dev/null +++ b/src/HealthChecks.AzureServiceBus/Configuration/AzureServiceBusQueueMessagesCountThresholdHealthCheckOptions.cs @@ -0,0 +1,22 @@ +namespace HealthChecks.AzureServiceBus.Configuration; + +/// +/// Configuration options for . +/// +public class AzureServiceBusQueueMessagesCountThresholdHealthCheckOptions : AzureServiceBusQueueHealthCheckOptions +{ + /// + /// Threshold configuration for active messages queue. + /// + public AzureServiceBusQueueMessagesCountThreshold? ActiveMessages { get; set; } + + /// + /// Threshold configuration for dead letter messages queue. + /// + public AzureServiceBusQueueMessagesCountThreshold? DeadLetterMessages { get; set; } + + public AzureServiceBusQueueMessagesCountThresholdHealthCheckOptions(string queueName) + : base(queueName) + { + } +} diff --git a/src/HealthChecks.AzureServiceBus/DependencyInjection/AzureServiceBusHealthCheckBuilderExtensions.cs b/src/HealthChecks.AzureServiceBus/DependencyInjection/AzureServiceBusHealthCheckBuilderExtensions.cs index 887428c804..6a05ce25bc 100644 --- a/src/HealthChecks.AzureServiceBus/DependencyInjection/AzureServiceBusHealthCheckBuilderExtensions.cs +++ b/src/HealthChecks.AzureServiceBus/DependencyInjection/AzureServiceBusHealthCheckBuilderExtensions.cs @@ -1,722 +1,814 @@ -using Azure.Core; -using Azure.Messaging.EventHubs; -using HealthChecks.AzureServiceBus; -using HealthChecks.AzureServiceBus.Configuration; -using Microsoft.Extensions.Diagnostics.HealthChecks; - -namespace Microsoft.Extensions.DependencyInjection; - -/// -/// Extension methods to configure , -/// , , -/// , . -/// -public static class AzureServiceBusHealthCheckBuilderExtensions -{ - private const string AZUREEVENTHUB_NAME = "azureeventhub"; - private const string AZUREQUEUE_NAME = "azurequeue"; - private const string AZURETOPIC_NAME = "azuretopic"; - private const string AZURESUBSCRIPTION_NAME = "azuresubscription"; - - /// - /// Add a health check for specified Azure Event Hub. - /// - /// The . - /// The azure event hub connection string. - /// The azure event hub name. - /// An optional action to allow additional Azure Event Hub configuration. - /// The health check name. Optional. If null the type name 'azureeventhub' will be used for the name. - /// - /// The that should be reported when the health check fails. Optional. If null then - /// the default status of will be reported. - /// - /// A list of tags that can be used to filter sets of health checks. Optional. - /// An optional representing the timeout of the check. - /// The specified . - public static IHealthChecksBuilder AddAzureEventHub( - this IHealthChecksBuilder builder, - string connectionString, - string eventHubName, - Action? configure = default, - string? name = default, - HealthStatus? failureStatus = default, - IEnumerable? tags = default, - TimeSpan? timeout = default) => - builder.AddAzureEventHub( - _ => connectionString, - _ => eventHubName, - configure, - name, - failureStatus, - tags, - timeout); - - /// - /// Add a health check for specified Azure Event Hub. - /// - /// The . - /// A factory to build the azure event hub connection string. - /// A factory to build the azure event hub name. - /// An optional action to allow additional Azure Event Hub configuration. - /// The health check name. Optional. If null the type name 'azureeventhub' will be used for the name. - /// - /// The that should be reported when the health check fails. Optional. If null then - /// the default status of will be reported. - /// - /// A list of tags that can be used to filter sets of health checks. Optional. - /// An optional representing the timeout of the check. - /// The specified . - public static IHealthChecksBuilder AddAzureEventHub( - this IHealthChecksBuilder builder, - Func connectionStringFactory, - Func eventHubNameFactory, - Action? configure = default, - string? name = default, - HealthStatus? failureStatus = default, - IEnumerable? tags = default, - TimeSpan? timeout = default) - { - Guard.ThrowIfNull(connectionStringFactory); - Guard.ThrowIfNull(eventHubNameFactory); - - return builder.Add(new HealthCheckRegistration( - name ?? AZUREEVENTHUB_NAME, - sp => - { - var options = new AzureEventHubHealthCheckOptions - { - ConnectionString = connectionStringFactory(sp), - EventHubName = eventHubNameFactory(sp) - }; - - configure?.Invoke(options); - return new AzureEventHubHealthCheck(options); - }, - failureStatus, - tags, - timeout)); - } - - /// - /// Add a health check for specified Azure Event Hub. - /// - /// The . - /// The azure event hub fully qualified namespace. - /// The azure event hub name. - /// The token credential for authentication. - /// An optional action to allow additional Azure Event Hub configuration. - /// The health check name. Optional. If null the type name 'azureeventhub' will be used for the name. - /// - /// The that should be reported when the health check fails. Optional. If null then - /// the default status of will be reported. - /// - /// A list of tags that can be used to filter sets of health checks. Optional. - /// An optional representing the timeout of the check. - /// The specified . - public static IHealthChecksBuilder AddAzureEventHub( - this IHealthChecksBuilder builder, - string fullyQualifiedNamespace, - string eventHubName, - TokenCredential tokenCredential, - Action? configure = default, - string? name = default, - HealthStatus? failureStatus = default, - IEnumerable? tags = default, - TimeSpan? timeout = default) => - builder.AddAzureEventHub( - _ => fullyQualifiedNamespace, - _ => eventHubName, - _ => tokenCredential, - configure, - name, - failureStatus, - tags, - timeout); - - /// - /// Add a health check for specified Azure Event Hub. - /// - /// The . - /// A factory to build the azure event hub fully qualified namespace. - /// A factory to build the azure event hub name. - /// A factory to build the token credential for authentication. - /// An optional action to allow additional Azure Event Hub configuration. - /// The health check name. Optional. If null the type name 'azureeventhub' will be used for the name. - /// - /// The that should be reported when the health check fails. Optional. If null then - /// the default status of will be reported. - /// - /// A list of tags that can be used to filter sets of health checks. Optional. - /// An optional representing the timeout of the check. - /// The specified . - public static IHealthChecksBuilder AddAzureEventHub( - this IHealthChecksBuilder builder, - Func fullyQualifiedNamespaceFactory, - Func eventHubNameFactory, - Func tokenCredentialFactory, - Action? configure = default, - string? name = default, - HealthStatus? failureStatus = default, - IEnumerable? tags = default, - TimeSpan? timeout = default) - { - Guard.ThrowIfNull(fullyQualifiedNamespaceFactory); - Guard.ThrowIfNull(eventHubNameFactory); - Guard.ThrowIfNull(tokenCredentialFactory); - - return builder.Add(new HealthCheckRegistration( - name ?? AZUREEVENTHUB_NAME, - sp => - { - var options = new AzureEventHubHealthCheckOptions - { - FullyQualifiedNamespace = fullyQualifiedNamespaceFactory(sp), - EventHubName = eventHubNameFactory(sp), - Credential = tokenCredentialFactory(sp) - }; - - configure?.Invoke(options); - return new AzureEventHubHealthCheck(options); - }, - failureStatus, - tags, - timeout)); - } - - /// - /// Add a health check for specified Azure Event Hub. - /// - /// The . - /// The event hub connection factory used to create a event hub connection for this health check. - /// An optional action to allow additional Azure Event Hub configuration. - /// The health check name. Optional. If null the type name 'azureeventhub' will be used for the name. - /// - /// The that should be reported when the health check fails. Optional. If null then - /// the default status of will be reported. - /// - /// A list of tags that can be used to filter sets of health checks. Optional. - /// An optional representing the timeout of the check. - /// The specified . - public static IHealthChecksBuilder AddAzureEventHub( - this IHealthChecksBuilder builder, - Func eventHubConnectionFactory, - Action? configure = default, - string? name = default, - HealthStatus? failureStatus = default, - IEnumerable? tags = default, - TimeSpan? timeout = default) - { - Guard.ThrowIfNull(eventHubConnectionFactory); - - return builder.Add(new HealthCheckRegistration( - name ?? AZUREEVENTHUB_NAME, - sp => - { - var options = new AzureEventHubHealthCheckOptions { Connection = eventHubConnectionFactory(sp) }; - configure?.Invoke(options); - return new AzureEventHubHealthCheck(options); - }, - failureStatus, - tags, - timeout)); - } - - /// - /// Add a health check for specified Azure Service Bus Queue. - /// - /// The . - /// The azure service bus connection string to be used. - /// The name of the queue to check. - /// An optional action to allow additional Azure Service Bus configuration. - /// The health check name. Optional. If null the type name 'azurequeue' will be used for the name. - /// - /// The that should be reported when the health check fails. Optional. If null then - /// the default status of will be reported. - /// - /// A list of tags that can be used to filter sets of health checks. Optional. - /// An optional representing the timeout of the check. - /// The specified . - public static IHealthChecksBuilder AddAzureServiceBusQueue( - this IHealthChecksBuilder builder, - string connectionString, - string queueName, - Action? configure = default, - string? name = default, - HealthStatus? failureStatus = default, - IEnumerable? tags = default, - TimeSpan? timeout = default) => - builder.AddAzureServiceBusQueue( - _ => connectionString, - _ => queueName, - configure, - name, - failureStatus, - tags, - timeout); - - /// - /// Add a health check for specified Azure Service Bus Queue. - /// - /// The . - /// A factory to build the azure service bus connection string to be used. - /// A factory to build the queue name to check. - /// An optional action to allow additional Azure Service Bus configuration. - /// The health check name. Optional. If null the type name 'azurequeue' will be used for the name. - /// - /// The that should be reported when the health check fails. Optional. If null then - /// the default status of will be reported. - /// - /// A list of tags that can be used to filter sets of health checks. Optional. - /// An optional representing the timeout of the check. - /// The specified . - public static IHealthChecksBuilder AddAzureServiceBusQueue( - this IHealthChecksBuilder builder, - Func connectionStringFactory, - Func queueNameFactory, - Action? configure = default, - string? name = default, - HealthStatus? failureStatus = default, - IEnumerable? tags = default, - TimeSpan? timeout = default) - { - Guard.ThrowIfNull(connectionStringFactory); - Guard.ThrowIfNull(queueNameFactory); - - return builder.Add(new HealthCheckRegistration( - name ?? AZUREQUEUE_NAME, - sp => - { - var options = new AzureServiceBusQueueHealthCheckOptions(queueNameFactory(sp)) - { - ConnectionString = connectionStringFactory(sp) - }; - - configure?.Invoke(options); - return new AzureServiceBusQueueHealthCheck(options); - }, - failureStatus, - tags, - timeout)); - } - - /// - /// Add a health check for specified Azure Service Bus Queue. - /// - /// The . - /// The azure service bus fully qualified namespace to be used, format sb://myservicebus.servicebus.windows.net/. - /// The name of the queue to check. - /// The token credential for authentication. - /// An optional action to allow additional Azure Service Bus configuration. - /// The health check name. Optional. If null the type name 'azurequeue' will be used for the name. - /// - /// The that should be reported when the health check fails. Optional. If null then - /// the default status of will be reported. - /// - /// A list of tags that can be used to filter sets of health checks. Optional. - /// An optional representing the timeout of the check. - /// The specified . - public static IHealthChecksBuilder AddAzureServiceBusQueue( - this IHealthChecksBuilder builder, - string fullyQualifiedNamespace, - string queueName, - TokenCredential tokenCredential, - Action? configure = default, - string? name = default, - HealthStatus? failureStatus = default, - IEnumerable? tags = default, - TimeSpan? timeout = default) => - builder.AddAzureServiceBusQueue( - _ => fullyQualifiedNamespace, - _ => queueName, - _ => tokenCredential, - configure, - name, - failureStatus, - tags, - timeout); - - /// - /// Add a health check for specified Azure Service Bus Queue. - /// - /// The . - /// A factory to build the azure service bus fully qualified namespace to be used, format sb://myservicebus.servicebus.windows.net/. - /// A factory to build the name of the queue to check. - /// A factory to build the token credential for authentication. - /// An optional action to allow additional Azure Service Bus configuration. - /// The health check name. Optional. If null the type name 'azurequeue' will be used for the name. - /// - /// The that should be reported when the health check fails. Optional. If null then - /// the default status of will be reported. - /// - /// A list of tags that can be used to filter sets of health checks. Optional. - /// An optional representing the timeout of the check. - /// The specified . - public static IHealthChecksBuilder AddAzureServiceBusQueue( - this IHealthChecksBuilder builder, - Func fullyQualifiedNamespaceFactory, - Func queueNameFactory, - Func tokenCredentialFactory, - Action? configure = default, - string? name = default, - HealthStatus? failureStatus = default, - IEnumerable? tags = default, - TimeSpan? timeout = default) - { - Guard.ThrowIfNull(fullyQualifiedNamespaceFactory); - Guard.ThrowIfNull(queueNameFactory); - Guard.ThrowIfNull(tokenCredentialFactory); - - return builder.Add(new HealthCheckRegistration( - name ?? AZUREQUEUE_NAME, - sp => - { - var options = new AzureServiceBusQueueHealthCheckOptions(queueNameFactory(sp)) - { - FullyQualifiedNamespace = fullyQualifiedNamespaceFactory(sp), - Credential = tokenCredentialFactory(sp) - }; - - configure?.Invoke(options); - return new AzureServiceBusQueueHealthCheck(options); - }, - failureStatus, - tags, - timeout)); - } - - /// - /// Add a health check for Azure Service Bus Topic. - /// - /// The . - /// The Azure ServiceBus connection string to be used. - /// The name of the topic to check. - /// An optional action to allow additional Azure Service Bus configuration. - /// The health check name. Optional. If null the type name 'azuretopic' will be used for the name. - /// - /// The that should be reported when the health check fails. Optional. If null then - /// the default status of will be reported. - /// - /// A list of tags that can be used to filter sets of health checks. Optional. - /// An optional representing the timeout of the check. - /// The specified . - public static IHealthChecksBuilder AddAzureServiceBusTopic( - this IHealthChecksBuilder builder, - string connectionString, - string topicName, - Action? configure = default, - string? name = default, - HealthStatus? failureStatus = default, - IEnumerable? tags = default, - TimeSpan? timeout = default) => - builder.AddAzureServiceBusTopic( - _ => connectionString, - _ => topicName, - configure, - name, - failureStatus, - tags, - timeout); - - /// - /// Add a health check for Azure Service Bus Topic. - /// - /// The . - /// A factory to build the Azure ServiceBus connection string to be used. - /// A factory to build the name of the topic to check. - /// An optional action to allow additional Azure Service Bus configuration. - /// The health check name. Optional. If null the type name 'azuretopic' will be used for the name. - /// - /// The that should be reported when the health check fails. Optional. If null then - /// the default status of will be reported. - /// - /// A list of tags that can be used to filter sets of health checks. Optional. - /// An optional representing the timeout of the check. - /// The specified . - public static IHealthChecksBuilder AddAzureServiceBusTopic( - this IHealthChecksBuilder builder, - Func connectionStringFactory, - Func topicNameFactory, - Action? configure = default, - string? name = default, - HealthStatus? failureStatus = default, - IEnumerable? tags = default, - TimeSpan? timeout = default) - { - Guard.ThrowIfNull(connectionStringFactory); - Guard.ThrowIfNull(topicNameFactory); - - return builder.Add(new HealthCheckRegistration( - name ?? AZURETOPIC_NAME, - sp => - { - var options = new AzureServiceBusTopicHealthCheckOptions(topicNameFactory(sp)) - { - ConnectionString = connectionStringFactory(sp) - }; - - configure?.Invoke(options); - return new AzureServiceBusTopicHealthCheck(options); - }, - failureStatus, - tags, - timeout)); - } - - /// - /// Add a health check for Azure Service Bus Topic. - /// - /// The . - /// The azure service bus fully qualified namespace to be used, format sb://myservicebus.servicebus.windows.net/. - /// The name of the topic to check. - /// The token credential for authentication. - /// The health check name. Optional. If null the type name 'azuretopic' will be used for the name. - /// - /// The that should be reported when the health check fails. Optional. If null then - /// the default status of will be reported. - /// - /// A list of tags that can be used to filter sets of health checks. Optional. - /// An optional representing the timeout of the check. - /// The specified . - public static IHealthChecksBuilder AddAzureServiceBusTopic( - this IHealthChecksBuilder builder, - string fullyQualifiedNamespace, - string topicName, - TokenCredential tokenCredential, - string? name = default, - HealthStatus? failureStatus = default, - IEnumerable? tags = default, - TimeSpan? timeout = default) => - builder.AddAzureServiceBusTopic( - _ => fullyQualifiedNamespace, - _ => topicName, - _ => tokenCredential, - configure: null, - name, - failureStatus, - tags, - timeout); - - /// - /// Add a health check for Azure Service Bus Topic. - /// - /// The . - /// A factory to build the azure service bus fully qualified namespace to be used, format sb://myservicebus.servicebus.windows.net/. - /// A factory to build the name of the topic to check. - /// A factory to build the token credential for authentication. - /// An optional action to allow additional Azure Service Bus configuration. - /// The health check name. Optional. If null the type name 'azuretopic' will be used for the name. - /// - /// The that should be reported when the health check fails. Optional. If null then - /// the default status of will be reported. - /// - /// A list of tags that can be used to filter sets of health checks. Optional. - /// An optional representing the timeout of the check. - /// The specified . - public static IHealthChecksBuilder AddAzureServiceBusTopic( - this IHealthChecksBuilder builder, - Func fullyQualifiedNamespaceFactory, - Func topicNameFactory, - Func tokenCredentialFactory, - Action? configure = default, - string? name = default, - HealthStatus? failureStatus = default, - IEnumerable? tags = default, - TimeSpan? timeout = default) - { - Guard.ThrowIfNull(fullyQualifiedNamespaceFactory); - Guard.ThrowIfNull(topicNameFactory); - Guard.ThrowIfNull(tokenCredentialFactory); - - return builder.Add(new HealthCheckRegistration( - name ?? AZURETOPIC_NAME, - sp => - { - var options = new AzureServiceBusTopicHealthCheckOptions(topicNameFactory(sp)) - { - FullyQualifiedNamespace = fullyQualifiedNamespaceFactory(sp), - Credential = tokenCredentialFactory(sp) - }; - - configure?.Invoke(options); - return new AzureServiceBusTopicHealthCheck(options); - }, - failureStatus, - tags, - timeout)); - } - - /// - /// Add a health check for Azure Service Bus Subscription. - /// - /// The . - /// The Azure ServiceBus connection string to be used. - /// The name of the topic to check. - /// The subscription name of the topic subscription to check. - /// An optional action to allow additional Azure Service Bus configuration. - /// The health check name. Optional. If null the type name 'azuretopic' will be used for the name. - /// - /// The that should be reported when the health check fails. Optional. If null then - /// the default status of will be reported. - /// - /// A list of tags that can be used to filter sets of health checks. Optional. - /// An optional representing the timeout of the check. - /// The specified . - public static IHealthChecksBuilder AddAzureServiceBusSubscription( - this IHealthChecksBuilder builder, - string connectionString, - string topicName, - string subscriptionName, - Action? configure = default, - string? name = default, - HealthStatus? failureStatus = default, - IEnumerable? tags = default, - TimeSpan? timeout = default) => - builder.AddAzureServiceBusSubscription( - _ => connectionString, - _ => topicName, - _ => subscriptionName, - configure, - name, - failureStatus, - tags, - timeout); - - /// - /// Add a health check for Azure Service Bus Subscription. - /// - /// The . - /// A factory to build the Azure ServiceBus connection string to be used. - /// A factory to build the name of the topic to check. - /// A factory to build the subscription name of the topic subscription to check. - /// An optional action to allow additional Azure Service Bus configuration. - /// The health check name. Optional. If null the type name 'azuretopic' will be used for the name. - /// - /// The that should be reported when the health check fails. Optional. If null then - /// the default status of will be reported. - /// - /// A list of tags that can be used to filter sets of health checks. Optional. - /// An optional representing the timeout of the check. - /// The specified . - public static IHealthChecksBuilder AddAzureServiceBusSubscription( - this IHealthChecksBuilder builder, - Func connectionStringFactory, - Func topicNameFactory, - Func subscriptionNameFactory, - Action? configure = default, - string? name = default, - HealthStatus? failureStatus = default, - IEnumerable? tags = default, - TimeSpan? timeout = default) - { - Guard.ThrowIfNull(connectionStringFactory); - Guard.ThrowIfNull(topicNameFactory); - Guard.ThrowIfNull(subscriptionNameFactory); - - return builder.Add(new HealthCheckRegistration( - name ?? AZURESUBSCRIPTION_NAME, - sp => - { - var options = new AzureServiceBusSubscriptionHealthCheckHealthCheckOptions(topicNameFactory(sp), subscriptionNameFactory(sp)) - { - ConnectionString = connectionStringFactory(sp) - }; - - configure?.Invoke(options); - return new AzureServiceBusSubscriptionHealthCheck(options); - }, - failureStatus, - tags, - timeout)); - } - - /// - /// Add a health check for Azure Service Bus Subscription. - /// - /// The . - /// The azure service bus fully qualified namespace to be used, format sb://myservicebus.servicebus.windows.net/. - /// The name of the topic to check. - /// The subscription name of the topic subscription to check. - /// The token credential for authentication. - /// An optional action to allow additional Azure Service Bus configuration. - /// The health check name. Optional. If null the type name 'azuretopic' will be used for the name. - /// - /// The that should be reported when the health check fails. Optional. If null then - /// the default status of will be reported. - /// - /// A list of tags that can be used to filter sets of health checks. Optional. - /// An optional representing the timeout of the check. - /// The specified . - public static IHealthChecksBuilder AddAzureServiceBusSubscription( - this IHealthChecksBuilder builder, - string fullyQualifiedNamespace, - string topicName, - string subscriptionName, - TokenCredential tokenCredential, - Action? configure = default, - string? name = default, - HealthStatus? failureStatus = default, - IEnumerable? tags = default, - TimeSpan? timeout = default) => - builder.AddAzureServiceBusSubscription( - _ => fullyQualifiedNamespace, - _ => topicName, - _ => subscriptionName, - _ => tokenCredential, - configure, - name, - failureStatus, - tags, - timeout); - - /// - /// Add a health check for Azure Service Bus Subscription. - /// - /// The . - /// A factory to build the azure service bus fully qualified namespace to be used, format sb://myservicebus.servicebus.windows.net/. - /// A factory to build the name of the topic to check. - /// A factory to build the subscription name of the topic subscription to check. - /// A factory to build the token credential for authentication. - /// An optional action to allow additional Azure Service Bus configuration. - /// The health check name. Optional. If null the type name 'azuretopic' will be used for the name. - /// - /// The that should be reported when the health check fails. Optional. If null then - /// the default status of will be reported. - /// - /// A list of tags that can be used to filter sets of health checks. Optional. - /// An optional representing the timeout of the check. - /// The specified . - public static IHealthChecksBuilder AddAzureServiceBusSubscription( - this IHealthChecksBuilder builder, - Func fullyQualifiedNamespaceFactory, - Func topicNameFactory, - Func subscriptionNameFactory, - Func tokenCredentialFactory, - Action? configure = default, - string? name = default, - HealthStatus? failureStatus = default, - IEnumerable? tags = default, - TimeSpan? timeout = default) - { - Guard.ThrowIfNull(fullyQualifiedNamespaceFactory); - Guard.ThrowIfNull(topicNameFactory); - Guard.ThrowIfNull(subscriptionNameFactory); - Guard.ThrowIfNull(tokenCredentialFactory); - - return builder.Add(new HealthCheckRegistration( - name ?? AZURESUBSCRIPTION_NAME, - sp => - { - var options = new AzureServiceBusSubscriptionHealthCheckHealthCheckOptions(topicNameFactory(sp), subscriptionNameFactory(sp)) - { - FullyQualifiedNamespace = fullyQualifiedNamespaceFactory(sp), - Credential = tokenCredentialFactory(sp) - }; - - configure?.Invoke(options); - return new AzureServiceBusSubscriptionHealthCheck(options); - }, - failureStatus, - tags, - timeout)); - } -} +using Azure.Core; +using Azure.Messaging.EventHubs; +using HealthChecks.AzureServiceBus; +using HealthChecks.AzureServiceBus.Configuration; +using Microsoft.Extensions.Diagnostics.HealthChecks; + +namespace Microsoft.Extensions.DependencyInjection; + +/// +/// Extension methods to configure , +/// , , +/// , , +/// . +/// +public static class AzureServiceBusHealthCheckBuilderExtensions +{ + private const string AZUREEVENTHUB_NAME = "azureeventhub"; + private const string AZUREQUEUE_NAME = "azurequeue"; + private const string AZURETOPIC_NAME = "azuretopic"; + private const string AZURESUBSCRIPTION_NAME = "azuresubscription"; + private const string AZUREQUEUETHRESHOLD_NAME = "azurequeuethreshold"; + + /// + /// Add a health check for specified Azure Event Hub. + /// + /// The . + /// The azure event hub connection string. + /// The azure event hub name. + /// An optional action to allow additional Azure Event Hub configuration. + /// The health check name. Optional. If null the type name 'azureeventhub' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddAzureEventHub( + this IHealthChecksBuilder builder, + string connectionString, + string eventHubName, + Action? configure = default, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) => + builder.AddAzureEventHub( + _ => connectionString, + _ => eventHubName, + configure, + name, + failureStatus, + tags, + timeout); + + /// + /// Add a health check for specified Azure Event Hub. + /// + /// The . + /// A factory to build the azure event hub connection string. + /// A factory to build the azure event hub name. + /// An optional action to allow additional Azure Event Hub configuration. + /// The health check name. Optional. If null the type name 'azureeventhub' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddAzureEventHub( + this IHealthChecksBuilder builder, + Func connectionStringFactory, + Func eventHubNameFactory, + Action? configure = default, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) + { + Guard.ThrowIfNull(connectionStringFactory); + Guard.ThrowIfNull(eventHubNameFactory); + + return builder.Add(new HealthCheckRegistration( + name ?? AZUREEVENTHUB_NAME, + sp => + { + var options = new AzureEventHubHealthCheckOptions + { + ConnectionString = connectionStringFactory(sp), + EventHubName = eventHubNameFactory(sp) + }; + + configure?.Invoke(options); + return new AzureEventHubHealthCheck(options); + }, + failureStatus, + tags, + timeout)); + } + + /// + /// Add a health check for specified Azure Event Hub. + /// + /// The . + /// The azure event hub fully qualified namespace. + /// The azure event hub name. + /// The token credential for authentication. + /// An optional action to allow additional Azure Event Hub configuration. + /// The health check name. Optional. If null the type name 'azureeventhub' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddAzureEventHub( + this IHealthChecksBuilder builder, + string fullyQualifiedNamespace, + string eventHubName, + TokenCredential tokenCredential, + Action? configure = default, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) => + builder.AddAzureEventHub( + _ => fullyQualifiedNamespace, + _ => eventHubName, + _ => tokenCredential, + configure, + name, + failureStatus, + tags, + timeout); + + /// + /// Add a health check for specified Azure Event Hub. + /// + /// The . + /// A factory to build the azure event hub fully qualified namespace. + /// A factory to build the azure event hub name. + /// A factory to build the token credential for authentication. + /// An optional action to allow additional Azure Event Hub configuration. + /// The health check name. Optional. If null the type name 'azureeventhub' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddAzureEventHub( + this IHealthChecksBuilder builder, + Func fullyQualifiedNamespaceFactory, + Func eventHubNameFactory, + Func tokenCredentialFactory, + Action? configure = default, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) + { + Guard.ThrowIfNull(fullyQualifiedNamespaceFactory); + Guard.ThrowIfNull(eventHubNameFactory); + Guard.ThrowIfNull(tokenCredentialFactory); + + return builder.Add(new HealthCheckRegistration( + name ?? AZUREEVENTHUB_NAME, + sp => + { + var options = new AzureEventHubHealthCheckOptions + { + FullyQualifiedNamespace = fullyQualifiedNamespaceFactory(sp), + EventHubName = eventHubNameFactory(sp), + Credential = tokenCredentialFactory(sp) + }; + + configure?.Invoke(options); + return new AzureEventHubHealthCheck(options); + }, + failureStatus, + tags, + timeout)); + } + + /// + /// Add a health check for specified Azure Event Hub. + /// + /// The . + /// The event hub connection factory used to create a event hub connection for this health check. + /// An optional action to allow additional Azure Event Hub configuration. + /// The health check name. Optional. If null the type name 'azureeventhub' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddAzureEventHub( + this IHealthChecksBuilder builder, + Func eventHubConnectionFactory, + Action? configure = default, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) + { + Guard.ThrowIfNull(eventHubConnectionFactory); + + return builder.Add(new HealthCheckRegistration( + name ?? AZUREEVENTHUB_NAME, + sp => + { + var options = new AzureEventHubHealthCheckOptions { Connection = eventHubConnectionFactory(sp) }; + configure?.Invoke(options); + return new AzureEventHubHealthCheck(options); + }, + failureStatus, + tags, + timeout)); + } + + /// + /// Add a health check for specified Azure Service Bus Queue. + /// + /// The . + /// The azure service bus connection string to be used. + /// The name of the queue to check. + /// An optional action to allow additional Azure Service Bus configuration. + /// The health check name. Optional. If null the type name 'azurequeue' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddAzureServiceBusQueue( + this IHealthChecksBuilder builder, + string connectionString, + string queueName, + Action? configure = default, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) => + builder.AddAzureServiceBusQueue( + _ => connectionString, + _ => queueName, + configure, + name, + failureStatus, + tags, + timeout); + + /// + /// Add a health check for specified Azure Service Bus Queue. + /// + /// The . + /// A factory to build the azure service bus connection string to be used. + /// A factory to build the queue name to check. + /// An optional action to allow additional Azure Service Bus configuration. + /// The health check name. Optional. If null the type name 'azurequeue' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddAzureServiceBusQueue( + this IHealthChecksBuilder builder, + Func connectionStringFactory, + Func queueNameFactory, + Action? configure = default, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) + { + Guard.ThrowIfNull(connectionStringFactory); + Guard.ThrowIfNull(queueNameFactory); + + return builder.Add(new HealthCheckRegistration( + name ?? AZUREQUEUE_NAME, + sp => + { + var options = new AzureServiceBusQueueHealthCheckOptions(queueNameFactory(sp)) + { + ConnectionString = connectionStringFactory(sp) + }; + + configure?.Invoke(options); + return new AzureServiceBusQueueHealthCheck(options); + }, + failureStatus, + tags, + timeout)); + } + + /// + /// Add a health check for specified Azure Service Bus Queue. + /// + /// The . + /// The azure service bus fully qualified namespace to be used, format sb://myservicebus.servicebus.windows.net/. + /// The name of the queue to check. + /// The token credential for authentication. + /// An optional action to allow additional Azure Service Bus configuration. + /// The health check name. Optional. If null the type name 'azurequeue' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddAzureServiceBusQueue( + this IHealthChecksBuilder builder, + string fullyQualifiedNamespace, + string queueName, + TokenCredential tokenCredential, + Action? configure = default, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) => + builder.AddAzureServiceBusQueue( + _ => fullyQualifiedNamespace, + _ => queueName, + _ => tokenCredential, + configure, + name, + failureStatus, + tags, + timeout); + + /// + /// Add a health check for specified Azure Service Bus Queue. + /// + /// The . + /// A factory to build the azure service bus fully qualified namespace to be used, format sb://myservicebus.servicebus.windows.net/. + /// A factory to build the name of the queue to check. + /// A factory to build the token credential for authentication. + /// An optional action to allow additional Azure Service Bus configuration. + /// The health check name. Optional. If null the type name 'azurequeue' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddAzureServiceBusQueue( + this IHealthChecksBuilder builder, + Func fullyQualifiedNamespaceFactory, + Func queueNameFactory, + Func tokenCredentialFactory, + Action? configure = default, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) + { + Guard.ThrowIfNull(fullyQualifiedNamespaceFactory); + Guard.ThrowIfNull(queueNameFactory); + Guard.ThrowIfNull(tokenCredentialFactory); + + return builder.Add(new HealthCheckRegistration( + name ?? AZUREQUEUE_NAME, + sp => + { + var options = new AzureServiceBusQueueHealthCheckOptions(queueNameFactory(sp)) + { + FullyQualifiedNamespace = fullyQualifiedNamespaceFactory(sp), + Credential = tokenCredentialFactory(sp) + }; + + configure?.Invoke(options); + return new AzureServiceBusQueueHealthCheck(options); + }, + failureStatus, + tags, + timeout)); + } + + /// + /// Add a health check for specified Azure Service Bus Queue active or dead letter messages threshold. + /// + /// The . + /// The azure service bus connection string to be used. + /// The name of the queue to check. + /// The health check name. Optional. If null the type name 'azurequeuethreshold' will be used for the name. + /// An optional action to allow additional Azure Service Bus configuration. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The . + public static IHealthChecksBuilder AddAzureServiceBusQueueMessageCountThreshold( + this IHealthChecksBuilder builder, + string connectionString, + string queueName, + string? name = default, + Action? configure = null, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) + { + Guard.ThrowIfNull(connectionString); + Guard.ThrowIfNull(queueName); + + var options = new AzureServiceBusQueueMessagesCountThresholdHealthCheckOptions(queueName) + { + ConnectionString = connectionString, + }; + + configure?.Invoke(options); + + return builder.Add(new HealthCheckRegistration( + name ?? AZUREQUEUETHRESHOLD_NAME, + sp => new AzureServiceBusQueueMessageCountThresholdHealthCheck(options), + failureStatus, + tags, + timeout)); + } + + /// + /// Add a health check for specified Azure Service Bus Queue active or dead letter messages threshold. + /// + /// The . + /// The azure service bus endpoint to be used, format sb://myservicebus.servicebus.windows.net/. + /// The name of the queue to check. + /// The token credential for authentication. + /// An optional action to allow additional Azure Service Bus configuration. + /// The health check name. Optional. If null the type name 'azurequeuethreshold' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The . + public static IHealthChecksBuilder AddAzureServiceBusQueueMessageCountThreshold( + this IHealthChecksBuilder builder, + string endpoint, + string queueName, + TokenCredential tokenCredential, + Action? configure = null, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) + { + Guard.ThrowIfNull(endpoint); + Guard.ThrowIfNull(queueName); + Guard.ThrowIfNull(tokenCredential); + + var options = new AzureServiceBusQueueMessagesCountThresholdHealthCheckOptions(queueName) + { + FullyQualifiedNamespace = endpoint, + Credential = tokenCredential, + }; + + configure?.Invoke(options); + + return builder.Add(new HealthCheckRegistration( + name ?? AZUREQUEUETHRESHOLD_NAME, + sp => new AzureServiceBusQueueMessageCountThresholdHealthCheck(options), + failureStatus, + tags, + timeout)); + } + + /// + /// Add a health check for Azure Service Bus Topic. + /// + /// The . + /// The Azure ServiceBus connection string to be used. + /// The name of the topic to check. + /// An optional action to allow additional Azure Service Bus configuration. + /// The health check name. Optional. If null the type name 'azuretopic' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddAzureServiceBusTopic( + this IHealthChecksBuilder builder, + string connectionString, + string topicName, + Action? configure = default, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) => + builder.AddAzureServiceBusTopic( + _ => connectionString, + _ => topicName, + configure, + name, + failureStatus, + tags, + timeout); + + /// + /// Add a health check for Azure Service Bus Topic. + /// + /// The . + /// A factory to build the Azure ServiceBus connection string to be used. + /// A factory to build the name of the topic to check. + /// An optional action to allow additional Azure Service Bus configuration. + /// The health check name. Optional. If null the type name 'azuretopic' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddAzureServiceBusTopic( + this IHealthChecksBuilder builder, + Func connectionStringFactory, + Func topicNameFactory, + Action? configure = default, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) + { + Guard.ThrowIfNull(connectionStringFactory); + Guard.ThrowIfNull(topicNameFactory); + + return builder.Add(new HealthCheckRegistration( + name ?? AZURETOPIC_NAME, + sp => + { + var options = new AzureServiceBusTopicHealthCheckOptions(topicNameFactory(sp)) + { + ConnectionString = connectionStringFactory(sp) + }; + + configure?.Invoke(options); + return new AzureServiceBusTopicHealthCheck(options); + }, + failureStatus, + tags, + timeout)); + } + + /// + /// Add a health check for Azure Service Bus Topic. + /// + /// The . + /// The azure service bus fully qualified namespace to be used, format sb://myservicebus.servicebus.windows.net/. + /// The name of the topic to check. + /// The token credential for authentication. + /// The health check name. Optional. If null the type name 'azuretopic' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddAzureServiceBusTopic( + this IHealthChecksBuilder builder, + string fullyQualifiedNamespace, + string topicName, + TokenCredential tokenCredential, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) => + builder.AddAzureServiceBusTopic( + _ => fullyQualifiedNamespace, + _ => topicName, + _ => tokenCredential, + configure: null, + name, + failureStatus, + tags, + timeout); + + /// + /// Add a health check for Azure Service Bus Topic. + /// + /// The . + /// A factory to build the azure service bus fully qualified namespace to be used, format sb://myservicebus.servicebus.windows.net/. + /// A factory to build the name of the topic to check. + /// A factory to build the token credential for authentication. + /// An optional action to allow additional Azure Service Bus configuration. + /// The health check name. Optional. If null the type name 'azuretopic' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddAzureServiceBusTopic( + this IHealthChecksBuilder builder, + Func fullyQualifiedNamespaceFactory, + Func topicNameFactory, + Func tokenCredentialFactory, + Action? configure = default, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) + { + Guard.ThrowIfNull(fullyQualifiedNamespaceFactory); + Guard.ThrowIfNull(topicNameFactory); + Guard.ThrowIfNull(tokenCredentialFactory); + + return builder.Add(new HealthCheckRegistration( + name ?? AZURETOPIC_NAME, + sp => + { + var options = new AzureServiceBusTopicHealthCheckOptions(topicNameFactory(sp)) + { + FullyQualifiedNamespace = fullyQualifiedNamespaceFactory(sp), + Credential = tokenCredentialFactory(sp) + }; + + configure?.Invoke(options); + return new AzureServiceBusTopicHealthCheck(options); + }, + failureStatus, + tags, + timeout)); + } + + /// + /// Add a health check for Azure Service Bus Subscription. + /// + /// The . + /// The Azure ServiceBus connection string to be used. + /// The name of the topic to check. + /// The subscription name of the topic subscription to check. + /// An optional action to allow additional Azure Service Bus configuration. + /// The health check name. Optional. If null the type name 'azuretopic' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddAzureServiceBusSubscription( + this IHealthChecksBuilder builder, + string connectionString, + string topicName, + string subscriptionName, + Action? configure = default, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) => + builder.AddAzureServiceBusSubscription( + _ => connectionString, + _ => topicName, + _ => subscriptionName, + configure, + name, + failureStatus, + tags, + timeout); + + /// + /// Add a health check for Azure Service Bus Subscription. + /// + /// The . + /// A factory to build the Azure ServiceBus connection string to be used. + /// A factory to build the name of the topic to check. + /// A factory to build the subscription name of the topic subscription to check. + /// An optional action to allow additional Azure Service Bus configuration. + /// The health check name. Optional. If null the type name 'azuretopic' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddAzureServiceBusSubscription( + this IHealthChecksBuilder builder, + Func connectionStringFactory, + Func topicNameFactory, + Func subscriptionNameFactory, + Action? configure = default, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) + { + Guard.ThrowIfNull(connectionStringFactory); + Guard.ThrowIfNull(topicNameFactory); + Guard.ThrowIfNull(subscriptionNameFactory); + + return builder.Add(new HealthCheckRegistration( + name ?? AZURESUBSCRIPTION_NAME, + sp => + { + var options = new AzureServiceBusSubscriptionHealthCheckHealthCheckOptions(topicNameFactory(sp), subscriptionNameFactory(sp)) + { + ConnectionString = connectionStringFactory(sp) + }; + + configure?.Invoke(options); + return new AzureServiceBusSubscriptionHealthCheck(options); + }, + failureStatus, + tags, + timeout)); + } + + /// + /// Add a health check for Azure Service Bus Subscription. + /// + /// The . + /// The azure service bus fully qualified namespace to be used, format sb://myservicebus.servicebus.windows.net/. + /// The name of the topic to check. + /// The subscription name of the topic subscription to check. + /// The token credential for authentication. + /// An optional action to allow additional Azure Service Bus configuration. + /// The health check name. Optional. If null the type name 'azuretopic' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddAzureServiceBusSubscription( + this IHealthChecksBuilder builder, + string fullyQualifiedNamespace, + string topicName, + string subscriptionName, + TokenCredential tokenCredential, + Action? configure = default, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) => + builder.AddAzureServiceBusSubscription( + _ => fullyQualifiedNamespace, + _ => topicName, + _ => subscriptionName, + _ => tokenCredential, + configure, + name, + failureStatus, + tags, + timeout); + + /// + /// Add a health check for Azure Service Bus Subscription. + /// + /// The . + /// A factory to build the azure service bus fully qualified namespace to be used, format sb://myservicebus.servicebus.windows.net/. + /// A factory to build the name of the topic to check. + /// A factory to build the subscription name of the topic subscription to check. + /// A factory to build the token credential for authentication. + /// An optional action to allow additional Azure Service Bus configuration. + /// The health check name. Optional. If null the type name 'azuretopic' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddAzureServiceBusSubscription( + this IHealthChecksBuilder builder, + Func fullyQualifiedNamespaceFactory, + Func topicNameFactory, + Func subscriptionNameFactory, + Func tokenCredentialFactory, + Action? configure = default, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) + { + Guard.ThrowIfNull(fullyQualifiedNamespaceFactory); + Guard.ThrowIfNull(topicNameFactory); + Guard.ThrowIfNull(subscriptionNameFactory); + Guard.ThrowIfNull(tokenCredentialFactory); + + return builder.Add(new HealthCheckRegistration( + name ?? AZURESUBSCRIPTION_NAME, + sp => + { + var options = new AzureServiceBusSubscriptionHealthCheckHealthCheckOptions(topicNameFactory(sp), subscriptionNameFactory(sp)) + { + FullyQualifiedNamespace = fullyQualifiedNamespaceFactory(sp), + Credential = tokenCredentialFactory(sp) + }; + + configure?.Invoke(options); + return new AzureServiceBusSubscriptionHealthCheck(options); + }, + failureStatus, + tags, + timeout)); + } +} diff --git a/test/HealthChecks.AzureServiceBus.Tests/DependencyInjection/AzureServiceBusQueueMessageThresholdCountUnitTests.cs b/test/HealthChecks.AzureServiceBus.Tests/DependencyInjection/AzureServiceBusQueueMessageThresholdCountUnitTests.cs new file mode 100644 index 0000000000..36ec4bad0a --- /dev/null +++ b/test/HealthChecks.AzureServiceBus.Tests/DependencyInjection/AzureServiceBusQueueMessageThresholdCountUnitTests.cs @@ -0,0 +1,55 @@ +namespace HealthChecks.AzureServiceBus.Tests.DependencyInjection; + +public class azure_service_bus_queue_message_threshold_registration_should +{ + [Fact] + public void add_health_check_when_properly_configured() + { + var services = new ServiceCollection(); + services.AddHealthChecks() + .AddAzureServiceBusQueueMessageCountThreshold("cnn", "queueName"); + + using var serviceProvider = services.BuildServiceProvider(); + var options = serviceProvider.GetRequiredService>(); + + var registration = options.Value.Registrations.First(); + var check = registration.Factory(serviceProvider); + + registration.Name.ShouldBe("azurequeuethreshold"); + check.ShouldBeOfType(); + } + + [Fact] + public void add_named_health_check_when_properly_configured() + { + var services = new ServiceCollection(); + services.AddHealthChecks() + .AddAzureServiceBusQueueMessageCountThreshold("cnn", "queueName", + name: "azureservicebusqueuemessagethresholdcheck"); + + using var serviceProvider = services.BuildServiceProvider(); + var options = serviceProvider.GetRequiredService>(); + + var registration = options.Value.Registrations.First(); + var check = registration.Factory(serviceProvider); + + registration.Name.ShouldBe("azureservicebusqueuemessagethresholdcheck"); + check.ShouldBeOfType(); + } + + [Fact] + public void fail_when_no_health_check_configuration_provided() + { + var services = new ServiceCollection(); + services.AddHealthChecks() + .AddAzureServiceBusQueue(string.Empty, string.Empty); + + using var serviceProvider = services.BuildServiceProvider(); + var options = serviceProvider.GetRequiredService>(); + + var registration = options.Value.Registrations.First(); + var factory = () => registration.Factory(serviceProvider); + + factory.ShouldThrow(); + } +} diff --git a/test/HealthChecks.AzureServiceBus.Tests/DependencyInjection/AzureServiceBusQueueMessageThresholdCountUnitWithTokenUnitTests.cs b/test/HealthChecks.AzureServiceBus.Tests/DependencyInjection/AzureServiceBusQueueMessageThresholdCountUnitWithTokenUnitTests.cs new file mode 100644 index 0000000000..f15e4af2c3 --- /dev/null +++ b/test/HealthChecks.AzureServiceBus.Tests/DependencyInjection/AzureServiceBusQueueMessageThresholdCountUnitWithTokenUnitTests.cs @@ -0,0 +1,63 @@ +using Azure.Core; + +namespace HealthChecks.AzureServiceBus.Tests.DependencyInjection; + +public class azure_service_bus_queue_message_threshold_registration_with_token_should +{ + [Fact] + public void add_health_check_when_properly_configured() + { + var services = new ServiceCollection(); + services.AddHealthChecks() + .AddAzureServiceBusQueueMessageCountThreshold("cnn", "queueName", new MockTokenCredentials()); + + using var serviceProvider = services.BuildServiceProvider(); + var options = serviceProvider.GetRequiredService>(); + + var registration = options.Value.Registrations.First(); + var check = registration.Factory(serviceProvider); + + registration.Name.ShouldBe("azurequeuethreshold"); + check.ShouldBeOfType(); + } + + [Fact] + public void add_named_health_check_when_properly_configured() + { + var services = new ServiceCollection(); + services.AddHealthChecks() + .AddAzureServiceBusQueueMessageCountThreshold("cnn", "queueName", new MockTokenCredentials(), + name: "azureservicebusqueuemessagethresholdcheck"); + + using var serviceProvider = services.BuildServiceProvider(); + var options = serviceProvider.GetRequiredService>(); + + var registration = options.Value.Registrations.First(); + var check = registration.Factory(serviceProvider); + + registration.Name.ShouldBe("azureservicebusqueuemessagethresholdcheck"); + check.ShouldBeOfType(); + } + + [Fact] + public void fail_when_no_health_check_configuration_provided() + { + var services = new ServiceCollection(); + services.AddHealthChecks() + .AddAzureServiceBusQueueMessageCountThreshold(string.Empty, string.Empty, new MockTokenCredentials()); + + using var serviceProvider = services.BuildServiceProvider(); + var options = serviceProvider.GetRequiredService>(); + + var registration = options.Value.Registrations.First(); + var factory = () => registration.Factory(serviceProvider); + + factory.ShouldThrow(); + } +} + +public class MockTokenCredentials : TokenCredential +{ + public override AccessToken GetToken(TokenRequestContext requestContext, CancellationToken cancellationToken) => throw new NotImplementedException(); + public override ValueTask GetTokenAsync(TokenRequestContext requestContext, CancellationToken cancellationToken) => throw new NotImplementedException(); +} diff --git a/test/HealthChecks.AzureServiceBus.Tests/HealthChecks.AzureServiceBus.approved.txt b/test/HealthChecks.AzureServiceBus.Tests/HealthChecks.AzureServiceBus.approved.txt index d51361b275..b260fea34d 100644 --- a/test/HealthChecks.AzureServiceBus.Tests/HealthChecks.AzureServiceBus.approved.txt +++ b/test/HealthChecks.AzureServiceBus.Tests/HealthChecks.AzureServiceBus.approved.txt @@ -24,6 +24,12 @@ namespace HealthChecks.AzureServiceBus protected override string ConnectionKey { get; } public System.Threading.Tasks.Task CheckHealthAsync(Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckContext context, System.Threading.CancellationToken cancellationToken = default) { } } + public class AzureServiceBusQueueMessageCountThresholdHealthCheck : HealthChecks.AzureServiceBus.AzureServiceBusHealthCheck, Microsoft.Extensions.Diagnostics.HealthChecks.IHealthCheck + { + public AzureServiceBusQueueMessageCountThresholdHealthCheck(HealthChecks.AzureServiceBus.Configuration.AzureServiceBusQueueMessagesCountThresholdHealthCheckOptions options) { } + protected override string ConnectionKey { get; } + public System.Threading.Tasks.Task CheckHealthAsync(Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckContext context, System.Threading.CancellationToken cancellationToken = default) { } + } public class AzureServiceBusSubscriptionHealthCheck : HealthChecks.AzureServiceBus.AzureServiceBusHealthCheck, Microsoft.Extensions.Diagnostics.HealthChecks.IHealthCheck { public AzureServiceBusSubscriptionHealthCheck(HealthChecks.AzureServiceBus.Configuration.AzureServiceBusSubscriptionHealthCheckHealthCheckOptions options) { } @@ -61,6 +67,18 @@ namespace HealthChecks.AzureServiceBus.Configuration public string QueueName { get; set; } public bool UsePeekMode { get; set; } } + public struct AzureServiceBusQueueMessagesCountThreshold + { + public AzureServiceBusQueueMessagesCountThreshold() { } + public int DegradedThreshold { get; set; } + public int UnhealthyThreshold { get; set; } + } + public class AzureServiceBusQueueMessagesCountThresholdHealthCheckOptions : HealthChecks.AzureServiceBus.Configuration.AzureServiceBusQueueHealthCheckOptions + { + public AzureServiceBusQueueMessagesCountThresholdHealthCheckOptions(string queueName) { } + public HealthChecks.AzureServiceBus.Configuration.AzureServiceBusQueueMessagesCountThreshold? ActiveMessages { get; set; } + public HealthChecks.AzureServiceBus.Configuration.AzureServiceBusQueueMessagesCountThreshold? DeadLetterMessages { get; set; } + } public class AzureServiceBusSubscriptionHealthCheckHealthCheckOptions : HealthChecks.AzureServiceBus.Configuration.AzureServiceBusTopicHealthCheckOptions { public AzureServiceBusSubscriptionHealthCheckHealthCheckOptions(string topicName, string subscriptionName) { } @@ -86,6 +104,8 @@ namespace Microsoft.Extensions.DependencyInjection public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddAzureServiceBusQueue(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, string connectionString, string queueName, System.Action? configure = null, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddAzureServiceBusQueue(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, System.Func fullyQualifiedNamespaceFactory, System.Func queueNameFactory, System.Func tokenCredentialFactory, System.Action? configure = null, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddAzureServiceBusQueue(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, string fullyQualifiedNamespace, string queueName, Azure.Core.TokenCredential tokenCredential, System.Action? configure = null, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } + public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddAzureServiceBusQueueMessageCountThreshold(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, string connectionString, string queueName, string? name = null, System.Action? configure = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } + public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddAzureServiceBusQueueMessageCountThreshold(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, string endpoint, string queueName, Azure.Core.TokenCredential tokenCredential, System.Action? configure = null, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddAzureServiceBusSubscription(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, System.Func connectionStringFactory, System.Func topicNameFactory, System.Func subscriptionNameFactory, System.Action? configure = null, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddAzureServiceBusSubscription(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, string connectionString, string topicName, string subscriptionName, System.Action? configure = null, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddAzureServiceBusSubscription(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, System.Func fullyQualifiedNamespaceFactory, System.Func topicNameFactory, System.Func subscriptionNameFactory, System.Func tokenCredentialFactory, System.Action? configure = null, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } From 7dc61b4898dbaa0aea4a872cdb8673166c3b7321 Mon Sep 17 00:00:00 2001 From: Ivan Maximov Date: Fri, 7 Jul 2023 11:49:26 +0300 Subject: [PATCH 08/48] Fix UI tests (#1879) --- .../Functional/DatabaseProviders/InMemoryStorageProviderTests.cs | 1 + .../Functional/DatabaseProviders/MySqlStorageProviderTests.cs | 1 + .../DatabaseProviders/PostgreSqlStorageProviderTests.cs | 1 + .../DatabaseProviders/SqlServerStorageProviderTests.cs | 1 + .../Functional/DatabaseProviders/SqliteStorageProviderTests.cs | 1 + 5 files changed, 5 insertions(+) diff --git a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/InMemoryStorageProviderTests.cs b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/InMemoryStorageProviderTests.cs index 6df4d35e05..f645dc753d 100644 --- a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/InMemoryStorageProviderTests.cs +++ b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/InMemoryStorageProviderTests.cs @@ -14,6 +14,7 @@ public void register_healthchecksdb_context() var customOptionsInvoked = false; var hostBuilder = new WebHostBuilder() + .UseStartup() .ConfigureServices(services => { services.AddHealthChecksUI() diff --git a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/MySqlStorageProviderTests.cs b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/MySqlStorageProviderTests.cs index 6e7d4f69b4..e54e678a1e 100644 --- a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/MySqlStorageProviderTests.cs +++ b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/MySqlStorageProviderTests.cs @@ -13,6 +13,7 @@ public void register_healthchecksdb_context_with_migrations() var customOptionsInvoked = false; var hostBuilder = new WebHostBuilder() + .UseStartup() .ConfigureServices(services => { services.AddHealthChecksUI() diff --git a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/PostgreSqlStorageProviderTests.cs b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/PostgreSqlStorageProviderTests.cs index bdf2c041f3..75d4e346f0 100644 --- a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/PostgreSqlStorageProviderTests.cs +++ b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/PostgreSqlStorageProviderTests.cs @@ -14,6 +14,7 @@ public void register_healthchecksdb_context_with_migrations() var customOptionsInvoked = false; var hostBuilder = new WebHostBuilder() + .UseStartup() .ConfigureServices(services => { services.AddHealthChecksUI() diff --git a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/SqlServerStorageProviderTests.cs b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/SqlServerStorageProviderTests.cs index b6f988812f..8f04232dc7 100644 --- a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/SqlServerStorageProviderTests.cs +++ b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/SqlServerStorageProviderTests.cs @@ -13,6 +13,7 @@ public void register_healthchecksdb_context_with_migrations() var customOptionsInvoked = false; var hostBuilder = new WebHostBuilder() + .UseStartup() .ConfigureServices(services => { services.AddHealthChecksUI() diff --git a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/SqliteStorageProviderTests.cs b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/SqliteStorageProviderTests.cs index 95953eebc4..b58976df21 100644 --- a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/SqliteStorageProviderTests.cs +++ b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/SqliteStorageProviderTests.cs @@ -13,6 +13,7 @@ public void register_healthchecksdb_context_with_migrations() var customOptionsInvoked = false; var hostBuilder = new WebHostBuilder() + .UseStartup() .ConfigureServices(services => { services.AddHealthChecksUI() From a65b73c40eec5b563582b9abe39216ec1c084e52 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Jul 2023 11:57:11 +0300 Subject: [PATCH 09/48] Bump Microsoft.EntityFrameworkCore.Design from 7.0.5 to 7.0.8 (#1872) Bumps [Microsoft.EntityFrameworkCore.Design](https://github.com/dotnet/efcore) from 7.0.5 to 7.0.8. - [Release notes](https://github.com/dotnet/efcore/releases) - [Commits](https://github.com/dotnet/efcore/compare/v7.0.5...v7.0.8) --- updated-dependencies: - dependency-name: Microsoft.EntityFrameworkCore.Design dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/HealthChecks.UI/HealthChecks.UI.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.UI/HealthChecks.UI.csproj b/src/HealthChecks.UI/HealthChecks.UI.csproj index 87c87fe63c..8e48ffcef5 100644 --- a/src/HealthChecks.UI/HealthChecks.UI.csproj +++ b/src/HealthChecks.UI/HealthChecks.UI.csproj @@ -19,7 +19,7 @@ - + From f538d0a63f58ef6a9dec16347d3c9a146eea43d8 Mon Sep 17 00:00:00 2001 From: Mateusz Date: Fri, 7 Jul 2023 17:48:05 +0200 Subject: [PATCH 10/48] Fix bug with regression of datetime string in OnStateFrom column in UI (#1880) Co-authored-by: Bo Petersen --- src/HealthChecks.UI/client/components/LivenessTable.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/HealthChecks.UI/client/components/LivenessTable.tsx b/src/HealthChecks.UI/client/components/LivenessTable.tsx index f526acdbe4..5d901fd481 100644 --- a/src/HealthChecks.UI/client/components/LivenessTable.tsx +++ b/src/HealthChecks.UI/client/components/LivenessTable.tsx @@ -1,4 +1,5 @@ import React, { FunctionComponent } from 'react'; +import moment from 'moment'; import { Liveness } from '../typings/models'; import { discoveryServices, getStatusConfig } from '../healthChecksResources'; import { CheckTable } from './CheckTable'; @@ -89,7 +90,9 @@ const LivenessTable: FunctionComponent = ({ livenessData, ex {statusConfig!.image} - {item.onStateFrom} + + {item.status} {moment.utc(item.onStateFrom).fromNow().toString()} + {new Date(item.lastExecuted).toLocaleString()} From 3cade21b8aef6badfe5b7ee6209bcaca24055a32 Mon Sep 17 00:00:00 2001 From: Ivan Maximov Date: Sat, 8 Jul 2023 01:19:02 +0300 Subject: [PATCH 11/48] Update readme (#1888) --- README.md | 179 +++++++++++++++++++++++------------------------------- 1 file changed, 75 insertions(+), 104 deletions(-) diff --git a/README.md b/README.md index f61daa6dcf..89d246ecd2 100644 --- a/README.md +++ b/README.md @@ -1,59 +1,13 @@ -[![HealthChecks Application Status CI](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_applicationstatus_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_applicationstatus_ci.yml) -[![ArangoDb Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_arangodb_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_arangodb_ci.yml) -[![Aws S3 Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_aws_s3_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_aws_s3_ci.yml) -[![Aws SecretsManager Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_aws_secretsmanager_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_aws_secretsmanager_ci.yml) -[![Aws Sns Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_aws_sns_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_aws_sns_ci.yml) -[![Aws Sqs Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_aws_sqs_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_aws_sqs_ci.yml) -[![Aws SystemsManager Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_aws_systemsmanager_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_aws_systemsmanager_ci.yml) -[![Azure IoTHub Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_azure_iothub_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_azure_iothub_ci.yml) -[![Azure DigitalTwin Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_azure_digitaltwin_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_azure_digitaltwin_ci.yml) -[![Azure KeyVault Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_azurekeyvault_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_azurekeyvault_ci.yml) -[![Azure ServiceBus Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_azureservicebus_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_azureservicebus_ci.yml) -[![Azure Storage Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_azurestorage_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_azurestorage_ci.yml) -[![Consul Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_consul_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_consul_ci.yml) -[![CosmosDb Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_cosmosdb_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_cosmosdb_ci.yml) -[![DocumentDb Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_documentdb_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_documentdb_ci.yml) -[![DynamoDb Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_dynamodb_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_dynamodb_ci.yml) -[![ElasticSearch Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_elasticsearch_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_elasticsearch_ci.yml) -[![EventStore Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_eventstore_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_eventstore_ci.yml) -[![EventStore gRPC Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_eventstore_grpc_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_eventstore_grpc_ci.yml) -[![Gcp CloudFirstore Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_gcp_cloudfirestore_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_gcp_cloudfirestore_ci.yml) -[![GremlinDb Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_gremlin_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_gremlin_ci.yml) -[![Hangfire Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_hangfire_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_hangfire_ci.yml) -[![IbmMQ Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_ibmmq_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_ibmmq_ci.yml) -[![InfluxDB Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_influxdb_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_influxdb_ci.yml) -[![Kafka Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_kafka_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_kafka_ci.yml) -[![MongoDb Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_mongodb_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_mongodb_ci.yml) -[![MySql Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_mysql_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_mysql_ci.yml) -[![Nats Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_nats_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_nats_ci.yml) -[![NpgSql Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_npgsql_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_npgsql_ci.yml) -[![Network Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_network_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_network_ci.yml) -[![OpenIdConnect Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_openidconnectserver_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_openidconnectserver_ci.yml) -[![Oracle Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_oracle_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_oracle_ci.yml) -[![Prometheus Metrics Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_prometheus_metrics_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_prometheus_metrics_ci.yml) -[![Publisher ApplicationInsights Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_publisher_applicationinsights_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_publisher_applicationinsights_ci.yml) -[![Publisher Datadog Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_publisher_datadog_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_publisher_datadog_ci.yml) -[![Publisher Prometheus Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_publisher_prometheus_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_publisher_prometheus_ci.yml) -[![Publisher Seq status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_publisher_seq_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_publisher_seq_ci.yml) -[![RabbitMQ Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_rabbitmq_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_rabbitmq_ci.yml) -[![RavenDb Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_ravendb_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_ravendb_ci.yml) -[![Redis Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_redis_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_redis_ci.yml) -[![SqlServer Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_sqlserver_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_sqlserver_ci.yml) -[![SendGrid Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_sendgrid_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_sendgrid_ci.yml) -[![SignalR Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_signalr_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_signalr_ci.yml) -[![Solr Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_solr_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_solr_ci.yml) -[![SqlLite Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_sqlite_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_sqlite_ci.yml) -[![System Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_system_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_system_ci.yml) -[![UI Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_ui_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_ui_ci.yml) -[![Uris Build status](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_uris_ci.yml/badge.svg)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/workflows/healthchecks_uris_ci.yml) - -![ui version](https://img.shields.io/docker/v/xabarilcoding/healthchecksui?label=Docker%20UI%20Version&logo=dsd&sort=date) -![ui pulls](https://img.shields.io/docker/pulls/xabarilcoding/healthchecksui.svg?label=Docker%20UI%20Pulls) - -![k8s version](https://img.shields.io/docker/v/xabarilcoding/healthchecksui-k8s-operator?label=k8s%20Operator%20Version&logo=dsd&sort=date) -![k8s pulls](https://img.shields.io/docker/pulls/xabarilcoding/healthchecksui-k8s-operator.svg?label=k8s%20Operator%20Pulls) - -[![codecov.io](https://codecov.io/github/Xabaril/AspNetCore.Diagnostics.HealthChecks/coverage.svg?branch=master)](https://codecov.io/github/Xabaril/AspNetCore.Diagnostics.HealthChecks?branch=master) +[![License](https://img.shields.io/github/license/Xabaril/AspNetCore.Diagnostics.HealthChecks)](LICENSE.md) +[![codecov](https://codecov.io/github/Xabaril/AspNetCore.Diagnostics.HealthChecks/coverage.svg?branch=master)](https://codecov.io/github/Xabaril/AspNetCore.Diagnostics.HealthChecks?branch=master) +[![GitHub Release Date](https://img.shields.io/github/release-date/Xabaril/AspNetCore.Diagnostics.HealthChecks?label=released)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/releases) +[![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/Xabaril/AspNetCore.Diagnostics.HealthChecks/latest?label=new+commits)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/commits/master) +![Size](https://img.shields.io/github/repo-size/Xabaril/AspNetCore.Diagnostics.HealthChecks) + +[![GitHub contributors](https://img.shields.io/github/contributors/Xabaril/AspNetCore.Diagnostics.HealthChecks)](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/contributors) +![Activity](https://img.shields.io/github/commit-activity/w/Xabaril/AspNetCore.Diagnostics.HealthChecks) +![Activity](https://img.shields.io/github/commit-activity/m/Xabaril/AspNetCore.Diagnostics.HealthChecks) +![Activity](https://img.shields.io/github/commit-activity/y/Xabaril/AspNetCore.Diagnostics.HealthChecks) # AspNetCore.Diagnostics.HealthChecks @@ -97,56 +51,65 @@ This repository offers a wide collection of **ASP.NET Core** Health Check packag - [Tutorials, Demos and walkthroughs](#tutorials-demos-and-walkthroughs-on-aspnet-core-healthchecks) +## Docker images + +HealthChecks repo provides following images: + +| Image | Downloads | Latest | +|------|--------|---| +| UI | ![ui pulls](https://img.shields.io/docker/pulls/xabarilcoding/healthchecksui.svg?label=downloads) | ![ui version](https://img.shields.io/docker/v/xabarilcoding/healthchecksui?label=docker&logo=dsd&sort=date) | +| K8s operator | ![k8s pulls](https://img.shields.io/docker/pulls/xabarilcoding/healthchecksui-k8s-operator.svg?label=downloads) | ![k8s version](https://img.shields.io/docker/v/xabarilcoding/healthchecksui-k8s-operator?label=docker&logo=dsd&sort=date) + ## Health Checks HealthChecks packages include health checks for: -| Package | Downloads | Notes | -| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| ApplicationStatus | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.ApplicationStatus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ApplicationStatus) | -| ArangoDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.ArangoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ArangoDb) | -| Amazon S3 | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.S3)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.S3) | -| Amazon Secrets Manager | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.SecretsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SecretsManager) | -| Amazon SNS | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.Sns)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sns) | -| Amazon SQS | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.Sqs)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sqs) | -| Amazon Systems Manager | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.SystemsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SystemsManager) | -| Azure IoT Hub | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Azure.IoTHub)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Azure.IoTHub) | -| Azure DigitalTwin | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureDigitalTwin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureDigitalTwin) | Subscription status, models and instances | -| Azure Key Vault | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureKeyVault)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureKeyVault) | -| Azure Search | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureSearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureSearch) | -| Azure Service Bus | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureServiceBus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureServiceBus) | EventHub, Queue and Topics | -| Azure Storage | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureStorage)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureStorage) | Blob, File, Queue | -| Consul | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Consul)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Consul) | -| CosmosDb | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.CosmosDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.CosmosDb) | CosmosDb and Azure Table -| Azure DocumentDb | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.DocumentDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DocumentDb) | -| Amazon DynamoDb | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.DynamoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DynamoDb) | -| Elasticsearch | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Elasticsearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Elasticsearch) | -| EventStore | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.EventStore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore) | [TCP EventStore](https://github.com/EventStore/EventStoreDB-Client-Dotnet-Legacy) -| EventStore gRPC | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.EventStore.gRPC)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore.gRPC) | [gRPC EventStore](https://github.com/EventStore/EventStore-Client-Dotnet) -| Google Cloud Firestore | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Gcp.CloudFirestore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gcp.CloudFirestore) | -| Gremlin | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Gremlin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gremlin) | -| Hangfire | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Hangfire)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Hangfire) | -| IbmMQ | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.IbmMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.IbmMQ) | -| InfluxDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.InfluxDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.InfluxDB) | -| Kafka | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Kafka)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kafka) | -| Kubernetes | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Kubernetes)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kubernetes) | -| MongoDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.MongoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MongoDb) | -| MySql | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.MySql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MySql) | -| Nats | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Nats)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Nats) | NATS, messaging, message-bus, pubsub | -| Network | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Network)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Network) | Ftp, SFtp, Dns, Tcp port, Smtp, Imap, Ssl | -| Postgres | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.NpgSql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.NpgSql) | -| Identity Server | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.OpenIdConnectServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.OpenIdConnectServer) | -| Oracle | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Oracle)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Oracle) | -| RabbitMQ | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.RabbitMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RabbitMQ) | -| RavenDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.RavenDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RavenDB) | -| Redis | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Redis)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Redis) | -| SendGrid | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.SendGrid)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SendGrid) | -| SignalR | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.SignalR)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SignalR) | -| Solr | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Solr)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Solr) | -| Sqlite | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Sqlite)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Sqlite) | -| Sql Server | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.SqlServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SqlServer) | -| System | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.System)](https://www.nuget.org/packages/AspNetCore.HealthChecks.System) | Disk Storage, Folder, Private Memory, Virtual Memory, Process, Windows Service | -| Uri | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Uris)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Uris) | Single uri and uri groups | +| Package | Downloads | NuGet Latest | Notes | +| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ---------------------------------------------------------------------- | +| ApplicationStatus | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.ApplicationStatus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ApplicationStatus) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.ApplicationStatus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ApplicationStatus) +| ArangoDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.ArangoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ArangoDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.ArangoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ArangoDb) +| Amazon S3 | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.S3)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.S3) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.S3)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.S3) +| Amazon Secrets Manager | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.SecretsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SecretsManager) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.SecretsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SecretsManager) +| Amazon SNS | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.Sns)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sns) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.Sns)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sns) +| Amazon SQS | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.Sqs)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sqs) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.Sqs)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sqs) +| Amazon Systems Manager | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.SystemsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SystemsManager) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.SystemsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SystemsManager) +| Azure IoT Hub | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Azure.IoTHub)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Azure.IoTHub) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Azure.IoTHub)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Azure.IoTHub) +| Azure DigitalTwin | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureDigitalTwin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureDigitalTwin) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureDigitalTwin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureDigitalTwin) | Subscription status, models and instances | +| Azure Key Vault | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureKeyVault)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureKeyVault) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureKeyVault)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureKeyVault) +| Azure Search | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureSearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureSearch) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureSearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureSearch) +| Azure Service Bus | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureServiceBus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureServiceBus) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureServiceBus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureServiceBus) | EventHub, Queue and Topics | +| Azure Storage | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureStorage)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureStorage) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureStorage)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureStorage) | Blob, File, Queue | +| Consul | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Consul)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Consul) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Consul)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Consul) +| CosmosDb | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.CosmosDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.CosmosDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.CosmosDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.CosmosDb) | CosmosDb and Azure Table +| Azure DocumentDb | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.DocumentDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DocumentDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.DocumentDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DocumentDb) +| Amazon DynamoDb | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.DynamoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DynamoDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.DynamoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DynamoDb) +| Elasticsearch | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Elasticsearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Elasticsearch) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Elasticsearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Elasticsearch) +| EventStore | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.EventStore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.EventStore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore) | [TCP EventStore](https://github.com/EventStore/EventStoreDB-Client-Dotnet-Legacy) +| EventStore gRPC | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.EventStore.gRPC)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore.gRPC) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.EventStore.gRPC)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore.gRPC) | [gRPC EventStore](https://github.com/EventStore/EventStore-Client-Dotnet) +| Google Cloud Firestore | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Gcp.CloudFirestore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gcp.CloudFirestore) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Gcp.CloudFirestore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gcp.CloudFirestore) +| Gremlin | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Gremlin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gremlin) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Gremlin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gremlin) +| Hangfire | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Hangfire)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Hangfire) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Hangfire)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Hangfire) +| IbmMQ | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.IbmMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.IbmMQ) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.IbmMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.IbmMQ) +| InfluxDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.InfluxDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.InfluxDB) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.InfluxDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.InfluxDB) +| Kafka | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Kafka)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kafka) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Kafka)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kafka) +| Kubernetes | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Kubernetes)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kubernetes) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Kubernetes)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kubernetes) +| MongoDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.MongoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MongoDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.MongoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MongoDb) +| MySql | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.MySql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MySql) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.MySql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MySql) +| Nats | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Nats)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Nats) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Nats)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Nats) | NATS, messaging, message-bus, pubsub | +| Network | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Network)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Network) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Network)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Network) | Ftp, SFtp, Dns, Tcp port, Smtp, Imap, Ssl | +| Postgres | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.NpgSql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.NpgSql) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.NpgSql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.NpgSql) +| Identity Server | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.OpenIdConnectServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.OpenIdConnectServer) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.OpenIdConnectServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.OpenIdConnectServer) +| Oracle | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Oracle)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Oracle) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Oracle)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Oracle) +| RabbitMQ | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.RabbitMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RabbitMQ) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.RabbitMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RabbitMQ) +| RavenDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.RavenDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RavenDB) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.RavenDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RavenDB) +| Redis | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Redis)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Redis) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Redis)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Redis) +| SendGrid | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.SendGrid)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SendGrid) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.SendGrid)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SendGrid) +| SignalR | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.SignalR)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SignalR) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.SignalR)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SignalR) +| Solr | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Solr)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Solr) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Solr)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Solr) +| Sqlite | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Sqlite)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Sqlite) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Sqlite)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Sqlite) +| Sql Server | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.SqlServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SqlServer) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.SqlServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SqlServer) +| System | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.System)](https://www.nuget.org/packages/AspNetCore.HealthChecks.System) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.System)](https://www.nuget.org/packages/AspNetCore.HealthChecks.System) | Disk Storage, Folder, Private Memory, Virtual Memory, Process, Windows Service | +| Uri | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Uris)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Uris) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Uris)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Uris) | Single uri and uri groups | > We support netcoreapp 2.2, 3.0 and 3.1. Please use package versions 2.2.X, 3.0.X and 3.1.X to target different versions. @@ -681,9 +644,17 @@ Check this [README](./extensions/README.md) on how to configure it. ## Contributing -AspNetCore.Diagnostics.HealthChecks wouldn't be possible without the time and effort of its contributors. The team is made up of Unai Zorrilla Castro [@unaizorrilla](https://github.com/unaizorrilla), Luis Ruiz Pavón [@lurumad](https://github.com/lurumad), Carlos Landeras [@carloslanderas](https://github.com/carloslanderas), Eduard Tomás [@eiximenis](https://github.com/eiximenis) and Eva Crespo [@evacrespob](https://github.com/evacrespob) +AspNetCore.Diagnostics.HealthChecks wouldn't be possible without the time and effort of its contributors. +The team is made up of Unai Zorrilla Castro [@unaizorrilla](https://github.com/unaizorrilla), +Luis Ruiz Pavón [@lurumad](https://github.com/lurumad), Carlos Landeras [@carloslanderas](https://github.com/carloslanderas), +Eduard Tomás [@eiximenis](https://github.com/eiximenis), Eva Crespo [@evacrespob](https://github.com/evacrespob) and +Ivan Maximov [@sungam3r](https://github.com/sungam3r). + +Thanks to all the people who already contributed! -_Our valued committers are_: Hugo Biarge @hbiarge, Matt Channer @mattchanner, Luis Fraile @lfraile, Bradley Grainger @bgrainger, Simon Birrer @SbiCA, Mahamadou Camara @poumup, Jonathan Berube @joncloud, Daniel Edwards @dantheman999301, Mike McFarland @roketworks, Matteo @Franklin89, Miňo Martiniak @Burgyn, Peter Winkler @pajzo, @mikevanoo,Alexandru Rus @AlexandruRus23,Volker Thiel @riker09, Ahmad Magdy @Ahmad-Magdy, Marcel Lambacher @Marcel-Lambacher, Ivan Maximov @sungam3r, David Bottiau @odonno,ZeWizard @zeWizard, Ruslan Popovych @rpopovych, @jnovick, Marcos Palacios @mpcmarcos, Gerard Godone-Maresca @ggmaresca, Facundo @fglaeser, Daniel Nordström @SpaceOgre, @mphelt + + + If you want to contribute to the project and make it better, your help is very welcome. You can contribute with helpful bug reports, features requests and also submitting new features with pull requests. From d334e332d04666bdc16f23a38f664bb7f75caf6d Mon Sep 17 00:00:00 2001 From: Ivan Maximov Date: Sat, 8 Jul 2023 01:24:47 +0300 Subject: [PATCH 12/48] Update readme --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 89d246ecd2..73a732bfc8 100644 --- a/README.md +++ b/README.md @@ -197,13 +197,13 @@ The project **AspNetCore.HealthChecks.Publisher.ApplicationInsights**, **AspNetC **AspNetCore.HealthChecks.Publisher.CloudWatch** define a consumers to send report results to Application Insights, Datadog, Prometheus, Seq or CloudWatch. -| Package | Downloads | Notes | -| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | -| Application Insights | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Publisher.ApplicationInsights)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Publisher.ApplicationInsights) | -| CloudWatch | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Publisher.CloudWatch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Publisher.CloudWatch) | -| Datadog | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Publisher.Datadog)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Publisher.Datadog) | -| Prometheus Gateway | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Publisher.Prometheus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Publisher.Prometheus) | **DEPRECATED** | -| Seq | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Publisher.Seq)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Publisher.Seq) | +| Package | Downloads | NuGet Latest | Notes | +| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | -------------- | +| Application Insights | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Publisher.ApplicationInsights)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Publisher.ApplicationInsights) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Publisher.ApplicationInsights)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Publisher.ApplicationInsights) +| CloudWatch | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Publisher.CloudWatch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Publisher.CloudWatch) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Publisher.CloudWatch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Publisher.CloudWatch) +| Datadog | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Publisher.Datadog)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Publisher.Datadog) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Publisher.Datadog)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Publisher.Datadog) +| Prometheus Gateway | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Publisher.Prometheus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Publisher.Prometheus) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Publisher.Prometheus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Publisher.Prometheus) | **DEPRECATED** | +| Seq | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Publisher.Seq)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Publisher.Seq) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Publisher.Seq)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Publisher.Seq) Include the package in your project: From 4e47d4bbaaabbd7e29c2b7a04bd58a438abcb07c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 8 Jul 2023 01:25:51 +0300 Subject: [PATCH 13/48] Bump Microsoft.AspNetCore.Authentication.JwtBearer from 7.0.5 to 7.0.8 (#1883) Bumps [Microsoft.AspNetCore.Authentication.JwtBearer](https://github.com/dotnet/aspnetcore) from 7.0.5 to 7.0.8. - [Release notes](https://github.com/dotnet/aspnetcore/releases) - [Changelog](https://github.com/dotnet/aspnetcore/blob/main/docs/ReleasePlanning.md) - [Commits](https://github.com/dotnet/aspnetcore/compare/v7.0.5...v7.0.8) --- updated-dependencies: - dependency-name: Microsoft.AspNetCore.Authentication.JwtBearer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../HealthChecks.UI.Branding/HealthChecks.UI.Branding.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/HealthChecks.UI.Branding/HealthChecks.UI.Branding.csproj b/samples/HealthChecks.UI.Branding/HealthChecks.UI.Branding.csproj index 9f8cde570d..419b38f7a7 100644 --- a/samples/HealthChecks.UI.Branding/HealthChecks.UI.Branding.csproj +++ b/samples/HealthChecks.UI.Branding/HealthChecks.UI.Branding.csproj @@ -5,7 +5,7 @@ - + From b58dd04387aa0cbf746fb1a1398f8893ed12a401 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 8 Jul 2023 01:27:10 +0300 Subject: [PATCH 14/48] Bump Hangfire.Core from 1.8.1 to 1.8.3 (#1886) Bumps [Hangfire.Core](https://github.com/HangfireIO/Hangfire) from 1.8.1 to 1.8.3. - [Release notes](https://github.com/HangfireIO/Hangfire/releases) - [Commits](https://github.com/HangfireIO/Hangfire/compare/v1.8.1...v1.8.3) --- updated-dependencies: - dependency-name: Hangfire.Core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/HealthChecks.Hangfire/HealthChecks.Hangfire.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.Hangfire/HealthChecks.Hangfire.csproj b/src/HealthChecks.Hangfire/HealthChecks.Hangfire.csproj index 43c7990301..0f9261922c 100644 --- a/src/HealthChecks.Hangfire/HealthChecks.Hangfire.csproj +++ b/src/HealthChecks.Hangfire/HealthChecks.Hangfire.csproj @@ -8,7 +8,7 @@ - + From 0ef1c35ea8e12d7a881ad147a121bbc858a285f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 8 Jul 2023 01:27:33 +0300 Subject: [PATCH 15/48] Bump Microsoft.EntityFrameworkCore.InMemory from 7.0.4 to 7.0.8 (#1885) Bumps [Microsoft.EntityFrameworkCore.InMemory](https://github.com/dotnet/efcore) from 7.0.4 to 7.0.8. - [Release notes](https://github.com/dotnet/efcore/releases) - [Commits](https://github.com/dotnet/efcore/compare/v7.0.4...v7.0.8) --- updated-dependencies: - dependency-name: Microsoft.EntityFrameworkCore.InMemory dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../HealthChecks.UI.InMemory.Storage.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj b/src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj index a5f5a75674..3da5b01cee 100644 --- a/src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj +++ b/src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj @@ -8,7 +8,7 @@ - + From 1669958f6cabe9b05b96fabcf0abe9fba594f16a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 8 Jul 2023 01:28:02 +0300 Subject: [PATCH 16/48] Bump Npgsql.EntityFrameworkCore.PostgreSQL from 7.0.3 to 7.0.4 (#1884) Bumps [Npgsql.EntityFrameworkCore.PostgreSQL](https://github.com/npgsql/efcore.pg) from 7.0.3 to 7.0.4. - [Release notes](https://github.com/npgsql/efcore.pg/releases) - [Commits](https://github.com/npgsql/efcore.pg/compare/v7.0.3...v7.0.4) --- updated-dependencies: - dependency-name: Npgsql.EntityFrameworkCore.PostgreSQL dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../HealthChecks.UI.PostgreSQL.Storage.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.UI.PostgreSQL.Storage/HealthChecks.UI.PostgreSQL.Storage.csproj b/src/HealthChecks.UI.PostgreSQL.Storage/HealthChecks.UI.PostgreSQL.Storage.csproj index 077f715636..a3ec6443dd 100644 --- a/src/HealthChecks.UI.PostgreSQL.Storage/HealthChecks.UI.PostgreSQL.Storage.csproj +++ b/src/HealthChecks.UI.PostgreSQL.Storage/HealthChecks.UI.PostgreSQL.Storage.csproj @@ -8,7 +8,7 @@ - + From 67168629e3d260ecf592f6b7f29029d56e86ada0 Mon Sep 17 00:00:00 2001 From: Ivan Maximov Date: Sat, 8 Jul 2023 11:22:56 +0300 Subject: [PATCH 17/48] Fix InfluxDB version --- README.md | 2 +- build/versions.props | 1 + src/HealthChecks.InfluxDB/HealthChecks.InfluxDB.csproj | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 73a732bfc8..436e3fb219 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This repository offers a wide collection of **ASP.NET Core** Health Check packages for widely used services and platforms. -**ASP.NET Core** versions supported: 6.0, 5.0, 3.1, 3.0 and 2.2 +**ASP.NET Core** versions supported: 7.0, 6.0, 5.0, 3.1, 3.0 and 2.2 # Sections diff --git a/build/versions.props b/build/versions.props index c097934708..7dadd6d566 100644 --- a/build/versions.props +++ b/build/versions.props @@ -23,6 +23,7 @@ 7.0.0 7.0.0 7.0.0 + 7.0.0 7.0.0 7.0.0 7.0.0 diff --git a/src/HealthChecks.InfluxDB/HealthChecks.InfluxDB.csproj b/src/HealthChecks.InfluxDB/HealthChecks.InfluxDB.csproj index ded5f310ed..f9f4544989 100644 --- a/src/HealthChecks.InfluxDB/HealthChecks.InfluxDB.csproj +++ b/src/HealthChecks.InfluxDB/HealthChecks.InfluxDB.csproj @@ -6,11 +6,11 @@ HealthChecks.InfluxDB is the health check package for InfluxDB. $(HealthCheckInfluxDB) - + - + From 885b2b150b7d354537d095b326bce018ce1efd9f Mon Sep 17 00:00:00 2001 From: Ivan Maximov Date: Sat, 8 Jul 2023 11:26:15 +0300 Subject: [PATCH 18/48] Remove workflows solution folder --- .../healthchecks_influxdb_cd_preview.yml | 2 +- AspNetCore.Diagnostics.HealthChecks.sln | 153 ------------------ 2 files changed, 1 insertion(+), 154 deletions(-) diff --git a/.github/workflows/healthchecks_influxdb_cd_preview.yml b/.github/workflows/healthchecks_influxdb_cd_preview.yml index b4ee1d5e7b..1e1c134548 100644 --- a/.github/workflows/healthchecks_influxdb_cd_preview.yml +++ b/.github/workflows/healthchecks_influxdb_cd_preview.yml @@ -5,7 +5,7 @@ on: tags: - preview-influxdb-* - preview-all-* - + jobs: build: env: diff --git a/AspNetCore.Diagnostics.HealthChecks.sln b/AspNetCore.Diagnostics.HealthChecks.sln index ab044f9385..107edb03aa 100644 --- a/AspNetCore.Diagnostics.HealthChecks.sln +++ b/AspNetCore.Diagnostics.HealthChecks.sln @@ -231,158 +231,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HealthChecks.Nats", "src\He EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HealthChecks.Nats.Tests", "test\HealthChecks.Nats.Tests\HealthChecks.Nats.Tests.csproj", "{BCEF8EE5-D93E-4F75-AAE0-52C9C87A0B6F}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{531ABAB1-F4B5-4EAE-B310-6CB55D8FA4FD}" - ProjectSection(SolutionItems) = preProject - .github\workflows\healthchecks_applicationstatus_cd.yml = .github\workflows\healthchecks_applicationstatus_cd.yml - .github\workflows\healthchecks_applicationstatus_cd_preview.yml = .github\workflows\healthchecks_applicationstatus_cd_preview.yml - .github\workflows\healthchecks_applicationstatus_ci.yml = .github\workflows\healthchecks_applicationstatus_ci.yml - .github\workflows\healthchecks_arangodb_cd.yml = .github\workflows\healthchecks_arangodb_cd.yml - .github\workflows\healthchecks_arangodb_cd_preview.yml = .github\workflows\healthchecks_arangodb_cd_preview.yml - .github\workflows\healthchecks_arangodb_ci.yml = .github\workflows\healthchecks_arangodb_ci.yml - .github\workflows\healthchecks_aws_s3_cd.yml = .github\workflows\healthchecks_aws_s3_cd.yml - .github\workflows\healthchecks_aws_s3_cd_preview.yml = .github\workflows\healthchecks_aws_s3_cd_preview.yml - .github\workflows\healthchecks_aws_s3_ci.yml = .github\workflows\healthchecks_aws_s3_ci.yml - .github\workflows\healthchecks_aws_secretsmanager_cd.yml = .github\workflows\healthchecks_aws_secretsmanager_cd.yml - .github\workflows\healthchecks_aws_secretsmanager_cd_preview.yml = .github\workflows\healthchecks_aws_secretsmanager_cd_preview.yml - .github\workflows\healthchecks_aws_secretsmanager_ci.yml = .github\workflows\healthchecks_aws_secretsmanager_ci.yml - .github\workflows\healthchecks_aws_sns_cd.yml = .github\workflows\healthchecks_aws_sns_cd.yml - .github\workflows\healthchecks_aws_sns_cd_preview.yml = .github\workflows\healthchecks_aws_sns_cd_preview.yml - .github\workflows\healthchecks_aws_sns_ci.yml = .github\workflows\healthchecks_aws_sns_ci.yml - .github\workflows\healthchecks_aws_sqs_cd.yml = .github\workflows\healthchecks_aws_sqs_cd.yml - .github\workflows\healthchecks_aws_sqs_cd_preview.yml = .github\workflows\healthchecks_aws_sqs_cd_preview.yml - .github\workflows\healthchecks_aws_sqs_ci.yml = .github\workflows\healthchecks_aws_sqs_ci.yml - .github\workflows\healthchecks_aws_systemsmanager_cd.yml = .github\workflows\healthchecks_aws_systemsmanager_cd.yml - .github\workflows\healthchecks_aws_systemsmanager_cd_preview.yml = .github\workflows\healthchecks_aws_systemsmanager_cd_preview.yml - .github\workflows\healthchecks_aws_systemsmanager_ci.yml = .github\workflows\healthchecks_aws_systemsmanager_ci.yml - .github\workflows\healthchecks_azurekeyvault_cd.yml = .github\workflows\healthchecks_azurekeyvault_cd.yml - .github\workflows\healthchecks_azurekeyvault_cd_preview.yml = .github\workflows\healthchecks_azurekeyvault_cd_preview.yml - .github\workflows\healthchecks_azurekeyvault_ci.yml = .github\workflows\healthchecks_azurekeyvault_ci.yml - .github\workflows\healthchecks_azureservicebus_cd.yml = .github\workflows\healthchecks_azureservicebus_cd.yml - .github\workflows\healthchecks_azureservicebus_cd_preview.yml = .github\workflows\healthchecks_azureservicebus_cd_preview.yml - .github\workflows\healthchecks_azureservicebus_ci.yml = .github\workflows\healthchecks_azureservicebus_ci.yml - .github\workflows\healthchecks_azurestorage_cd.yml = .github\workflows\healthchecks_azurestorage_cd.yml - .github\workflows\healthchecks_azurestorage_cd_preview.yml = .github\workflows\healthchecks_azurestorage_cd_preview.yml - .github\workflows\healthchecks_azurestorage_ci.yml = .github\workflows\healthchecks_azurestorage_ci.yml - .github\workflows\healthchecks_azure_digitaltwin_cd.yml = .github\workflows\healthchecks_azure_digitaltwin_cd.yml - .github\workflows\healthchecks_azure_digitaltwin_cd_preview.yml = .github\workflows\healthchecks_azure_digitaltwin_cd_preview.yml - .github\workflows\healthchecks_azure_digitaltwin_ci.yml = .github\workflows\healthchecks_azure_digitaltwin_ci.yml - .github\workflows\healthchecks_azure_iothub_cd .yml = .github\workflows\healthchecks_azure_iothub_cd .yml - .github\workflows\healthchecks_azure_iothub_cd_preview.yml = .github\workflows\healthchecks_azure_iothub_cd_preview.yml - .github\workflows\healthchecks_azure_iothub_ci.yml = .github\workflows\healthchecks_azure_iothub_ci.yml - .github\workflows\healthchecks_consul_cd.yml = .github\workflows\healthchecks_consul_cd.yml - .github\workflows\healthchecks_consul_cd_preview.yml = .github\workflows\healthchecks_consul_cd_preview.yml - .github\workflows\healthchecks_consul_ci.yml = .github\workflows\healthchecks_consul_ci.yml - .github\workflows\healthchecks_cosmosdb_cd.yml = .github\workflows\healthchecks_cosmosdb_cd.yml - .github\workflows\healthchecks_cosmosdb_cd_preview.yml = .github\workflows\healthchecks_cosmosdb_cd_preview.yml - .github\workflows\healthchecks_cosmosdb_ci.yml = .github\workflows\healthchecks_cosmosdb_ci.yml - .github\workflows\healthchecks_documentdb_cd.yml = .github\workflows\healthchecks_documentdb_cd.yml - .github\workflows\healthchecks_documentdb_cd_preview.yml = .github\workflows\healthchecks_documentdb_cd_preview.yml - .github\workflows\healthchecks_documentdb_ci.yml = .github\workflows\healthchecks_documentdb_ci.yml - .github\workflows\healthchecks_dynamodb_cd.yml = .github\workflows\healthchecks_dynamodb_cd.yml - .github\workflows\healthchecks_dynamodb_cd_preview.yml = .github\workflows\healthchecks_dynamodb_cd_preview.yml - .github\workflows\healthchecks_dynamodb_ci.yml = .github\workflows\healthchecks_dynamodb_ci.yml - .github\workflows\healthchecks_elasticsearch_cd.yml = .github\workflows\healthchecks_elasticsearch_cd.yml - .github\workflows\healthchecks_elasticsearch_cd_preview.yml = .github\workflows\healthchecks_elasticsearch_cd_preview.yml - .github\workflows\healthchecks_elasticsearch_ci.yml = .github\workflows\healthchecks_elasticsearch_ci.yml - .github\workflows\healthchecks_eventstore_cd.yml = .github\workflows\healthchecks_eventstore_cd.yml - .github\workflows\healthchecks_eventstore_cd_preview.yml = .github\workflows\healthchecks_eventstore_cd_preview.yml - .github\workflows\healthchecks_eventstore_ci.yml = .github\workflows\healthchecks_eventstore_ci.yml - .github\workflows\healthchecks_eventstore_grpc_cd.yml = .github\workflows\healthchecks_eventstore_grpc_cd.yml - .github\workflows\healthchecks_eventstore_grpc_cd_preview.yml = .github\workflows\healthchecks_eventstore_grpc_cd_preview.yml - .github\workflows\healthchecks_eventstore_grpc_ci.yml = .github\workflows\healthchecks_eventstore_grpc_ci.yml - .github\workflows\healthchecks_gcp_cloudfirestore_cd.yml = .github\workflows\healthchecks_gcp_cloudfirestore_cd.yml - .github\workflows\healthchecks_gcp_cloudfirestore_cd_preview.yml = .github\workflows\healthchecks_gcp_cloudfirestore_cd_preview.yml - .github\workflows\healthchecks_gcp_cloudfirestore_ci.yml = .github\workflows\healthchecks_gcp_cloudfirestore_ci.yml - .github\workflows\healthchecks_gremlin_cd.yml = .github\workflows\healthchecks_gremlin_cd.yml - .github\workflows\healthchecks_gremlin_cd_preview.yml = .github\workflows\healthchecks_gremlin_cd_preview.yml - .github\workflows\healthchecks_gremlin_ci.yml = .github\workflows\healthchecks_gremlin_ci.yml - .github\workflows\healthchecks_hangfire_cd.yml = .github\workflows\healthchecks_hangfire_cd.yml - .github\workflows\healthchecks_hangfire_cd_preview.yml = .github\workflows\healthchecks_hangfire_cd_preview.yml - .github\workflows\healthchecks_hangfire_ci.yml = .github\workflows\healthchecks_hangfire_ci.yml - .github\workflows\healthchecks_ibmmq_cd.yml = .github\workflows\healthchecks_ibmmq_cd.yml - .github\workflows\healthchecks_ibmmq_cd_preview.yml = .github\workflows\healthchecks_ibmmq_cd_preview.yml - .github\workflows\healthchecks_ibmmq_ci.yml = .github\workflows\healthchecks_ibmmq_ci.yml - .github\workflows\healthchecks_influxdb_cd.yml = .github\workflows\healthchecks_influxdb_cd.yml - .github\workflows\healthchecks_influxdb_cd_preview.yml = .github\workflows\healthchecks_influxdb_cd_preview.yml - .github\workflows\healthchecks_influxdb_ci.yml = .github\workflows\healthchecks_influxdb_ci.yml - .github\workflows\healthchecks_kafka_cd.yml = .github\workflows\healthchecks_kafka_cd.yml - .github\workflows\healthchecks_kafka_cd_preview.yml = .github\workflows\healthchecks_kafka_cd_preview.yml - .github\workflows\healthchecks_kafka_ci.yml = .github\workflows\healthchecks_kafka_ci.yml - .github\workflows\healthchecks_mongodb_cd.yml = .github\workflows\healthchecks_mongodb_cd.yml - .github\workflows\healthchecks_mongodb_cd_preview.yml = .github\workflows\healthchecks_mongodb_cd_preview.yml - .github\workflows\healthchecks_mongodb_ci.yml = .github\workflows\healthchecks_mongodb_ci.yml - .github\workflows\healthchecks_mysql_cd.yml = .github\workflows\healthchecks_mysql_cd.yml - .github\workflows\healthchecks_mysql_cd_preview.yml = .github\workflows\healthchecks_mysql_cd_preview.yml - .github\workflows\healthchecks_mysql_ci.yml = .github\workflows\healthchecks_mysql_ci.yml - .github\workflows\healthchecks_nats_cd.yml = .github\workflows\healthchecks_nats_cd.yml - .github\workflows\healthchecks_nats_cd_preview.yml = .github\workflows\healthchecks_nats_cd_preview.yml - .github\workflows\healthchecks_nats_ci.yml = .github\workflows\healthchecks_nats_ci.yml - .github\workflows\healthchecks_network_cd.yml = .github\workflows\healthchecks_network_cd.yml - .github\workflows\healthchecks_network_cd_preview.yml = .github\workflows\healthchecks_network_cd_preview.yml - .github\workflows\healthchecks_network_ci.yml = .github\workflows\healthchecks_network_ci.yml - .github\workflows\healthchecks_npgsql_cd.yml = .github\workflows\healthchecks_npgsql_cd.yml - .github\workflows\healthchecks_npgsql_cd_preview.yml = .github\workflows\healthchecks_npgsql_cd_preview.yml - .github\workflows\healthchecks_npgsql_ci.yml = .github\workflows\healthchecks_npgsql_ci.yml - .github\workflows\healthchecks_openidconnectserver_cd.yml = .github\workflows\healthchecks_openidconnectserver_cd.yml - .github\workflows\healthchecks_openidconnectserver_cd_preview.yml = .github\workflows\healthchecks_openidconnectserver_cd_preview.yml - .github\workflows\healthchecks_openidconnectserver_ci.yml = .github\workflows\healthchecks_openidconnectserver_ci.yml - .github\workflows\healthchecks_oracle_cd.yml = .github\workflows\healthchecks_oracle_cd.yml - .github\workflows\healthchecks_oracle_cd_preview.yml = .github\workflows\healthchecks_oracle_cd_preview.yml - .github\workflows\healthchecks_oracle_ci.yml = .github\workflows\healthchecks_oracle_ci.yml - .github\workflows\healthchecks_prometheus_metrics_cd.yml = .github\workflows\healthchecks_prometheus_metrics_cd.yml - .github\workflows\healthchecks_prometheus_metrics_cd_preview.yml = .github\workflows\healthchecks_prometheus_metrics_cd_preview.yml - .github\workflows\healthchecks_prometheus_metrics_ci.yml = .github\workflows\healthchecks_prometheus_metrics_ci.yml - .github\workflows\healthchecks_publisher_applicationinsights_cd.yml = .github\workflows\healthchecks_publisher_applicationinsights_cd.yml - .github\workflows\healthchecks_publisher_applicationinsights_cd_preview.yml = .github\workflows\healthchecks_publisher_applicationinsights_cd_preview.yml - .github\workflows\healthchecks_publisher_applicationinsights_ci.yml = .github\workflows\healthchecks_publisher_applicationinsights_ci.yml - .github\workflows\healthchecks_publisher_cloudwatch_cd.yml = .github\workflows\healthchecks_publisher_cloudwatch_cd.yml - .github\workflows\healthchecks_publisher_cloudwatch_cd_preview.yml = .github\workflows\healthchecks_publisher_cloudwatch_cd_preview.yml - .github\workflows\healthchecks_publisher_cloudwatch_ci.yml = .github\workflows\healthchecks_publisher_cloudwatch_ci.yml - .github\workflows\healthchecks_publisher_datadog_cd.yml = .github\workflows\healthchecks_publisher_datadog_cd.yml - .github\workflows\healthchecks_publisher_datadog_cd_preview.yml = .github\workflows\healthchecks_publisher_datadog_cd_preview.yml - .github\workflows\healthchecks_publisher_datadog_ci.yml = .github\workflows\healthchecks_publisher_datadog_ci.yml - .github\workflows\healthchecks_publisher_prometheus_cd.yml = .github\workflows\healthchecks_publisher_prometheus_cd.yml - .github\workflows\healthchecks_publisher_prometheus_cd_preview.yml = .github\workflows\healthchecks_publisher_prometheus_cd_preview.yml - .github\workflows\healthchecks_publisher_prometheus_ci.yml = .github\workflows\healthchecks_publisher_prometheus_ci.yml - .github\workflows\healthchecks_publisher_seq_cd.yml = .github\workflows\healthchecks_publisher_seq_cd.yml - .github\workflows\healthchecks_publisher_seq_cd_preview.yml = .github\workflows\healthchecks_publisher_seq_cd_preview.yml - .github\workflows\healthchecks_publisher_seq_ci.yml = .github\workflows\healthchecks_publisher_seq_ci.yml - .github\workflows\healthchecks_rabbitmq_cd.yml = .github\workflows\healthchecks_rabbitmq_cd.yml - .github\workflows\healthchecks_rabbitmq_cd_preview.yml = .github\workflows\healthchecks_rabbitmq_cd_preview.yml - .github\workflows\healthchecks_rabbitmq_ci.yml = .github\workflows\healthchecks_rabbitmq_ci.yml - .github\workflows\healthchecks_ravendb_cd.yml = .github\workflows\healthchecks_ravendb_cd.yml - .github\workflows\healthchecks_ravendb_cd_preview.yml = .github\workflows\healthchecks_ravendb_cd_preview.yml - .github\workflows\healthchecks_ravendb_ci.yml = .github\workflows\healthchecks_ravendb_ci.yml - .github\workflows\healthchecks_redis_cd.yml = .github\workflows\healthchecks_redis_cd.yml - .github\workflows\healthchecks_redis_cd_preview.yml = .github\workflows\healthchecks_redis_cd_preview.yml - .github\workflows\healthchecks_redis_ci.yml = .github\workflows\healthchecks_redis_ci.yml - .github\workflows\healthchecks_sendgrid_cd.yml = .github\workflows\healthchecks_sendgrid_cd.yml - .github\workflows\healthchecks_sendgrid_cd_preview.yml = .github\workflows\healthchecks_sendgrid_cd_preview.yml - .github\workflows\healthchecks_sendgrid_ci.yml = .github\workflows\healthchecks_sendgrid_ci.yml - .github\workflows\healthchecks_signalr_cd.yml = .github\workflows\healthchecks_signalr_cd.yml - .github\workflows\healthchecks_signalr_cd_preview.yml = .github\workflows\healthchecks_signalr_cd_preview.yml - .github\workflows\healthchecks_signalr_ci.yml = .github\workflows\healthchecks_signalr_ci.yml - .github\workflows\healthchecks_solr_cd.yml = .github\workflows\healthchecks_solr_cd.yml - .github\workflows\healthchecks_solr_cd_preview.yml = .github\workflows\healthchecks_solr_cd_preview.yml - .github\workflows\healthchecks_solr_ci.yml = .github\workflows\healthchecks_solr_ci.yml - .github\workflows\healthchecks_sqlite_cd.yml = .github\workflows\healthchecks_sqlite_cd.yml - .github\workflows\healthchecks_sqlite_cd_preview.yml = .github\workflows\healthchecks_sqlite_cd_preview.yml - .github\workflows\healthchecks_sqlite_ci.yml = .github\workflows\healthchecks_sqlite_ci.yml - .github\workflows\healthchecks_sqlserver_cd.yml = .github\workflows\healthchecks_sqlserver_cd.yml - .github\workflows\healthchecks_sqlserver_cd_preview.yml = .github\workflows\healthchecks_sqlserver_cd_preview.yml - .github\workflows\healthchecks_sqlserver_ci.yml = .github\workflows\healthchecks_sqlserver_ci.yml - .github\workflows\healthchecks_system_cd.yml = .github\workflows\healthchecks_system_cd.yml - .github\workflows\healthchecks_system_cd_preview.yml = .github\workflows\healthchecks_system_cd_preview.yml - .github\workflows\healthchecks_system_ci.yml = .github\workflows\healthchecks_system_ci.yml - .github\workflows\healthchecks_ui_cd.yml = .github\workflows\healthchecks_ui_cd.yml - .github\workflows\healthchecks_ui_cd_preview.yml = .github\workflows\healthchecks_ui_cd_preview.yml - .github\workflows\healthchecks_ui_ci.yml = .github\workflows\healthchecks_ui_ci.yml - .github\workflows\healthchecks_uris_cd.yml = .github\workflows\healthchecks_uris_cd.yml - .github\workflows\healthchecks_uris_cd_preview.yml = .github\workflows\healthchecks_uris_cd_preview.yml - .github\workflows\healthchecks_uris_ci.yml = .github\workflows\healthchecks_uris_ci.yml - .github\workflows\label.yml = .github\workflows\label.yml - EndProjectSection -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HealthChecks.AzureDigitalTwin", "src\HealthChecks.AzureDigitalTwin\HealthChecks.AzureDigitalTwin.csproj", "{256B649E-9631-44AB-B577-96B3627C889E}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HealthChecks.Aws.SecretsManager", "src\HealthChecks.Aws.SecretsManager\HealthChecks.Aws.SecretsManager.csproj", "{7873D709-1467-4EDC-B54A-39A40EEFF1BF}" @@ -1021,7 +869,6 @@ Global {9E0AFD9E-F565-4196-85C1-545633580971} = {FF4414C2-8863-4ADA-8A1D-4B9F25C361FE} {030B2B8A-8C73-4469-ABAF-E934C4454B69} = {2A3FD988-2BB8-43CF-B3A2-B70E648259D4} {BCEF8EE5-D93E-4F75-AAE0-52C9C87A0B6F} = {FF4414C2-8863-4ADA-8A1D-4B9F25C361FE} - {531ABAB1-F4B5-4EAE-B310-6CB55D8FA4FD} = {A5A8CE48-FF38-4A49-9E59-0EC1FC4474C0} {256B649E-9631-44AB-B577-96B3627C889E} = {2A3FD988-2BB8-43CF-B3A2-B70E648259D4} {7873D709-1467-4EDC-B54A-39A40EEFF1BF} = {2A3FD988-2BB8-43CF-B3A2-B70E648259D4} {6E583EA4-CEED-468E-8B40-5F6E168D29AF} = {FF4414C2-8863-4ADA-8A1D-4B9F25C361FE} From f7f8cf24992df004236319e45c1386fe41db4b2d Mon Sep 17 00:00:00 2001 From: Mateusz Date: Sun, 9 Jul 2023 22:08:09 +0200 Subject: [PATCH 19/48] Adds mechanism to prevent spam from unhealthy notifications (#1877) --- README.md | 11 + src/HealthChecks.UI/Configuration/Settings.cs | 293 +++++++++--------- .../HealthCheckReportCollector.cs | 30 +- .../HealthChecks.UI.approved.txt | 1 + 4 files changed, 191 insertions(+), 144 deletions(-) diff --git a/README.md b/README.md index 436e3fb219..3e499572d6 100644 --- a/README.md +++ b/README.md @@ -543,6 +543,17 @@ Webhooks can be configured with configuration providers and also by code. Using The [web hooks section](./doc/webhooks.md) contains more information and webhooks samples for Microsoft Teams, Azure Functions, Slack and more. +**Avoid Fail notification spam** + +To prevent you from receiving several failure notifications from your application, a configuration was created to meet this scenario. + +```csharp +services.AddHealthChecksUI(setup => +{ + setup.SetNotifyUnHealthyOneTimeUntilChange(); // You will only receive one failure notification until the status changes. +}); +``` + ## UI Style and branding customization ### Sample of dotnet styled UI diff --git a/src/HealthChecks.UI/Configuration/Settings.cs b/src/HealthChecks.UI/Configuration/Settings.cs index 5082a260cf..44e301e6d3 100644 --- a/src/HealthChecks.UI/Configuration/Settings.cs +++ b/src/HealthChecks.UI/Configuration/Settings.cs @@ -1,143 +1,150 @@ -using HealthChecks.UI.Core; - -namespace HealthChecks.UI.Configuration -{ - public class Settings - { - internal List HealthChecks { get; set; } = new List(); - internal List Webhooks { get; set; } = new List(); - internal bool DisableMigrations { get; set; } = false; - internal int MaximumExecutionHistoriesPerEndpoint { get; private set; } = 100; - internal int EvaluationTimeInSeconds { get; set; } = 10; - internal int ApiMaxActiveRequests { get; private set; } = 3; - internal int MinimumSecondsBetweenFailureNotifications { get; set; } = 60 * 10; - internal Func? ApiEndpointHttpHandler { get; private set; } - internal Action? ApiEndpointHttpClientConfig { get; private set; } - internal Dictionary ApiEndpointDelegatingHandlerTypes { get; set; } = new(); - internal Func? WebHooksEndpointHttpHandler { get; private set; } - internal Action? WebHooksEndpointHttpClientConfig { get; private set; } - internal Dictionary WebHooksEndpointDelegatingHandlerTypes { get; set; } = new(); - internal string HeaderText { get; private set; } = "Health Checks Status"; - - public Settings AddHealthCheckEndpoint(string name, string uri) - { - HealthChecks.Add(new HealthCheckSetting - { - Name = name, - Uri = uri - }); - - return this; - } - - public Settings AddWebhookNotification(string name, string uri, string payload, string restorePayload = "", Func? shouldNotifyFunc = null, Func? customMessageFunc = null, Func? customDescriptionFunc = null) - { - Webhooks.Add(new WebHookNotification - { - Name = name, - Uri = uri, - Payload = payload, - RestoredPayload = restorePayload, - ShouldNotifyFunc = shouldNotifyFunc, - CustomMessageFunc = customMessageFunc, - CustomDescriptionFunc = customDescriptionFunc - }); - return this; - } - - public Settings DisableDatabaseMigrations() - { - DisableMigrations = true; - return this; - } - - public Settings SetEvaluationTimeInSeconds(int seconds) - { - EvaluationTimeInSeconds = seconds; - return this; - } - - public Settings SetApiMaxActiveRequests(int apiMaxActiveRequests) - { - ApiMaxActiveRequests = apiMaxActiveRequests; - return this; - } - - public Settings SetHeaderText(string text) - { - HeaderText = string.IsNullOrEmpty(text) ? HeaderText : text; - return this; - } - - public Settings SetMinimumSecondsBetweenFailureNotifications(int seconds) - { - MinimumSecondsBetweenFailureNotifications = seconds; - return this; - } - - public Settings UseApiEndpointHttpMessageHandler(Func apiEndpointHttpHandler) - { - ApiEndpointHttpHandler = apiEndpointHttpHandler; - return this; - } - - public Settings UseApiEndpointDelegatingHandler() where T : DelegatingHandler - { - Type delegatingHandlerType = typeof(T); - - ApiEndpointDelegatingHandlerTypes.TryAdd(delegatingHandlerType.FullName!, delegatingHandlerType); - - return this; - } - - public Settings UseWebhookEndpointHttpMessageHandler(Func webhookEndpointHttpHandler) - { - WebHooksEndpointHttpHandler = webhookEndpointHttpHandler; - return this; - } - - public Settings UseWebHooksEndpointDelegatingHandler() where T : DelegatingHandler - { - var delegatingHandlerType = typeof(T); - - WebHooksEndpointDelegatingHandlerTypes.TryAdd(delegatingHandlerType.FullName!, delegatingHandlerType); - - return this; - } - - public Settings ConfigureApiEndpointHttpclient(Action apiEndpointHttpClientconfig) - { - ApiEndpointHttpClientConfig = apiEndpointHttpClientconfig; - return this; - } - - public Settings ConfigureWebhooksEndpointHttpclient(Action webhooksEndpointHttpClientconfig) - { - WebHooksEndpointHttpClientConfig = webhooksEndpointHttpClientconfig; - return this; - } - - public Settings MaximumHistoryEntriesPerEndpoint(int maxValue) - { - MaximumExecutionHistoriesPerEndpoint = maxValue; - return this; - } - } - - public class HealthCheckSetting - { - public string Name { get; set; } = null!; - public string Uri { get; set; } = null!; - } - - public class WebHookNotification - { - public string Name { get; set; } = null!; - public string Uri { get; set; } = null!; - public string Payload { get; set; } = null!; - public string RestoredPayload { get; set; } = null!; - internal Func? ShouldNotifyFunc { get; set; } - internal Func? CustomMessageFunc { get; set; } - internal Func? CustomDescriptionFunc { get; set; } - } -} +using HealthChecks.UI.Core; + +namespace HealthChecks.UI.Configuration +{ + public class Settings + { + internal List HealthChecks { get; set; } = new List(); + internal List Webhooks { get; set; } = new List(); + internal bool DisableMigrations { get; set; } = false; + internal int MaximumExecutionHistoriesPerEndpoint { get; private set; } = 100; + internal int EvaluationTimeInSeconds { get; set; } = 10; + internal int ApiMaxActiveRequests { get; private set; } = 3; + internal int MinimumSecondsBetweenFailureNotifications { get; set; } = 60 * 10; + internal bool NotifyUnHealthyOneTimeUntilChange { get; set; } = false; + internal Func? ApiEndpointHttpHandler { get; private set; } + internal Action? ApiEndpointHttpClientConfig { get; private set; } + internal Dictionary ApiEndpointDelegatingHandlerTypes { get; set; } = new(); + internal Func? WebHooksEndpointHttpHandler { get; private set; } + internal Action? WebHooksEndpointHttpClientConfig { get; private set; } + internal Dictionary WebHooksEndpointDelegatingHandlerTypes { get; set; } = new(); + internal string HeaderText { get; private set; } = "Health Checks Status"; + + public Settings AddHealthCheckEndpoint(string name, string uri) + { + HealthChecks.Add(new HealthCheckSetting + { + Name = name, + Uri = uri + }); + + return this; + } + + public Settings AddWebhookNotification(string name, string uri, string payload, string restorePayload = "", Func? shouldNotifyFunc = null, Func? customMessageFunc = null, Func? customDescriptionFunc = null) + { + Webhooks.Add(new WebHookNotification + { + Name = name, + Uri = uri, + Payload = payload, + RestoredPayload = restorePayload, + ShouldNotifyFunc = shouldNotifyFunc, + CustomMessageFunc = customMessageFunc, + CustomDescriptionFunc = customDescriptionFunc + }); + return this; + } + + public Settings DisableDatabaseMigrations() + { + DisableMigrations = true; + return this; + } + + public Settings SetEvaluationTimeInSeconds(int seconds) + { + EvaluationTimeInSeconds = seconds; + return this; + } + + public Settings SetApiMaxActiveRequests(int apiMaxActiveRequests) + { + ApiMaxActiveRequests = apiMaxActiveRequests; + return this; + } + + public Settings SetHeaderText(string text) + { + HeaderText = string.IsNullOrEmpty(text) ? HeaderText : text; + return this; + } + + public Settings SetMinimumSecondsBetweenFailureNotifications(int seconds) + { + MinimumSecondsBetweenFailureNotifications = seconds; + return this; + } + + public Settings SetNotifyUnHealthyOneTimeUntilChange() + { + NotifyUnHealthyOneTimeUntilChange = true; + return this; + } + + public Settings UseApiEndpointHttpMessageHandler(Func apiEndpointHttpHandler) + { + ApiEndpointHttpHandler = apiEndpointHttpHandler; + return this; + } + + public Settings UseApiEndpointDelegatingHandler() where T : DelegatingHandler + { + Type delegatingHandlerType = typeof(T); + + ApiEndpointDelegatingHandlerTypes.TryAdd(delegatingHandlerType.FullName!, delegatingHandlerType); + + return this; + } + + public Settings UseWebhookEndpointHttpMessageHandler(Func webhookEndpointHttpHandler) + { + WebHooksEndpointHttpHandler = webhookEndpointHttpHandler; + return this; + } + + public Settings UseWebHooksEndpointDelegatingHandler() where T : DelegatingHandler + { + var delegatingHandlerType = typeof(T); + + WebHooksEndpointDelegatingHandlerTypes.TryAdd(delegatingHandlerType.FullName!, delegatingHandlerType); + + return this; + } + + public Settings ConfigureApiEndpointHttpclient(Action apiEndpointHttpClientconfig) + { + ApiEndpointHttpClientConfig = apiEndpointHttpClientconfig; + return this; + } + + public Settings ConfigureWebhooksEndpointHttpclient(Action webhooksEndpointHttpClientconfig) + { + WebHooksEndpointHttpClientConfig = webhooksEndpointHttpClientconfig; + return this; + } + + public Settings MaximumHistoryEntriesPerEndpoint(int maxValue) + { + MaximumExecutionHistoriesPerEndpoint = maxValue; + return this; + } + } + + public class HealthCheckSetting + { + public string Name { get; set; } = null!; + public string Uri { get; set; } = null!; + } + + public class WebHookNotification + { + public string Name { get; set; } = null!; + public string Uri { get; set; } = null!; + public string Payload { get; set; } = null!; + public string RestoredPayload { get; set; } = null!; + internal Func? ShouldNotifyFunc { get; set; } + internal Func? CustomMessageFunc { get; set; } + internal Func? CustomDescriptionFunc { get; set; } + } +} diff --git a/src/HealthChecks.UI/Core/HostedService/HealthCheckReportCollector.cs b/src/HealthChecks.UI/Core/HostedService/HealthCheckReportCollector.cs index b499452cb6..4b0b39a225 100644 --- a/src/HealthChecks.UI/Core/HostedService/HealthCheckReportCollector.cs +++ b/src/HealthChecks.UI/Core/HostedService/HealthCheckReportCollector.cs @@ -1,12 +1,14 @@ using System.Net.Http.Json; using System.Text.Json; using System.Text.Json.Serialization; +using HealthChecks.UI.Configuration; using HealthChecks.UI.Core.Extensions; using HealthChecks.UI.Core.Notifications; using HealthChecks.UI.Data; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Diagnostics.HealthChecks; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; namespace HealthChecks.UI.Core.HostedService { @@ -18,6 +20,7 @@ internal class HealthCheckReportCollector : IHealthCheckReportCollector private readonly ILogger _logger; private readonly ServerAddressesService _serverAddressService; private readonly IEnumerable _interceptors; + private readonly Settings _settings; private static readonly Dictionary _endpointAddresses = new(); private static readonly JsonSerializerOptions _options = new(JsonSerializerDefaults.Web) { @@ -33,6 +36,7 @@ public HealthCheckReportCollector( IHealthCheckFailureNotifier healthCheckFailureNotifier, IHttpClientFactory httpClientFactory, ILogger logger, + IOptions settings, ServerAddressesService serverAddressService, IEnumerable interceptors) { @@ -41,6 +45,7 @@ public HealthCheckReportCollector( _logger = Guard.ThrowIfNull(logger); _serverAddressService = Guard.ThrowIfNull(serverAddressService); _interceptors = interceptors ?? Enumerable.Empty(); + _settings = Guard.ThrowIfNull(settings.Value); _httpClient = httpClientFactory.CreateClient(Keys.HEALTH_CHECK_HTTP_CLIENT_NAME); } @@ -67,7 +72,10 @@ public async Task Collect(CancellationToken cancellationToken) if (healthReport.Status != UIHealthStatus.Healthy) { - await _healthCheckFailureNotifier.NotifyDown(item.Name, healthReport); + if (!_settings.NotifyUnHealthyOneTimeUntilChange || await ShouldNotifyAsync(item.Name)) + { + await _healthCheckFailureNotifier.NotifyDown(item.Name, healthReport); + } } else { @@ -173,6 +181,26 @@ private async Task HasLivenessRecoveredFromFailureAsync(HealthCheckConfigu .SingleOrDefaultAsync(); } + private async Task ShouldNotifyAsync(string healthCheckName) + { + var lastNotifications = await _db.Failures + .Where(lf => string.Equals(lf.HealthCheckName, healthCheckName, StringComparison.OrdinalIgnoreCase)) + .OrderByDescending(lf => lf.LastNotified) + .Take(2).ToListAsync(); + + if (lastNotifications?.Count == 2) + { + var first = lastNotifications[0]; + var second = lastNotifications[1]; + if (first.IsUpAndRunning == second.IsUpAndRunning) + { + return false; + } + } + + return true; + } + private async Task SaveExecutionHistoryAsync(HealthCheckConfiguration configuration, UIHealthReport healthReport) { _logger.LogDebug("HealthReportCollector - health report execution history saved."); diff --git a/test/HealthChecks.UI.Tests/HealthChecks.UI.approved.txt b/test/HealthChecks.UI.Tests/HealthChecks.UI.approved.txt index e2743f0b1a..e2ef58b496 100644 --- a/test/HealthChecks.UI.Tests/HealthChecks.UI.approved.txt +++ b/test/HealthChecks.UI.Tests/HealthChecks.UI.approved.txt @@ -33,6 +33,7 @@ namespace HealthChecks.UI.Configuration public HealthChecks.UI.Configuration.Settings SetEvaluationTimeInSeconds(int seconds) { } public HealthChecks.UI.Configuration.Settings SetHeaderText(string text) { } public HealthChecks.UI.Configuration.Settings SetMinimumSecondsBetweenFailureNotifications(int seconds) { } + public HealthChecks.UI.Configuration.Settings SetNotifyUnHealthyOneTimeUntilChange() { } public HealthChecks.UI.Configuration.Settings UseApiEndpointDelegatingHandler() where T : System.Net.Http.DelegatingHandler { } public HealthChecks.UI.Configuration.Settings UseApiEndpointHttpMessageHandler(System.Func apiEndpointHttpHandler) { } From 364c6d32dcc8df8482340a5465186c4228ae316c Mon Sep 17 00:00:00 2001 From: Mateusz Date: Tue, 11 Jul 2023 07:47:35 +0200 Subject: [PATCH 20/48] Add RequestTimeout as option for RavenDB healthcheck (#1881) --- .../RavenDBHealthCheck.cs | 26 +++++++++++---- src/HealthChecks.RavenDB/RavenDBOptions.cs | 2 ++ .../Functional/RavenDbHealthCheckTests.cs | 33 ++++++++++++++++++- .../HealthChecks.RavenDB.approved.txt | 1 + 4 files changed, 54 insertions(+), 8 deletions(-) diff --git a/src/HealthChecks.RavenDB/RavenDBHealthCheck.cs b/src/HealthChecks.RavenDB/RavenDBHealthCheck.cs index 2cb0e17969..b702e9afab 100644 --- a/src/HealthChecks.RavenDB/RavenDBHealthCheck.cs +++ b/src/HealthChecks.RavenDB/RavenDBHealthCheck.cs @@ -17,12 +17,12 @@ namespace HealthChecks.RavenDB; /// public class RavenDBHealthCheck : IHealthCheck { + private const int DEFAULT_REQUEST_TIMEOUT_IN_SECONDS = 15; + private readonly RavenDBOptions _options; private static readonly GetBuildNumberOperation _serverHealthCheck = new(); - private static readonly DatabaseHealthCheckOperation _databaseHealthCheck = new(); - private static readonly GetStatisticsOperation _legacyDatabaseHealthCheck = new(); private static readonly ConcurrentDictionary _stores = new(); @@ -51,6 +51,11 @@ public async Task CheckHealthAsync(HealthCheckContext context try { store.Initialize(); + if (!string.IsNullOrWhiteSpace(_options.Database)) + { + store.SetRequestTimeout(_options.RequestTimeout ?? TimeSpan.FromSeconds(DEFAULT_REQUEST_TIMEOUT_IN_SECONDS), _options.Database); + } + return new DocumentStoreHolder { Store = store, @@ -113,7 +118,7 @@ private static Task CheckServerHealthAsync(IDocumentStore store, CancellationTok .SendAsync(_serverHealthCheck, cancellationToken); } - private static async Task CheckDatabaseHealthAsync(IDocumentStore store, string database, bool legacy, CancellationToken cancellationToken) + private async Task CheckDatabaseHealthAsync(IDocumentStore store, string database, bool legacy, CancellationToken cancellationToken) { var executor = store.Maintenance.ForDatabase(database); @@ -123,21 +128,28 @@ private static async Task CheckDatabaseHealthAsync(IDocumentStore store, string return; } - await executor.SendAsync(_databaseHealthCheck, cancellationToken).ConfigureAwait(false); + await executor.SendAsync(new DatabaseHealthCheckOperation(_options.RequestTimeout ?? TimeSpan.FromSeconds(DEFAULT_REQUEST_TIMEOUT_IN_SECONDS)), cancellationToken).ConfigureAwait(false); } private class DatabaseHealthCheckOperation : IMaintenanceOperation { + private readonly TimeSpan _timeout; + + public DatabaseHealthCheckOperation(TimeSpan timeout) + { + _timeout = timeout; + } + public RavenCommand GetCommand(DocumentConventions conventions, JsonOperationContext context) { - return new DatabaseHealthCheckCommand(); + return new DatabaseHealthCheckCommand(_timeout); } private class DatabaseHealthCheckCommand : RavenCommand { - public DatabaseHealthCheckCommand() + public DatabaseHealthCheckCommand(TimeSpan timeout) { - Timeout = TimeSpan.FromSeconds(15); // maybe even less? + Timeout = timeout; } public override HttpRequestMessage CreateRequest(JsonOperationContext ctx, ServerNode node, out string url) diff --git a/src/HealthChecks.RavenDB/RavenDBOptions.cs b/src/HealthChecks.RavenDB/RavenDBOptions.cs index fdf7475e37..449d0ddd4d 100644 --- a/src/HealthChecks.RavenDB/RavenDBOptions.cs +++ b/src/HealthChecks.RavenDB/RavenDBOptions.cs @@ -12,4 +12,6 @@ public class RavenDBOptions public string[] Urls { get; set; } = null!; public X509Certificate2? Certificate { get; set; } + + public TimeSpan? RequestTimeout { get; set; } } diff --git a/test/HealthChecks.RavenDb.Tests/Functional/RavenDbHealthCheckTests.cs b/test/HealthChecks.RavenDb.Tests/Functional/RavenDbHealthCheckTests.cs index f6dd598aef..1f928a2991 100644 --- a/test/HealthChecks.RavenDb.Tests/Functional/RavenDbHealthCheckTests.cs +++ b/test/HealthChecks.RavenDb.Tests/Functional/RavenDbHealthCheckTests.cs @@ -82,6 +82,37 @@ public async Task be_healthy_if_ravendb_is_available_and_contains_specific_datab response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); } + [Fact] + public async Task be_unhealthy_if_ravendb_is_available_but_timeout_is_too_low() + { + var webHostBuilder = new WebHostBuilder() + .ConfigureServices(services => + { + services + .AddHealthChecks() + .AddRavenDB(_ => + { + _.Urls = _urls; + _.Database = "Demo"; + _.RequestTimeout = TimeSpan.Zero; + }, tags: new string[] { "ravendb" }); + }) + .Configure(app => + { + app.UseHealthChecks("/health", new HealthCheckOptions + { + Predicate = r => r.Tags.Contains("ravendb"), + ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse, + }); + }); + + using var server = new TestServer(webHostBuilder); + + var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + + response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); + } + [Fact] public async Task be_unhealthy_if_ravendb_is_not_available() { @@ -135,7 +166,7 @@ public async Task be_unhealthy_if_ravendb_is_available_but_database_doesnot_exis using var server = new TestServer(webHostBuilder); - var response = await server.CreateRequest($"/health").GetAsync().ConfigureAwait(false); + var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); } diff --git a/test/HealthChecks.RavenDb.Tests/HealthChecks.RavenDB.approved.txt b/test/HealthChecks.RavenDb.Tests/HealthChecks.RavenDB.approved.txt index 82380f16ad..2bb1af36d5 100644 --- a/test/HealthChecks.RavenDb.Tests/HealthChecks.RavenDB.approved.txt +++ b/test/HealthChecks.RavenDb.Tests/HealthChecks.RavenDB.approved.txt @@ -10,6 +10,7 @@ namespace HealthChecks.RavenDB public RavenDBOptions() { } public System.Security.Cryptography.X509Certificates.X509Certificate2? Certificate { get; set; } public string? Database { get; set; } + public System.TimeSpan? RequestTimeout { get; set; } public string[] Urls { get; set; } } } From c6b9ffbf18b390f4e79d412a6ac934eb6bf66d3c Mon Sep 17 00:00:00 2001 From: Mateusz Date: Tue, 11 Jul 2023 07:51:11 +0200 Subject: [PATCH 21/48] Add overload to AddAzureBlobStorage to supply your own BlobServiceClient from delegate (#1889) --- ...zureStorageHealthCheckBuilderExtensions.cs | 75 ++++++++++++++++++- .../AzureBlobStorageRegistrationTests.cs | 56 ++++++++++++++ .../HealthChecks.AzureStorage.approved.txt | 2 + 3 files changed, 132 insertions(+), 1 deletion(-) diff --git a/src/HealthChecks.AzureStorage/DependencyInjection/AzureStorageHealthCheckBuilderExtensions.cs b/src/HealthChecks.AzureStorage/DependencyInjection/AzureStorageHealthCheckBuilderExtensions.cs index f2b1e90bd9..93965c5110 100644 --- a/src/HealthChecks.AzureStorage/DependencyInjection/AzureStorageHealthCheckBuilderExtensions.cs +++ b/src/HealthChecks.AzureStorage/DependencyInjection/AzureStorageHealthCheckBuilderExtensions.cs @@ -122,11 +122,48 @@ public static IHealthChecksBuilder AddAzureBlobStorage( timeout)); } + /// + /// Add a health check for Azure Blob Storage. + /// + /// The . + /// Delegate for creating a . + /// Delegate for configuring the health check. Optional. + /// The health check name. Optional. If the type name 'azureblob' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddAzureBlobStorage( + this IHealthChecksBuilder builder, + Func clientFactory, + Action? configureOptions = default, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) + { + return builder.Add(new HealthCheckRegistration( + name ?? AZUREBLOB_NAME, + sp => + { + var options = new AzureBlobStorageHealthCheckOptions(); + configureOptions?.Invoke(options); + return new AzureBlobStorageHealthCheck(clientFactory(sp), options); + }, + failureStatus, + tags, + timeout)); + } + /// /// Add a health check for Azure Blob Storage. /// /// - /// A service must be registered in the service container. + /// A service must be registered in the service container. For named instances + /// you may use other overload with argument. /// /// The . /// Delegate for configuring the health check. Optional. @@ -159,6 +196,42 @@ public static IHealthChecksBuilder AddAzureBlobStorage( timeout)); } + /// + /// Add a health check for Azure Blob Storage. + /// + /// The . + /// Delegate for creating a . + /// Delegate for configuring the health check. Optional. + /// The health check name. Optional. If the type name 'azureblob' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddAzureBlobStorage( + this IHealthChecksBuilder builder, + Func clientFactory, + Action? configureOptions = default, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) + { + return builder.Add(new HealthCheckRegistration( + name ?? AZUREBLOB_NAME, + sp => + { + var options = new AzureBlobStorageHealthCheckOptions(); + configureOptions?.Invoke(sp, options); + return new AzureBlobStorageHealthCheck(clientFactory(sp), options); + }, + failureStatus, + tags, + timeout)); + } + /// /// Add a health check for an Azure file share. /// diff --git a/test/HealthChecks.AzureStorage.Tests/DependencyInjection/AzureBlobStorageRegistrationTests.cs b/test/HealthChecks.AzureStorage.Tests/DependencyInjection/AzureBlobStorageRegistrationTests.cs index b0eaac1e39..56c564ef72 100644 --- a/test/HealthChecks.AzureStorage.Tests/DependencyInjection/AzureBlobStorageRegistrationTests.cs +++ b/test/HealthChecks.AzureStorage.Tests/DependencyInjection/AzureBlobStorageRegistrationTests.cs @@ -91,6 +91,34 @@ public void add_health_check_with_client_from_service_provider(string? container check.ShouldBeOfType(); } + [Theory] + [InlineData(null, null, null)] + [InlineData("container", null, null)] + [InlineData(null, "my-azureblob-group", null)] + [InlineData(null, null, HealthStatus.Degraded)] + [InlineData("container", "my-azureblob-group", HealthStatus.Degraded)] + public void add_health_check_with_client_from_delegate(string? containerName, string? registrationName, HealthStatus? failureStatus) + { + using var serviceProvider = new ServiceCollection() + .AddHealthChecks() + .AddAzureBlobStorage( + clientFactory: sp => Substitute.For(), + o => o.ContainerName = containerName, + name: registrationName, + failureStatus: failureStatus) + .Services + .BuildServiceProvider(); + + var options = serviceProvider.GetRequiredService>(); + + var registration = options.Value.Registrations.First(); + var check = registration.Factory(serviceProvider); + + registration.Name.ShouldBe(registrationName ?? "azureblob"); + registration.FailureStatus.ShouldBe(failureStatus ?? HealthStatus.Unhealthy); + check.ShouldBeOfType(); + } + [Theory] [InlineData(null, null, null)] [InlineData("container", null, null)] @@ -118,4 +146,32 @@ public void add_health_check_with_client_from_service_provider_and_advanced_dele registration.FailureStatus.ShouldBe(failureStatus ?? HealthStatus.Unhealthy); check.ShouldBeOfType(); } + + [Theory] + [InlineData(null, null, null)] + [InlineData("container", null, null)] + [InlineData(null, "my-azureblob-group", null)] + [InlineData(null, null, HealthStatus.Degraded)] + [InlineData("container", "my-azureblob-group", HealthStatus.Degraded)] + public void add_health_check_with_client_from_delegate_and_advanced_delegate(string? containerName, string? registrationName, HealthStatus? failureStatus) + { + using var serviceProvider = new ServiceCollection() + .AddHealthChecks() + .AddAzureBlobStorage( + clientFactory: sp => Substitute.For(), + (sp, o) => o.ContainerName = containerName, + name: registrationName, + failureStatus: failureStatus) + .Services + .BuildServiceProvider(); + + var options = serviceProvider.GetRequiredService>(); + + var registration = options.Value.Registrations.First(); + var check = registration.Factory(serviceProvider); + + registration.Name.ShouldBe(registrationName ?? "azureblob"); + registration.FailureStatus.ShouldBe(failureStatus ?? HealthStatus.Unhealthy); + check.ShouldBeOfType(); + } } diff --git a/test/HealthChecks.AzureStorage.Tests/HealthChecks.AzureStorage.approved.txt b/test/HealthChecks.AzureStorage.Tests/HealthChecks.AzureStorage.approved.txt index 7458b65648..c6a711058c 100644 --- a/test/HealthChecks.AzureStorage.Tests/HealthChecks.AzureStorage.approved.txt +++ b/test/HealthChecks.AzureStorage.Tests/HealthChecks.AzureStorage.approved.txt @@ -42,6 +42,8 @@ namespace Microsoft.Extensions.DependencyInjection { public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddAzureBlobStorage(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, System.Action? configureOptions = null, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddAzureBlobStorage(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, System.Action? configureOptions = null, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } + public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddAzureBlobStorage(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, System.Func clientFactory, System.Action? configureOptions = null, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } + public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddAzureBlobStorage(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, System.Func clientFactory, System.Action? configureOptions = null, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddAzureBlobStorage(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, string connectionString, string? containerName = null, Azure.Storage.Blobs.BlobClientOptions? clientOptions = null, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddAzureBlobStorage(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, System.Uri blobServiceUri, Azure.Core.TokenCredential credential, string? containerName = null, Azure.Storage.Blobs.BlobClientOptions? clientOptions = null, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddAzureFileShare(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, System.Action? configureOptions = null, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } From a8be32b4d71cb2883aeea2474de6c7c8ff08acee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Jul 2023 08:56:30 +0300 Subject: [PATCH 22/48] Bump InfluxDB.Client from 4.11.0 to 4.12.0 (#1892) Bumps [InfluxDB.Client](https://github.com/influxdata/influxdb-client-csharp) from 4.11.0 to 4.12.0. - [Release notes](https://github.com/influxdata/influxdb-client-csharp/releases) - [Changelog](https://github.com/influxdata/influxdb-client-csharp/blob/master/CHANGELOG.md) - [Commits](https://github.com/influxdata/influxdb-client-csharp/compare/v4.11.0...v4.12.0) --- updated-dependencies: - dependency-name: InfluxDB.Client dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/HealthChecks.InfluxDB/HealthChecks.InfluxDB.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.InfluxDB/HealthChecks.InfluxDB.csproj b/src/HealthChecks.InfluxDB/HealthChecks.InfluxDB.csproj index f9f4544989..af10e85c17 100644 --- a/src/HealthChecks.InfluxDB/HealthChecks.InfluxDB.csproj +++ b/src/HealthChecks.InfluxDB/HealthChecks.InfluxDB.csproj @@ -8,7 +8,7 @@ - + From eb6ad6ad3222bc2948f4876c8ec8a9a441508de9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Jul 2023 08:58:20 +0300 Subject: [PATCH 23/48] Bump coverlet.collector from 3.2.0 to 6.0.0 (#1894) Bumps [coverlet.collector](https://github.com/coverlet-coverage/coverlet) from 3.2.0 to 6.0.0. - [Release notes](https://github.com/coverlet-coverage/coverlet/releases) - [Commits](https://github.com/coverlet-coverage/coverlet/compare/v3.2.0...v6.0.0) --- updated-dependencies: - dependency-name: coverlet.collector dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 7a5a0a1da6..0e5b313741 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -45,7 +45,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 43b8ea348fb1067eabb24d09ba51b8ca909c550c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Jul 2023 08:59:12 +0300 Subject: [PATCH 24/48] Bump System.ServiceProcess.ServiceController from 7.0.0 to 7.0.1 (#1895) Bumps [System.ServiceProcess.ServiceController](https://github.com/dotnet/runtime) from 7.0.0 to 7.0.1. - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/compare/v7.0.0...v7.0.1) --- updated-dependencies: - dependency-name: System.ServiceProcess.ServiceController dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/HealthChecks.System/HealthChecks.System.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.System/HealthChecks.System.csproj b/src/HealthChecks.System/HealthChecks.System.csproj index 7e670652a6..2ebded1b20 100644 --- a/src/HealthChecks.System/HealthChecks.System.csproj +++ b/src/HealthChecks.System/HealthChecks.System.csproj @@ -9,7 +9,7 @@ - + From 9bb49627fec27f262cd046df861ad159f2bb6489 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Jul 2023 09:00:07 +0300 Subject: [PATCH 25/48] Bump StackExchange.Redis from 2.6.104 to 2.6.122 (#1893) Bumps [StackExchange.Redis](https://github.com/StackExchange/StackExchange.Redis) from 2.6.104 to 2.6.122. - [Release notes](https://github.com/StackExchange/StackExchange.Redis/releases) - [Changelog](https://github.com/StackExchange/StackExchange.Redis/blob/main/docs/ReleaseNotes.md) - [Commits](https://github.com/StackExchange/StackExchange.Redis/compare/2.6.104...2.6.122) --- updated-dependencies: - dependency-name: StackExchange.Redis dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/HealthChecks.Redis/HealthChecks.Redis.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.Redis/HealthChecks.Redis.csproj b/src/HealthChecks.Redis/HealthChecks.Redis.csproj index 95d75d3e06..4977629ffa 100644 --- a/src/HealthChecks.Redis/HealthChecks.Redis.csproj +++ b/src/HealthChecks.Redis/HealthChecks.Redis.csproj @@ -8,7 +8,7 @@ - + From eb640992b0ed061ddff8c8e41df8d93f7799e90c Mon Sep 17 00:00:00 2001 From: Ivan Maximov Date: Tue, 11 Jul 2023 14:03:49 +0300 Subject: [PATCH 26/48] Fix ui_api_request_limiting tests (#1896) --- .github/workflows/healthchecks_ui_ci.yml | 11 +++ AspNetCore.Diagnostics.HealthChecks.sln | 7 ++ src/HealthChecks.UI.Data/HealthChecksDb.cs | 7 +- src/HealthChecks.UI/Configuration/Settings.cs | 10 +++ .../ApplicationBuilderExtensions.cs | 3 + .../EndpointRouteBuilderExtensions.cs | 3 +- .../Middleware/UIApiEndpointMiddleware.cs | 11 +-- .../UIApiRequestLimitingMidleware.cs | 8 +-- .../HealthChecks.UI.Data.Tests.csproj | 15 ++++ .../HealthChecks.UI.Data.approved.txt | 71 +++++++++++++++++++ .../HealthChecksDbTests.cs | 20 ++++++ .../Functional/UIApiRequestLimitingTests.cs | 39 +++++----- 12 files changed, 169 insertions(+), 36 deletions(-) create mode 100644 test/HealthChecks.UI.Data.Tests/HealthChecks.UI.Data.Tests.csproj create mode 100644 test/HealthChecks.UI.Data.Tests/HealthChecks.UI.Data.approved.txt create mode 100644 test/HealthChecks.UI.Data.Tests/HealthChecksDbTests.cs diff --git a/.github/workflows/healthchecks_ui_ci.yml b/.github/workflows/healthchecks_ui_ci.yml index 9d96a2af35..f9fd8a5916 100644 --- a/.github/workflows/healthchecks_ui_ci.yml +++ b/.github/workflows/healthchecks_ui_ci.yml @@ -72,6 +72,7 @@ jobs: dotnet restore ./src/HealthChecks.UI.Core/HealthChecks.UI.Core.csproj && dotnet restore ./test/HealthChecks.UI.Core.Tests/HealthChecks.UI.Core.Tests.csproj && dotnet restore ./src/HealthChecks.UI.Data/HealthChecks.UI.Data.csproj && + dotnet restore ./test/HealthChecks.UI.Data.Tests/HealthChecks.UI.Data.Tests.csproj && dotnet restore ./src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj && dotnet restore ./src/HealthChecks.UI.MySql.Storage/HealthChecks.UI.MySql.Storage.csproj && dotnet restore ./src/HealthChecks.UI.PostgreSQL.Storage/HealthChecks.UI.PostgreSQL.Storage.csproj && @@ -88,6 +89,7 @@ jobs: dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.Core/HealthChecks.UI.Core.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) && dotnet format --no-restore --verify-no-changes --severity warn ./test/HealthChecks.UI.Core.Tests/HealthChecks.UI.Core.Tests.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) && dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.Data/HealthChecks.UI.Data.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) && + dotnet format --no-restore --verify-no-changes --severity warn ./test/HealthChecks.UI.Data.Tests/HealthChecks.UI.Data.Tests.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) && dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) && dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.MySql.Storage/HealthChecks.UI.MySql.Storage.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) && dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.PostgreSQL.Storage/HealthChecks.UI.PostgreSQL.Storage.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) && @@ -104,6 +106,7 @@ jobs: dotnet build --no-restore ./src/HealthChecks.UI.Core/HealthChecks.UI.Core.csproj && dotnet build --no-restore ./test/HealthChecks.UI.Core.Tests/HealthChecks.UI.Core.Tests.csproj && dotnet build --no-restore ./src/HealthChecks.UI.Data/HealthChecks.UI.Data.csproj && + dotnet build --no-restore ./test/HealthChecks.UI.Data.Tests/HealthChecks.UI.Data.Tests.csproj && dotnet build --no-restore ./src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj && dotnet build --no-restore ./src/HealthChecks.UI.MySql.Storage/HealthChecks.UI.MySql.Storage.csproj && dotnet build --no-restore ./src/HealthChecks.UI.PostgreSQL.Storage/HealthChecks.UI.PostgreSQL.Storage.csproj && @@ -137,6 +140,14 @@ jobs: --results-directory .coverage -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover + dotnet test + ./test/HealthChecks.UI.Data.Tests/HealthChecks.UI.Data.Tests.csproj + --no-restore + --no-build + --collect "XPlat Code Coverage" + --results-directory .coverage + -- + DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover - name: Upload Coverage uses: codecov/codecov-action@v3 diff --git a/AspNetCore.Diagnostics.HealthChecks.sln b/AspNetCore.Diagnostics.HealthChecks.sln index 107edb03aa..d92dba4561 100644 --- a/AspNetCore.Diagnostics.HealthChecks.sln +++ b/AspNetCore.Diagnostics.HealthChecks.sln @@ -275,6 +275,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HealthChecks.AzureSearch", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HealthChecks.AzureSearch.Tests", "test\HealthChecks.AzureSearch.Tests\HealthChecks.AzureSearch.Tests.csproj", "{076B7DAE-E92A-4B81-BC1D-D63AF0E9C5B4}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HealthChecks.UI.Data.Tests", "test\HealthChecks.UI.Data.Tests\HealthChecks.UI.Data.Tests.csproj", "{93DEEAD7-9A89-48C6-AD42-103AEADBCACE}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -765,6 +767,10 @@ Global {076B7DAE-E92A-4B81-BC1D-D63AF0E9C5B4}.Debug|Any CPU.Build.0 = Debug|Any CPU {076B7DAE-E92A-4B81-BC1D-D63AF0E9C5B4}.Release|Any CPU.ActiveCfg = Release|Any CPU {076B7DAE-E92A-4B81-BC1D-D63AF0E9C5B4}.Release|Any CPU.Build.0 = Release|Any CPU + {93DEEAD7-9A89-48C6-AD42-103AEADBCACE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {93DEEAD7-9A89-48C6-AD42-103AEADBCACE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {93DEEAD7-9A89-48C6-AD42-103AEADBCACE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {93DEEAD7-9A89-48C6-AD42-103AEADBCACE}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -891,6 +897,7 @@ Global {E8CEC72F-15D2-409B-ACA1-DE45697DCA54} = {FF4414C2-8863-4ADA-8A1D-4B9F25C361FE} {0BE32765-7244-4717-9D48-B4C716DD1769} = {2A3FD988-2BB8-43CF-B3A2-B70E648259D4} {076B7DAE-E92A-4B81-BC1D-D63AF0E9C5B4} = {FF4414C2-8863-4ADA-8A1D-4B9F25C361FE} + {93DEEAD7-9A89-48C6-AD42-103AEADBCACE} = {FF4414C2-8863-4ADA-8A1D-4B9F25C361FE} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {2B8C62A1-11B6-469F-874C-A02443256568} diff --git a/src/HealthChecks.UI.Data/HealthChecksDb.cs b/src/HealthChecks.UI.Data/HealthChecksDb.cs index 528fab5c8b..804e7af790 100644 --- a/src/HealthChecks.UI.Data/HealthChecksDb.cs +++ b/src/HealthChecks.UI.Data/HealthChecksDb.cs @@ -3,8 +3,7 @@ namespace HealthChecks.UI.Data { - public class HealthChecksDb - : DbContext + public class HealthChecksDb : DbContext { public DbSet Configurations { get; set; } @@ -16,6 +15,10 @@ public class HealthChecksDb public DbSet HealthCheckExecutionHistories { get; set; } + protected HealthChecksDb(DbContextOptions options) : base(options) + { + } + #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. public HealthChecksDb(DbContextOptions options) : base(options) #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. diff --git a/src/HealthChecks.UI/Configuration/Settings.cs b/src/HealthChecks.UI/Configuration/Settings.cs index 44e301e6d3..549f23a973 100644 --- a/src/HealthChecks.UI/Configuration/Settings.cs +++ b/src/HealthChecks.UI/Configuration/Settings.cs @@ -1,9 +1,12 @@ using HealthChecks.UI.Core; +using HealthChecks.UI.Data; +using Microsoft.AspNetCore.Http; namespace HealthChecks.UI.Configuration { public class Settings { + internal Action>? ConfigureUIApiEndpointResult { get; set; } internal List HealthChecks { get; set; } = new List(); internal List Webhooks { get; set; } = new List(); internal bool DisableMigrations { get; set; } = false; @@ -58,6 +61,13 @@ public Settings SetEvaluationTimeInSeconds(int seconds) return this; } + /// + /// Sets limit on maximum active (concurrent) HTTP requests to URL. + /// If this limit is exceeded, requests to return . + /// Initially, this value is set to 3. + /// + /// Concurrency limit. + /// Reference to the same . public Settings SetApiMaxActiveRequests(int apiMaxActiveRequests) { ApiMaxActiveRequests = apiMaxActiveRequests; diff --git a/src/HealthChecks.UI/Extensions/ApplicationBuilderExtensions.cs b/src/HealthChecks.UI/Extensions/ApplicationBuilderExtensions.cs index a2dc049969..bcda22ea9a 100644 --- a/src/HealthChecks.UI/Extensions/ApplicationBuilderExtensions.cs +++ b/src/HealthChecks.UI/Extensions/ApplicationBuilderExtensions.cs @@ -14,10 +14,12 @@ public static IApplicationBuilder UseHealthChecksUI(this IApplicationBuilder app return ConfigurePipeline(app, options); } + public static IApplicationBuilder UseHealthChecksUI(this IApplicationBuilder app) { return ConfigurePipeline(app, new Options()); } + private static IApplicationBuilder ConfigurePipeline(IApplicationBuilder app, Options options) { EnsureValidApiOptions(options); @@ -41,6 +43,7 @@ private static IApplicationBuilder ConfigurePipeline(IApplicationBuilder app, Op return app; } + private static void EnsureValidApiOptions(Options options) { Action ensureValidPath = (string path, string argument) => diff --git a/src/HealthChecks.UI/Extensions/EndpointRouteBuilderExtensions.cs b/src/HealthChecks.UI/Extensions/EndpointRouteBuilderExtensions.cs index 6a176f1380..fd7bd144f8 100644 --- a/src/HealthChecks.UI/Extensions/EndpointRouteBuilderExtensions.cs +++ b/src/HealthChecks.UI/Extensions/EndpointRouteBuilderExtensions.cs @@ -8,8 +8,7 @@ namespace Microsoft.AspNetCore.Builder { public static class EndpointRouteBuilderExtensions { - public static IEndpointConventionBuilder MapHealthChecksUI(this IEndpointRouteBuilder builder, - Action? setupOptions = null) + public static IEndpointConventionBuilder MapHealthChecksUI(this IEndpointRouteBuilder builder, Action? setupOptions = null) { var options = new Options(); setupOptions?.Invoke(options); diff --git a/src/HealthChecks.UI/Middleware/UIApiEndpointMiddleware.cs b/src/HealthChecks.UI/Middleware/UIApiEndpointMiddleware.cs index f874520869..b244f3666b 100644 --- a/src/HealthChecks.UI/Middleware/UIApiEndpointMiddleware.cs +++ b/src/HealthChecks.UI/Middleware/UIApiEndpointMiddleware.cs @@ -34,7 +34,7 @@ public async Task InvokeAsync(HttpContext context) using var scope = _serviceScopeFactory.CreateScope(); using var db = scope.ServiceProvider.GetRequiredService(); - var healthChecks = await db.Configurations.ToListAsync(); + var healthChecks = await db.Configurations.ToListAsync().ConfigureAwait(false); var healthChecksExecutions = new List(); @@ -44,7 +44,8 @@ public async Task InvokeAsync(HttpContext context) .Include(le => le.Entries) .Where(le => le.Name == item.Name) .AsNoTracking() - .SingleOrDefaultAsync(); + .SingleOrDefaultAsync() + .ConfigureAwait(false); if (execution != null) { @@ -52,16 +53,18 @@ public async Task InvokeAsync(HttpContext context) .Where(eh => EF.Property(eh, "HealthCheckExecutionId") == execution.Id) .OrderByDescending(eh => eh.On) .Take(_settings.MaximumExecutionHistoriesPerEndpoint) - .ToListAsync(); + .ToListAsync() + .ConfigureAwait(false); healthChecksExecutions.Add(execution); } } + _settings.ConfigureUIApiEndpointResult?.Invoke(healthChecksExecutions); var responseContent = JsonConvert.SerializeObject(healthChecksExecutions, _jsonSerializationSettings); context.Response.ContentType = Keys.DEFAULT_RESPONSE_CONTENT_TYPE; - await context.Response.WriteAsync(responseContent); + await context.Response.WriteAsync(responseContent).ConfigureAwait(false); } } } diff --git a/src/HealthChecks.UI/Middleware/UIApiRequestLimitingMidleware.cs b/src/HealthChecks.UI/Middleware/UIApiRequestLimitingMidleware.cs index 473c3706fe..3df0443d18 100644 --- a/src/HealthChecks.UI/Middleware/UIApiRequestLimitingMidleware.cs +++ b/src/HealthChecks.UI/Middleware/UIApiRequestLimitingMidleware.cs @@ -29,7 +29,7 @@ public UIApiRequestLimitingMidleware(RequestDelegate next, IOptions se public async Task InvokeAsync(HttpContext context) { - if (!await _semaphore.WaitAsync(TimeSpan.Zero)) + if (!await _semaphore.WaitAsync(TimeSpan.Zero).ConfigureAwait(false)) { context.Response.StatusCode = StatusCodes.Status429TooManyRequests; return; @@ -37,11 +37,9 @@ public async Task InvokeAsync(HttpContext context) try { - _logger.LogDebug("Executing api middleware for client {client}, remaining slots: {slots}", - context.Connection.RemoteIpAddress, - _semaphore.CurrentCount); + _logger.LogDebug("Executing api middleware for client {client}, remaining slots: {slots}", context.Connection.RemoteIpAddress, _semaphore.CurrentCount); - await _next(context); + await _next(context).ConfigureAwait(false); } finally { diff --git a/test/HealthChecks.UI.Data.Tests/HealthChecks.UI.Data.Tests.csproj b/test/HealthChecks.UI.Data.Tests/HealthChecks.UI.Data.Tests.csproj new file mode 100644 index 0000000000..e55ebfa32f --- /dev/null +++ b/test/HealthChecks.UI.Data.Tests/HealthChecks.UI.Data.Tests.csproj @@ -0,0 +1,15 @@ + + + + net6.0;net7.0 + + + + + + + + + + + diff --git a/test/HealthChecks.UI.Data.Tests/HealthChecks.UI.Data.approved.txt b/test/HealthChecks.UI.Data.Tests/HealthChecks.UI.Data.approved.txt new file mode 100644 index 0000000000..e6e7e5d3d2 --- /dev/null +++ b/test/HealthChecks.UI.Data.Tests/HealthChecks.UI.Data.approved.txt @@ -0,0 +1,71 @@ +namespace HealthChecks.UI.Data.Configuration +{ + public class HealthCheckFailureNotificationsMap : Microsoft.EntityFrameworkCore.IEntityTypeConfiguration + { + public HealthCheckFailureNotificationsMap() { } + public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder builder) { } + } +} +namespace HealthChecks.UI.Data +{ + public class HealthCheckConfiguration + { + public HealthCheckConfiguration() { } + public string? DiscoveryService { get; set; } + public int Id { get; set; } + public string Name { get; set; } + public string Uri { get; set; } + public void Deconstruct(out string uri, out string name) { } + } + public class HealthCheckExecution + { + public HealthCheckExecution() { } + public string? DiscoveryService { get; set; } + public System.Collections.Generic.List Entries { get; set; } + public System.Collections.Generic.List History { get; set; } + public int Id { get; set; } + public System.DateTime LastExecuted { get; set; } + public string Name { get; set; } + public System.DateTime OnStateFrom { get; set; } + public HealthChecks.UI.Core.UIHealthStatus Status { get; set; } + public string Uri { get; set; } + } + public class HealthCheckExecutionEntry + { + public HealthCheckExecutionEntry() { } + public string? Description { get; set; } + public System.TimeSpan Duration { get; set; } + public int Id { get; set; } + public string Name { get; set; } + public HealthChecks.UI.Core.UIHealthStatus Status { get; set; } + public System.Collections.Generic.List? Tags { get; set; } + } + public class HealthCheckExecutionHistory + { + public HealthCheckExecutionHistory() { } + public string? Description { get; set; } + public int Id { get; set; } + public string Name { get; set; } + public System.DateTime On { get; set; } + public HealthChecks.UI.Core.UIHealthStatus Status { get; set; } + } + public class HealthCheckFailureNotification + { + public HealthCheckFailureNotification() { } + public string HealthCheckName { get; set; } + public int Id { get; set; } + public bool IsUpAndRunning { get; set; } + public System.DateTime LastNotified { get; set; } + } + public class HealthChecksDb : Microsoft.EntityFrameworkCore.DbContext + { + protected HealthChecksDb(Microsoft.EntityFrameworkCore.DbContextOptions options) { } + public HealthChecksDb(Microsoft.EntityFrameworkCore.DbContextOptions options) { } + public Microsoft.EntityFrameworkCore.DbSet Configurations { get; set; } + public Microsoft.EntityFrameworkCore.DbSet Executions { get; set; } + public Microsoft.EntityFrameworkCore.DbSet Failures { get; set; } + public Microsoft.EntityFrameworkCore.DbSet HealthCheckExecutionEntries { get; set; } + public Microsoft.EntityFrameworkCore.DbSet HealthCheckExecutionHistories { get; set; } + protected override void OnModelCreating(Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder) { } + } +} \ No newline at end of file diff --git a/test/HealthChecks.UI.Data.Tests/HealthChecksDbTests.cs b/test/HealthChecks.UI.Data.Tests/HealthChecksDbTests.cs new file mode 100644 index 0000000000..1af2ddae8e --- /dev/null +++ b/test/HealthChecks.UI.Data.Tests/HealthChecksDbTests.cs @@ -0,0 +1,20 @@ +using Microsoft.EntityFrameworkCore; + +namespace HealthChecks.UI.Data.Tests; + +public class HealthChecksDbTests +{ + [Fact] + public async Task HealthChecksDb_Primitive_Test() + { + var services = new ServiceCollection(); + services.AddDbContext(b => b.UseInMemoryDatabase("")); + using var provider = services.BuildServiceProvider(); + var db = provider.GetRequiredService(); + (await db.Configurations.ToListAsync().ConfigureAwait(false)).Count.ShouldBe(0); + (await db.Executions.ToListAsync().ConfigureAwait(false)).Count.ShouldBe(0); + (await db.Failures.ToListAsync().ConfigureAwait(false)).Count.ShouldBe(0); + (await db.HealthCheckExecutionEntries.ToListAsync().ConfigureAwait(false)).Count.ShouldBe(0); + (await db.HealthCheckExecutionHistories.ToListAsync().ConfigureAwait(false)).Count.ShouldBe(0); + } +} diff --git a/test/HealthChecks.UI.Tests/Functional/UIApiRequestLimitingTests.cs b/test/HealthChecks.UI.Tests/Functional/UIApiRequestLimitingTests.cs index 54a94ae8cb..68449c4814 100644 --- a/test/HealthChecks.UI.Tests/Functional/UIApiRequestLimitingTests.cs +++ b/test/HealthChecks.UI.Tests/Functional/UIApiRequestLimitingTests.cs @@ -17,16 +17,12 @@ public async Task should_return_too_many_requests_status_code_when_exceding_conf services .AddRouting() .AddHealthChecks() - .AddAsyncCheck("Delayed", async () => - { - await Task.Delay(200).ConfigureAwait(false); - return HealthCheckResult.Healthy(); - }) .Services .AddHealthChecksUI(setup => { setup.AddHealthCheckEndpoint("endpoint1", "http://localhost/health"); setup.SetApiMaxActiveRequests(maxActiveRequests); + setup.ConfigureUIApiEndpointResult = _ => Thread.Sleep(200); }) .AddInMemoryStorage(databaseName: "LimitingTests"); }) @@ -37,7 +33,7 @@ public async Task should_return_too_many_requests_status_code_when_exceding_conf { setup.MapHealthChecks("/health", new HealthCheckOptions { - Predicate = r => true, + Predicate = _ => true, ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse }); @@ -47,12 +43,13 @@ public async Task should_return_too_many_requests_status_code_when_exceding_conf using var server = new TestServer(webHostBuilder); - var requests = Enumerable.Range(1, maxActiveRequests) - .Select(n => server.CreateRequest($"/healthchecks-api").GetAsync()); + var requests = Enumerable.Range(1, maxActiveRequests + 2) + .Select(_ => server.CreateRequest(new Configuration.Options().ApiPath).GetAsync()) + .ToList(); var results = await Task.WhenAll(requests).ConfigureAwait(false); - results.Where(r => r.StatusCode == HttpStatusCode.TooManyRequests).Count().ShouldBe(requests.Count() - maxActiveRequests); + results.Where(r => r.StatusCode == HttpStatusCode.TooManyRequests).Count().ShouldBe(requests.Count - maxActiveRequests); results.Where(r => r.StatusCode == HttpStatusCode.OK).Count().ShouldBe(maxActiveRequests); } @@ -65,13 +62,12 @@ public async Task should_return_too_many_requests_status_using_default_server_ma services .AddRouting() .AddHealthChecks() - .AddAsyncCheck("Delayed", async () => + .Services + .AddHealthChecksUI(setup => { - await Task.Delay(200).ConfigureAwait(false); - return HealthCheckResult.Healthy(); + setup.AddHealthCheckEndpoint("endpoint1", "http://localhost/health"); + setup.ConfigureUIApiEndpointResult = _ => Thread.Sleep(200); }) - .Services - .AddHealthChecksUI(setup => setup.AddHealthCheckEndpoint("endpoint1", "http://localhost/health")) .AddInMemoryStorage(databaseName: "LimitingTests"); }) .Configure(app => @@ -81,7 +77,7 @@ public async Task should_return_too_many_requests_status_using_default_server_ma { setup.MapHealthChecks("/health", new HealthCheckOptions { - Predicate = r => true, + Predicate = _ => true, ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse }); @@ -94,17 +90,14 @@ public async Task should_return_too_many_requests_status_using_default_server_ma var serverSettings = server.Services.GetRequiredService>().Value; - var requests = Enumerable.Range(1, serverSettings.ApiMaxActiveRequests) - .Select(n => server.CreateRequest($"/healthchecks-api").GetAsync()); + var requests = Enumerable.Range(1, serverSettings.ApiMaxActiveRequests + 2) + .Select(_ => server.CreateRequest(new Configuration.Options().ApiPath).GetAsync()) + .ToList(); var results = await Task.WhenAll(requests).ConfigureAwait(false); - results.Where(r => r.StatusCode == HttpStatusCode.TooManyRequests) - .Count() - .ShouldBe(requests.Count() - serverSettings.ApiMaxActiveRequests); - - results.Where(r => r.StatusCode == HttpStatusCode.OK).Count() - .ShouldBe(serverSettings.ApiMaxActiveRequests); + results.Where(r => r.StatusCode == HttpStatusCode.TooManyRequests).Count().ShouldBe(requests.Count - serverSettings.ApiMaxActiveRequests); + results.Where(r => r.StatusCode == HttpStatusCode.OK).Count().ShouldBe(serverSettings.ApiMaxActiveRequests); } } } From d0280f38c741222c3dc97b828092669fda1b2bd9 Mon Sep 17 00:00:00 2001 From: Mateusz Date: Tue, 11 Jul 2023 13:06:58 +0200 Subject: [PATCH 27/48] Add Application Insights HealthCheck (#1891) --- ...althchecks_azureapplicationinsights_cd.yml | 29 ++++++ ...ks_azureapplicationinsights_cd_preview.yml | 30 ++++++ ...althchecks_azureapplicationinsights_ci.yml | 65 +++++++++++++ AspNetCore.Diagnostics.HealthChecks.sln | 14 +++ README.md | 94 ++++++++++--------- build/versions.props | 1 + .../AzureApplicationInsightsHealthCheck.cs | 79 ++++++++++++++++ ...ionInsightsHealthCheckBuilderExtensions.cs | 44 +++++++++ ...althChecks.AzureApplicationInsights.csproj | 15 +++ .../README.md | 23 +++++ .../AzureApplicationInsightsUnitTests.cs | 57 +++++++++++ ...ecks.AzureApplicationInsights.Tests.csproj | 11 +++ ...ecks.AzureApplicationInsights.approved.txt | 15 +++ 13 files changed, 431 insertions(+), 46 deletions(-) create mode 100644 .github/workflows/healthchecks_azureapplicationinsights_cd.yml create mode 100644 .github/workflows/healthchecks_azureapplicationinsights_cd_preview.yml create mode 100644 .github/workflows/healthchecks_azureapplicationinsights_ci.yml create mode 100644 src/HealthChecks.AzureApplicationInsights/AzureApplicationInsightsHealthCheck.cs create mode 100644 src/HealthChecks.AzureApplicationInsights/DependencyInjection/AzureApplicationInsightsHealthCheckBuilderExtensions.cs create mode 100644 src/HealthChecks.AzureApplicationInsights/HealthChecks.AzureApplicationInsights.csproj create mode 100644 src/HealthChecks.AzureApplicationInsights/README.md create mode 100644 test/HealthChecks.AzureApplicationInsights.Tests/DependencyInjection/AzureApplicationInsightsUnitTests.cs create mode 100644 test/HealthChecks.AzureApplicationInsights.Tests/HealthChecks.AzureApplicationInsights.Tests.csproj create mode 100644 test/HealthChecks.AzureApplicationInsights.Tests/HealthChecks.AzureApplicationInsights.approved.txt diff --git a/.github/workflows/healthchecks_azureapplicationinsights_cd.yml b/.github/workflows/healthchecks_azureapplicationinsights_cd.yml new file mode 100644 index 0000000000..b1e804fec4 --- /dev/null +++ b/.github/workflows/healthchecks_azureapplicationinsights_cd.yml @@ -0,0 +1,29 @@ +name: HealthChecks AzureApplicationInsights CD + +on: + push: + tags: + - release-azureapplicationinsights-* + - release-all-* + +jobs: + build: + env: + BUILD_CONFIG: Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 6.0.x + 7.0.x + - name: Restore + run: dotnet restore ./src/HealthChecks.AzureApplicationInsights/HealthChecks.AzureApplicationInsights.csproj + - name: Build + run: dotnet build --no-restore ./src/HealthChecks.AzureApplicationInsights/HealthChecks.AzureApplicationInsights.csproj -c $BUILD_CONFIG + - name: Pack + run: dotnet pack --no-build ./src/HealthChecks.AzureApplicationInsights/HealthChecks.AzureApplicationInsights.csproj -c $BUILD_CONFIG -o ./artifacts + - name: Publish + run: dotnet nuget push ./artifacts/AspNetCore.HealthChecks.AzureApplicationInsights.*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate diff --git a/.github/workflows/healthchecks_azureapplicationinsights_cd_preview.yml b/.github/workflows/healthchecks_azureapplicationinsights_cd_preview.yml new file mode 100644 index 0000000000..214b36d0eb --- /dev/null +++ b/.github/workflows/healthchecks_azureapplicationinsights_cd_preview.yml @@ -0,0 +1,30 @@ +name: HealthChecks AzureApplicationInsights Preview CD + +on: + push: + tags: + - preview-azureapplicationinsights-* + - preview-all-* + +jobs: + build: + env: + BUILD_CONFIG: Release + VERSION_SUFFIX: rc2.${{ github.run_number }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 6.0.x + 7.0.x + - name: Restore + run: dotnet restore ./src/HealthChecks.AzureApplicationInsights/HealthChecks.AzureApplicationInsights.csproj + - name: Build + run: dotnet build --no-restore ./src/HealthChecks.AzureApplicationInsights/HealthChecks.AzureApplicationInsights.csproj -c $BUILD_CONFIG + - name: Pack + run: dotnet pack --no-build ./src/HealthChecks.AzureApplicationInsights/HealthChecks.AzureApplicationInsights.csproj --version-suffix $VERSION_SUFFIX -c $BUILD_CONFIG -o ./artifacts + - name: Publish + run: dotnet nuget push ./artifacts/AspNetCore.HealthChecks.AzureApplicationInsights.*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate diff --git a/.github/workflows/healthchecks_azureapplicationinsights_ci.yml b/.github/workflows/healthchecks_azureapplicationinsights_ci.yml new file mode 100644 index 0000000000..7728b94c64 --- /dev/null +++ b/.github/workflows/healthchecks_azureapplicationinsights_ci.yml @@ -0,0 +1,65 @@ +name: HealthChecks AzureApplicationInsights CI + +on: + workflow_dispatch: + push: + branches: [ master ] + paths: + - src/HealthChecks.AzureApplicationInsights/** + - test/HealthChecks.AzureApplicationInsights.Tests/** + - test/_SHARED/** + - .github/workflows/healthchecks_azureapplicationinsights_ci.yml + - Directory.Build.props + - Directory.Build.targets + tags-ignore: + - release-* + - preview-* + + pull_request: + branches: [ master ] + paths: + - src/HealthChecks.AzureApplicationInsights/** + - test/HealthChecks.AzureApplicationInsights.Tests/** + - test/_SHARED/** + - .github/workflows/healthchecks_azureapplicationinsights_ci.yml + - Directory.Build.props + - Directory.Build.targets + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 6.0.x + 7.0.x + - name: Restore + run: | + dotnet restore ./src/HealthChecks.AzureApplicationInsights/HealthChecks.AzureApplicationInsights.csproj && + dotnet restore ./test/HealthChecks.AzureApplicationInsights.Tests/HealthChecks.AzureApplicationInsights.Tests.csproj + - name: Check formatting + run: | + dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.AzureApplicationInsights/HealthChecks.AzureApplicationInsights.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) && + dotnet format --no-restore --verify-no-changes --severity warn ./test/HealthChecks.AzureApplicationInsights.Tests/HealthChecks.AzureApplicationInsights.Tests.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) + - name: Build + run: | + dotnet build --no-restore ./src/HealthChecks.AzureApplicationInsights/HealthChecks.AzureApplicationInsights.csproj && + dotnet build --no-restore ./test/HealthChecks.AzureApplicationInsights.Tests/HealthChecks.AzureApplicationInsights.Tests.csproj + - name: Test + run: > + dotnet test + ./test/HealthChecks.AzureApplicationInsights.Tests/HealthChecks.AzureApplicationInsights.Tests.csproj + --no-restore + --no-build + --collect "XPlat Code Coverage" + --results-directory .coverage + -- + DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover + - name: Upload Coverage + uses: codecov/codecov-action@v3 + with: + flags: AzureApplicationInsights + directory: .coverage diff --git a/AspNetCore.Diagnostics.HealthChecks.sln b/AspNetCore.Diagnostics.HealthChecks.sln index d92dba4561..ef68a873a6 100644 --- a/AspNetCore.Diagnostics.HealthChecks.sln +++ b/AspNetCore.Diagnostics.HealthChecks.sln @@ -247,6 +247,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HealthChecks.AzureDigitalTw EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HealthChecks.Aws.Sqs", "src\HealthChecks.Aws.Sqs\HealthChecks.Aws.Sqs.csproj", "{3E28B63C-814E-46C9-ADBF-7357997148F5}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HealthChecks.AzureApplicationInsights", "src\HealthChecks.AzureApplicationInsights\HealthChecks.AzureApplicationInsights.csproj", "{97C43FFC-0A48-47C7-93EE-7382C2989AAE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HealthChecks.AzureApplicationInsights.Tests", "test\HealthChecks.AzureApplicationInsights.Tests\HealthChecks.AzureApplicationInsights.Tests.csproj", "{78902D9E-CD1A-4FB7-B752-A3471A2DD457}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HealthChecks.Aws.Sqs.Tests", "test\HealthChecks.Aws.Sqs.Tests\HealthChecks.Aws.Sqs.Tests.csproj", "{EFA76A2C-CA0E-42BC-8215-AEEB16414947}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HealthChecks.Aws.Sns", "src\HealthChecks.Aws.Sns\HealthChecks.Aws.Sns.csproj", "{AE41DB38-93BC-48A7-8841-163E5E13CE8D}" @@ -707,6 +711,14 @@ Global {7052C706-4B1A-4167-A33A-DF3E9FBCFE6B}.Debug|Any CPU.Build.0 = Debug|Any CPU {7052C706-4B1A-4167-A33A-DF3E9FBCFE6B}.Release|Any CPU.ActiveCfg = Release|Any CPU {7052C706-4B1A-4167-A33A-DF3E9FBCFE6B}.Release|Any CPU.Build.0 = Release|Any CPU + {78902D9E-CD1A-4FB7-B752-A3471A2DD457}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {78902D9E-CD1A-4FB7-B752-A3471A2DD457}.Debug|Any CPU.Build.0 = Debug|Any CPU + {78902D9E-CD1A-4FB7-B752-A3471A2DD457}.Release|Any CPU.ActiveCfg = Release|Any CPU + {78902D9E-CD1A-4FB7-B752-A3471A2DD457}.Release|Any CPU.Build.0 = Release|Any CPU + {97C43FFC-0A48-47C7-93EE-7382C2989AAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {97C43FFC-0A48-47C7-93EE-7382C2989AAE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {97C43FFC-0A48-47C7-93EE-7382C2989AAE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {97C43FFC-0A48-47C7-93EE-7382C2989AAE}.Release|Any CPU.Build.0 = Release|Any CPU {3E28B63C-814E-46C9-ADBF-7357997148F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3E28B63C-814E-46C9-ADBF-7357997148F5}.Debug|Any CPU.Build.0 = Debug|Any CPU {3E28B63C-814E-46C9-ADBF-7357997148F5}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -882,6 +894,8 @@ Global {FF492215-60BC-40C6-B118-D22DF9063547} = {2A3FD988-2BB8-43CF-B3A2-B70E648259D4} {247EF2E5-F4B9-47D4-BB89-27860DF53D5F} = {FF4414C2-8863-4ADA-8A1D-4B9F25C361FE} {7052C706-4B1A-4167-A33A-DF3E9FBCFE6B} = {FF4414C2-8863-4ADA-8A1D-4B9F25C361FE} + {78902D9E-CD1A-4FB7-B752-A3471A2DD457} = {FF4414C2-8863-4ADA-8A1D-4B9F25C361FE} + {97C43FFC-0A48-47C7-93EE-7382C2989AAE} = {2A3FD988-2BB8-43CF-B3A2-B70E648259D4} {3E28B63C-814E-46C9-ADBF-7357997148F5} = {2A3FD988-2BB8-43CF-B3A2-B70E648259D4} {EFA76A2C-CA0E-42BC-8215-AEEB16414947} = {FF4414C2-8863-4ADA-8A1D-4B9F25C361FE} {AE41DB38-93BC-48A7-8841-163E5E13CE8D} = {2A3FD988-2BB8-43CF-B3A2-B70E648259D4} diff --git a/README.md b/README.md index 3e499572d6..b848e96c8b 100644 --- a/README.md +++ b/README.md @@ -64,52 +64,53 @@ HealthChecks repo provides following images: HealthChecks packages include health checks for: -| Package | Downloads | NuGet Latest | Notes | -| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ---------------------------------------------------------------------- | -| ApplicationStatus | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.ApplicationStatus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ApplicationStatus) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.ApplicationStatus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ApplicationStatus) -| ArangoDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.ArangoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ArangoDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.ArangoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ArangoDb) -| Amazon S3 | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.S3)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.S3) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.S3)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.S3) -| Amazon Secrets Manager | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.SecretsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SecretsManager) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.SecretsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SecretsManager) -| Amazon SNS | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.Sns)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sns) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.Sns)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sns) -| Amazon SQS | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.Sqs)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sqs) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.Sqs)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sqs) -| Amazon Systems Manager | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.SystemsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SystemsManager) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.SystemsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SystemsManager) -| Azure IoT Hub | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Azure.IoTHub)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Azure.IoTHub) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Azure.IoTHub)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Azure.IoTHub) -| Azure DigitalTwin | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureDigitalTwin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureDigitalTwin) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureDigitalTwin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureDigitalTwin) | Subscription status, models and instances | -| Azure Key Vault | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureKeyVault)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureKeyVault) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureKeyVault)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureKeyVault) -| Azure Search | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureSearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureSearch) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureSearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureSearch) -| Azure Service Bus | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureServiceBus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureServiceBus) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureServiceBus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureServiceBus) | EventHub, Queue and Topics | -| Azure Storage | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureStorage)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureStorage) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureStorage)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureStorage) | Blob, File, Queue | -| Consul | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Consul)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Consul) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Consul)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Consul) -| CosmosDb | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.CosmosDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.CosmosDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.CosmosDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.CosmosDb) | CosmosDb and Azure Table -| Azure DocumentDb | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.DocumentDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DocumentDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.DocumentDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DocumentDb) -| Amazon DynamoDb | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.DynamoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DynamoDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.DynamoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DynamoDb) -| Elasticsearch | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Elasticsearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Elasticsearch) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Elasticsearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Elasticsearch) -| EventStore | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.EventStore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.EventStore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore) | [TCP EventStore](https://github.com/EventStore/EventStoreDB-Client-Dotnet-Legacy) -| EventStore gRPC | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.EventStore.gRPC)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore.gRPC) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.EventStore.gRPC)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore.gRPC) | [gRPC EventStore](https://github.com/EventStore/EventStore-Client-Dotnet) -| Google Cloud Firestore | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Gcp.CloudFirestore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gcp.CloudFirestore) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Gcp.CloudFirestore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gcp.CloudFirestore) -| Gremlin | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Gremlin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gremlin) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Gremlin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gremlin) -| Hangfire | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Hangfire)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Hangfire) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Hangfire)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Hangfire) -| IbmMQ | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.IbmMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.IbmMQ) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.IbmMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.IbmMQ) -| InfluxDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.InfluxDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.InfluxDB) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.InfluxDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.InfluxDB) -| Kafka | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Kafka)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kafka) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Kafka)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kafka) -| Kubernetes | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Kubernetes)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kubernetes) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Kubernetes)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kubernetes) -| MongoDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.MongoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MongoDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.MongoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MongoDb) -| MySql | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.MySql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MySql) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.MySql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MySql) -| Nats | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Nats)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Nats) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Nats)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Nats) | NATS, messaging, message-bus, pubsub | -| Network | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Network)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Network) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Network)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Network) | Ftp, SFtp, Dns, Tcp port, Smtp, Imap, Ssl | -| Postgres | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.NpgSql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.NpgSql) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.NpgSql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.NpgSql) -| Identity Server | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.OpenIdConnectServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.OpenIdConnectServer) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.OpenIdConnectServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.OpenIdConnectServer) -| Oracle | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Oracle)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Oracle) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Oracle)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Oracle) -| RabbitMQ | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.RabbitMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RabbitMQ) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.RabbitMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RabbitMQ) -| RavenDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.RavenDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RavenDB) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.RavenDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RavenDB) -| Redis | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Redis)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Redis) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Redis)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Redis) -| SendGrid | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.SendGrid)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SendGrid) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.SendGrid)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SendGrid) -| SignalR | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.SignalR)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SignalR) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.SignalR)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SignalR) -| Solr | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Solr)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Solr) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Solr)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Solr) -| Sqlite | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Sqlite)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Sqlite) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Sqlite)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Sqlite) -| Sql Server | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.SqlServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SqlServer) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.SqlServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SqlServer) -| System | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.System)](https://www.nuget.org/packages/AspNetCore.HealthChecks.System) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.System)](https://www.nuget.org/packages/AspNetCore.HealthChecks.System) | Disk Storage, Folder, Private Memory, Virtual Memory, Process, Windows Service | -| Uri | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Uris)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Uris) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Uris)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Uris) | Single uri and uri groups | +| Package | Downloads | NuGet Latest | Notes | +| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ---------------------------------------------------------------------- | +| ApplicationStatus | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.ApplicationStatus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ApplicationStatus) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.ApplicationStatus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ApplicationStatus) +| ArangoDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.ArangoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ArangoDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.ArangoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ArangoDb) +| Amazon S3 | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.S3)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.S3) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.S3)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.S3) +| Amazon Secrets Manager | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.SecretsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SecretsManager) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.SecretsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SecretsManager) +| Amazon SNS | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.Sns)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sns) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.Sns)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sns) +| Amazon SQS | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.Sqs)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sqs) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.Sqs)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sqs) +| Amazon Systems Manager | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.SystemsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SystemsManager) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.SystemsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SystemsManager) +| Azure Application Insights | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureApplicationInsights)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureApplicationInsights) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureApplicationInsights)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureApplicationInsights) +| Azure IoT Hub | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Azure.IoTHub)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Azure.IoTHub) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Azure.IoTHub)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Azure.IoTHub) +| Azure DigitalTwin | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureDigitalTwin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureDigitalTwin) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureDigitalTwin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureDigitalTwin) | Subscription status, models and instances | +| Azure Key Vault | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureKeyVault)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureKeyVault) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureKeyVault)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureKeyVault) +| Azure Search | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureSearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureSearch) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureSearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureSearch) +| Azure Service Bus | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureServiceBus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureServiceBus) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureServiceBus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureServiceBus) | EventHub, Queue and Topics | +| Azure Storage | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureStorage)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureStorage) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureStorage)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureStorage) | Blob, File, Queue | +| Consul | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Consul)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Consul) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Consul)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Consul) +| CosmosDb | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.CosmosDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.CosmosDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.CosmosDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.CosmosDb) | CosmosDb and Azure Table +| Azure DocumentDb | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.DocumentDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DocumentDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.DocumentDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DocumentDb) +| Amazon DynamoDb | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.DynamoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DynamoDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.DynamoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DynamoDb) +| Elasticsearch | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Elasticsearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Elasticsearch) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Elasticsearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Elasticsearch) +| EventStore | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.EventStore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.EventStore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore) | [TCP EventStore](https://github.com/EventStore/EventStoreDB-Client-Dotnet-Legacy) +| EventStore gRPC | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.EventStore.gRPC)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore.gRPC) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.EventStore.gRPC)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore.gRPC) | [gRPC EventStore](https://github.com/EventStore/EventStore-Client-Dotnet) +| Google Cloud Firestore | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Gcp.CloudFirestore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gcp.CloudFirestore) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Gcp.CloudFirestore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gcp.CloudFirestore) +| Gremlin | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Gremlin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gremlin) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Gremlin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gremlin) +| Hangfire | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Hangfire)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Hangfire) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Hangfire)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Hangfire) +| IbmMQ | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.IbmMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.IbmMQ) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.IbmMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.IbmMQ) +| InfluxDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.InfluxDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.InfluxDB) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.InfluxDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.InfluxDB) +| Kafka | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Kafka)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kafka) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Kafka)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kafka) +| Kubernetes | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Kubernetes)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kubernetes) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Kubernetes)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kubernetes) +| MongoDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.MongoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MongoDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.MongoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MongoDb) +| MySql | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.MySql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MySql) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.MySql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MySql) +| Nats | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Nats)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Nats) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Nats)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Nats) | NATS, messaging, message-bus, pubsub | +| Network | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Network)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Network) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Network)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Network) | Ftp, SFtp, Dns, Tcp port, Smtp, Imap, Ssl | +| Postgres | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.NpgSql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.NpgSql) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.NpgSql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.NpgSql) +| Identity Server | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.OpenIdConnectServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.OpenIdConnectServer) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.OpenIdConnectServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.OpenIdConnectServer) +| Oracle | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Oracle)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Oracle) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Oracle)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Oracle) +| RabbitMQ | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.RabbitMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RabbitMQ) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.RabbitMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RabbitMQ) +| RavenDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.RavenDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RavenDB) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.RavenDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RavenDB) +| Redis | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Redis)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Redis) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Redis)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Redis) +| SendGrid | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.SendGrid)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SendGrid) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.SendGrid)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SendGrid) +| SignalR | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.SignalR)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SignalR) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.SignalR)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SignalR) +| Solr | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Solr)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Solr) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Solr)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Solr) +| Sqlite | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Sqlite)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Sqlite) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Sqlite)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Sqlite) +| Sql Server | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.SqlServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SqlServer) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.SqlServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SqlServer) +| System | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.System)](https://www.nuget.org/packages/AspNetCore.HealthChecks.System) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.System)](https://www.nuget.org/packages/AspNetCore.HealthChecks.System) | Disk Storage, Folder, Private Memory, Virtual Memory, Process, Windows Service | +| Uri | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Uris)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Uris) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Uris)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Uris) | Single uri and uri groups | > We support netcoreapp 2.2, 3.0 and 3.1. Please use package versions 2.2.X, 3.0.X and 3.1.X to target different versions. @@ -122,6 +123,7 @@ Install-Package AspNetCore.HealthChecks.Aws.Sns Install-Package AspNetCore.HealthChecks.Aws.Sqs Install-Package AspNetCore.HealthChecks.Aws.SystemsManager Install-Package AspNetCore.HealthChecks.Azure.IoTHub +Install-Package AspNetCore.HealthChecks.AzureApplicationInsights Install-Package AspNetCore.HealthChecks.AzureDigitalTwin Install-Package AspNetCore.HealthChecks.AzureKeyVault Install-Package AspNetCore.HealthChecks.AzureSearch diff --git a/build/versions.props b/build/versions.props index 7dadd6d566..6206e7ad98 100644 --- a/build/versions.props +++ b/build/versions.props @@ -8,6 +8,7 @@ 7.0.0 7.0.0 7.0.0 + 7.0.0 7.0.0 7.0.0 7.0.0 diff --git a/src/HealthChecks.AzureApplicationInsights/AzureApplicationInsightsHealthCheck.cs b/src/HealthChecks.AzureApplicationInsights/AzureApplicationInsightsHealthCheck.cs new file mode 100644 index 0000000000..8dd8e9c94e --- /dev/null +++ b/src/HealthChecks.AzureApplicationInsights/AzureApplicationInsightsHealthCheck.cs @@ -0,0 +1,79 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Diagnostics.HealthChecks; + +namespace HealthChecks.AzureApplicationInsights; + +public class AzureApplicationInsightsHealthCheck : IHealthCheck +{ + // from https://docs.microsoft.com/en-us/azure/azure-monitor/app/ip-addresses#outgoing-ports + private readonly string[] _appInsightsUrls = + { + "https://dc.applicationinsights.azure.com", + "https://dc.applicationinsights.microsoft.com", + "https://dc.services.visualstudio.com" + }; + private readonly string _instrumentationKey; + + private readonly IHttpClientFactory _httpClientFactory; + + public AzureApplicationInsightsHealthCheck(string instrumentationKey, IHttpClientFactory httpClientFactory) + { + _instrumentationKey = Guard.ThrowIfNull(instrumentationKey, throwOnEmptyString: true); + _httpClientFactory = Guard.ThrowIfNull(httpClientFactory); + } + + /// + public async Task CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default) + { + try + { + bool resourceExists = await ApplicationInsightsResourceExistsAsync(cancellationToken).ConfigureAwait(false); + if (resourceExists) + { + return HealthCheckResult.Healthy(); + } + else + { + return new HealthCheckResult(context.Registration.FailureStatus, description: $"Could not find application insights resource. Searched resources: {string.Join(", ", _appInsightsUrls)}"); + } + } + catch (Exception ex) + { + return new HealthCheckResult(context.Registration.FailureStatus, exception: ex); + } + } + + private async Task ApplicationInsightsResourceExistsAsync(CancellationToken cancellationToken) + { + using var httpClient = _httpClientFactory.CreateClient(AzureApplicationInsightsHealthCheckBuilderExtensions.AZUREAPPLICATIONINSIGHTS_NAME); + + string path = $"/api/profiles/{_instrumentationKey}/appId"; + int index = 0; + var exceptions = new List(); + while (index < _appInsightsUrls.Length) + { + try + { + var uri = new Uri(_appInsightsUrls[index++] + path); + HttpResponseMessage response = await httpClient.GetAsync(uri, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + if (response.IsSuccessStatusCode) + { + return true; + } + } + catch (Exception e) + { + exceptions.Add(e); + } + } + + // All endpoints threw exceptions + if (exceptions.Count == _appInsightsUrls.Length) + { + throw new AggregateException(exceptions.ToArray()); + } + + // No success responses were returned and at least one endpoint returned an unsuccesful response + return false; + } +} diff --git a/src/HealthChecks.AzureApplicationInsights/DependencyInjection/AzureApplicationInsightsHealthCheckBuilderExtensions.cs b/src/HealthChecks.AzureApplicationInsights/DependencyInjection/AzureApplicationInsightsHealthCheckBuilderExtensions.cs new file mode 100644 index 0000000000..e880243420 --- /dev/null +++ b/src/HealthChecks.AzureApplicationInsights/DependencyInjection/AzureApplicationInsightsHealthCheckBuilderExtensions.cs @@ -0,0 +1,44 @@ +using HealthChecks.AzureApplicationInsights; +using Microsoft.Extensions.Diagnostics.HealthChecks; + +namespace Microsoft.Extensions.DependencyInjection; + +/// +/// Extension methods to configure . +/// +public static class AzureApplicationInsightsHealthCheckBuilderExtensions +{ + internal const string AZUREAPPLICATIONINSIGHTS_NAME = "azureappinsights"; + + /// + /// Add a health check for specified Azure Application Insights. + /// + /// The . + /// The azure app insights instrumentation key. + /// The health check name. Optional. If null the type name 'azureappinsights' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional System.TimeSpan representing the timeout of the check. + /// The . + public static IHealthChecksBuilder AddAzureApplicationInsights( + this IHealthChecksBuilder builder, + string instrumentationKey, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) + { + var registrationName = name ?? AZUREAPPLICATIONINSIGHTS_NAME; + builder.Services.AddHttpClient(registrationName); + + return builder.Add(new HealthCheckRegistration( + registrationName, + sp => new AzureApplicationInsightsHealthCheck(instrumentationKey, sp.GetRequiredService()), + failureStatus, + tags, + timeout)); + } +} diff --git a/src/HealthChecks.AzureApplicationInsights/HealthChecks.AzureApplicationInsights.csproj b/src/HealthChecks.AzureApplicationInsights/HealthChecks.AzureApplicationInsights.csproj new file mode 100644 index 0000000000..cecf47c83b --- /dev/null +++ b/src/HealthChecks.AzureApplicationInsights/HealthChecks.AzureApplicationInsights.csproj @@ -0,0 +1,15 @@ + + + + netstandard2.0 + HealthCheck;Azure;ApplicationInsights + HealthChecks.AzureApplicationInsights is the health check package for Azure Application Insights. + $(HealthCheckAzureApplicationInsights) + + + + + + + + diff --git a/src/HealthChecks.AzureApplicationInsights/README.md b/src/HealthChecks.AzureApplicationInsights/README.md new file mode 100644 index 0000000000..815d40931f --- /dev/null +++ b/src/HealthChecks.AzureApplicationInsights/README.md @@ -0,0 +1,23 @@ +# Azure Application Insights Health Check + +This health check verifies the existence of a Azure Application Insights resource. For more information about Azure Application Insights check the [Azure AppInsights Microsoft Site](https://docs.microsoft.com/en-us/azure/azure-monitor/app/app-insights-overview) + +## Example Usage + +With all of the following examples, you can additionally add the following parameters: + +- `name`: The health check name. Default if not specified is `azureappinsights`. +- `failureStatus`: The `HealthStatus` that should be reported when the health check fails. Default is `HealthStatus.Unhealthy`. +- `tags`: A list of tags that can be used to filter sets of health checks. +- `timeout`: A `System.TimeSpan` representing the timeout of the check. + +### Basic + +```csharp +public void ConfigureServices(IServiceCollection services) +{ + services + .AddHealthChecks() + .AddAzureApplicationInsights("instrumentationKey"); +} +``` diff --git a/test/HealthChecks.AzureApplicationInsights.Tests/DependencyInjection/AzureApplicationInsightsUnitTests.cs b/test/HealthChecks.AzureApplicationInsights.Tests/DependencyInjection/AzureApplicationInsightsUnitTests.cs new file mode 100644 index 0000000000..c94d77d9c2 --- /dev/null +++ b/test/HealthChecks.AzureApplicationInsights.Tests/DependencyInjection/AzureApplicationInsightsUnitTests.cs @@ -0,0 +1,57 @@ +using HealthChecks.AzureApplicationInsights; + +namespace UnitTests.DependencyInjection.AzureApplicationInsights; + +public class azure_application_insights_registration_should +{ + [Fact] + public void add_health_check_when_properly_configured() + { + var services = new ServiceCollection(); + services.AddHealthChecks() + .AddAzureApplicationInsights("instrumentationKey"); + + using var serviceProvider = services.BuildServiceProvider(); + var options = serviceProvider.GetRequiredService>(); + + var registration = options.Value.Registrations.First(); + var check = registration.Factory(serviceProvider); + + registration.Name.ShouldBe("azureappinsights"); + check.ShouldBeOfType(); + } + + [Fact] + public void add_named_health_check_when_properly_configured() + { + var healthCheckName = "azureappinsightscheck"; + var services = new ServiceCollection(); + services.AddHealthChecks() + .AddAzureApplicationInsights("instrumentationKey", name: healthCheckName); + + using var serviceProvider = services.BuildServiceProvider(); + var options = serviceProvider.GetRequiredService>(); + + var registration = options.Value.Registrations.First(); + var check = registration.Factory(serviceProvider); + + registration.Name.ShouldBe(healthCheckName); + check.ShouldBeOfType(); + } + + [Fact] + public void fail_when_no_health_check_configuration_provided() + { + var services = new ServiceCollection(); + services.AddHealthChecks() + .AddAzureApplicationInsights(string.Empty); + + using var serviceProvider = services.BuildServiceProvider(); + var options = serviceProvider.GetRequiredService>(); + + var registration = options.Value.Registrations.First(); + var factory = () => registration.Factory(serviceProvider); + + factory.ShouldThrow(); + } +} diff --git a/test/HealthChecks.AzureApplicationInsights.Tests/HealthChecks.AzureApplicationInsights.Tests.csproj b/test/HealthChecks.AzureApplicationInsights.Tests/HealthChecks.AzureApplicationInsights.Tests.csproj new file mode 100644 index 0000000000..0aab3f976f --- /dev/null +++ b/test/HealthChecks.AzureApplicationInsights.Tests/HealthChecks.AzureApplicationInsights.Tests.csproj @@ -0,0 +1,11 @@ + + + + net6.0;net7.0 + + + + + + + diff --git a/test/HealthChecks.AzureApplicationInsights.Tests/HealthChecks.AzureApplicationInsights.approved.txt b/test/HealthChecks.AzureApplicationInsights.Tests/HealthChecks.AzureApplicationInsights.approved.txt new file mode 100644 index 0000000000..884fe5f639 --- /dev/null +++ b/test/HealthChecks.AzureApplicationInsights.Tests/HealthChecks.AzureApplicationInsights.approved.txt @@ -0,0 +1,15 @@ +namespace HealthChecks.AzureApplicationInsights +{ + public class AzureApplicationInsightsHealthCheck : Microsoft.Extensions.Diagnostics.HealthChecks.IHealthCheck + { + public AzureApplicationInsightsHealthCheck(string instrumentationKey, System.Net.Http.IHttpClientFactory httpClientFactory) { } + public System.Threading.Tasks.Task CheckHealthAsync(Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckContext context, System.Threading.CancellationToken cancellationToken = default) { } + } +} +namespace Microsoft.Extensions.DependencyInjection +{ + public static class AzureApplicationInsightsHealthCheckBuilderExtensions + { + public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddAzureApplicationInsights(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, string instrumentationKey, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } + } +} \ No newline at end of file From 60cedfba929163651ca26d74be2041efc0f68625 Mon Sep 17 00:00:00 2001 From: Ivan Maximov Date: Tue, 11 Jul 2023 23:32:38 +0300 Subject: [PATCH 28/48] Fix ApplicationInsights version --- .../HealthChecks.AzureApplicationInsights.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.AzureApplicationInsights/HealthChecks.AzureApplicationInsights.csproj b/src/HealthChecks.AzureApplicationInsights/HealthChecks.AzureApplicationInsights.csproj index cecf47c83b..23088bbad0 100644 --- a/src/HealthChecks.AzureApplicationInsights/HealthChecks.AzureApplicationInsights.csproj +++ b/src/HealthChecks.AzureApplicationInsights/HealthChecks.AzureApplicationInsights.csproj @@ -4,7 +4,7 @@ netstandard2.0 HealthCheck;Azure;ApplicationInsights HealthChecks.AzureApplicationInsights is the health check package for Azure Application Insights. - $(HealthCheckAzureApplicationInsights) + $(HealthCheckAzureApplicationInsights) From 40438ed80b8c21641fee1cdcfb8364e6281bde3f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Jul 2023 00:55:05 +0300 Subject: [PATCH 29/48] Bump Azure.Storage.Blobs from 12.16.0 to 12.17.0 (#1899) Bumps [Azure.Storage.Blobs](https://github.com/Azure/azure-sdk-for-net) from 12.16.0 to 12.17.0. - [Release notes](https://github.com/Azure/azure-sdk-for-net/releases) - [Commits](https://github.com/Azure/azure-sdk-for-net/compare/Azure.Storage.Blobs_12.16.0...Azure.Storage.Blobs_12.17.0) --- updated-dependencies: - dependency-name: Azure.Storage.Blobs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/HealthChecks.AzureStorage/HealthChecks.AzureStorage.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.AzureStorage/HealthChecks.AzureStorage.csproj b/src/HealthChecks.AzureStorage/HealthChecks.AzureStorage.csproj index 27e719b9c1..a6f1f02c78 100644 --- a/src/HealthChecks.AzureStorage/HealthChecks.AzureStorage.csproj +++ b/src/HealthChecks.AzureStorage/HealthChecks.AzureStorage.csproj @@ -8,7 +8,7 @@ - + From 686b3edbac42acddc0fdbc0bfc6a2c511fe9eb96 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Jul 2023 00:57:30 +0300 Subject: [PATCH 30/48] Bump Azure.Identity from 1.8.2 to 1.9.0 (#1900) Bumps [Azure.Identity](https://github.com/Azure/azure-sdk-for-net) from 1.8.2 to 1.9.0. - [Release notes](https://github.com/Azure/azure-sdk-for-net/releases) - [Commits](https://github.com/Azure/azure-sdk-for-net/compare/Azure.Identity_1.8.2...Azure.Identity_1.9.0) --- updated-dependencies: - dependency-name: Azure.Identity dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../HealthChecks.UI.Image/HealthChecks.UI.Image.csproj | 2 +- .../HealthChecks.AzureDigitalTwin.csproj | 2 +- .../HealthChecks.AzureDigitalTwin.Tests.csproj | 2 +- .../HealthChecks.AzureServiceBus.Tests.csproj | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/docker-images/HealthChecks.UI.Image/HealthChecks.UI.Image.csproj b/build/docker-images/HealthChecks.UI.Image/HealthChecks.UI.Image.csproj index b4a65af3a0..6adcb9ac01 100644 --- a/build/docker-images/HealthChecks.UI.Image/HealthChecks.UI.Image.csproj +++ b/build/docker-images/HealthChecks.UI.Image/HealthChecks.UI.Image.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/HealthChecks.AzureDigitalTwin/HealthChecks.AzureDigitalTwin.csproj b/src/HealthChecks.AzureDigitalTwin/HealthChecks.AzureDigitalTwin.csproj index dcacdf8c61..85e7b0945a 100644 --- a/src/HealthChecks.AzureDigitalTwin/HealthChecks.AzureDigitalTwin.csproj +++ b/src/HealthChecks.AzureDigitalTwin/HealthChecks.AzureDigitalTwin.csproj @@ -8,7 +8,7 @@ - + diff --git a/test/HealthChecks.AzureDigitalTwin.Tests/HealthChecks.AzureDigitalTwin.Tests.csproj b/test/HealthChecks.AzureDigitalTwin.Tests/HealthChecks.AzureDigitalTwin.Tests.csproj index 3c83826964..3aca440c4a 100644 --- a/test/HealthChecks.AzureDigitalTwin.Tests/HealthChecks.AzureDigitalTwin.Tests.csproj +++ b/test/HealthChecks.AzureDigitalTwin.Tests/HealthChecks.AzureDigitalTwin.Tests.csproj @@ -5,7 +5,7 @@ - + diff --git a/test/HealthChecks.AzureServiceBus.Tests/HealthChecks.AzureServiceBus.Tests.csproj b/test/HealthChecks.AzureServiceBus.Tests/HealthChecks.AzureServiceBus.Tests.csproj index c507ed9d09..d1860b984b 100644 --- a/test/HealthChecks.AzureServiceBus.Tests/HealthChecks.AzureServiceBus.Tests.csproj +++ b/test/HealthChecks.AzureServiceBus.Tests/HealthChecks.AzureServiceBus.Tests.csproj @@ -5,7 +5,7 @@ - + From d5f1e36913e5f46c13e4f6fbeb41d968920adf22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Jul 2023 00:58:58 +0300 Subject: [PATCH 31/48] Bump Microsoft.AspNetCore.SignalR.Client from 7.0.8 to 7.0.9 (#1902) Bumps [Microsoft.AspNetCore.SignalR.Client](https://github.com/dotnet/aspnetcore) from 7.0.8 to 7.0.9. - [Release notes](https://github.com/dotnet/aspnetcore/releases) - [Changelog](https://github.com/dotnet/aspnetcore/blob/main/docs/ReleasePlanning.md) - [Commits](https://github.com/dotnet/aspnetcore/compare/v7.0.8...v7.0.9) --- updated-dependencies: - dependency-name: Microsoft.AspNetCore.SignalR.Client dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/HealthChecks.SignalR/HealthChecks.SignalR.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.SignalR/HealthChecks.SignalR.csproj b/src/HealthChecks.SignalR/HealthChecks.SignalR.csproj index 6efdd40fe8..33a58e4094 100644 --- a/src/HealthChecks.SignalR/HealthChecks.SignalR.csproj +++ b/src/HealthChecks.SignalR/HealthChecks.SignalR.csproj @@ -8,7 +8,7 @@ - + From 3ebadc271829ed67a6df24b0ac7550c7ff53c06d Mon Sep 17 00:00:00 2001 From: Ivan Maximov Date: Wed, 12 Jul 2023 02:09:19 +0300 Subject: [PATCH 32/48] Fix ui_api_request_limiting tests again (#1904) --- .../Functional/UIApiRequestLimitingTests.cs | 49 +++++++++++++------ 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/test/HealthChecks.UI.Tests/Functional/UIApiRequestLimitingTests.cs b/test/HealthChecks.UI.Tests/Functional/UIApiRequestLimitingTests.cs index 68449c4814..56b783b7bf 100644 --- a/test/HealthChecks.UI.Tests/Functional/UIApiRequestLimitingTests.cs +++ b/test/HealthChecks.UI.Tests/Functional/UIApiRequestLimitingTests.cs @@ -7,7 +7,7 @@ namespace HealthChecks.UI.Tests public class ui_api_request_limiting { [Fact] - public async Task should_return_too_many_requests_status_code_when_exceding_configured_max_active_requests() + public void should_return_too_many_requests_status_code_when_exceding_configured_max_active_requests() { int maxActiveRequests = 2; @@ -22,7 +22,7 @@ public async Task should_return_too_many_requests_status_code_when_exceding_conf { setup.AddHealthCheckEndpoint("endpoint1", "http://localhost/health"); setup.SetApiMaxActiveRequests(maxActiveRequests); - setup.ConfigureUIApiEndpointResult = _ => Thread.Sleep(200); + setup.ConfigureUIApiEndpointResult = _ => Thread.Sleep(300); }) .AddInMemoryStorage(databaseName: "LimitingTests"); }) @@ -43,18 +43,29 @@ public async Task should_return_too_many_requests_status_code_when_exceding_conf using var server = new TestServer(webHostBuilder); - var requests = Enumerable.Range(1, maxActiveRequests + 2) - .Select(_ => server.CreateRequest(new Configuration.Options().ApiPath).GetAsync()) + List responses = new(); + var b = new Barrier(maxActiveRequests + 5); + + // see discussion from https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/pull/1896 + var threads = Enumerable.Range(1, maxActiveRequests + 5) + .Select(_ => new Thread(_ => + { + b.SignalAndWait(); + var r = server.CreateRequest(new Configuration.Options().ApiPath).GetAsync().Result; + lock (responses) + responses.Add(r); + })) .ToList(); - var results = await Task.WhenAll(requests).ConfigureAwait(false); + threads.ForEach(t => t.Start()); + threads.ForEach(t => t.Join()); - results.Where(r => r.StatusCode == HttpStatusCode.TooManyRequests).Count().ShouldBe(requests.Count - maxActiveRequests); - results.Where(r => r.StatusCode == HttpStatusCode.OK).Count().ShouldBe(maxActiveRequests); + responses.Where(r => r.StatusCode == HttpStatusCode.TooManyRequests).Count().ShouldBe(responses.Count - maxActiveRequests); + responses.Where(r => r.StatusCode == HttpStatusCode.OK).Count().ShouldBe(maxActiveRequests); } [Fact] - public async Task should_return_too_many_requests_status_using_default_server_max_active_requests() + public void should_return_too_many_requests_status_using_default_server_max_active_requests() { var webHostBuilder = new WebHostBuilder() .ConfigureServices(services => @@ -66,7 +77,7 @@ public async Task should_return_too_many_requests_status_using_default_server_ma .AddHealthChecksUI(setup => { setup.AddHealthCheckEndpoint("endpoint1", "http://localhost/health"); - setup.ConfigureUIApiEndpointResult = _ => Thread.Sleep(200); + setup.ConfigureUIApiEndpointResult = _ => Thread.Sleep(300); }) .AddInMemoryStorage(databaseName: "LimitingTests"); }) @@ -88,16 +99,26 @@ public async Task should_return_too_many_requests_status_using_default_server_ma using var server = new TestServer(webHostBuilder); + List responses = new(); var serverSettings = server.Services.GetRequiredService>().Value; + var b = new Barrier(serverSettings.ApiMaxActiveRequests + 5); - var requests = Enumerable.Range(1, serverSettings.ApiMaxActiveRequests + 2) - .Select(_ => server.CreateRequest(new Configuration.Options().ApiPath).GetAsync()) + // see discussion from https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/pull/1896 + var threads = Enumerable.Range(1, serverSettings.ApiMaxActiveRequests + 5) + .Select(_ => new Thread(_ => + { + b.SignalAndWait(); + var r = server.CreateRequest(new Configuration.Options().ApiPath).GetAsync().Result; + lock (responses) + responses.Add(r); + })) .ToList(); - var results = await Task.WhenAll(requests).ConfigureAwait(false); + threads.ForEach(t => t.Start()); + threads.ForEach(t => t.Join()); - results.Where(r => r.StatusCode == HttpStatusCode.TooManyRequests).Count().ShouldBe(requests.Count - serverSettings.ApiMaxActiveRequests); - results.Where(r => r.StatusCode == HttpStatusCode.OK).Count().ShouldBe(serverSettings.ApiMaxActiveRequests); + responses.Where(r => r.StatusCode == HttpStatusCode.TooManyRequests).Count().ShouldBe(responses.Count - serverSettings.ApiMaxActiveRequests); + responses.Where(r => r.StatusCode == HttpStatusCode.OK).Count().ShouldBe(serverSettings.ApiMaxActiveRequests); } } } From 83338e821d93094363198acc8fb71556e2584c19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Jul 2023 08:57:23 +0300 Subject: [PATCH 33/48] Bump Microsoft.EntityFrameworkCore.InMemory from 7.0.8 to 7.0.9 (#1907) Bumps [Microsoft.EntityFrameworkCore.InMemory](https://github.com/dotnet/efcore) from 7.0.8 to 7.0.9. - [Release notes](https://github.com/dotnet/efcore/releases) - [Commits](https://github.com/dotnet/efcore/compare/v7.0.8...v7.0.9) --- updated-dependencies: - dependency-name: Microsoft.EntityFrameworkCore.InMemory dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../HealthChecks.UI.InMemory.Storage.csproj | 2 +- .../HealthChecks.UI.Data.Tests.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj b/src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj index 3da5b01cee..6a781a9df1 100644 --- a/src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj +++ b/src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj @@ -8,7 +8,7 @@ - + diff --git a/test/HealthChecks.UI.Data.Tests/HealthChecks.UI.Data.Tests.csproj b/test/HealthChecks.UI.Data.Tests/HealthChecks.UI.Data.Tests.csproj index e55ebfa32f..4bf4c560e2 100644 --- a/test/HealthChecks.UI.Data.Tests/HealthChecks.UI.Data.Tests.csproj +++ b/test/HealthChecks.UI.Data.Tests/HealthChecks.UI.Data.Tests.csproj @@ -5,7 +5,7 @@ - + From 02b512608009bdb4372f44d41ecdf955b9bff8a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Jul 2023 08:58:43 +0300 Subject: [PATCH 34/48] Bump Microsoft.Extensions.Http.Polly from 7.0.5 to 7.0.9 (#1903) Bumps [Microsoft.Extensions.Http.Polly](https://github.com/dotnet/aspnetcore) from 7.0.5 to 7.0.9. - [Release notes](https://github.com/dotnet/aspnetcore/releases) - [Changelog](https://github.com/dotnet/aspnetcore/blob/main/docs/ReleasePlanning.md) - [Commits](https://github.com/dotnet/aspnetcore/compare/v7.0.5...v7.0.9) --- updated-dependencies: - dependency-name: Microsoft.Extensions.Http.Polly dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- samples/HealthChecks.UIAndApi/HealthChecks.UIAndApi.csproj | 2 +- .../HealthChecks.UIAndApiCustomization.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/HealthChecks.UIAndApi/HealthChecks.UIAndApi.csproj b/samples/HealthChecks.UIAndApi/HealthChecks.UIAndApi.csproj index 2558f55422..cb9e4f87ac 100644 --- a/samples/HealthChecks.UIAndApi/HealthChecks.UIAndApi.csproj +++ b/samples/HealthChecks.UIAndApi/HealthChecks.UIAndApi.csproj @@ -6,7 +6,7 @@ - + diff --git a/samples/HealthChecks.UIAndApiCustomization/HealthChecks.UIAndApiCustomization.csproj b/samples/HealthChecks.UIAndApiCustomization/HealthChecks.UIAndApiCustomization.csproj index 8b6b9e94b5..aed6caf5fc 100644 --- a/samples/HealthChecks.UIAndApiCustomization/HealthChecks.UIAndApiCustomization.csproj +++ b/samples/HealthChecks.UIAndApiCustomization/HealthChecks.UIAndApiCustomization.csproj @@ -6,7 +6,7 @@ - + From b5141ec1585892fa8979ba39b50f56bf61146e99 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Jul 2023 08:59:29 +0300 Subject: [PATCH 35/48] Bump IBMMQDotnetClient from 9.3.2.1 to 9.3.3 (#1908) Bumps IBMMQDotnetClient from 9.3.2.1 to 9.3.3. --- updated-dependencies: - dependency-name: IBMMQDotnetClient dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/HealthChecks.IbmMQ/HealthChecks.IbmMQ.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.IbmMQ/HealthChecks.IbmMQ.csproj b/src/HealthChecks.IbmMQ/HealthChecks.IbmMQ.csproj index c9b94bff33..8161b6027c 100644 --- a/src/HealthChecks.IbmMQ/HealthChecks.IbmMQ.csproj +++ b/src/HealthChecks.IbmMQ/HealthChecks.IbmMQ.csproj @@ -8,7 +8,7 @@ - + From 78b5852060fd9a3bd79d3b10f007806a3da69afb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Jul 2023 09:00:19 +0300 Subject: [PATCH 36/48] Bump Microsoft.Azure.Cosmos from 3.32.3 to 3.35.1 (#1906) Bumps [Microsoft.Azure.Cosmos](https://github.com/Azure/azure-cosmos-dotnet-v3) from 3.32.3 to 3.35.1. - [Release notes](https://github.com/Azure/azure-cosmos-dotnet-v3/releases) - [Changelog](https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/changelog.md) - [Commits](https://github.com/Azure/azure-cosmos-dotnet-v3/compare/3.32.3...3.35.1) --- updated-dependencies: - dependency-name: Microsoft.Azure.Cosmos dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/HealthChecks.CosmosDb/HealthChecks.CosmosDb.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.CosmosDb/HealthChecks.CosmosDb.csproj b/src/HealthChecks.CosmosDb/HealthChecks.CosmosDb.csproj index 669b39911a..5654e8c070 100644 --- a/src/HealthChecks.CosmosDb/HealthChecks.CosmosDb.csproj +++ b/src/HealthChecks.CosmosDb/HealthChecks.CosmosDb.csproj @@ -8,7 +8,7 @@ - + From 41b61cce7a42d289323ee479fdab1f5c19b20ef6 Mon Sep 17 00:00:00 2001 From: Turrican Date: Thu, 13 Jul 2023 08:11:27 +0200 Subject: [PATCH 37/48] Fixed docker compose (consul service) (#1898) --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2cf3463b2d..ee3a4c86ee 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -134,7 +134,7 @@ services: - "${TMPDIR:-/tmp/localstack}:/tmp/localstack" - "/var/run/docker.sock:/var/run/docker.sock" consul: - image: consul:latest + image: hashicorp/consul:latest ports: - "8500:8500" - "8600:8600" From d4962bd19e8effde5682f806afab32f95abecd3e Mon Sep 17 00:00:00 2001 From: Ivan Maximov Date: Thu, 13 Jul 2023 09:13:23 +0300 Subject: [PATCH 38/48] Add missed flags to codecov.yml --- .github/codecov.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/codecov.yml b/.github/codecov.yml index 9011ef50b1..8ef912e73d 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -9,16 +9,24 @@ flags: carryforward: true Aws.S3: carryforward: true + Aws.SecretsManager: + carryforward: true Aws.Sns: carryforward: true Aws.Sqs: carryforward: true - AzureDigitalTwin: + Aws.SystemsManager: carryforward: true Azure.IoTHub: carryforward: true + AzureApplicationInsights: + carryforward: true + AzureDigitalTwin: + carryforward: true AzureKeyVault: carryforward: true + AzureSearch: + carryforward: true AzureServiceBus: carryforward: true AzureStorage: @@ -49,6 +57,8 @@ flags: carryforward: true Kafka: carryforward: true + Kubernetes: + carryforward: true MongoDb: carryforward: true MySql: @@ -59,6 +69,8 @@ flags: carryforward: true Npgsql: carryforward: true + OpenIdConnectServer: + carryforward: true Oracle: carryforward: true Prometheus.Metrics: From a19515f5a4054b62e938a42bca36cfdaea23d27a Mon Sep 17 00:00:00 2001 From: Turrican Date: Thu, 13 Jul 2023 08:29:11 +0200 Subject: [PATCH 39/48] Added MySQL HealthChecks Query and Callback support. (#1835) --- .../MySqlHealthCheckBuilderExtensions.cs | 82 ++++++++++++++++++- src/HealthChecks.MySql/MySqlHealthCheck.cs | 19 +++-- .../MySqlHealthCheckOptions.cs | 31 +++++++ .../Functional/MySqlHealthCheckTests.cs | 30 +++++++ .../HealthChecks.MySql.approved.txt | 14 +++- 5 files changed, 165 insertions(+), 11 deletions(-) create mode 100644 src/HealthChecks.MySql/MySqlHealthCheckOptions.cs diff --git a/src/HealthChecks.MySql/DependencyInjection/MySqlHealthCheckBuilderExtensions.cs b/src/HealthChecks.MySql/DependencyInjection/MySqlHealthCheckBuilderExtensions.cs index 629ba41b86..09e2fac106 100644 --- a/src/HealthChecks.MySql/DependencyInjection/MySqlHealthCheckBuilderExtensions.cs +++ b/src/HealthChecks.MySql/DependencyInjection/MySqlHealthCheckBuilderExtensions.cs @@ -1,5 +1,6 @@ using HealthChecks.MySql; using Microsoft.Extensions.Diagnostics.HealthChecks; +using MySqlConnector; namespace Microsoft.Extensions.DependencyInjection; @@ -9,12 +10,15 @@ namespace Microsoft.Extensions.DependencyInjection; public static class MySqlHealthCheckBuilderExtensions { private const string NAME = "mysql"; + internal const string HEALTH_QUERY = "SELECT 1;"; /// - /// Add a health check for MySql databases. + /// Add a health check for MySQL databases. /// /// The . - /// The MySql connection string to be used. + /// The MySQL connection string to be used. + /// The query to be executed. + /// An optional action to allow additional MySQL specific configuration. /// The health check name. Optional. If null the type name 'mysql' will be used for the name. /// /// The that should be reported when the health check fails. Optional. If null then @@ -26,14 +30,86 @@ public static class MySqlHealthCheckBuilderExtensions public static IHealthChecksBuilder AddMySql( this IHealthChecksBuilder builder, string connectionString, + string healthQuery = HEALTH_QUERY, + Action? configure = null, string? name = default, HealthStatus? failureStatus = default, IEnumerable? tags = default, TimeSpan? timeout = default) { + return builder.AddMySql(_ => connectionString, healthQuery, configure, name, failureStatus, tags, timeout); + } + + /// + /// Add a health check for MySQL databases. + /// + /// The . + /// A factory to build the MySQL connection string to use. + /// The query to be executed. + /// An optional action to allow additional MySQL specific configuration. + /// The health check name. Optional. If null the type name 'mysql' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddMySql( + this IHealthChecksBuilder builder, + Func connectionStringFactory, + string healthQuery = HEALTH_QUERY, + Action? configure = null, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) + { + Guard.ThrowIfNull(connectionStringFactory); + + return builder.Add(new HealthCheckRegistration( + name ?? NAME, + sp => + { + var options = new MySqlHealthCheckOptions + { + ConnectionString = connectionStringFactory(sp), + CommandText = healthQuery, + Configure = configure, + }; + return new MySqlHealthCheck(options); + }, + failureStatus, + tags, + timeout)); + } + + /// + /// Add a health check for MySQL databases. + /// + /// The . + /// Options for health check. + /// The health check name. Optional. If null the type name 'mysql' will be used for the name. + /// + /// The that should be reported when the health check fails. Optional. If null then + /// the default status of will be reported. + /// + /// A list of tags that can be used to filter sets of health checks. Optional. + /// An optional representing the timeout of the check. + /// The specified . + public static IHealthChecksBuilder AddMySql( + this IHealthChecksBuilder builder, + MySqlHealthCheckOptions options, + string? name = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default) + { + Guard.ThrowIfNull(options); + return builder.Add(new HealthCheckRegistration( name ?? NAME, - _ => new MySqlHealthCheck(connectionString), + _ => new MySqlHealthCheck(options), failureStatus, tags, timeout)); diff --git a/src/HealthChecks.MySql/MySqlHealthCheck.cs b/src/HealthChecks.MySql/MySqlHealthCheck.cs index 1ec46587bf..8c25a28396 100644 --- a/src/HealthChecks.MySql/MySqlHealthCheck.cs +++ b/src/HealthChecks.MySql/MySqlHealthCheck.cs @@ -8,11 +8,13 @@ namespace HealthChecks.MySql; /// public class MySqlHealthCheck : IHealthCheck { - private readonly string _connectionString; + private readonly MySqlHealthCheckOptions _options; - public MySqlHealthCheck(string connectionString) + public MySqlHealthCheck(MySqlHealthCheckOptions options) { - _connectionString = Guard.ThrowIfNull(connectionString); + Guard.ThrowIfNull(options.ConnectionString, true); + Guard.ThrowIfNull(options.CommandText, true); + _options = options; } /// @@ -20,13 +22,18 @@ public async Task CheckHealthAsync(HealthCheckContext context { try { - using var connection = new MySqlConnection(_connectionString); + using var connection = new MySqlConnection(_options.ConnectionString); + _options.Configure?.Invoke(connection); await connection.OpenAsync(cancellationToken).ConfigureAwait(false); - return await connection.PingAsync(cancellationToken).ConfigureAwait(false) + using var command = connection.CreateCommand(); + command.CommandText = _options.CommandText; + object? result = await command.ExecuteScalarAsync(cancellationToken).ConfigureAwait(false); + + return _options.HealthCheckResultBuilder == null ? HealthCheckResult.Healthy() - : new HealthCheckResult(context.Registration.FailureStatus, description: $"The {nameof(MySqlHealthCheck)} check fail."); + : _options.HealthCheckResultBuilder(result); } catch (Exception ex) { diff --git a/src/HealthChecks.MySql/MySqlHealthCheckOptions.cs b/src/HealthChecks.MySql/MySqlHealthCheckOptions.cs new file mode 100644 index 0000000000..d8a1f073d7 --- /dev/null +++ b/src/HealthChecks.MySql/MySqlHealthCheckOptions.cs @@ -0,0 +1,31 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Diagnostics.HealthChecks; +using MySqlConnector; + +namespace HealthChecks.MySql; + +/// +/// Options for . +/// +public class MySqlHealthCheckOptions +{ + /// + /// The MySQL connection string to be used. + /// + public string ConnectionString { get; set; } = null!; + + /// + /// The query to be executed. + /// + public string CommandText { get; set; } = MySqlHealthCheckBuilderExtensions.HEALTH_QUERY; + + /// + /// An optional action executed before the connection is opened in the health check. + /// + public Action? Configure { get; set; } + + /// + /// An optional delegate to build health check result. + /// + public Func? HealthCheckResultBuilder { get; set; } +} diff --git a/test/HealthChecks.MySql.Tests/Functional/MySqlHealthCheckTests.cs b/test/HealthChecks.MySql.Tests/Functional/MySqlHealthCheckTests.cs index 98035393b6..a4995ffe84 100644 --- a/test/HealthChecks.MySql.Tests/Functional/MySqlHealthCheckTests.cs +++ b/test/HealthChecks.MySql.Tests/Functional/MySqlHealthCheckTests.cs @@ -55,4 +55,34 @@ public async Task be_unhealthy_when_mysql_server_is_unavailable() response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } + + [Fact] + public async Task be_unhealthy_when_mysql_server_is_unavailable_using_options() + { + var connectionString = "server=255.255.255.255;port=3306;database=information_schema;uid=root;password=Password12!"; + + var webHostBuilder = new WebHostBuilder() + .ConfigureServices(services => + { + var mysqlOptions = new MySqlHealthCheckOptions + { + ConnectionString = connectionString + }; + services.AddHealthChecks() + .AddMySql(mysqlOptions, tags: new string[] { "mysql" }); + }) + .Configure(app => + { + app.UseHealthChecks("/health", new HealthCheckOptions + { + Predicate = r => r.Tags.Contains("mysql") + }); + }); + + using var server = new TestServer(webHostBuilder); + + var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + + response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); + } } diff --git a/test/HealthChecks.MySql.Tests/HealthChecks.MySql.approved.txt b/test/HealthChecks.MySql.Tests/HealthChecks.MySql.approved.txt index 16005308ab..f3dfe4a8d5 100644 --- a/test/HealthChecks.MySql.Tests/HealthChecks.MySql.approved.txt +++ b/test/HealthChecks.MySql.Tests/HealthChecks.MySql.approved.txt @@ -2,14 +2,24 @@ namespace HealthChecks.MySql { public class MySqlHealthCheck : Microsoft.Extensions.Diagnostics.HealthChecks.IHealthCheck { - public MySqlHealthCheck(string connectionString) { } + public MySqlHealthCheck(HealthChecks.MySql.MySqlHealthCheckOptions options) { } public System.Threading.Tasks.Task CheckHealthAsync(Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckContext context, System.Threading.CancellationToken cancellationToken = default) { } } + public class MySqlHealthCheckOptions + { + public MySqlHealthCheckOptions() { } + public string CommandText { get; set; } + public System.Action? Configure { get; set; } + public string ConnectionString { get; set; } + public System.Func? HealthCheckResultBuilder { get; set; } + } } namespace Microsoft.Extensions.DependencyInjection { public static class MySqlHealthCheckBuilderExtensions { - public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddMySql(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, string connectionString, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } + public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddMySql(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, HealthChecks.MySql.MySqlHealthCheckOptions options, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } + public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddMySql(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, System.Func connectionStringFactory, string healthQuery = "SELECT 1;", System.Action? configure = null, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } + public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddMySql(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, string connectionString, string healthQuery = "SELECT 1;", System.Action? configure = null, string? name = null, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable? tags = null, System.TimeSpan? timeout = default) { } } } \ No newline at end of file From a9b59bda70eb55674b5ed9dda9958e320cfc86f2 Mon Sep 17 00:00:00 2001 From: Ivan Maximov Date: Thu, 13 Jul 2023 09:41:39 +0300 Subject: [PATCH 40/48] MySql->MySQL --- src/HealthChecks.MySql/MySqlHealthCheck.cs | 2 +- .../HealthChecks.UI.MySql.Storage.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/HealthChecks.MySql/MySqlHealthCheck.cs b/src/HealthChecks.MySql/MySqlHealthCheck.cs index 8c25a28396..fb7f433193 100644 --- a/src/HealthChecks.MySql/MySqlHealthCheck.cs +++ b/src/HealthChecks.MySql/MySqlHealthCheck.cs @@ -4,7 +4,7 @@ namespace HealthChecks.MySql; /// -/// A health check for MySql databases. +/// A health check for MySQL databases. /// public class MySqlHealthCheck : IHealthCheck { diff --git a/src/HealthChecks.UI.MySql.Storage/HealthChecks.UI.MySql.Storage.csproj b/src/HealthChecks.UI.MySql.Storage/HealthChecks.UI.MySql.Storage.csproj index 89e135902b..75895b4c26 100644 --- a/src/HealthChecks.UI.MySql.Storage/HealthChecks.UI.MySql.Storage.csproj +++ b/src/HealthChecks.UI.MySql.Storage/HealthChecks.UI.MySql.Storage.csproj @@ -3,7 +3,7 @@ net6.0 $(PackageTags);MySql - HealthChecks.UI.MySql.Storage package contains the required classes to use the MySql database provider in the UI + HealthChecks.UI.MySql.Storage package contains the required classes to use the MySQL database provider in the UI $(HealthCheckUIMySqlStorage) From b7a683ec1066e7dc3490efacf673055edb2b5e42 Mon Sep 17 00:00:00 2001 From: Ivan Maximov Date: Thu, 13 Jul 2023 09:48:29 +0300 Subject: [PATCH 41/48] Format readme --- README.md | 94 +++++++++++++++++++++++++++---------------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index b848e96c8b..279cf1a4f5 100644 --- a/README.md +++ b/README.md @@ -64,53 +64,53 @@ HealthChecks repo provides following images: HealthChecks packages include health checks for: -| Package | Downloads | NuGet Latest | Notes | -| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ---------------------------------------------------------------------- | -| ApplicationStatus | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.ApplicationStatus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ApplicationStatus) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.ApplicationStatus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ApplicationStatus) -| ArangoDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.ArangoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ArangoDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.ArangoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ArangoDb) -| Amazon S3 | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.S3)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.S3) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.S3)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.S3) -| Amazon Secrets Manager | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.SecretsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SecretsManager) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.SecretsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SecretsManager) -| Amazon SNS | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.Sns)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sns) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.Sns)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sns) -| Amazon SQS | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.Sqs)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sqs) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.Sqs)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sqs) -| Amazon Systems Manager | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.SystemsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SystemsManager) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.SystemsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SystemsManager) -| Azure Application Insights | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureApplicationInsights)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureApplicationInsights) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureApplicationInsights)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureApplicationInsights) -| Azure IoT Hub | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Azure.IoTHub)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Azure.IoTHub) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Azure.IoTHub)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Azure.IoTHub) -| Azure DigitalTwin | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureDigitalTwin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureDigitalTwin) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureDigitalTwin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureDigitalTwin) | Subscription status, models and instances | -| Azure Key Vault | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureKeyVault)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureKeyVault) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureKeyVault)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureKeyVault) -| Azure Search | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureSearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureSearch) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureSearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureSearch) -| Azure Service Bus | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureServiceBus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureServiceBus) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureServiceBus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureServiceBus) | EventHub, Queue and Topics | -| Azure Storage | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureStorage)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureStorage) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureStorage)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureStorage) | Blob, File, Queue | -| Consul | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Consul)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Consul) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Consul)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Consul) -| CosmosDb | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.CosmosDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.CosmosDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.CosmosDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.CosmosDb) | CosmosDb and Azure Table -| Azure DocumentDb | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.DocumentDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DocumentDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.DocumentDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DocumentDb) -| Amazon DynamoDb | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.DynamoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DynamoDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.DynamoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DynamoDb) -| Elasticsearch | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Elasticsearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Elasticsearch) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Elasticsearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Elasticsearch) -| EventStore | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.EventStore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.EventStore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore) | [TCP EventStore](https://github.com/EventStore/EventStoreDB-Client-Dotnet-Legacy) -| EventStore gRPC | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.EventStore.gRPC)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore.gRPC) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.EventStore.gRPC)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore.gRPC) | [gRPC EventStore](https://github.com/EventStore/EventStore-Client-Dotnet) -| Google Cloud Firestore | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Gcp.CloudFirestore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gcp.CloudFirestore) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Gcp.CloudFirestore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gcp.CloudFirestore) -| Gremlin | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Gremlin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gremlin) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Gremlin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gremlin) -| Hangfire | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Hangfire)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Hangfire) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Hangfire)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Hangfire) -| IbmMQ | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.IbmMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.IbmMQ) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.IbmMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.IbmMQ) -| InfluxDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.InfluxDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.InfluxDB) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.InfluxDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.InfluxDB) -| Kafka | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Kafka)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kafka) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Kafka)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kafka) -| Kubernetes | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Kubernetes)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kubernetes) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Kubernetes)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kubernetes) -| MongoDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.MongoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MongoDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.MongoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MongoDb) -| MySql | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.MySql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MySql) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.MySql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MySql) -| Nats | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Nats)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Nats) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Nats)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Nats) | NATS, messaging, message-bus, pubsub | -| Network | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Network)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Network) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Network)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Network) | Ftp, SFtp, Dns, Tcp port, Smtp, Imap, Ssl | -| Postgres | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.NpgSql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.NpgSql) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.NpgSql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.NpgSql) -| Identity Server | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.OpenIdConnectServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.OpenIdConnectServer) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.OpenIdConnectServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.OpenIdConnectServer) -| Oracle | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Oracle)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Oracle) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Oracle)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Oracle) -| RabbitMQ | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.RabbitMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RabbitMQ) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.RabbitMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RabbitMQ) -| RavenDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.RavenDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RavenDB) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.RavenDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RavenDB) -| Redis | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Redis)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Redis) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Redis)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Redis) -| SendGrid | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.SendGrid)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SendGrid) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.SendGrid)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SendGrid) -| SignalR | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.SignalR)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SignalR) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.SignalR)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SignalR) -| Solr | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Solr)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Solr) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Solr)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Solr) -| Sqlite | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Sqlite)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Sqlite) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Sqlite)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Sqlite) -| Sql Server | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.SqlServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SqlServer) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.SqlServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SqlServer) -| System | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.System)](https://www.nuget.org/packages/AspNetCore.HealthChecks.System) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.System)](https://www.nuget.org/packages/AspNetCore.HealthChecks.System) | Disk Storage, Folder, Private Memory, Virtual Memory, Process, Windows Service | -| Uri | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Uris)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Uris) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Uris)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Uris) | Single uri and uri groups | +| Package | Downloads | NuGet Latest | Notes | +| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ---------------------------------------------------------------------- | +| ApplicationStatus | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.ApplicationStatus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ApplicationStatus) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.ApplicationStatus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ApplicationStatus) +| ArangoDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.ArangoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ArangoDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.ArangoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.ArangoDb) +| Amazon S3 | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.S3)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.S3) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.S3)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.S3) +| Amazon Secrets Manager | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.SecretsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SecretsManager) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.SecretsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SecretsManager) +| Amazon SNS | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.Sns)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sns) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.Sns)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sns) +| Amazon SQS | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.Sqs)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sqs) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.Sqs)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.Sqs) +| Amazon Systems Manager | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Aws.SystemsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SystemsManager) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Aws.SystemsManager)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Aws.SystemsManager) +| Azure Application Insights | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureApplicationInsights)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureApplicationInsights) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureApplicationInsights)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureApplicationInsights) +| Azure IoT Hub | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Azure.IoTHub)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Azure.IoTHub) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Azure.IoTHub)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Azure.IoTHub) +| Azure DigitalTwin | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureDigitalTwin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureDigitalTwin) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureDigitalTwin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureDigitalTwin) | Subscription status, models and instances | +| Azure Key Vault | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureKeyVault)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureKeyVault) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureKeyVault)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureKeyVault) +| Azure Search | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureSearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureSearch) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureSearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureSearch) +| Azure Service Bus | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureServiceBus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureServiceBus) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureServiceBus)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureServiceBus) | EventHub, Queue and Topics | +| Azure Storage | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.AzureStorage)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureStorage) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.AzureStorage)](https://www.nuget.org/packages/AspNetCore.HealthChecks.AzureStorage) | Blob, File, Queue | +| Consul | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Consul)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Consul) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Consul)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Consul) +| CosmosDb | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.CosmosDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.CosmosDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.CosmosDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.CosmosDb) | CosmosDb and Azure Table +| Azure DocumentDb | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.DocumentDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DocumentDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.DocumentDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DocumentDb) +| Amazon DynamoDb | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.DynamoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DynamoDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.DynamoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.DynamoDb) +| Elasticsearch | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Elasticsearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Elasticsearch) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Elasticsearch)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Elasticsearch) +| EventStore | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.EventStore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.EventStore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore) | [TCP EventStore](https://github.com/EventStore/EventStoreDB-Client-Dotnet-Legacy) +| EventStore gRPC | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.EventStore.gRPC)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore.gRPC) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.EventStore.gRPC)](https://www.nuget.org/packages/AspNetCore.HealthChecks.EventStore.gRPC) | [gRPC EventStore](https://github.com/EventStore/EventStore-Client-Dotnet) +| Google Cloud Firestore | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Gcp.CloudFirestore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gcp.CloudFirestore) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Gcp.CloudFirestore)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gcp.CloudFirestore) +| Gremlin | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Gremlin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gremlin) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Gremlin)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Gremlin) +| Hangfire | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Hangfire)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Hangfire) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Hangfire)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Hangfire) +| IbmMQ | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.IbmMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.IbmMQ) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.IbmMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.IbmMQ) +| InfluxDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.InfluxDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.InfluxDB) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.InfluxDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.InfluxDB) +| Kafka | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Kafka)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kafka) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Kafka)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kafka) +| Kubernetes | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Kubernetes)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kubernetes) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Kubernetes)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Kubernetes) +| MongoDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.MongoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MongoDb) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.MongoDb)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MongoDb) +| MySql | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.MySql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MySql) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.MySql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.MySql) +| Nats | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Nats)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Nats) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Nats)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Nats) | NATS, messaging, message-bus, pubsub | +| Network | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Network)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Network) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Network)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Network) | Ftp, SFtp, Dns, Tcp port, Smtp, Imap, Ssl | +| Postgres | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.NpgSql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.NpgSql) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.NpgSql)](https://www.nuget.org/packages/AspNetCore.HealthChecks.NpgSql) +| Identity Server | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.OpenIdConnectServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.OpenIdConnectServer) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.OpenIdConnectServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.OpenIdConnectServer) +| Oracle | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Oracle)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Oracle) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Oracle)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Oracle) +| RabbitMQ | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.RabbitMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RabbitMQ) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.RabbitMQ)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RabbitMQ) +| RavenDB | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.RavenDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RavenDB) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.RavenDB)](https://www.nuget.org/packages/AspNetCore.HealthChecks.RavenDB) +| Redis | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Redis)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Redis) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Redis)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Redis) +| SendGrid | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.SendGrid)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SendGrid) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.SendGrid)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SendGrid) +| SignalR | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.SignalR)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SignalR) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.SignalR)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SignalR) +| Solr | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Solr)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Solr) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Solr)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Solr) +| Sqlite | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Sqlite)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Sqlite) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Sqlite)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Sqlite) +| Sql Server | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.SqlServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SqlServer) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.SqlServer)](https://www.nuget.org/packages/AspNetCore.HealthChecks.SqlServer) +| System | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.System)](https://www.nuget.org/packages/AspNetCore.HealthChecks.System) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.System)](https://www.nuget.org/packages/AspNetCore.HealthChecks.System) | Disk Storage, Folder, Private Memory, Virtual Memory, Process, Windows Service | +| Uri | [![Nuget](https://img.shields.io/nuget/dt/AspNetCore.HealthChecks.Uris)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Uris) | [![Nuget](https://img.shields.io/nuget/v/AspNetCore.HealthChecks.Uris)](https://www.nuget.org/packages/AspNetCore.HealthChecks.Uris) | Single uri and uri groups | > We support netcoreapp 2.2, 3.0 and 3.1. Please use package versions 2.2.X, 3.0.X and 3.1.X to target different versions. From 5a9c65810ddfb1c3739b8e7160b3bbb7f8e30105 Mon Sep 17 00:00:00 2001 From: Ivan Maximov Date: Thu, 13 Jul 2023 10:02:27 +0300 Subject: [PATCH 42/48] Less allocations in HealthChecks.Network (#1814) --- src/HealthChecks.Network/Core/ImapCommands.cs | 8 ---- .../Core/ImapConnection.cs | 41 +++++++++++++------ .../Core/MailConnection.cs | 10 ++--- src/HealthChecks.Network/Core/SmtpCommands.cs | 7 ---- .../Core/SmtpConnection.cs | 38 +++++++++++++---- .../Extensions/TaskExtensions.cs | 19 +++++++++ .../HealthChecks.Network.csproj | 1 + .../ExtensionsTests.cs | 21 ++++++++++ .../HealthChecks.Network.approved.txt | 22 ++-------- 9 files changed, 107 insertions(+), 60 deletions(-) create mode 100644 test/HealthChecks.Network.Tests/ExtensionsTests.cs diff --git a/src/HealthChecks.Network/Core/ImapCommands.cs b/src/HealthChecks.Network/Core/ImapCommands.cs index d9cb7ac864..f9e984524c 100644 --- a/src/HealthChecks.Network/Core/ImapCommands.cs +++ b/src/HealthChecks.Network/Core/ImapCommands.cs @@ -7,11 +7,3 @@ public class ImapCommands public static string ListFolders() => "& LIST " + "\"\"" + " \"*\"" + "\r\n"; public static string StartTLS() => "& STARTTLS\r\n"; } - -public class ImapResponse -{ - public static string OK = "& OK"; - public static string ERROR = "& NO"; - public static string AUTHFAILED = "AUTHENTICATIONFAILED"; - public static string OK_TLS_NEGOTIATION = "OK Begin TLS"; -} diff --git a/src/HealthChecks.Network/Core/ImapConnection.cs b/src/HealthChecks.Network/Core/ImapConnection.cs index fc25e570cc..f19fa7fc54 100644 --- a/src/HealthChecks.Network/Core/ImapConnection.cs +++ b/src/HealthChecks.Network/Core/ImapConnection.cs @@ -1,3 +1,5 @@ +using HealthChecks.Network.Extensions; + namespace HealthChecks.Network.Core; internal class ImapConnection : MailConnection @@ -53,15 +55,27 @@ public async Task AuthenticateAsync(string user, string password, Cancella await UpgradeToSecureConnectionAsync(cancellationToken).ConfigureAwait(false); } - var result = await ExecuteCommandAsync(ImapCommands.Login(user, password), cancellationToken).ConfigureAwait(false); - IsAuthenticated = !result.Contains(ImapResponse.AUTHFAILED); + IsAuthenticated = await ExecuteCommandAsync( + ImapCommands.Login(user, password), + result => + { + var AUTHFAILED = "AUTHENTICATIONFAILED"u8; + return !result.ContainsArray(AUTHFAILED); + }, + cancellationToken).ConfigureAwait(false); return IsAuthenticated; } private async Task UpgradeToSecureConnectionAsync(CancellationToken cancellationToken) { - var commandResult = await ExecuteCommandAsync(ImapCommands.StartTLS(), cancellationToken).ConfigureAwait(false); - var upgradeSuccess = commandResult.Contains(ImapResponse.OK_TLS_NEGOTIATION); + var upgradeSuccess = await ExecuteCommandAsync( + ImapCommands.StartTLS(), + result => + { + var OK_TLS_NEGOTIATION = "OK Begin TLS"u8; + return result.ContainsArray(OK_TLS_NEGOTIATION); + }, + cancellationToken).ConfigureAwait(false); if (upgradeSuccess) { ConnectionType = ImapConnectionType.SSL_TLS; @@ -76,14 +90,15 @@ private async Task UpgradeToSecureConnectionAsync(CancellationToken cancel public async Task SelectFolderAsync(string folder, CancellationToken cancellationToken = default) { - var result = await ExecuteCommandAsync(ImapCommands.SelectFolder(folder), cancellationToken).ConfigureAwait(false); - - //Double check, some servers sometimes include a last line with a & OK appending extra info when command fails - return result.Contains(ImapResponse.OK) && !result.Contains(ImapResponse.ERROR); - } - - public async Task GetFoldersAsync(CancellationToken cancellationToken = default) - { - return await ExecuteCommandAsync(ImapCommands.ListFolders(), cancellationToken).ConfigureAwait(false); + return await ExecuteCommandAsync( + ImapCommands.SelectFolder(folder), + result => + { + var OK = "& OK"u8; + var ERROR = "& NO"u8; + //Double check, some servers sometimes include a last line with a & OK appending extra info when command fails + return result.ContainsArray(OK) && !result.ContainsArray(ERROR); + }, + cancellationToken).ConfigureAwait(false); } } diff --git a/src/HealthChecks.Network/Core/MailConnection.cs b/src/HealthChecks.Network/Core/MailConnection.cs index 8e7966f7b2..83dc3c57f3 100644 --- a/src/HealthChecks.Network/Core/MailConnection.cs +++ b/src/HealthChecks.Network/Core/MailConnection.cs @@ -41,7 +41,7 @@ public async Task ConnectAsync(CancellationToken cancellationToken = defau #endif _stream = await GetStreamAsync(cancellationToken).ConfigureAwait(false); - await ExecuteCommandAsync(string.Empty, cancellationToken).ConfigureAwait(false); + await ExecuteCommandAsync(string.Empty, _ => true, cancellationToken).ConfigureAwait(false); return _tcpClient.Connected; } @@ -86,7 +86,9 @@ protected SslStream GetSSLStream(Stream stream) } } - protected async Task ExecuteCommandAsync(string command, CancellationToken cancellationToken) + public delegate bool CommandResultAction(byte[] result); + + protected async Task ExecuteCommandAsync(string command, CommandResultAction action, CancellationToken cancellationToken) { if (_stream == null) throw new InvalidOperationException($"{nameof(ConnectAsync)} should be called first"); @@ -102,14 +104,12 @@ protected async Task ExecuteCommandAsync(string command, CancellationTok var readBuffer = ArrayPool.Shared.Rent(512); try { - #if NET5_0_OR_GREATER int read = await _stream.ReadAsync(readBuffer, cancellationToken).ConfigureAwait(false); #else int read = await _stream.ReadAsync(readBuffer, 0, readBuffer.Length, cancellationToken).ConfigureAwait(false); #endif - - return Encoding.UTF8.GetString(readBuffer); + return action(readBuffer); } finally { diff --git a/src/HealthChecks.Network/Core/SmtpCommands.cs b/src/HealthChecks.Network/Core/SmtpCommands.cs index 71448935dc..64920ec41d 100644 --- a/src/HealthChecks.Network/Core/SmtpCommands.cs +++ b/src/HealthChecks.Network/Core/SmtpCommands.cs @@ -6,10 +6,3 @@ public class SmtpCommands public static string EHLO(string host) => $"EHLO {host}\r\n"; public static string AUTHLOGIN() => $"AUTH LOGIN\r\n"; } - -public class SmtpResponse -{ - public const string ACTION_OK = "250"; - public const string SERVICE_READY = "220"; - public const string AUTHENTICATION_SUCCESS = "235"; -} diff --git a/src/HealthChecks.Network/Core/SmtpConnection.cs b/src/HealthChecks.Network/Core/SmtpConnection.cs index 5c5342dc39..e86a16fa8d 100644 --- a/src/HealthChecks.Network/Core/SmtpConnection.cs +++ b/src/HealthChecks.Network/Core/SmtpConnection.cs @@ -1,4 +1,5 @@ using System.Text; +using HealthChecks.Network.Extensions; namespace HealthChecks.Network.Core; @@ -29,8 +30,14 @@ public SmtpConnection(SmtpConnectionOptions options) public new async Task ConnectAsync(CancellationToken cancellationToken = default) { await base.ConnectAsync(cancellationToken).ConfigureAwait(false); - var result = await ExecuteCommandAsync(SmtpCommands.EHLO(Host), cancellationToken).ConfigureAwait(false); - return result.Contains(SmtpResponse.ACTION_OK); + return await ExecuteCommandAsync( + SmtpCommands.EHLO(Host), + result => + { + var ACTION_OK = "250"u8; + return result.ContainsArray(ACTION_OK); + }, + cancellationToken).ConfigureAwait(false); } public async Task AuthenticateAsync(string userName, string password, CancellationToken cancellationToken = default) @@ -39,14 +46,20 @@ public async Task AuthenticateAsync(string userName, string password, Canc { await UpgradeToSecureConnectionAsync(cancellationToken).ConfigureAwait(false); } - await ExecuteCommandAsync(SmtpCommands.EHLO(Host), cancellationToken).ConfigureAwait(false); - await ExecuteCommandAsync(SmtpCommands.AUTHLOGIN(), cancellationToken).ConfigureAwait(false); - await ExecuteCommandAsync($"{ToBase64(userName)}\r\n", cancellationToken).ConfigureAwait(false); + await ExecuteCommandAsync(SmtpCommands.EHLO(Host), _ => true, cancellationToken).ConfigureAwait(false); + await ExecuteCommandAsync(SmtpCommands.AUTHLOGIN(), _ => true, cancellationToken).ConfigureAwait(false); + await ExecuteCommandAsync($"{ToBase64(userName)}\r\n", _ => true, cancellationToken).ConfigureAwait(false); password = password?.Length > 0 ? ToBase64(password) : ""; - var result = await ExecuteCommandAsync($"{password}\r\n", cancellationToken).ConfigureAwait(false); - return result.Contains(SmtpResponse.AUTHENTICATION_SUCCESS); + return await ExecuteCommandAsync( + $"{password}\r\n", + result => + { + var AUTHENTICATION_SUCCESS = "235"u8; + return result.ContainsArray(AUTHENTICATION_SUCCESS); + }, + cancellationToken).ConfigureAwait(false); } private bool ShouldUpgradeConnection => !UseSSL && _connectionType != SmtpConnectionType.PLAIN; @@ -74,8 +87,15 @@ private void ComputeDefaultValues() private async Task UpgradeToSecureConnectionAsync(CancellationToken cancellationToken) { - var upgradeResult = await ExecuteCommandAsync(SmtpCommands.STARTTLS(), cancellationToken).ConfigureAwait(false); - if (upgradeResult.Contains(SmtpResponse.SERVICE_READY)) + var upgradeResult = await ExecuteCommandAsync( + SmtpCommands.STARTTLS(), + result => + { + var SERVICE_READY = "220"u8; + return result.ContainsArray(SERVICE_READY); + }, + cancellationToken).ConfigureAwait(false); + if (upgradeResult) { UseSSL = true; _stream = await GetStreamAsync(cancellationToken).ConfigureAwait(false); diff --git a/src/HealthChecks.Network/Extensions/TaskExtensions.cs b/src/HealthChecks.Network/Extensions/TaskExtensions.cs index 8e543980b6..ebd1ec66b5 100644 --- a/src/HealthChecks.Network/Extensions/TaskExtensions.cs +++ b/src/HealthChecks.Network/Extensions/TaskExtensions.cs @@ -31,4 +31,23 @@ public static async Task WithCancellationTokenAsync(this Task task, Can return await task.ConfigureAwait(false); } } + + internal static bool ContainsArray(this byte[] source, ReadOnlySpan segment) + { + if (segment.Length == 0) + return true; + + for (int i = 0; i < source.Length - segment.Length + 1; ++i) + { + for (int j = 0; j < segment.Length; ++j) + { + if (source[i + j] != segment[j]) + break; + if (j == segment.Length - 1) + return true; + } + } + + return false; + } } diff --git a/src/HealthChecks.Network/HealthChecks.Network.csproj b/src/HealthChecks.Network/HealthChecks.Network.csproj index c56f645dda..ec23c3e593 100644 --- a/src/HealthChecks.Network/HealthChecks.Network.csproj +++ b/src/HealthChecks.Network/HealthChecks.Network.csproj @@ -12,6 +12,7 @@ + diff --git a/test/HealthChecks.Network.Tests/ExtensionsTests.cs b/test/HealthChecks.Network.Tests/ExtensionsTests.cs new file mode 100644 index 0000000000..bca3787b40 --- /dev/null +++ b/test/HealthChecks.Network.Tests/ExtensionsTests.cs @@ -0,0 +1,21 @@ +using System.Text; +using HealthChecks.Network.Extensions; + +namespace HealthChecks.Network.Tests; + +public class ExtensionsTests +{ + [Theory] + [InlineData("abcdef", "", true)] + [InlineData("abcdef", "cd", true)] + [InlineData("abcdef", "ef", true)] + [InlineData("abcdef", "cdef", true)] + [InlineData("abcdef", "abcdefg", false)] + [InlineData("abcdef", "k", false)] + [InlineData("abcdef", "ee", false)] + [InlineData("abcdef", "ff", false)] + public void ContainsArray(string source, string segment, bool expected) + { + Encoding.UTF8.GetBytes(source).ContainsArray(Encoding.UTF8.GetBytes(segment)).ShouldBe(expected); + } +} diff --git a/test/HealthChecks.Network.Tests/HealthChecks.Network.approved.txt b/test/HealthChecks.Network.Tests/HealthChecks.Network.approved.txt index 2db8bd5b3d..72b73280da 100644 --- a/test/HealthChecks.Network.Tests/HealthChecks.Network.approved.txt +++ b/test/HealthChecks.Network.Tests/HealthChecks.Network.approved.txt @@ -22,14 +22,6 @@ namespace HealthChecks.Network.Core SSL_TLS = 1, STARTTLS = 2, } - public class ImapResponse - { - public static string AUTHFAILED; - public static string ERROR; - public static string OK; - public static string OK_TLS_NEGOTIATION; - public ImapResponse() { } - } public class MailConnection : System.IDisposable { protected System.IO.Stream? _stream; @@ -39,12 +31,13 @@ namespace HealthChecks.Network.Core public string Host { get; set; } public int Port { get; set; } protected bool UseSSL { get; set; } - public System.Threading.Tasks.Task ConnectAsync() { } + public System.Threading.Tasks.Task ConnectAsync(System.Threading.CancellationToken cancellationToken = default) { } public void Dispose() { } protected virtual void Dispose(bool disposing) { } - protected System.Threading.Tasks.Task ExecuteCommand(string command) { } + protected System.Threading.Tasks.Task ExecuteCommandAsync(string command, HealthChecks.Network.Core.MailConnection.CommandResultAction action, System.Threading.CancellationToken cancellationToken) { } protected System.Net.Security.SslStream GetSSLStream(System.IO.Stream stream) { } - protected System.IO.Stream GetStream() { } + protected System.Threading.Tasks.Task GetStreamAsync(System.Threading.CancellationToken cancellationToken) { } + public delegate T CommandResultAction(byte[] result); } public class SmtpCommands { @@ -68,13 +61,6 @@ namespace HealthChecks.Network.Core TLS = 2, PLAIN = 3, } - public class SmtpResponse - { - public const string ACTION_OK = "250"; - public const string AUTHENTICATION_SUCCESS = "235"; - public const string SERVICE_READY = "220"; - public SmtpResponse() { } - } } namespace HealthChecks.Network { From e881d666a294e978e4542e01182d303a9c02eda9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Jul 2023 16:21:25 +0300 Subject: [PATCH 43/48] Bump bumpalo from 3.2.1 to 3.12.0 in /deploy/operator/installer (#1648) Bumps [bumpalo](https://github.com/fitzgen/bumpalo) from 3.2.1 to 3.12.0. - [Release notes](https://github.com/fitzgen/bumpalo/releases) - [Changelog](https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md) - [Commits](https://github.com/fitzgen/bumpalo/compare/3.2.1...3.12.0) --- updated-dependencies: - dependency-name: bumpalo dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- deploy/operator/installer/Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/operator/installer/Cargo.lock b/deploy/operator/installer/Cargo.lock index 12fcac2e81..8ef202e864 100644 --- a/deploy/operator/installer/Cargo.lock +++ b/deploy/operator/installer/Cargo.lock @@ -68,9 +68,9 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "bumpalo" -version = "3.2.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12ae9db68ad7fac5fe51304d20f016c911539251075a214f8e663babefa35187" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" [[package]] name = "byteorder" From 298345b8bd79dcaa5017b136186c8155459df062 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Jul 2023 07:55:33 +0300 Subject: [PATCH 44/48] Bump MySqlConnector from 2.2.5 to 2.2.6 (#1911) Bumps [MySqlConnector](https://github.com/mysql-net/MySqlConnector) from 2.2.5 to 2.2.6. - [Release notes](https://github.com/mysql-net/MySqlConnector/releases) - [Changelog](https://github.com/mysql-net/MySqlConnector/blob/master/docs/VersionHistory.md) - [Commits](https://github.com/mysql-net/MySqlConnector/compare/2.2.5...2.2.6) --- updated-dependencies: - dependency-name: MySqlConnector dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/HealthChecks.MySql/HealthChecks.MySql.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.MySql/HealthChecks.MySql.csproj b/src/HealthChecks.MySql/HealthChecks.MySql.csproj index 0789630bc3..3586cf3b0c 100644 --- a/src/HealthChecks.MySql/HealthChecks.MySql.csproj +++ b/src/HealthChecks.MySql/HealthChecks.MySql.csproj @@ -8,7 +8,7 @@ - + From 3c3b82fb152645bc1d6870b95dbf2813577007ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Jul 2023 07:57:00 +0300 Subject: [PATCH 45/48] Bump Serilog.Extensions.Logging from 3.1.0 to 7.0.0 (#1912) Bumps [Serilog.Extensions.Logging](https://github.com/serilog/serilog-extensions-logging) from 3.1.0 to 7.0.0. - [Release notes](https://github.com/serilog/serilog-extensions-logging/releases) - [Commits](https://github.com/serilog/serilog-extensions-logging/compare/v3.1.0...v7.0.0) --- updated-dependencies: - dependency-name: Serilog.Extensions.Logging dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../HealthChecks.UI.K8s.Operator.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.UI.K8s.Operator/HealthChecks.UI.K8s.Operator.csproj b/src/HealthChecks.UI.K8s.Operator/HealthChecks.UI.K8s.Operator.csproj index 6f236c19b0..60c6d2e171 100644 --- a/src/HealthChecks.UI.K8s.Operator/HealthChecks.UI.K8s.Operator.csproj +++ b/src/HealthChecks.UI.K8s.Operator/HealthChecks.UI.K8s.Operator.csproj @@ -13,7 +13,7 @@ - + From e3036d43686a844523c8f2527b151fce8ec933cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Jul 2023 07:58:28 +0300 Subject: [PATCH 46/48] Bump NATS.Client from 1.0.3 to 1.0.7 (#1913) Bumps [NATS.Client](https://github.com/nats-io/nats.net) from 1.0.3 to 1.0.7. - [Release notes](https://github.com/nats-io/nats.net/releases) - [Commits](https://github.com/nats-io/nats.net/compare/1.0.3...1.0.7) --- updated-dependencies: - dependency-name: NATS.Client dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/HealthChecks.Nats/HealthChecks.Nats.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.Nats/HealthChecks.Nats.csproj b/src/HealthChecks.Nats/HealthChecks.Nats.csproj index 40df1bea92..294f9760ce 100644 --- a/src/HealthChecks.Nats/HealthChecks.Nats.csproj +++ b/src/HealthChecks.Nats/HealthChecks.Nats.csproj @@ -9,7 +9,7 @@ - + From 18b39d6e56c7185c286afe4f4463594c50fdc9eb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Jul 2023 07:59:12 +0300 Subject: [PATCH 47/48] Bump Azure.Storage.Files.Shares from 12.14.0 to 12.15.0 (#1914) Bumps [Azure.Storage.Files.Shares](https://github.com/Azure/azure-sdk-for-net) from 12.14.0 to 12.15.0. - [Release notes](https://github.com/Azure/azure-sdk-for-net/releases) - [Commits](https://github.com/Azure/azure-sdk-for-net/compare/Azure.Storage.Files.Shares_12.14.0...Azure.Storage.Files.Shares_12.15.0) --- updated-dependencies: - dependency-name: Azure.Storage.Files.Shares dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/HealthChecks.AzureStorage/HealthChecks.AzureStorage.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.AzureStorage/HealthChecks.AzureStorage.csproj b/src/HealthChecks.AzureStorage/HealthChecks.AzureStorage.csproj index a6f1f02c78..25586f0b9c 100644 --- a/src/HealthChecks.AzureStorage/HealthChecks.AzureStorage.csproj +++ b/src/HealthChecks.AzureStorage/HealthChecks.AzureStorage.csproj @@ -10,7 +10,7 @@ - + From d70a7fbc09fc186537e2d0f5d8bbafcf442dce65 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Jul 2023 08:03:27 +0300 Subject: [PATCH 48/48] Bump Azure.Storage.Queues from 12.14.0 to 12.15.0 (#1915) Bumps [Azure.Storage.Queues](https://github.com/Azure/azure-sdk-for-net) from 12.14.0 to 12.15.0. - [Release notes](https://github.com/Azure/azure-sdk-for-net/releases) - [Commits](https://github.com/Azure/azure-sdk-for-net/compare/Azure.Storage.Queues_12.14.0...Azure.Storage.Queues_12.15.0) --- updated-dependencies: - dependency-name: Azure.Storage.Queues dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/HealthChecks.AzureStorage/HealthChecks.AzureStorage.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HealthChecks.AzureStorage/HealthChecks.AzureStorage.csproj b/src/HealthChecks.AzureStorage/HealthChecks.AzureStorage.csproj index 25586f0b9c..24bf2051a0 100644 --- a/src/HealthChecks.AzureStorage/HealthChecks.AzureStorage.csproj +++ b/src/HealthChecks.AzureStorage/HealthChecks.AzureStorage.csproj @@ -9,7 +9,7 @@ - +