diff --git a/.gitignore b/.gitignore index 2560153..0deb4c9 100644 --- a/.gitignore +++ b/.gitignore @@ -268,3 +268,6 @@ __pycache__/ #nCrunchTemp_ +# macOS system files +.DS_Store + diff --git a/CHANGELOG.md b/CHANGELOG.md index e21f8fe..5118949 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## v1.7.0 (February 5, 2026) + +### Removed: +- NewRelic.Agent.Api dependency removed to make the project vendor-neutral +- All NewRelic monitoring attributes ([Transaction], [Trace]) removed from codebase +- This change makes the project more suitable for open-source use without proprietary dependencies + +### Changed: +- Users can now integrate their own preferred monitoring solution (OpenTelemetry, Application Insights, Datadog, etc.) + ## v1.6.0 (July 2, 2025) ### Added: diff --git a/README.md b/README.md index 121a083..cf45037 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,19 @@ The application uses circuit breakers to handle database operation failures grac The application can be configured using the `config.json` and `secret.json` files. Here are the configurations you can set: +## Monitoring & Observability + +This project does not include built-in APM or monitoring. Users can integrate their preferred observability solution: +- **OpenTelemetry** (vendor-neutral, recommended for distributed tracing) +- **Application Insights** (Azure) +- **Datadog** +- **NewRelic** +- **Elastic APM** +- **Prometheus** (for metrics) +- Or any other monitoring tool of your choice + +The codebase is clean and ready for you to add instrumentation as needed for your monitoring platform. + ## Important Notes > [!WARNING] diff --git a/src/Coordinators/MissingCoordinator/Services/MissingEventCleaner.cs b/src/Coordinators/MissingCoordinator/Services/MissingEventCleaner.cs index 407d3a9..74065f7 100644 --- a/src/Coordinators/MissingCoordinator/Services/MissingEventCleaner.cs +++ b/src/Coordinators/MissingCoordinator/Services/MissingEventCleaner.cs @@ -4,7 +4,6 @@ using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using NewRelic.Api.Agent; using PollingOutboxPublisher.ConfigOptions; using PollingOutboxPublisher.Coordinators.MissingCoordinator.Services.Interfaces; using PollingOutboxPublisher.Database.Repositories.Interfaces; @@ -31,7 +30,6 @@ public MissingEventCleaner(IOptions workerSettings, ILogger results) { @@ -46,13 +44,11 @@ public async Task CleanMissingEventsHaveOutboxEventAsync(MissingEvent[] missingE await PushToExceeded(missingEvents, _brokerErrorsMaxRetryCount); } - [Trace] public async Task CleanMissingEventsNotHaveOutboxEventAsync(MissingEvent[] missingEvents) { await PushToExceeded(missingEvents, _missingEventsMaxRetryCount); } - [Trace] public async Task HandleNonMatchedMissingEventsAsync(OutboxEvent[] outboxEvents, MissingEvent[] retryableMissingEvents) { diff --git a/src/Coordinators/MissingCoordinator/Services/PollingMissingEventsQueue.cs b/src/Coordinators/MissingCoordinator/Services/PollingMissingEventsQueue.cs index 7bd653d..4c97307 100644 --- a/src/Coordinators/MissingCoordinator/Services/PollingMissingEventsQueue.cs +++ b/src/Coordinators/MissingCoordinator/Services/PollingMissingEventsQueue.cs @@ -1,9 +1,8 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Options; -using NewRelic.Api.Agent; using PollingOutboxPublisher.ConfigOptions; using PollingOutboxPublisher.Coordinators.MissingCoordinator.Services.Interfaces; using PollingOutboxPublisher.Models; @@ -26,7 +25,6 @@ public PollingMissingEventsQueue(IPollingMissingEventsSource pollingMissingEvent _retryLimit = outboxSettings.Value.MissingEventsMaxRetryCount; } - [Trace] public Task<(MissingEvent[], MissingEvent[], List, OutboxEvent[])> DequeueAsync( CancellationToken cancellationToken) { diff --git a/src/Coordinators/MissingCoordinator/Services/PollingMissingEventsSource.cs b/src/Coordinators/MissingCoordinator/Services/PollingMissingEventsSource.cs index 5b83098..598422e 100644 --- a/src/Coordinators/MissingCoordinator/Services/PollingMissingEventsSource.cs +++ b/src/Coordinators/MissingCoordinator/Services/PollingMissingEventsSource.cs @@ -1,8 +1,7 @@ -using System; +using System; using System.Linq; using System.Threading.Tasks; using Microsoft.Extensions.Logging; -using NewRelic.Api.Agent; using PollingOutboxPublisher.Coordinators.MissingCoordinator.Services.Interfaces; using PollingOutboxPublisher.Database.Repositories.Interfaces; using PollingOutboxPublisher.Extensions; @@ -25,7 +24,6 @@ public PollingMissingEventsSource(ILogger logger, _outboxEventRepository = outboxEventRepository; } - [Trace] public async Task GetMissingEventsAsync(int batchCount) { var missingEvents = await _missingEventRepository.GetMissingEventsAsync(batchCount); diff --git a/src/Coordinators/OutboxCoordinator/Services/OffsetSetter.cs b/src/Coordinators/OutboxCoordinator/Services/OffsetSetter.cs index a8207e9..42debca 100644 --- a/src/Coordinators/OutboxCoordinator/Services/OffsetSetter.cs +++ b/src/Coordinators/OutboxCoordinator/Services/OffsetSetter.cs @@ -3,7 +3,6 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.Extensions.Logging; -using NewRelic.Api.Agent; using PollingOutboxPublisher.Coordinators.OutboxCoordinator.Services.Interfaces; using PollingOutboxPublisher.Database.Repositories.Interfaces; using PollingOutboxPublisher.Models; @@ -23,7 +22,6 @@ public OffsetSetter(ILogger logger, IOutboxOffsetRepository outbox _outboxOffsetRepository = outboxOffsetRepository; } - [Trace] public async Task SetLatestOffset(OutboxEvent[] items) { try diff --git a/src/Coordinators/OutboxCoordinator/Services/PollingOutboxQueue.cs b/src/Coordinators/OutboxCoordinator/Services/PollingOutboxQueue.cs index 3034d2f..68afecc 100644 --- a/src/Coordinators/OutboxCoordinator/Services/PollingOutboxQueue.cs +++ b/src/Coordinators/OutboxCoordinator/Services/PollingOutboxQueue.cs @@ -1,7 +1,6 @@ -using System.Threading; +using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Options; -using NewRelic.Api.Agent; using PollingOutboxPublisher.ConfigOptions; using PollingOutboxPublisher.Coordinators.OutboxCoordinator.Services.Interfaces; using PollingOutboxPublisher.Models; @@ -23,7 +22,6 @@ public PollingOutboxQueue(IPollingSource pollingSource, IOptions _prefetchCount = workerSettings.Value.OutboxEventsBatchSize; } - [Trace] public async Task DequeueAsync(CancellationToken cancellationToken) { var result = await _pollingSource.GetNextAsync(_prefetchCount); diff --git a/src/Coordinators/OutboxCoordinator/Services/PollingSource.cs b/src/Coordinators/OutboxCoordinator/Services/PollingSource.cs index 7150ade..aea189f 100644 --- a/src/Coordinators/OutboxCoordinator/Services/PollingSource.cs +++ b/src/Coordinators/OutboxCoordinator/Services/PollingSource.cs @@ -1,6 +1,5 @@ -using System.Threading.Tasks; +using System.Threading.Tasks; using Microsoft.Extensions.Logging; -using NewRelic.Api.Agent; using PollingOutboxPublisher.Coordinators.OutboxCoordinator.Services.Interfaces; using PollingOutboxPublisher.Database.Repositories.Interfaces; using PollingOutboxPublisher.Models; @@ -22,7 +21,6 @@ public PollingSource(ILogger logger, IOutboxOffsetRepository outb _outboxEventRepository = outboxEventRepository; } - [Trace] public async Task GetNextAsync(int batchCount) { var outboxEventsBatch = new OutboxEventsBatch(); diff --git a/src/Coordinators/Services/KafkaProducer.cs b/src/Coordinators/Services/KafkaProducer.cs index 8d7c770..c9f8c33 100644 --- a/src/Coordinators/Services/KafkaProducer.cs +++ b/src/Coordinators/Services/KafkaProducer.cs @@ -4,7 +4,6 @@ using Confluent.Kafka; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using NewRelic.Api.Agent; using PollingOutboxPublisher.ConfigOptions; using PollingOutboxPublisher.Coordinators.Services.Interfaces; @@ -61,14 +60,12 @@ private void BuildProducer(Kafka kafka) _producer = new ProducerBuilder(config).Build(); } - [Trace] public async Task> ProduceAsync(string topic, Message message) { var deliveryResult = await _producer.ProduceAsync(topic, message); return deliveryResult; } - [Trace] public void Dispose() { _producer?.Flush(TimeSpan.FromSeconds(10)); diff --git a/src/Coordinators/Services/KafkaService.cs b/src/Coordinators/Services/KafkaService.cs index d559de2..4dc8e47 100644 --- a/src/Coordinators/Services/KafkaService.cs +++ b/src/Coordinators/Services/KafkaService.cs @@ -1,7 +1,6 @@ using System.Diagnostics.CodeAnalysis; using System.Threading.Tasks; using Confluent.Kafka; -using NewRelic.Api.Agent; using PollingOutboxPublisher.Coordinators.Services.Interfaces; namespace PollingOutboxPublisher.Coordinators.Services; @@ -16,7 +15,6 @@ public KafkaService(IKafkaProducer kafkaProducer) _kafkaProducer = kafkaProducer; } - [Trace] public Task> ProduceAsync(string topic, Message message) { return _kafkaProducer.ProduceAsync(topic, message); diff --git a/src/Coordinators/Services/OutboxDispatcher.cs b/src/Coordinators/Services/OutboxDispatcher.cs index f8671d4..df3b1f9 100644 --- a/src/Coordinators/Services/OutboxDispatcher.cs +++ b/src/Coordinators/Services/OutboxDispatcher.cs @@ -1,8 +1,7 @@ -using System; +using System; using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using NewRelic.Api.Agent; using PollingOutboxPublisher.ConfigOptions; using PollingOutboxPublisher.Coordinators.Services.Interfaces; using PollingOutboxPublisher.Database.Repositories.Interfaces; @@ -34,7 +33,6 @@ public OutboxDispatcher(ILogger logger, _redeliveryDelayAfterError = workerSettings.Value.RedeliveryDelayAfterError; } - [Transaction] public async Task DispatchAsync(OutboxEvent outboxEvent) { try @@ -49,7 +47,6 @@ await LogErrorAndHandle(ex, "Message broker is unavailable", } } - [Transaction] public async Task DispatchMissingAsync(MappedMissingEvent mappedMissingEvent) { try @@ -77,7 +74,6 @@ await LogErrorAndHandle(ex, "An error occurred", return mappedMissingEvent; } - [Trace] private async Task PublishAsync(OutboxEvent outboxEvent) { if (!_benchmarkOptions.Value.IsPublishingOn) diff --git a/src/Database/Providers/CouchbaseScopeProvider.cs b/src/Database/Providers/CouchbaseScopeProvider.cs index 0ffaf7c..66a1881 100644 --- a/src/Database/Providers/CouchbaseScopeProvider.cs +++ b/src/Database/Providers/CouchbaseScopeProvider.cs @@ -1,9 +1,8 @@ -using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.CodeAnalysis; using System.Threading.Tasks; using Couchbase; using Couchbase.KeyValue; using Microsoft.Extensions.Options; -using NewRelic.Api.Agent; using PollingOutboxPublisher.Database.Providers.Interfaces; using PollingOutboxPublisher.Exceptions; @@ -20,7 +19,6 @@ public CouchbaseScopeProvider(IOptions couchbaseOptions _couchbase = couchbaseOptions.Value; } - [Trace] public async Task GetScopeAsync() { if (_scope != null) return _scope; diff --git a/src/Database/Repositories/Couchbase/CouchbaseMissingEventRepository.cs b/src/Database/Repositories/Couchbase/CouchbaseMissingEventRepository.cs index 52487ab..78d6ef0 100644 --- a/src/Database/Repositories/Couchbase/CouchbaseMissingEventRepository.cs +++ b/src/Database/Repositories/Couchbase/CouchbaseMissingEventRepository.cs @@ -6,7 +6,6 @@ using Couchbase.KeyValue; using Couchbase.Query; using Microsoft.Extensions.Options; -using NewRelic.Api.Agent; using PollingOutboxPublisher.ConfigOptions; using PollingOutboxPublisher.Database.Providers.Interfaces; using PollingOutboxPublisher.Database.Repositories.Interfaces; @@ -42,7 +41,6 @@ private async Task InitializeCollectionAsync() _collection ??= await _scope.CollectionAsync(_tableName); } - [Trace] public async Task InsertAsync(MissingEvent missingEvent) { await InitializeCollectionAsync(); diff --git a/src/Database/Repositories/MsSql/MsSqlMissingEventRepository.cs b/src/Database/Repositories/MsSql/MsSqlMissingEventRepository.cs index 592532f..d8527b9 100644 --- a/src/Database/Repositories/MsSql/MsSqlMissingEventRepository.cs +++ b/src/Database/Repositories/MsSql/MsSqlMissingEventRepository.cs @@ -4,7 +4,6 @@ using Dapper; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using NewRelic.Api.Agent; using PollingOutboxPublisher.ConfigOptions; using PollingOutboxPublisher.Database.Providers.Interfaces; using PollingOutboxPublisher.Database.Repositories.Interfaces; @@ -30,7 +29,6 @@ public MsSqlMissingEventRepository(IMsSqlConnectionProvider msSqlConnectionProvi throw new MissingConfigurationException(nameof(dataStoreSettings.Value.MissingEvents)); } - [Trace] public async Task InsertAsync(MissingEvent missingEvent) { using var connection = _msSqlConnectionProvider.CreateConnection(); diff --git a/src/Database/Repositories/Postgres/PostgresMissingEventRepository.cs b/src/Database/Repositories/Postgres/PostgresMissingEventRepository.cs index 1ef63ec..97f1c30 100644 --- a/src/Database/Repositories/Postgres/PostgresMissingEventRepository.cs +++ b/src/Database/Repositories/Postgres/PostgresMissingEventRepository.cs @@ -4,7 +4,6 @@ using Dapper; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using NewRelic.Api.Agent; using PollingOutboxPublisher.ConfigOptions; using PollingOutboxPublisher.Database.Providers.Interfaces; using PollingOutboxPublisher.Database.Repositories.Interfaces; @@ -29,8 +28,7 @@ public PostgresMissingEventRepository(ILogger lo throw new MissingConfigurationException(nameof(tableNameSettings.Value.MissingEvents)); } - [Trace] - public async Task InsertAsync(MissingEvent missingEvent) + public async Task InsertAsync(MissingEvent missingEvent) { using var connection = _postgresConnectionProvider.CreateConnection(); await connection.ExecuteAsync(InsertStatement(), missingEvent); diff --git a/src/Helper/KafkaHelper.cs b/src/Helper/KafkaHelper.cs index 1815d1f..2fb396b 100644 --- a/src/Helper/KafkaHelper.cs +++ b/src/Helper/KafkaHelper.cs @@ -3,7 +3,6 @@ using System.Diagnostics.CodeAnalysis; using System.Text; using Confluent.Kafka; -using NewRelic.Api.Agent; using Newtonsoft.Json; using PollingOutboxPublisher.Models; @@ -12,7 +11,6 @@ namespace PollingOutboxPublisher.Helper; [ExcludeFromCodeCoverage] public static class KafkaHelper { - [Trace] public static KafkaMessageModel PrepareKafkaMessageModel(this OutboxEvent message, string topicName, string key) { var kafkaMessage = new Message @@ -33,7 +31,6 @@ public static KafkaMessageModel PrepareKafkaMessageModel(this OutboxEvent messag return response; } - [Trace] private static void SetHeader(Message message, string messageHeader) { if (string.IsNullOrEmpty(messageHeader)) @@ -50,7 +47,6 @@ private static void SetHeader(Message message, string messageHea } } - [Trace] private static void AddHeader(this Message message, string key, string value) { var bytes = value == null diff --git a/src/PollingOutboxPublisher.csproj b/src/PollingOutboxPublisher.csproj index 27612c8..0a76747 100644 --- a/src/PollingOutboxPublisher.csproj +++ b/src/PollingOutboxPublisher.csproj @@ -4,7 +4,7 @@ Exe net8.0 false - 1.6.0 + 1.7.0 PollingOutboxPublisher @@ -14,7 +14,6 @@ -