Skip to content
Closed
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,6 @@ __pycache__/

#nCrunchTemp_

# macOS system files
.DS_Store

10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -31,7 +30,6 @@ public MissingEventCleaner(IOptions<WorkerSettings> workerSettings, ILogger<Miss
_brokerErrorsMaxRetryCount = workerSettings.Value.BrokerErrorsMaxRetryCount;
}

[Trace]
public async Task CleanMissingEventsHaveOutboxEventAsync(MissingEvent[] missingEvents,
List<MappedMissingEvent> results)
{
Expand All @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -26,7 +25,6 @@ public PollingMissingEventsQueue(IPollingMissingEventsSource pollingMissingEvent
_retryLimit = outboxSettings.Value.MissingEventsMaxRetryCount;
}

[Trace]
public Task<(MissingEvent[], MissingEvent[], List<MappedMissingEvent>, OutboxEvent[])> DequeueAsync(
CancellationToken cancellationToken)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -25,7 +24,6 @@ public PollingMissingEventsSource(ILogger<PollingMissingEventsSource> logger,
_outboxEventRepository = outboxEventRepository;
}

[Trace]
public async Task<MissingEvent[]> GetMissingEventsAsync(int batchCount)
{
var missingEvents = await _missingEventRepository.GetMissingEventsAsync(batchCount);
Expand Down
2 changes: 0 additions & 2 deletions src/Coordinators/OutboxCoordinator/Services/OffsetSetter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -23,7 +22,6 @@ public OffsetSetter(ILogger<OffsetSetter> logger, IOutboxOffsetRepository outbox
_outboxOffsetRepository = outboxOffsetRepository;
}

[Trace]
public async Task SetLatestOffset(OutboxEvent[] items)
{
try
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -23,7 +22,6 @@ public PollingOutboxQueue(IPollingSource pollingSource, IOptions<WorkerSettings>
_prefetchCount = workerSettings.Value.OutboxEventsBatchSize;
}

[Trace]
public async Task<OutboxEvent[]> DequeueAsync(CancellationToken cancellationToken)
{
var result = await _pollingSource.GetNextAsync(_prefetchCount);
Expand Down
4 changes: 1 addition & 3 deletions src/Coordinators/OutboxCoordinator/Services/PollingSource.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -22,7 +21,6 @@ public PollingSource(ILogger<PollingSource> logger, IOutboxOffsetRepository outb
_outboxEventRepository = outboxEventRepository;
}

[Trace]
public async Task<OutboxEventsBatch> GetNextAsync(int batchCount)
{
var outboxEventsBatch = new OutboxEventsBatch();
Expand Down
3 changes: 0 additions & 3 deletions src/Coordinators/Services/KafkaProducer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -61,14 +60,12 @@ private void BuildProducer(Kafka kafka)
_producer = new ProducerBuilder<string, string>(config).Build();
}

[Trace]
public async Task<DeliveryResult<string, string>> ProduceAsync(string topic, Message<string, string> message)
{
var deliveryResult = await _producer.ProduceAsync(topic, message);
return deliveryResult;
}

[Trace]
public void Dispose()
{
_producer?.Flush(TimeSpan.FromSeconds(10));
Expand Down
2 changes: 0 additions & 2 deletions src/Coordinators/Services/KafkaService.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -16,7 +15,6 @@ public KafkaService(IKafkaProducer kafkaProducer)
_kafkaProducer = kafkaProducer;
}

[Trace]
public Task<DeliveryResult<string, string>> ProduceAsync(string topic, Message<string, string> message)
{
return _kafkaProducer.ProduceAsync(topic, message);
Expand Down
6 changes: 1 addition & 5 deletions src/Coordinators/Services/OutboxDispatcher.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -34,7 +33,6 @@ public OutboxDispatcher(ILogger<OutboxDispatcher> logger,
_redeliveryDelayAfterError = workerSettings.Value.RedeliveryDelayAfterError;
}

[Transaction]
public async Task DispatchAsync(OutboxEvent outboxEvent)
{
try
Expand All @@ -49,7 +47,6 @@ await LogErrorAndHandle(ex, "Message broker is unavailable",
}
}

[Transaction]
public async Task<MappedMissingEvent> DispatchMissingAsync(MappedMissingEvent mappedMissingEvent)
{
try
Expand Down Expand Up @@ -77,7 +74,6 @@ await LogErrorAndHandle(ex, "An error occurred",
return mappedMissingEvent;
}

[Trace]
private async Task PublishAsync(OutboxEvent outboxEvent)
{
if (!_benchmarkOptions.Value.IsPublishingOn)
Expand Down
4 changes: 1 addition & 3 deletions src/Database/Providers/CouchbaseScopeProvider.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -20,7 +19,6 @@ public CouchbaseScopeProvider(IOptions<ConfigOptions.Couchbase> couchbaseOptions
_couchbase = couchbaseOptions.Value;
}

[Trace]
public async Task<IScope> GetScopeAsync()
{
if (_scope != null) return _scope;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -42,7 +41,6 @@ private async Task InitializeCollectionAsync()
_collection ??= await _scope.CollectionAsync(_tableName);
}

[Trace]
public async Task InsertAsync(MissingEvent missingEvent)
{
await InitializeCollectionAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -29,8 +28,7 @@ public PostgresMissingEventRepository(ILogger<PostgresMissingEventRepository> 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);
Expand Down
4 changes: 0 additions & 4 deletions src/Helper/KafkaHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Text;
using Confluent.Kafka;
using NewRelic.Api.Agent;
using Newtonsoft.Json;
using PollingOutboxPublisher.Models;

Expand All @@ -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<string, string>
Expand All @@ -33,7 +31,6 @@ public static KafkaMessageModel PrepareKafkaMessageModel(this OutboxEvent messag
return response;
}

[Trace]
private static void SetHeader(Message<string, string> message, string messageHeader)
{
if (string.IsNullOrEmpty(messageHeader))
Expand All @@ -50,7 +47,6 @@ private static void SetHeader(Message<string, string> message, string messageHea
}
}

[Trace]
private static void AddHeader(this Message<string, string> message, string key, string value)
{
var bytes = value == null
Expand Down
3 changes: 1 addition & 2 deletions src/PollingOutboxPublisher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<Version>1.6.0</Version>
<Version>1.7.0</Version>
<RootNamespace>PollingOutboxPublisher</RootNamespace>
</PropertyGroup>

Expand All @@ -14,7 +14,6 @@
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="NewRelic.Agent.Api" Version="10.25.1" />
<PackageReference Include="Polly" Version="8.4.0" />
<PackageReference Include="Polly.Contrib.WaitAndRetry" Version="1.1.1" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0" />
Expand Down
Loading