Skip to content

Commit

Permalink
Don't record activity if scheduled job doesn't run. Add aspire to hos…
Browse files Browse the repository at this point in the history
…ting sample to view traces and metrics.
  • Loading branch information
ejsmith committed Oct 28, 2024
1 parent f2962b9 commit f3c520a
Show file tree
Hide file tree
Showing 15 changed files with 329 additions and 165 deletions.
16 changes: 15 additions & 1 deletion Foundatio.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
build\common.props = build\common.props
tests\Directory.Build.props = tests\Directory.Build.props
src\Directory.Build.props = src\Directory.Build.props
samples\Directory.Build.props = samples\Directory.Build.props
NuGet.config = NuGet.config
README.md = README.md
.github\workflows\build-workflow.yml = .github\workflows\build-workflow.yml
Expand Down Expand Up @@ -40,6 +39,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Foundatio.MessagePack", "sr
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Foundatio.DataProtection", "src\Foundatio.DataProtection\Foundatio.DataProtection.csproj", "{BD5CB540-DFF1-4E5F-8532-7B92935F93D4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Foundatio.AppHost", "samples\Foundatio.AppHost\Foundatio.AppHost.csproj", "{7EABA9A2-C459-4A6A-B5AF-218E6A59E635}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -170,6 +171,18 @@ Global
{BD5CB540-DFF1-4E5F-8532-7B92935F93D4}.Release|x64.Build.0 = Release|Any CPU
{BD5CB540-DFF1-4E5F-8532-7B92935F93D4}.Release|x86.ActiveCfg = Release|Any CPU
{BD5CB540-DFF1-4E5F-8532-7B92935F93D4}.Release|x86.Build.0 = Release|Any CPU
{7EABA9A2-C459-4A6A-B5AF-218E6A59E635}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7EABA9A2-C459-4A6A-B5AF-218E6A59E635}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7EABA9A2-C459-4A6A-B5AF-218E6A59E635}.Debug|x64.ActiveCfg = Debug|Any CPU
{7EABA9A2-C459-4A6A-B5AF-218E6A59E635}.Debug|x64.Build.0 = Debug|Any CPU
{7EABA9A2-C459-4A6A-B5AF-218E6A59E635}.Debug|x86.ActiveCfg = Debug|Any CPU
{7EABA9A2-C459-4A6A-B5AF-218E6A59E635}.Debug|x86.Build.0 = Debug|Any CPU
{7EABA9A2-C459-4A6A-B5AF-218E6A59E635}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7EABA9A2-C459-4A6A-B5AF-218E6A59E635}.Release|Any CPU.Build.0 = Release|Any CPU
{7EABA9A2-C459-4A6A-B5AF-218E6A59E635}.Release|x64.ActiveCfg = Release|Any CPU
{7EABA9A2-C459-4A6A-B5AF-218E6A59E635}.Release|x64.Build.0 = Release|Any CPU
{7EABA9A2-C459-4A6A-B5AF-218E6A59E635}.Release|x86.ActiveCfg = Release|Any CPU
{7EABA9A2-C459-4A6A-B5AF-218E6A59E635}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -178,6 +191,7 @@ Global
{39AFF0C0-D64A-4D57-871F-17D9BF2E5A93} = {A1DFF80C-113F-4FEC-84BB-1E3790FB410F}
{6A0F1A4B-C0D2-423C-9B9D-7E75B91B41EE} = {70515E66-DAF8-4D18-8F8F-8A2934171AA9}
{99CBF75F-9204-4D7E-A792-4377C0291900} = {70515E66-DAF8-4D18-8F8F-8A2934171AA9}
{7EABA9A2-C459-4A6A-B5AF-218E6A59E635} = {A1DFF80C-113F-4FEC-84BB-1E3790FB410F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BD75F5C6-658B-40DF-A8F6-91C3EB76DAAA}
Expand Down
8 changes: 0 additions & 8 deletions samples/Directory.Build.props

This file was deleted.

23 changes: 23 additions & 0 deletions samples/Foundatio.AppHost/Foundatio.AppHost.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<Sdk Name="Aspire.AppHost.Sdk" Version="9.0.0-rc.1.24511.1" />

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsAspireHost>true</IsAspireHost>
<UserSecretsId>96cfcbc9-36fb-452f-9b99-0165197e1978</UserSecretsId>
<IsPackable>False</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.0.0-rc.1.24511.1"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Foundatio.HostingSample\Foundatio.HostingSample.csproj" />
</ItemGroup>

</Project>
9 changes: 9 additions & 0 deletions samples/Foundatio.AppHost/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Projects;

var builder = DistributedApplication.CreateBuilder(args);

builder.AddProject<Foundatio_HostingSample>("HostingSample")
.WithExternalHttpEndpoints()
.WithArgs("all");

builder.Build().Run();
29 changes: 29 additions & 0 deletions samples/Foundatio.AppHost/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:17176;http://localhost:15249",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21196",
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22113"
}
},
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:15249",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19180",
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20234"
}
}
}
}
8 changes: 8 additions & 0 deletions samples/Foundatio.AppHost/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
9 changes: 9 additions & 0 deletions samples/Foundatio.AppHost/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Aspire.Hosting.Dcp": "Warning"
}
}
}
18 changes: 15 additions & 3 deletions samples/Foundatio.HostingSample/Foundatio.HostingSample.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>False</IsPackable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Foundatio.Extensions.Hosting\Foundatio.Extensions.Hosting.csproj" />
<ProjectReference Include="..\..\src\Foundatio.Xunit\Foundatio.Xunit.csproj" />
<ProjectReference Include="..\..\src\Foundatio\Foundatio.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.4" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" />
</ItemGroup>
</Project>

</Project>
Loading

0 comments on commit f3c520a

Please sign in to comment.