Skip to content

Commit

Permalink
refactor: replace old datadog libs
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneD committed Apr 8, 2024
1 parent 06d970c commit a2017f1
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 84 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Populate a Redis cache based on a list of URLs.
* [Polly](https://github.com/App-vNext/Polly) - _Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner._ - [BSD](https://choosealicense.com/licenses/bsd-3-clause/)
* [Marvin.Cache.Headers](https://github.com/KevinDockx/HttpCacheHeaders) - _ASP.NET Core HTTP response cache headers for Cache-Control, Pragma, and Expires._ - [MIT](https://choosealicense.com/licenses/mit/)
* [StackExchange.Redis](https://github.com/StackExchange/StackExchange.Redis) - _General purpose redis client._ - [MIT](https://choosealicense.com/licenses/mit/)
*
* [DataDog](https://github.com/DataDog/dd-trace-dotnet) - _.NET Client Library for Datadog APM_ - [Apache License 2.0](https://choosealicense.com/licenses/apache-2.0/)

### Tooling

Expand All @@ -65,6 +65,5 @@ Populate a Redis cache based on a list of URLs.
### Flemish Government Libraries

* [Be.Vlaanderen.Basisregisters.Build.Pipeline](https://github.com/informatievlaanderen/build-pipeline/blob/master/LICENSE) - _Contains generic files for all Basisregisters pipelines._ - [MIT](https://choosealicense.com/licenses/mit/)
* [Be.Vlaanderen.Basisregisters.DataDog](https://github.com/Informatievlaanderen/datadog-tracing) - _A C# Implementation of Data Dog Tracing._ - [MIT](https://choosealicense.com/licenses/mit/)
* [Be.Vlaanderen.Basisregisters.Aws.DistributedMutex](https://github.com/Informatievlaanderen/aws-distributed-mutex) - _A distributed lock (mutex) implementation for AWS using DynamoDB._ - [MIT](https://choosealicense.com/licenses/mit/)
* [Be.Vlaanderen.Basisregisters.AspNetCore.Mvc.Formatters.Json](https://github.com/Informatievlaanderen/json-serializer-settings) - _Default Json.NET serializer settings._ - [MIT](https://choosealicense.com/licenses/mit/)
14 changes: 5 additions & 9 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ nuget Microsoft.EntityFrameworkCore.InMemory 8.0.3
nuget Autofac 8.0.0
nuget Autofac.Extensions.DependencyInjection 9.0.0

nuget Datadog.Trace.Bundle 2.49.0

nuget Polly 8.3.1
nuget Marvin.Cache.Headers 7.1.0
nuget StackExchange.Redis 2.7.33
Expand All @@ -33,17 +35,11 @@ nuget Serilog.Enrichers.Environment 2.3.0
nuget Serilog.Formatting.Compact 2.0.0

// VBR STUFF
nuget Be.Vlaanderen.Basisregisters.Build.Pipeline 7.0.4

nuget Be.Vlaanderen.Basisregisters.Api 21.0.0
nuget Be.Vlaanderen.Basisregisters.Build.Pipeline 7.2.5

nuget Be.Vlaanderen.Basisregisters.ProjectionHandling.LastChangedList 13.0.0
nuget Be.Vlaanderen.Basisregisters.Api 23.0.0

nuget Be.Vlaanderen.Basisregisters.DataDog.Tracing 6.0.0
nuget Be.Vlaanderen.Basisregisters.DataDog.Tracing.Sql 6.0.0
nuget Be.Vlaanderen.Basisregisters.DataDog.Tracing.AspNetCore 6.0.0
nuget Be.Vlaanderen.Basisregisters.DataDog.Tracing.SqlStreamStore 6.0.0
nuget Be.Vlaanderen.Basisregisters.DataDog.Tracing.Autofac 6.0.0
nuget Be.Vlaanderen.Basisregisters.ProjectionHandling.LastChangedList 14.0.0

nuget Be.Vlaanderen.Basisregisters.AspNetCore.Mvc.Formatters.Json 5.0.0

Expand Down
70 changes: 18 additions & 52 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ NUGET
Be.Vlaanderen.Basisregisters.AggregateSource (9.0.1)
Be.Vlaanderen.Basisregisters.EventHandling (>= 5.0)
SqlStreamStore (>= 1.2)
Be.Vlaanderen.Basisregisters.Api (21.0)
Be.Vlaanderen.Basisregisters.Api (23.0)
Asp.Versioning.Mvc.ApiExplorer (>= 8.0)
Autofac (>= 8.0)
Autofac.Extensions.DependencyInjection (>= 9.0)
Expand All @@ -64,11 +64,6 @@ NUGET
Be.Vlaanderen.Basisregisters.AspNetCore.Swagger (>= 5.0)
Be.Vlaanderen.Basisregisters.AspNetCore.Swagger.ReDoc (>= 5.0)
Be.Vlaanderen.Basisregisters.Aws.DistributedMutex (>= 4.0.1)
Be.Vlaanderen.Basisregisters.DataDog.Tracing (>= 6.0)
Be.Vlaanderen.Basisregisters.DataDog.Tracing.AspNetCore (>= 6.0)
Be.Vlaanderen.Basisregisters.DataDog.Tracing.Autofac (>= 6.0)
Be.Vlaanderen.Basisregisters.DataDog.Tracing.Sql (>= 6.0)
Be.Vlaanderen.Basisregisters.DataDog.Tracing.SqlStreamStore (>= 6.0)
Be.Vlaanderen.Basisregisters.EventHandling.Autofac (>= 5.0)
Be.Vlaanderen.Basisregisters.Generators.Guid.Deterministic (>= 4.0)
Be.Vlaanderen.Basisregisters.Middleware.AddProblemJsonHeader (>= 3.0)
Expand Down Expand Up @@ -148,30 +143,9 @@ NUGET
Be.Vlaanderen.Basisregisters.Aws.DistributedMutex (4.0.1)
AWSSDK.DynamoDBv2 (>= 3.7.301.18)
Microsoft.Extensions.Logging (>= 8.0)
Be.Vlaanderen.Basisregisters.Build.Pipeline (7.0.4)
Be.Vlaanderen.Basisregisters.Build.Pipeline (7.2.5)
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.AspNetCore (6.0)
Be.Vlaanderen.Basisregisters.DataDog.Tracing (6.0)
Serilog (>= 3.1.1)
Be.Vlaanderen.Basisregisters.DataDog.Tracing.Autofac (6.0)
Autofac.Extensions.DependencyInjection (>= 9.0)
Be.Vlaanderen.Basisregisters.DataDog.Tracing (6.0)
Microsoft.Extensions.Configuration (>= 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.DataDog.Tracing.SqlStreamStore (6.0)
Autofac (>= 8.0)
Be.Vlaanderen.Basisregisters.DataDog.Tracing (6.0)
SqlStreamStore.MsSql (>= 1.2)
System.Data.Common (>= 4.3)
Be.Vlaanderen.Basisregisters.EventHandling (5.0)
Be.Vlaanderen.Basisregisters.Converters.TrimString (>= 4.0)
Newtonsoft.Json (>= 13.0.3)
Expand All @@ -183,22 +157,21 @@ NUGET
Be.Vlaanderen.Basisregisters.Middleware.AddProblemJsonHeader (3.0)
Be.Vlaanderen.Basisregisters.ProblemDetails (9.0)
System.Reflection.Metadata (>= 8.0)
Be.Vlaanderen.Basisregisters.ProjectionHandling.Connector (13.0)
Be.Vlaanderen.Basisregisters.ProjectionHandling.Connector (14.0)
Microsoft.EntityFrameworkCore (>= 8.0.2)
Be.Vlaanderen.Basisregisters.ProjectionHandling.LastChangedList (13.0)
Be.Vlaanderen.Basisregisters.ProjectionHandling.LastChangedList (14.0)
Autofac.Extensions.DependencyInjection (>= 9.0)
Be.Vlaanderen.Basisregisters.AggregateSource.SqlStreamStore (>= 9.0.1)
Be.Vlaanderen.Basisregisters.DataDog.Tracing.Sql (>= 6.0)
Be.Vlaanderen.Basisregisters.ProjectionHandling.Runner.SqlServer (13.0)
Be.Vlaanderen.Basisregisters.ProjectionHandling.SqlStreamStore (13.0)
Be.Vlaanderen.Basisregisters.ProjectionHandling.Runner.SqlServer (14.0)
Be.Vlaanderen.Basisregisters.ProjectionHandling.SqlStreamStore (14.0)
Microsoft.EntityFrameworkCore.SqlServer (>= 8.0.2)
Microsoft.Extensions.DependencyInjection (>= 8.0)
Polly (>= 8.3.1)
SqlStreamStore.MsSql (>= 1.2)
Be.Vlaanderen.Basisregisters.ProjectionHandling.Runner (13.0)
Be.Vlaanderen.Basisregisters.ProjectionHandling.Runner (14.0)
Autofac.Extensions.DependencyInjection (>= 9.0)
Be.Vlaanderen.Basisregisters.ProjectionHandling.Connector (13.0)
Be.Vlaanderen.Basisregisters.ProjectionHandling.SqlStreamStore (13.0)
Be.Vlaanderen.Basisregisters.ProjectionHandling.Connector (14.0)
Be.Vlaanderen.Basisregisters.ProjectionHandling.SqlStreamStore (14.0)
Microsoft.EntityFrameworkCore.InMemory (>= 8.0.2)
Microsoft.EntityFrameworkCore.Relational (>= 8.0.2)
Microsoft.Extensions.Configuration (>= 8.0)
Expand All @@ -207,13 +180,13 @@ NUGET
Microsoft.Extensions.Configuration.FileExtensions (>= 8.0)
Microsoft.Extensions.Configuration.Json (>= 8.0)
SqlStreamStore (>= 1.2)
Be.Vlaanderen.Basisregisters.ProjectionHandling.Runner.SqlServer (13.0)
Be.Vlaanderen.Basisregisters.ProjectionHandling.Connector (13.0)
Be.Vlaanderen.Basisregisters.ProjectionHandling.Runner (13.0)
Be.Vlaanderen.Basisregisters.ProjectionHandling.SqlStreamStore (13.0)
Be.Vlaanderen.Basisregisters.ProjectionHandling.Runner.SqlServer (14.0)
Be.Vlaanderen.Basisregisters.ProjectionHandling.Connector (14.0)
Be.Vlaanderen.Basisregisters.ProjectionHandling.Runner (14.0)
Be.Vlaanderen.Basisregisters.ProjectionHandling.SqlStreamStore (14.0)
Microsoft.EntityFrameworkCore.SqlServer (>= 8.0.2)
Polly (>= 8.3.1)
Be.Vlaanderen.Basisregisters.ProjectionHandling.SqlStreamStore (13.0)
Be.Vlaanderen.Basisregisters.ProjectionHandling.SqlStreamStore (14.0)
Be.Vlaanderen.Basisregisters.EventHandling (>= 5.0)
SqlStreamStore (>= 1.2)
Be.Vlaanderen.Basisregisters.Utilities.HashCodeCalculator (4.0)
Expand All @@ -223,6 +196,10 @@ NUGET
Be.Vlaanderen.Basisregisters.Utilities.ToStringBuilder (4.0)
Castle.Core (5.1.1)
System.Diagnostics.EventLog (>= 6.0)
Datadog.Trace (2.49)
System.Diagnostics.DiagnosticSource (>= 4.4.1)
Datadog.Trace.Bundle (2.49)
Datadog.Trace (>= 2.49)
Destructurama.JsonNet (3.0)
Newtonsoft.Json (>= 13.0.3)
Serilog (>= 3.1.1)
Expand Down Expand Up @@ -553,15 +530,6 @@ NUGET
System.Configuration.ConfigurationManager (8.0)
System.Diagnostics.EventLog (>= 8.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 @@ -606,7 +574,6 @@ NUGET
System.Memory.Data (8.0)
System.Text.Json (>= 8.0)
System.Numerics.Vectors (4.5)
System.Reactive (6.0)
System.Reflection (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
Expand Down Expand Up @@ -668,7 +635,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.Xml.ReaderWriter (4.3.1)
System.Collections (>= 4.3)
Expand Down
8 changes: 8 additions & 0 deletions src/Be.Vlaanderen.Basisregisters.Redis.Populator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@ RUN apt-get update && \
apt-get install curl jq -y && \
chmod +x ./init.sh

ENV CORECLR_ENABLE_PROFILING=1
ENV CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
ENV CORECLR_PROFILER_PATH=/app/datadog/linux-x64/Datadog.Trace.ClrProfiler.Native.so
ENV DD_DOTNET_TRACER_HOME=/app/datadog

# Run the createLogPath script on Linux to ensure the automatic instrumentation logs are generated without permission issues
RUN /app/datadog/createLogPath.sh

ENTRYPOINT ["./init.sh"]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace Be.Vlaanderen.Basisregisters.Redis.Populator.Modules
using System.Net.Http.Headers;
using System.Text;
using Autofac;
using DataDog.Tracing.Http;
using Infrastructure;
using Marvin.Cache.Headers;
using Marvin.Cache.Headers.Interfaces;
Expand Down Expand Up @@ -44,11 +43,6 @@ public PopulatorModule(
}
})

.ConfigurePrimaryHttpMessageHandler(c =>
new TraceHttpMessageHandler(
new System.Net.Http.HttpClientHandler(),
configuration["DataDog:ServiceName"]))

// HttpRequestException, HTTP 5XX, and HTTP 408
.AddTransientHttpErrorPolicy(policyBuilder => policyBuilder
.WaitAndRetryAsync(
Expand Down Expand Up @@ -76,11 +70,6 @@ public PopulatorModule(
}
})

.ConfigurePrimaryHttpMessageHandler(c =>
new TraceHttpMessageHandler(
new System.Net.Http.HttpClientHandler(),
configuration["DataDog:ServiceName"]))

// HttpRequestException, HTTP 5XX, and HTTP 408
.AddTransientHttpErrorPolicy(policyBuilder => policyBuilder
.WaitAndRetryAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ private static IServiceProvider ConfigureServices(IConfiguration configuration)
.RegisterModule(
new LastChangedListModule(
configuration.GetConnectionString("LastChangedList"),

Check warning on line 116 in src/Be.Vlaanderen.Basisregisters.Redis.Populator/Program.cs

View workflow job for this annotation

GitHub Actions / Build

Possible null reference argument for parameter 'connectionString' in 'LastChangedListModule.LastChangedListModule(string connectionString, IServiceCollection services, ILoggerFactory loggerFactory)'.
configuration["DataDog:ServiceName"],
services,
loggerFactory))

Check warning on line 118 in src/Be.Vlaanderen.Basisregisters.Redis.Populator/Program.cs

View workflow job for this annotation

GitHub Actions / Build

Possible null reference argument for parameter 'loggerFactory' in 'LastChangedListModule.LastChangedListModule(string connectionString, IServiceCollection services, ILoggerFactory loggerFactory)'.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
"LastChangedList": "Server=.;Database=dummyregistry-dev;Trusted_Connection=True;"
},

"DataDog": {
"Enabled": false,
"Debug": false,
"ServiceName": "dummy-registry-redis-projections"
},

"Redis": {
"ConnectionString": "127.0.0.1",
"ClientName": "Redis - Dummy Registry Populator",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Microsoft.EntityFrameworkCore.InMemory

Autofac.Extensions.DependencyInjection

Datadog.Trace.Bundle

Polly
Marvin.Cache.Headers
StackExchange.Redis
Expand All @@ -29,9 +31,6 @@ Serilog.Formatting.Compact

Be.Vlaanderen.Basisregisters.ProjectionHandling.LastChangedList

Be.Vlaanderen.Basisregisters.DataDog.Tracing.Sql
Be.Vlaanderen.Basisregisters.DataDog.Tracing.Autofac

Be.Vlaanderen.Basisregisters.AspNetCore.Mvc.Formatters.Json

Be.Vlaanderen.Basisregisters.Aws.DistributedMutex
Expand Down

0 comments on commit a2017f1

Please sign in to comment.