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

F/245090 apm and logging #147

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions amorphie.client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
using Elastic.Apm.NetCoreAll;
using Dapr.Client;

ThreadPool.SetMinThreads(50, 50);

var builder = WebApplication.CreateBuilder(args);
var client = new DaprClientBuilder().Build();
using (var tokenSource = new CancellationTokenSource(20000))
Expand Down
2 changes: 1 addition & 1 deletion amorphie.client/amorphie.client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.4" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4" />
<PackageReference Include="amorphie.core" Version="1.1.31" />
<PackageReference Include="amorphie.core" Version="1.1.32" />
<PackageReference Include="amorphie.core.security" Version="1.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.8" />
<PackageReference Include="Elastic.Apm.NetCoreAll" Version="1.25.3" />
Expand Down
2 changes: 1 addition & 1 deletion amorphie.fact.core/amorphie.fact.core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
<PackageReference Include="amorphie.core" Version="1.1.31" />
<PackageReference Include="amorphie.core" Version="1.1.32" />
<PackageReference Include="amorphie.core.security" Version="1.0.1" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.8" />
Expand Down
19 changes: 8 additions & 11 deletions amorphie.user.zeebe.workers/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
using System.Reflection;
using FluentValidation;
using amorphie.core.Extension;
using amorphie.core.Middleware.Logging;
using Dapr.Client;
using Elastic.Apm.NetCoreAll;

var builder = WebApplication.CreateBuilder(args);
var client = new DaprClientBuilder().Build();
Expand All @@ -28,35 +30,30 @@
//var postgreSql = "Host=localhost:5432;Database=users;Username=postgres;Password=postgres";
// Add services to the container.
builder.Services.AddDaprClient();
builder.Logging.ClearProviders();
builder.Logging.AddJsonConsole();
builder.AddSeriLog<AmorphieLogEnricher>();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();

builder.Services.AddDbContext<UserDBContext>
(options => options.UseNpgsql(postgreSql, b => b.MigrationsAssembly("amorphie.fact.data")));

var app = builder.Build();
if (!app.Environment.IsDevelopment())
{
app.UseAllElasticApm(app.Configuration);
}
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);

using var scope = app.Services.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<UserDBContext>();
//db.Database.Migrate();


// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}

app.UseCloudEvents();
app.UseRouting();
app.MapSubscribeHandler();
app.UseSwagger();
app.UseSwaggerUI();

app.UseLoggingHandlerMiddlewares();
app.MapZeebeSmsSenderEndpoints();

app.Run();
59 changes: 30 additions & 29 deletions amorphie.user.zeebe.workers/amorphie.user.zeebe.workers.csproj
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.Client" Version="1.12.0" />
<PackageReference Include="Dapr.AspNetCore" Version="1.12.0" />
<PackageReference Include="Konscious.Security.Cryptography.Argon2" Version="1.3.0" />
<PackageReference Include="Konscious.Security.Cryptography.Blake2" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.5" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />

<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.4" />
<PackageReference Include="amorphie.core" Version="1.1.31" />
<PackageReference Include="amorphie.core.security" Version="1.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.8" />
</ItemGroup>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.Client" Version="1.12.0"/>
<PackageReference Include="Dapr.AspNetCore" Version="1.12.0"/>
<PackageReference Include="Konscious.Security.Cryptography.Argon2" Version="1.3.0"/>
<PackageReference Include="Konscious.Security.Cryptography.Blake2" Version="1.1.0"/>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.5"/>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0"/>

<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4"/>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.4"/>
<PackageReference Include="amorphie.core" Version="1.1.32"/>
<PackageReference Include="amorphie.core.security" Version="1.0.1"/>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.8"/>
<PackageReference Include="Elastic.Apm.NetCoreAll" Version="1.25.3"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\amorphie.fact.data\amorphie.fact.data.csproj"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\amorphie.fact.core\amorphie.fact.core.csproj"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\amorphie.fact.data\amorphie.fact.data.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\amorphie.fact.core\amorphie.fact.core.csproj" />
</ItemGroup>

</Project>
3 changes: 2 additions & 1 deletion amorphie.user/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
using Elastic.Apm.NetCoreAll;
using Microsoft.EntityFrameworkCore.Infrastructure;


ThreadPool.SetMinThreads(20, 20);

var builder = WebApplication.CreateBuilder(args);
var client = new DaprClientBuilder().Build();
using (var tokenSource = new CancellationTokenSource(20000))
Expand Down
2 changes: 1 addition & 1 deletion amorphie.user/amorphie.user.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.4"/>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4"/>
<PackageReference Include="amorphie.core" Version="1.1.31"/>
<PackageReference Include="amorphie.core" Version="1.1.32"/>
<PackageReference Include="amorphie.core.security" Version="1.0.1"/>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.8"/>
</ItemGroup>
Expand Down
Loading