Skip to content

Commit

Permalink
refactor: remove datadog
Browse files Browse the repository at this point in the history
BREAKING CHANGE: remove datadog from the project
  • Loading branch information
ArneD committed Apr 5, 2024
1 parent 99cb947 commit d4bf7c5
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 37 deletions.
2 changes: 0 additions & 2 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ nuget Be.Vlaanderen.Basisregisters.AggregateSource.SqlStreamStore.Autofac 9.0.1
nuget Be.Vlaanderen.Basisregisters.EventHandling 5.0.0
nuget Be.Vlaanderen.Basisregisters.EventHandling.Autofac 5.0.0

nuget Be.Vlaanderen.Basisregisters.DataDog.Tracing.Sql 6.0.0

// TEST STUFF
nuget Microsoft.NET.Test.Sdk 17.9.0
nuget Microsoft.TestPlatform.ObjectModel 17.9.0
Expand Down
21 changes: 0 additions & 21 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ NUGET
Be.Vlaanderen.Basisregisters.Build.Pipeline (7.0.4)
Be.Vlaanderen.Basisregisters.Converters.TrimString (4.0)
Newtonsoft.Json (>= 13.0.3)
Be.Vlaanderen.Basisregisters.DataDog.Tracing (6.0)
Microsoft.Extensions.Logging.Abstractions (>= 8.0)
Newtonsoft.Json (>= 13.0.3)
System.Reactive (>= 6.0)
System.Reflection (>= 4.3)
System.Threading.Tasks.Dataflow (>= 8.0)
Be.Vlaanderen.Basisregisters.DataDog.Tracing.Sql (6.0)
Be.Vlaanderen.Basisregisters.DataDog.Tracing (6.0)
System.Data.Common (>= 4.3)
Be.Vlaanderen.Basisregisters.EventHandling (5.0)
Be.Vlaanderen.Basisregisters.Converters.TrimString (>= 4.0)
Newtonsoft.Json (>= 13.0.3)
Expand Down Expand Up @@ -316,15 +307,6 @@ NUGET
System.Configuration.ConfigurationManager (8.0) - restriction: || (== net8.0) (&& (== netstandard2.1) (>= net8.0))
System.Diagnostics.EventLog (>= 8.0) - restriction: || (== net8.0) (&& (== netstandard2.1) (>= net7.0))
System.Security.Cryptography.ProtectedData (>= 8.0)
System.Data.Common (4.3)
System.Collections (>= 4.3)
System.Globalization (>= 4.3)
System.IO (>= 4.3)
System.Resources.ResourceManager (>= 4.3)
System.Runtime (>= 4.3)
System.Runtime.Extensions (>= 4.3)
System.Text.RegularExpressions (>= 4.3)
System.Threading.Tasks (>= 4.3)
System.Diagnostics.Debug (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
Expand Down Expand Up @@ -376,8 +358,6 @@ NUGET
System.Memory.Data (8.0) - restriction: || (== net8.0) (&& (== netstandard2.1) (>= net8.0))
System.Text.Json (>= 8.0)
System.Numerics.Vectors (4.5)
System.Reactive (6.0)
System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net8.0) (>= net472)) (&& (== net8.0) (< net6.0)) (&& (== net8.0) (>= uap10.1)) (== netstandard2.1)
System.Reflection (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
Expand Down Expand Up @@ -453,7 +433,6 @@ NUGET
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Threading.Tasks.Dataflow (8.0)
System.Threading.Tasks.Extensions (4.5.4)
System.Runtime.CompilerServices.Unsafe (>= 4.5.3) - restriction: || (&& (== net8.0) (>= net461)) (&& (== net8.0) (< netcoreapp2.1)) (&& (== net8.0) (< netstandard1.0)) (&& (== net8.0) (< netstandard2.0)) (&& (== net8.0) (>= wp8)) (== netstandard2.1)
System.Xml.ReaderWriter (4.3.1)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
namespace Be.Vlaanderen.Basisregisters.ProjectionHandling.LastChangedList
{
using System;
using Microsoft.Data.SqlClient;
using Autofac;
using DataDog.Tracing.Sql.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Runner.MigrationExtensions;
using Runner.SqlServer.MigrationExtensions;

public class LastChangedListModule : Module
{
public LastChangedListModule(
string connectionString,
string datadogServiceName,
IServiceCollection services,
ILoggerFactory loggerFactory)
{
var logger = loggerFactory.CreateLogger<LastChangedListModule>();

var hasConnectionString = !string.IsNullOrWhiteSpace(connectionString);
if (hasConnectionString)
RunOnSqlServer(datadogServiceName, services, loggerFactory, connectionString);
RunOnSqlServer(services, loggerFactory, connectionString);
else
RunInMemoryDb(services, loggerFactory, logger);

Expand All @@ -36,20 +32,15 @@ public LastChangedListModule(
}

private static void RunOnSqlServer(
string datadogServiceName,
IServiceCollection services,
ILoggerFactory loggerFactory,
string backofficeProjectionsConnectionString)
{
services
.AddScoped(s =>
new TraceDbConnection<LastChangedListContext>(
new SqlConnection(backofficeProjectionsConnectionString),
datadogServiceName))
.AddDbContext<LastChangedListContext>((provider, options) => options
.AddDbContext<LastChangedListContext>((_, options) => options
.UseLoggerFactory(loggerFactory)
.UseSqlServer(
provider.GetRequiredService<TraceDbConnection<LastChangedListContext>>(),
backofficeProjectionsConnectionString,
sqlServerOptions =>
{
sqlServerOptions.EnableRetryOnFailure();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ Polly

Be.Vlaanderen.Basisregisters.EventHandling
Be.Vlaanderen.Basisregisters.AggregateSource.SqlStreamStore
Be.Vlaanderen.Basisregisters.DataDog.Tracing.Sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ dependencies
Be.Vlaanderen.Basisregisters.ProjectionHandling.SqlStreamStore CURRENTVERSION

Be.Vlaanderen.Basisregisters.AggregateSource.SqlStreamStore >= LOCKEDVERSION
Be.Vlaanderen.Basisregisters.DataDog.Tracing.Sql >= LOCKEDVERSION

Microsoft.EntityFrameworkCore.SqlServer >= LOCKEDVERSION
Microsoft.Extensions.DependencyInjection >= LOCKEDVERSION
Expand Down

0 comments on commit d4bf7c5

Please sign in to comment.