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

chore(deps): update #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
28 changes: 14 additions & 14 deletions src/JustSending/JustSending.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
<ServerGarbageCollection>false</ServerGarbageCollection>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Ardalis.ApiEndpoints" Version="4.0.1" />
<PackageReference Include="HangFire" Version="1.8" />
<PackageReference Include="Hangfire.Redis.StackExchange" Version="1.8.6" />
<PackageReference Include="Hangfire.Storage.SQLite" Version="0.3.2" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.0.0-rc9.9" />
<PackageReference Include="Honeycomb.OpenTelemetry" Version="1.2.1" />
<PackageReference Include="Honeycomb.OpenTelemetry.Instrumentation.AspNetCore" Version="0.26.1-beta" />
<PackageReference Include="Ardalis.ApiEndpoints" Version="4.1.0" />
<PackageReference Include="HangFire" Version="1.8.14" />
<PackageReference Include="Hangfire.Redis.StackExchange" Version="1.9.3" />
<PackageReference Include="Hangfire.Storage.SQLite" Version="0.4.2" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
<PackageReference Include="Honeycomb.OpenTelemetry" Version="1.5.0" />
<PackageReference Include="Honeycomb.OpenTelemetry.Instrumentation.AspNetCore" Version="0.29.0-beta" />
<PackageReference Include="Honeycomb.OpenTelemetry.AutoInstrumentations" Version="0.26.1-beta" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="8.0.7" />
<PackageReference Include="Microsoft.AspNetCore.WebSockets" Version="2.2.1" />
<PackageReference Include="LiteDB" Version="5.0.21" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="8.0.7" />
<PackageReference Include="RedLock.net" Version="2.3.2" />
<PackageReference Include="Sentry" Version="3.23.1" />
<PackageReference Include="Sentry.AspNetCore" Version="3.23.1" />
<PackageReference Include="Sentry.Serilog" Version="3.23.1" />
<PackageReference Include="Serilog.AspNetCore" Version="6.0.1" />
<PackageReference Include="prometheus-net.AspNetCore" Version="7.0.0" />
<PackageReference Include="Sentry" Version="4.8.1" />
<PackageReference Include="Sentry.AspNetCore" Version="4.8.1" />
<PackageReference Include="Sentry.Serilog" Version="4.8.1" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageReference Include="prometheus-net.AspNetCore" Version="8.2.1" />
</ItemGroup>
</Project>
87 changes: 44 additions & 43 deletions src/JustSending/Program.cs
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
using System;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Serilog;
using Serilog.Events;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Hangfire;
using Hangfire.Redis.StackExchange;
using Hangfire.Storage.SQLite;
using JustSending.Data;
using JustSending.Services;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using OpenTelemetry.Trace;
using Prometheus;
using RedLockNet.SERedis;
using RedLockNet.SERedis.Configuration;
using StackExchange.Redis;
using Serilog;
using Serilog.Core;
using Prometheus;
using OpenTelemetry.Trace;
using System.Threading.Tasks;
using System.Linq;
using Serilog.Events;
using StackExchange.Redis;

public class Program
{
Expand Down Expand Up @@ -60,46 +61,47 @@ public static WebApplication InitializeApp(string[] args)
return app;
}

static Logger CreateLogger()
=> new LoggerConfiguration()
.Enrich.FromLogContext()
.MinimumLevel.Override("Microsoft.AspNetCore", LogEventLevel.Warning)
.WriteTo.Console(new Serilog.Formatting.Compact.CompactJsonFormatter())
.WriteTo.Sentry(o =>
{
o.MinimumBreadcrumbLevel = LogEventLevel.Debug;
o.MinimumEventLevel = LogEventLevel.Warning;
})
.Filter.ByExcluding(logEvent =>
static Logger CreateLogger() => new LoggerConfiguration()
.Enrich.FromLogContext()
.MinimumLevel.Override("Microsoft.AspNetCore", LogEventLevel.Warning)
.WriteTo.Console(new Serilog.Formatting.Compact.CompactJsonFormatter())
.WriteTo.Sentry(o =>
{
o.Dsn = ""; // ToDO: read from config
o.MinimumBreadcrumbLevel = LogEventLevel.Debug;
o.MinimumEventLevel = LogEventLevel.Warning;
})
.Filter.ByExcluding(logEvent =>
{
if (logEvent.Properties.TryGetValue("RequestPath", out var p))
{
if (logEvent.Properties.TryGetValue("RequestPath", out var p))
{
var path = p.ToString();
return path.Contains("/api/test");
}
var path = p.ToString();
return path.Contains("/api/test");
}

return false;
})
.CreateLogger();
return false;
})
.CreateLogger();

static void ConfigureServices(IServiceCollection services, IConfigurationRoot config)
{
services.AddSingleton(config);

var honeycombOptions = config.GetHoneycombOptions();
services
.AddOpenTelemetryTracing(builder => builder
.AddHoneycomb(honeycombOptions)
.AddAspNetCoreInstrumentation(c =>
{
c.Filter = (ctx) => (!ctx.Request.Path.Value?.StartsWith("/api/test") ?? true) && (!ctx.Request.Path.Value?.StartsWith("/metrics") ?? true);
c.EnableGrpcAspNetCoreSupport = true;
c.RecordException = true;
c.EnrichWithBaggage();
})
.AddAutoInstrumentations()
.AddHttpClientInstrumentation())
.AddSingleton(TracerProvider.Default.GetTracer(honeycombOptions.ServiceName));
// services
// .AddOpenTelemetry()
// .WithTracing(builder => builder
// .AddHoneycomb(honeycombOptions)
// .AddAspNetCoreInstrumentation(c =>
// {
// c.Filter = (ctx) => (!ctx.Request.Path.Value?.StartsWith("/api/test") ?? true) && (!ctx.Request.Path.Value?.StartsWith("/metrics") ?? true);
// c.EnableGrpcAspNetCoreSupport = true;
// c.RecordException = true;
// c.EnrichWithBaggage();
// })
// .AddAutoInstrumentations()
// .AddHttpClientInstrumentation());
services.AddSingleton(TracerProvider.Default.GetTracer(honeycombOptions.ServiceName));

services.Configure<FormOptions>(x =>
{
Expand Down Expand Up @@ -138,7 +140,7 @@ static void ConfigureServices(IServiceCollection services, IConfigurationRoot co
services
.AddSingleton(sp => RedLockFactory.Create(new List<RedLockMultiplexer>
{
new(ConnectionMultiplexer.Connect(redisConfig!))
new(ConnectionMultiplexer.Connect(redisConfig!))
}))
.AddTransient<ILock, RedisLock>();
}
Expand Down Expand Up @@ -211,7 +213,6 @@ static void ConfigureMiddleware(WebApplication app)

app.UseHealthChecks("/api/test");


app.UseCors(c =>
{
c
Expand Down
14 changes: 7 additions & 7 deletions test/JustSending.Test/JustSending.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.8.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.7" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Selenium.Chrome.WebDriver" Version="85.0.0" />
<PackageReference Include="Selenium.Support" Version="4.6.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.6.0" />
<PackageReference Include="Selenium.Support" Version="4.22.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.22.0" />
</ItemGroup>

<ItemGroup>
Expand Down