Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic health check #2976

Merged
merged 6 commits into from
Jan 8, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions OrchardCore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.ResponseCompres
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Google", "src\OrchardCore.Modules\OrchardCore.Google\OrchardCore.Google.csproj", "{E7CB5F02-2E90-4ADD-A851-1C49CDA184D6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrchardCore.HealthChecks", "src\OrchardCore.Modules\OrchardCore.HealthChecks\OrchardCore.HealthChecks.csproj", "{76023624-8D28-4666-9CA6-5978ACC2571D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -969,6 +971,10 @@ Global
{E7CB5F02-2E90-4ADD-A851-1C49CDA184D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E7CB5F02-2E90-4ADD-A851-1C49CDA184D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E7CB5F02-2E90-4ADD-A851-1C49CDA184D6}.Release|Any CPU.Build.0 = Release|Any CPU
{76023624-8D28-4666-9CA6-5978ACC2571D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{76023624-8D28-4666-9CA6-5978ACC2571D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{76023624-8D28-4666-9CA6-5978ACC2571D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{76023624-8D28-4666-9CA6-5978ACC2571D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1140,6 +1146,7 @@ Global
{C9C1BEE9-8FD1-4186-96BD-A8A64BF5BAE4} = {A066395F-6F73-45DC-B5A6-B4E306110DCE}
{C6EEBB52-183F-418F-A5C0-458D146C10A2} = {A066395F-6F73-45DC-B5A6-B4E306110DCE}
{E7CB5F02-2E90-4ADD-A851-1C49CDA184D6} = {A066395F-6F73-45DC-B5A6-B4E306110DCE}
{76023624-8D28-4666-9CA6-5978ACC2571D} = {A066395F-6F73-45DC-B5A6-B4E306110DCE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {46A1D25A-78D1-4476-9CBF-25B75E296341}
Expand Down
1 change: 1 addition & 0 deletions src/OrchardCore.Build/Dependencies.AspNetCore.props
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
<PackageManagement Include="Microsoft.VisualStudio.Web.CodeGeneration.Templating" Version="2.2.0" />
<PackageManagement Include="Microsoft.VisualStudio.Web.CodeGeneration.Utils" Version="2.2.0" />
<PackageManagement Include="Microsoft.VisualStudio.Web.CodeGenerators.Mvc" Version="2.2.0" />
<PackageManagement Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" Version="2.2.0" />
</ItemGroup>

<PropertyGroup>
Expand Down
10 changes: 10 additions & 0 deletions src/OrchardCore.Modules/OrchardCore.HealthChecks/Manifest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using OrchardCore.Modules.Manifest;

[assembly: Module(
Name = "Health Check",
Author = "The Orchard Team",
Website = "http://orchardproject.net",
Version = "2.0.0",
Description = "This module provides health check for the website.",
Category = "Infrastructure"
)]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\OrchardCore\OrchardCore.Module.Targets\OrchardCore.Module.Targets.csproj" />
</ItemGroup>

</Project>
22 changes: 22 additions & 0 deletions src/OrchardCore.Modules/OrchardCore.HealthChecks/Startup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
using OrchardCore.Modules;

namespace OrchardCore.HealthChecks
{
public class Startup : StartupBase
{
public override void Configure(IApplicationBuilder app, IRouteBuilder routes, IServiceProvider serviceProvider)
{
app.UseHealthChecks("/health/live");

}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove empty space


public override void ConfigureServices(IServiceCollection services)
{
services.AddHealthChecks();
}
}
}